panhui 3 лет назад
Родитель
Сommit
fd929bbd56
1 измененных файлов с 31 добавлено и 0 удалено
  1. 31 0
      src/views/Submit.vue

+ 31 - 0
src/views/Submit.vue

@@ -459,6 +459,37 @@ export default {
                         this.tradeCode = '';
                         this.$toast(e.error || '支付失败');
                     });
+            } else if (this.payType === 'ALI') {
+                this.$toast.loading({
+                    message: '支付中',
+                    forbidClick: true
+                });
+                (this.payUrlScheme
+                    ? Promise.resolve()
+                    : this.$http.get('/payOrder/v2/ali', { id: this.orderId }).then(res => {
+                          this.payUrlScheme = res;
+                      })
+                )
+                    .then(() => {
+                        this.$nextTick(() => {
+                            document.getElementById('pay').click();
+                        });
+
+                        this.getOrder(true);
+                    })
+                    .catch(e => {
+                        this.$toast.clear();
+                        e = e || {};
+                        e.error = e.error || '支付失败';
+                        this.$dialog
+                            .alert({
+                                title: '提示',
+                                message: this.backReson(e.error)
+                            })
+                            .then(res => {
+                                this.$router.back();
+                            });
+                    });
             }
         },
         goCoupon() {