You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.0 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. import Vue from 'vue'
  2. import App from './App'
  3. import store from './store' // store
  4. import plugins from './plugins' // plugins
  5. import './permission' // permission
  6. import share from 'utils/share.js'//share.js
  7. import uView from '@/uni_modules/uview-ui'
  8. import configListMinxin from '@/mixins/configList.js'
  9. Vue.use(uView)
  10. Vue.use(plugins)
  11. Vue.mixin(configListMinxin)
  12. Vue.config.productionTip = false
  13. Vue.prototype.$store = store
  14. App.mpType = 'app'
  15. Vue.mixin(share)
  16. // 创建一个空的Vue实例作为事件中心
  17. Vue.prototype.$eventHub = new Vue()
  18. Vue.prototype.uploadFilePromise = function(url) {
  19. return new Promise((resolve, reject) => {
  20. let a = uni.uploadFile({
  21. url: 'https://store-test.catmdogd.com/test-api/h5/oss/upload',
  22. filePath: url,
  23. name: 'file',
  24. formData: {
  25. user: 'test'
  26. },
  27. success: (res) => {
  28. setTimeout(() => {
  29. if (res && res.data) {
  30. let resData = JSON.parse(res.data);
  31. resolve(resData.url);
  32. }
  33. reject("上传失败");
  34. }, 1000)
  35. }
  36. });
  37. })
  38. }
  39. Vue.prototype.initGlobalData = function() {
  40. Vue.prototype.$globalData = {
  41. isAgree:false,
  42. submitData: {
  43. "phone": "",
  44. "wechatId": "",
  45. "note": "",
  46. "totalPrice": "",
  47. "address": {
  48. "province": "",
  49. "city": "",
  50. "district": "",
  51. "detailAddress": ""
  52. }
  53. },
  54. mainSku:[],
  55. augmentedSku:[],
  56. itemPrices:[],
  57. servicePrices:[],
  58. openIdStr:'',
  59. confirmData: {
  60. phone: "",
  61. wechatId: "",
  62. note: "",
  63. },
  64. newOrderData:{
  65. orderId : '',//需要取消的订单id
  66. currentAddress:{},
  67. currentPets:[],
  68. totalPrice:0,
  69. needPreFamiliarize:[],
  70. distancePrice : 0, // 距离加价
  71. companionLevelPrice : 0, // 伴宠师等级价格
  72. }
  73. }
  74. }
  75. Vue.prototype.initGlobalData()
  76. // 创建全局变量
  77. // Vue.prototype.$globalData = {
  78. // isAgree:false,
  79. // submitData: {
  80. // "phone": "",
  81. // "wechatId": "",
  82. // "note": "",
  83. // "totalPrice": "",
  84. // "address": {
  85. // "province": "",
  86. // "city": "",
  87. // "district": "",
  88. // "detailAddress": ""
  89. // },
  90. // "skuList": [],
  91. // "service": {
  92. // "serviceFrequency": "once_a_day",
  93. // "serviceDate": [],
  94. // "serviceTimeFirst": "",
  95. // "serviceTimeSecond": "",
  96. // "pet": []
  97. // }
  98. // },
  99. // mainSku:[],
  100. // augmentedSku:[],
  101. // itemPrices:[],
  102. // servicePrices:[],
  103. // openIdStr:'',
  104. // confirmData: {
  105. // phone: "",
  106. // wechatId: "",
  107. // note: "",
  108. // },
  109. // newOrderData:{
  110. // orderId : '',//需要取消的订单id
  111. // currentAddress:{},
  112. // currentPets:[],
  113. // totalPrice:0,
  114. // needPreFamiliarize:[]
  115. // }
  116. // }
  117. const app = new Vue({
  118. ...App
  119. })
  120. app.$mount()