xuqiang 4 лет назад
Родитель
Сommit
e83daf0f66
1 измененных файлов с 61 добавлено и 6 удалено
  1. 61 6
      src/components/AllorderInfo.vue

+ 61 - 6
src/components/AllorderInfo.vue

@@ -39,6 +39,10 @@
                 <div v-if="status == 'COMPETED'" @click="logistics" class="box-but3">查看物流</div>
                 <div v-if="status == 'CANCELED'" @click="deletes" class="box-but">删除订单</div>
                 <div v-if="status == 'CANCELED'" @click="again" class="box-but3">重新购买</div>
+                <div v-if="status == 'REFUND'" @click="cancelrefund" class="box-but">取消退款</div>
+                <div v-if="status == 'REFUND'" @click="sales" class="box-but3">联系买家</div>
+                <div v-if="status == 'REFUNDED'" @click="deletes" class="box-but">删除订单</div>
+                <div v-if="status == 'REFUNDED'" @click="applydetails" class="box-but3">退款详情</div>
             </div>
         </div>
         <van-popup :show="show" custom-style="background:transparent;border-radius: 12px 12px 0 0;" use-slot>
@@ -79,7 +83,8 @@ export default {
         return {
             show: false,
             stepsList: [],
-            logisTics: []
+            logisTics: [],
+            refundId: 0
         };
     },
     computed: {
@@ -111,6 +116,12 @@ export default {
             if (this.status === 'SEND') {
                 return '待收货';
             }
+            if (this.status === 'REFUND') {
+                return '申请退款中';
+            }
+            if (this.status === 'REFUNDED') {
+                return '退款成功';
+            }
             return '';
         }
     },
@@ -149,12 +160,17 @@ export default {
             this.$emit('refreash');
         },
         allorder() {
-            this.navigateTo('/pages/orderdetails?id=' + this.id);
+            if (this.status === 'REFUND' || this.status === 'REFUNDED') {
+                this.navigateTo('/pages/Applydetails?id=' + this.id);
+            } else {
+                this.navigateTo('/pages/orderdetails?id=' + this.id);
+            }
         },
         again() {
             this.navigateTo('/pages/details?id=' + this.caseId);
         },
         sales() {
+            console.log(this.all);
             wx.showToast({
                 title: '敬请开放',
                 icon: 'none'
@@ -249,6 +265,23 @@ export default {
                 }
             });
         },
+        rufundApply() {
+            if (this.status === 'REFUND' || this.status === 'REFUNDED') {
+                this.$http
+                    .get('/orderInfo/get/' + this.id)
+                    .then(res => {
+                        this.refundId = res.refundId;
+                        console.log(this.refundId);
+                        this.hideLoading();
+                    })
+                    .catch(e => {
+                        this.hideLoading();
+                        if (e.error) {
+                            this.toast(e.rror);
+                        }
+                    });
+            }
+        },
         deletes() {
             wx.showModal({
                 title: '提示',
@@ -268,12 +301,31 @@ export default {
                 }
             });
         },
-        Apply() {
-            wx.showToast({
-                title: '敬请开放',
-                icon: 'none'
+        cancelrefund() {
+            wx.showModal({
+                title: '提示',
+                content: '确定取消退款?',
+                success: res => {
+                    if (res.confirm) {
+                        this.$http.post('orderRefundApply/cancel', { id: this.refundId }).then(res => {
+                            wx.showToast({
+                                icon: 'none',
+                                title: '退款已取消'
+                            });
+                            setTimeout(() => {
+                                this.refreash();
+                            }, 1000);
+                        });
+                    }
+                }
             });
         },
+        Apply() {
+            this.navigateTo('/pages/Apply?id=' + this.id);
+        },
+        applydetails() {
+            this.navigateTo('/pages/Applydetails?id=' + this.id);
+        },
         remind() {
             this.$http.post('orderInfo/remindMy', { orderInfoId: this.id, remark: '' }).then(res => {
                 wx.showToast({
@@ -282,6 +334,9 @@ export default {
                 });
             });
         }
+    },
+    created() {
+        this.rufundApply();
     }
 };
 </script>