main.js 2.2 KB

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