main.js 2.0 KB

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