Browse Source

fix: 重复出单bug及订单备注问题

LaveyD 2 tuần trước cách đây
mục cha
commit
18635507c4
3 tập tin đã thay đổi với 15 bổ sung và 4 xóa
  1. 1 1
      package.json
  2. 7 0
      src/pages/sellManage/common/confirmMixin.js
  3. 7 3
      src/utils/request.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "ticket",
-  "version": "1.0.18",
+  "version": "1.0.19",
   "private": true,
   "description": "多巴胺科技",
   "author": "",

+ 7 - 0
src/pages/sellManage/common/confirmMixin.js

@@ -198,6 +198,7 @@ export default {
       // 西宁景区储值卡支付预留
       if (this.payType === 'VALUECARD' && this.scenicName === '西宁景区') {
         this.setParams()
+        this.params.createOrderRemark = this.createOrderRemark
         this.$refs.readValueCard.show(this.params)
         return
       }
@@ -213,7 +214,13 @@ export default {
       // 是否使用外部扫码
       if (this.payType === 'B_SCAN_C_PAY' && !qrcode) {
         if (this.submitDisable) return
+        // 订单已创建且支付未完成:重新唤起付款码弹窗,禁止重复创建订单
+        if (this.createOrderStatus === 1) {
+          this.payCodeDialogVisible = true
+          return
+        }
         this.setParams()
+        this.params.createOrderRemark = this.createOrderRemark
         this.submitDisable = true
         createOrder(this.params).then(res => {
           this.$log.warn(this.pageName + '下单成功')

+ 7 - 3
src/utils/request.js

@@ -68,7 +68,7 @@ service.interceptors.response.use(response => {
   }
 }, error => {
   let message = ''
-  if (error.response.data && error.response.data.message) {
+  if (error.response && error.response.data && error.response.data.message) {
     message = error.response.data.message
   } else {
     message = '网络出错了'
@@ -78,8 +78,12 @@ service.interceptors.response.use(response => {
     type: 'error'
   })
 
-  log.error(JSON.stringify(error.response.config.data))
-  log.error(JSON.stringify(error.response.data))
+  try {
+    log.error(JSON.stringify(error.response && error.response.config && error.response.config.data))
+    log.error(JSON.stringify(error.response && error.response.data))
+  } catch (e) {
+    log.error('请求异常:' + (error.message || '未知错误'))
+  }
 
   return Promise.reject(error)
 })