main.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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/utilsTools.js'
  6. import * as Regs from '@/common/config/common.js'
  7. import {
  8. msg,
  9. modal,
  10. prePage
  11. } from './utils/util'
  12. import cuCustom from './components/cm-custom/cu-custom.vue'
  13. import auCustom from './components/cm-custom/au-custom.vue'
  14. import cmCustom from './components/cm-custom/cm-custom.vue'
  15. import wsCustom from './components/cm-custom/ws-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('ws-custom', wsCustom)
  22. Vue.component('scroll-top', scrollTop)
  23. Vue.component('city-Picker',CityPicker)
  24. Vue.prototype.$getStorage = function(key) {
  25. var userParam = uni.getStorageSync(key)
  26. if (userParam != null && userParam != '' && userParam != undefined) {
  27. return userParam
  28. } else {
  29. return null
  30. }
  31. }
  32. /**
  33. * 友盟+小程序统计
  34. */
  35. // #ifdef MP-WEIXIN
  36. // import { umtrackWxKey } from '@/utils/config.js'
  37. // import uma from 'umtrack-wx';
  38. // uma.init({
  39. // appKey: umtrackWxKey, //由友盟分配的APP_KEY
  40. // // 使用Openid进行统计,此项为false时将使用友盟+uuid进行用户统计。
  41. // // 使用Openid来统计微信小程序的用户,会使统计的指标更为准确,对系统准确性要求高的应用推荐使用Openid。
  42. // useOpenid: true,
  43. // // 使用openid进行统计时,是否授权友盟自动获取Openid,
  44. // // 如若需要,请到友盟后台"设置管理-应用信息"(https://mp.umeng.com/setting/appset)中设置appId及secret
  45. // autoGetOpenid: true,
  46. // debug: true, //是否打开调试模式
  47. // uploadUserInfo: false // 自动上传用户信息,设为false取消上传,默认为false
  48. // });
  49. // uma.install = function (Vue) {
  50. // Vue.prototype.$uma = uma;
  51. // }
  52. // #endif
  53. Vue.config.productionTip = false
  54. Vue.prototype.$fire = new Vue()
  55. Vue.prototype.$store = store
  56. Vue.prototype.$util = {
  57. msg,
  58. prePage,
  59. modal
  60. }
  61. Vue.prototype.$api = Api
  62. Vue.prototype.$reg = Regs
  63. Vue.prototype.$Static = 'https://static.caimei365.com/app/mini-hehe/icon/'
  64. // Vue.use(uma);
  65. App.mpType = 'app'
  66. const app = new Vue({
  67. ...App
  68. })
  69. app.$mount()