| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import App from "./App";
- // #ifndef VUE3
- import Vue from "vue";
- Vue.config.productionTip = false;
- App.mpType = "app";
- Vue.prototype.$getOpenId = new Promise(resolve => {
- Vue.prototype.$isResolve = resolve;
- })
- const app = new Vue({
- ...App,
- });
- app.$mount();
- // #endif
- // #ifdef VUE3
- import {createSSRApp} from "vue";
- export function createApp() {
- const app = createSSRApp(App);
- return {
- app,
- };
- }
- // #endif
- Vue.filter("globalTime", function (value) {
- if (value) {
- const time = new Date(value * 1000);
- const y = time.getFullYear();
- const m =
- time.getMonth() + 1 < 10
- ? "0" + (time.getMonth() + 1)
- : time.getMonth() + 1;
- const d = time.getDate() < 10 ? "0" + time.getDate() : time.getDate();
- // const h = time.getHours()
- // const mm = time.getMinutes();
- // const s = time.getSeconds();
- return y + "-" + m + "-" + d;
- } else {
- return "";
- }
- });
- Vue.filter("globalTimeSecond", function (value) {
- if (value) {
- const time = new Date(value * 1000);
- // const y = time.getFullYear();
- // const m = (time.getMonth() + 1) < 10 ? '0' + (time.getMonth() + 1) : (time.getMonth() + 1);
- // const d = time.getDate() < 10 ? '0' + time.getDate(): time.getDate();
- const h = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
- const mm = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
- const s = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
- return h + ":" + mm + ":" + s;
- // return h + ":" + mm;
- } else {
- return "";
- }
- });
- Vue.filter("nameFilter", function (value) {
- if (value) {
- let start = new Array(value.length).join('*');
- let end = value.slice(0,1);
- return `${end}${start}`
- } else {
- return "";
- }
- });
- Vue.filter("phoneFilter", function (value) {
- if (value) {
- let reg = /^(.{3}).*(.{4})$/
- return value.replace(reg,'$1****$2')
- } else {
- return "";
- }
- });
|