Преглед изворни кода

关闭支付 订单购物车销毁 跳转到订单列表页 防止重复下单

kevin_zhangl пре 3 година
родитељ
комит
d5d437a0b1
1 измењених фајлова са 16 додато и 1 уклоњено
  1. 16 1
      frontendEle/src/views/shop/order.vue

+ 16 - 1
frontendEle/src/views/shop/order.vue

@@ -160,7 +160,7 @@
                 :close="processClose"
             >
                 <el-button type="primary" size="small">支 付</el-button>
-<!--                <el-button type="danger" size="small"  @click="handleClose">取 消</el-button>-->
+<!--                <el-button type="danger" size="small"  class="cancelButton" @click="handleClose">取 消</el-button>-->
             </paystack>
         </el-dialog>
     </div>
@@ -442,10 +442,20 @@
                 let _this = this
                 _this.$confirm('确认关闭?').then(() => {
                     return network.postData('shop/delete-approach-order', {orderSn: this.form.orderSn}).then(() => {
+                        // 关闭支付模态框
                         _this.visible = false
+                        // 关闭购物车页面,返回到订单列表页
+                        sessionStorage.setItem('order_goods', null)
+                        sessionStorage.setItem('category_type', null)
+                        this.$router.push({path: `/shop/index`})
                     })
                 }).catch(() => {
+                    // 关闭支付模态框
                     _this.visible = false
+                    // 关闭购物车页面,返回到订单列表页
+                    sessionStorage.setItem('order_goods', null)
+                    sessionStorage.setItem('category_type', null)
+                    this.$router.push({path: `/shop/index`})
                 })
             },
             // 支付成功回调
@@ -482,7 +492,12 @@
             },
             // 关闭支付回调
             processClose() {
+                // 关闭支付模态框
                 this.visible = false
+                // 关闭购物车页面,返回到订单列表页
+                sessionStorage.removeItem('order_goods')
+                sessionStorage.removeItem('category_type')
+                this.$router.push({path: `/shop/index`})
             }
         }
     }