import Vue from 'vue' import App from './App' import store from '@/store/index' import request from '@/common/request' import util from '@/common/util.js'; import { imgHost, imgHost2 } from '@/common/env'; import uView from "uview-ui"; Vue.use(uView); Vue.config.productionTip = false; //挂载全局对象 //Vue.prototype.$store = store Vue.prototype.$request = request Vue.prototype.$util = util Vue.prototype.$imgHost = imgHost Vue.prototype.$imgHost2 = imgHost2 // 引入colorUI Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ store, request, ...App }) app.$mount() Vue.prototype.formatDate = function(t) { t = t || Date.now(); let time = new Date(t); let str = time.getFullYear() str += '-' str += time.getMonth() < 9 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1); str += '-'; str += time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate(); str += ' '; str += time.getHours(); str += ':'; str += time.getMinutes() < 10 ? ('0' + time.getMinutes()) : time.getMinutes(); return str; }