main.js 2.6 KB

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