main.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import Vue from 'vue'
  2. import store from './store'
  3. import App from './App'
  4. import './services/index.js'
  5. import * as Api from '@/common/config/caimeiApi.js'
  6. import * as Regs from '@/common/config/common.js'
  7. import ResidenceTime from './plugins/simple-residence-time'
  8. import residence from './utils/residence.js'
  9. // 友盟
  10. import Uma from './plugins/uma'
  11. // 公共组件 全局组件
  12. import { msg, modal, prePage, boundingClientRect } from './utils/util'
  13. import cuCustom from './components/cm-custom/cu-custom.vue'
  14. import auCustom from './components/cm-custom/au-custom.vue'
  15. import cmCustom from './components/cm-custom/cm-custom.vue'
  16. import scrollTop from '@/components/cm-module/scrollTop/scrollTop.vue'
  17. import CityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue' //全局注册地址组件
  18. Vue.component('cu-custom', cuCustom)
  19. Vue.component('au-custom', auCustom)
  20. Vue.component('cm-custom', cmCustom)
  21. Vue.component('scroll-top', scrollTop)
  22. Vue.component('city-Picker', CityPicker)
  23. Vue.prototype.$getStorage = function(key) {
  24. var userParam = uni.getStorageSync(key)
  25. if (userParam != null && userParam != '' && userParam != undefined) {
  26. return userParam
  27. } else {
  28. return null
  29. }
  30. }
  31. // Vue实例化
  32. Vue.config.productionTip = false
  33. Vue.prototype.$fire = new Vue()
  34. Vue.prototype.$store = store
  35. Vue.prototype.$util = { msg, prePage, modal, boundingClientRect }
  36. Vue.prototype.$api = Api
  37. Vue.prototype.$reg = Regs
  38. Vue.prototype.$Static = 'https://static.caimei365.com/app/img/'
  39. App.mpType = 'app'
  40. // 使用插件
  41. Vue.use(Uma)
  42. Vue.use(ResidenceTime, residence)
  43. const app = new Vue({
  44. ...App
  45. })
  46. app.$mount()