Explorar o código

下单报错返回

panhui %!s(int64=4) %!d(string=hai) anos
pai
achega
6af9db1ef7
Modificáronse 2 ficheiros con 65 adicións e 4 borrados
  1. 27 3
      src/views/Submit.vue
  2. 38 1
      src/views/product/Detail.vue

+ 27 - 3
src/views/Submit.vue

@@ -348,7 +348,15 @@ export default {
                 })
                 })
                 .catch(e => {
                 .catch(e => {
                     if (e) {
                     if (e) {
-                        this.$toast(e.error);
+                        this.$toast.clear();
+                        this.$dialog
+                            .alert({
+                                title: '提示',
+                                message: e.error
+                            })
+                            .then(res => {
+                                this.$router.back();
+                            });
                     }
                     }
                 });
                 });
         },
         },
@@ -434,7 +442,15 @@ export default {
                                     })
                                     })
                                     .catch(e => {
                                     .catch(e => {
                                         if (e.error) {
                                         if (e.error) {
-                                            this.$toast(e.error);
+                                            this.$toast.clear();
+                                            this.$dialog
+                                                .alert({
+                                                    title: '提示',
+                                                    message: e.error
+                                                })
+                                                .then(res => {
+                                                    this.$router.back();
+                                                });
                                             reject();
                                             reject();
                                         }
                                         }
                                     });
                                     });
@@ -478,7 +494,15 @@ export default {
                                     // });
                                     // });
                                 })
                                 })
                                 .catch(e => {
                                 .catch(e => {
-                                    this.$toast(e.error || '支付失败请稍后再试');
+                                    this.$toast.clear();
+                                    this.$dialog
+                                        .alert({
+                                            title: '提示',
+                                            message: e.error || '支付失败请稍后再试'
+                                        })
+                                        .then(res => {
+                                            this.$router.back();
+                                        });
                                     reject();
                                     reject();
                                 });
                                 });
                         }
                         }

+ 38 - 1
src/views/product/Detail.vue

@@ -276,6 +276,17 @@
                         <van-button style="font-size: 12px" class="no-btn" v-else-if="!info.openQuota" block round>
                         <van-button style="font-size: 12px" class="no-btn" v-else-if="!info.openQuota" block round>
                             活动名额已被抢光
                             活动名额已被抢光
                         </van-button>
                         </van-button>
+                        <van-button
+                            style="font-size: 12px"
+                            @click="showReason"
+                            class="no-btn"
+                            v-else-if="noPay"
+                            block
+                            round
+                        >
+                            存在未支付无效订单
+                        </van-button>
+
                         <van-button @click="share" v-else type="primary" block round>邀请获取白名单 </van-button>
                         <van-button @click="share" v-else type="primary" block round>邀请获取白名单 </van-button>
                     </template>
                     </template>
 
 
@@ -354,7 +365,8 @@ export default {
             inWeixin,
             inWeixin,
             limit: {},
             limit: {},
             couponList: [],
             couponList: [],
-            assignments: []
+            assignments: [],
+            noPay: false
         };
         };
     },
     },
     computed: {
     computed: {
@@ -383,6 +395,25 @@ export default {
         this.$http.get('/order/checkLimit', { collectionId: this.$route.query.id }).then(res => {
         this.$http.get('/order/checkLimit', { collectionId: this.$route.query.id }).then(res => {
             this.limit = res;
             this.limit = res;
         });
         });
+        if (this.isLogin) {
+            this.$http
+                .post(
+                    '/order/all',
+                    {
+                        query: {
+                            userId: this.$store.state.userInfo.id,
+                            collectionId: this.$route.query.id,
+                            status: 'NOT_PAID'
+                        }
+                    },
+                    { body: 'json' }
+                )
+                .then(res => {
+                    if (!res.empty) {
+                        this.noPay = true;
+                    }
+                });
+        }
     },
     },
     methods: {
     methods: {
         preview(index = 0, list = []) {
         preview(index = 0, list = []) {
@@ -500,6 +531,12 @@ export default {
                     }
                     }
                 });
                 });
         },
         },
+        showReason() {
+            this.$dialog.alert({
+                title: '提示',
+                message: '存在未支付无效订单,等待订单自动5分钟内取消,退回白名单资格。'
+            });
+        },
         getCouponList() {
         getCouponList() {
             if (!this.isLogin) {
             if (!this.isLogin) {
                 return;
                 return;