main.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import App from './App'
  2. import store from './store'
  3. import uView from "@/node_modules/uview-ui";
  4. import {formatSalesNum,formatNum} from "@/utils/tools.js"
  5. import {getDict,isEmpty,parseIDCardInfo,parseText,urlToObj,clearHisSearch,getHisSearch,addHisSearch,logout,getDictLabelName,getProvider,parsePhone,isLogin,getAge,parseIdCard,isLoginCourse,reLoginCheck} from './utils/common.js'
  6. // #ifndef VUE3
  7. import Vue from 'vue'
  8. // Vuex 插件注册
  9. import Vuex from 'vuex'
  10. Vue.config.productionTip = false
  11. App.mpType = 'app'
  12. Vue.use(Vuex)
  13. Vue.use(uView);
  14. Vue.prototype.$formatNum= formatNum;
  15. Vue.prototype.$formatSalesNum= formatSalesNum;
  16. Vue.prototype.$getProvider = getProvider;
  17. Vue.prototype.$parsePhone = parsePhone;
  18. Vue.prototype.$isLogin = isLogin;
  19. Vue.prototype.$isEmpty = isEmpty;
  20. Vue.prototype.$getAge = getAge;
  21. Vue.prototype.$parseIdCard = parseIdCard;
  22. Vue.prototype.$getDictLabelName = getDictLabelName;
  23. Vue.prototype.$parseText = parseText;
  24. Vue.prototype.$logout = logout;
  25. Vue.prototype.$clearHisSearch = clearHisSearch
  26. Vue.prototype.$getHisSearch = getHisSearch
  27. Vue.prototype.$addHisSearch = addHisSearch
  28. Vue.prototype.$urlToObj = urlToObj
  29. Vue.prototype.$parseText = parseText
  30. Vue.prototype.$parseIDCardInfo = parseIDCardInfo
  31. Vue.prototype.$isLoginCourse = isLoginCourse
  32. Vue.prototype.$reLoginCheck = reLoginCheck
  33. Vue.prototype.$getDict = getDict
  34. // Vue.prototype.$formatHour = formatHour;
  35. // Vue.prototype.$updateMsgDot = updateMsgDot;
  36. const app = new Vue({
  37. store,
  38. ...App
  39. })
  40. // 引入请求封装
  41. require("./pages_im/util/request/index")(app);
  42. app.$mount()
  43. // #endif
  44. // #ifdef VUE3
  45. import { createSSRApp } from 'vue'
  46. import uviewPlus from '@/uni_modules/uview-plus'
  47. export function createApp() {
  48. const app = createSSRApp(App)
  49. app.config.globalProperties.$getProvider = getProvider
  50. app.config.globalProperties.$parsePhone = parsePhone
  51. app.config.globalProperties.$isLogin = isLogin
  52. app.config.globalProperties.$isEmpty = isEmpty
  53. app.config.globalProperties.$getAge = getAge
  54. app.config.globalProperties.$parseIdCard = parseIdCard
  55. app.config.globalProperties.$getDictLabelName = getDictLabelName
  56. app.config.globalProperties.$logout = logout
  57. app.config.globalProperties.$clearHisSearch = clearHisSearch
  58. app.config.globalProperties.$getHisSearch = getHisSearch
  59. app.config.globalProperties.$addHisSearch = addHisSearch
  60. app.config.globalProperties.$urlToObj = urlToObj
  61. app.config.globalProperties.$parseText = parseText
  62. app.config.globalProperties.$parseIDCardInfo = parseIDCardInfo
  63. app.config.globalProperties.$isLoginCourse = isLoginCourse
  64. app.config.globalProperties.$formatSalesNum = formatSalesNum
  65. app.config.globalProperties.$getDict = getDict
  66. app.config.globalProperties.$formatNum = formatNum
  67. app.use(uviewPlus)
  68. return {
  69. app
  70. }
  71. }
  72. // #endif