main.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false
  5. App.mpType = 'app'
  6. import system from '@/utils/system.js'
  7. Vue.mixin(system);
  8. import CusHeader from '@/components/CusHeader'
  9. Vue.component('CusHeader',CusHeader);
  10. //日期格式处理
  11. import dateFormat from '@/utils/dateFormat.js'
  12. Vue.use(dateFormat);
  13. import regTest from './utils/reg.js'
  14. import api from '@/http/index.js'
  15. Vue.prototype.$api = api;
  16. Vue.prototype.$reg = regTest;
  17. Vue.prototype.$imgBase = "http://106.54.209.120:8666/image/";
  18. //重载uni.showToast,简化调用
  19. Vue.prototype.$showToast = function(title, duration = 2000, icon = "none") {
  20. return uni.showToast({
  21. title,
  22. duration,
  23. icon
  24. })
  25. }
  26. //重载uni.showModal,简化调用
  27. Vue.prototype.$showModal = function(content) {
  28. return uni.showModal({
  29. title:'温馨提示',
  30. content,
  31. showCancel:false,
  32. confirmText: '确定',
  33. confirmColor: '#007A69'
  34. })
  35. }
  36. // 引入全局uView
  37. import uView from '@/uni_modules/uview-ui'
  38. Vue.use(uView)
  39. uni.$u.config.unit = 'rpx'
  40. const app = new Vue({
  41. ...App
  42. })
  43. app.$mount()
  44. // #endif
  45. // #ifdef VUE3
  46. import {
  47. createSSRApp
  48. } from 'vue'
  49. export function createApp() {
  50. const app = createSSRApp(App)
  51. return {
  52. app
  53. }
  54. }
  55. // #endif