yuwenjun1997 2 vuotta sitten
vanhempi
commit
9bde40f413
2 muutettua tiedostoa jossa 8 lisäystä ja 1 poistoa
  1. 1 1
      pages/views/order/mixins/orderList.js
  2. 7 0
      pages/views/order/order-detail.vue

+ 1 - 1
pages/views/order/mixins/orderList.js

@@ -142,7 +142,7 @@ const orderList = {
             try {
                 const res = await confirmFunc[type](order)
                 // 确认操作订单成功后的回调都在这里执行 在this.$on 中监听 orderAction 事件的执行
-                this.$emit('orderAction')
+                this.$emit('orderAction', type)
                 if (res && res.msg) this.$toast.success(res.msg)
             } catch (error) {
                 this.$toast.error(res.msg)

+ 7 - 0
pages/views/order/order-detail.vue

@@ -95,6 +95,13 @@ export default {
     onLoad(options) {
         this.orderId = options.orderId
         this.fetchOrderDetail()
+        this.$on('orderAction', (type) => {
+            if(type === 'delete'){
+                this.$router.navigateBack(1)
+            }else{
+                this.fetchOrderDetail()
+            }
+        })
     },
     methods: {
         async fetchOrderDetail() {