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.

133 lines
2.9 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 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. }
  72. }
  73. }
  74. Vue.prototype.initGlobalData()
  75. // 创建全局变量
  76. // Vue.prototype.$globalData = {
  77. // isAgree:false,
  78. // submitData: {
  79. // "phone": "",
  80. // "wechatId": "",
  81. // "note": "",
  82. // "totalPrice": "",
  83. // "address": {
  84. // "province": "",
  85. // "city": "",
  86. // "district": "",
  87. // "detailAddress": ""
  88. // },
  89. // "skuList": [],
  90. // "service": {
  91. // "serviceFrequency": "once_a_day",
  92. // "serviceDate": [],
  93. // "serviceTimeFirst": "",
  94. // "serviceTimeSecond": "",
  95. // "pet": []
  96. // }
  97. // },
  98. // mainSku:[],
  99. // augmentedSku:[],
  100. // itemPrices:[],
  101. // servicePrices:[],
  102. // openIdStr:'',
  103. // confirmData: {
  104. // phone: "",
  105. // wechatId: "",
  106. // note: "",
  107. // },
  108. // newOrderData:{
  109. // orderId : '',//需要取消的订单id
  110. // currentAddress:{},
  111. // currentPets:[],
  112. // totalPrice:0,
  113. // needPreFamiliarize:[]
  114. // }
  115. // }
  116. const app = new Vue({
  117. ...App
  118. })
  119. app.$mount()