main.js 1.5 KB

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