ソースを参照

feat: 支持线下支付直接更新支付方式并进入下一步

Yannay 1 ヶ月 前
コミット
45094bf6c2
共有1 個のファイルを変更した22 個の追加3 個の削除を含む
  1. 22 3
      pages/orderDetailRefactored/components/PageThree.vue

+ 22 - 3
pages/orderDetailRefactored/components/PageThree.vue

@@ -603,14 +603,33 @@ export default {
603
         return
603
         return
604
       }
604
       }
605
 
605
 
606
+      // 线下支付:不弹确认框,直接更新支付方式并进入下一步
607
+      if (this.paymentMethodRadio === 'offline') {
608
+        await uni.$u.api.updateClueOrderForm({
609
+          id: this.orderDetail.id,
610
+          paymentMethod: this.paymentMethod || ''
611
+        })
612
+        this.handleNext()
613
+        return
614
+      }
615
+
606
       this.payNowModalVisible = true
616
       this.payNowModalVisible = true
607
     },
617
     },
608
 
618
 
609
     /**
619
     /**
610
      * 确认风险警示
620
      * 确认风险警示
611
      */
621
      */
612
-    confirmRiskWarning() {
622
+    async confirmRiskWarning() {
613
       this.riskWarningModalVisible = false
623
       this.riskWarningModalVisible = false
624
+      // 线下支付:不弹确认框,直接更新支付方式并进入下一步
625
+      if (this.paymentMethodRadio === 'offline') {
626
+        await uni.$u.api.updateClueOrderForm({
627
+          id: this.orderDetail.id,
628
+          paymentMethod: this.paymentMethod || ''
629
+        })
630
+        this.handleNext()
631
+        return
632
+      }
614
       this.payNowModalVisible = true
633
       this.payNowModalVisible = true
615
     },
634
     },
616
 
635
 
@@ -624,8 +643,8 @@ export default {
624
         id: this.orderDetail.id,
643
         id: this.orderDetail.id,
625
         paymentMethod: this.paymentMethod || ''
644
         paymentMethod: this.paymentMethod || ''
626
       })
645
       })
627
-      //如果是小葫芦线上支付或者小葫芦线上支付宝就调用接口,如果不是小葫芦线上支付就不要调用接口,直接点击下一步
628
-      if (this.paymentMethod === '小葫芦线上支付' || this.paymentMethod === '小葫芦线上支付宝') {
646
+      // 根据 radio 选择判断:线上支付(online / online_alipay)需调用支付接口,线下则直接下一步
647
+      if (this.paymentMethodRadio === 'online' || this.paymentMethodRadio === 'online_alipay') {
629
         this.$emit('confirm-pay')
648
         this.$emit('confirm-pay')
630
       } else {
649
       } else {
631
         this.handleNext()
650
         this.handleNext()