import Vue from 'vue' import store from './store' import App from './App' import './services/index.js' import * as Api from '@/common/config/caimeiApi.js' import * as Regs from '@/common/config/common.js' import { dateFormat } from './utils/util.js' import ResidenceTime from './plugins/simple-residence-time' import residence from './utils/residence.js' // 友盟 import Uma from './plugins/uma' // 公共组件 全局组件 import { msg, modal, prePage, boundingClientRect } from './utils/util' import cuCustom from './components/cm-custom/cu-custom.vue' import auCustom from './components/cm-custom/au-custom.vue' import cmCustom from './components/cm-custom/cm-custom.vue' import scrollTop from '@/components/cm-module/scrollTop/scrollTop.vue' import CityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue' //全局注册地址组件 Vue.component('cu-custom', cuCustom) Vue.component('au-custom', auCustom) Vue.component('cm-custom', cmCustom) Vue.component('scroll-top', scrollTop) Vue.component('city-Picker', CityPicker) Vue.prototype.$getStorage = function(key) { var userParam = uni.getStorageSync(key) if (userParam != null && userParam != '' && userParam != undefined) { return userParam } else { return null } } // 格式化时间 Vue.filter('dateFormat', function(value) { if (!value) return '未知' if (value instanceof Date) { return dateFormat(value, 'yyyy-MM-dd') } else { value = new Date(value) return dateFormat(value, 'yyyy-MM-dd') } }) // Vue实例化 Vue.config.productionTip = false Vue.prototype.$fire = new Vue() Vue.prototype.$store = store Vue.prototype.$util = { msg, prePage, modal, boundingClientRect } Vue.prototype.$api = Api Vue.prototype.$reg = Regs Vue.prototype.$Static = 'https://static.caimei365.com/app/img/' App.mpType = 'app' // 使用插件 Vue.use(Uma) Vue.use(ResidenceTime, residence) const app = new Vue({ ...App }) app.$mount()