main.js 2.1 KB

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