Parcourir la source

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

Yannay il y a 1 mois
Parent
commit
45094bf6c2
1 fichiers modifiés avec 22 ajouts et 3 suppressions
  1. 22 3
      pages/orderDetailRefactored/components/PageThree.vue

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

@@ -603,14 +603,33 @@ export default {
603 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 616
       this.payNowModalVisible = true
607 617
     },
608 618
 
609 619
     /**
610 620
      * 确认风险警示
611 621
      */
612
-    confirmRiskWarning() {
622
+    async confirmRiskWarning() {
613 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 633
       this.payNowModalVisible = true
615 634
     },
616 635
 
@@ -624,8 +643,8 @@ export default {
624 643
         id: this.orderDetail.id,
625 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 648
         this.$emit('confirm-pay')
630 649
       } else {
631 650
         this.handleNext()