소스 검색

修复在线下支付的时候必填的问题

Yannay 4 주 전
부모
커밋
a91e2db455
1개의 변경된 파일23개의 추가작업 그리고 13개의 파일을 삭제
  1. 23 13
      pages/orderDetailRefactored/components/PageThree.vue

+ 23 - 13
pages/orderDetailRefactored/components/PageThree.vue

@@ -601,7 +601,27 @@ export default {
601 601
      * 立即支付点击
602 602
      */
603 603
     async handlePayNowClick() {
604
-      // 与 PC 端一致:支付信息通过 updateReceiptForm 保存;后端需 sendFormId 才能更新发单表的开户人/银行/身份证等
604
+      // 与 PC 端一致:先做必填校验
605
+      if (this.paymentAmount <= 0) {
606
+        uni.$u.toast('请填写正确的支付总额')
607
+        return
608
+      }
609
+      // 支付方式必填(与 PC 一致)
610
+      if (!this.paymentMethod) {
611
+        uni.$u.toast('请填写支付方式')
612
+        return
613
+      }
614
+      // 仅线上支付时校验开户人/银行/身份证;线下支付不校验(与 PC 一致)
615
+      if (this.paymentMethodRadio === 'online' || this.paymentMethodRadio === 'online_alipay') {
616
+        if (!this.paymentInfo.customName || !this.paymentInfo.bankName ||
617
+          !this.paymentInfo.bankAccount || !this.paymentInfo.idNumber) {
618
+          uni.$u.toast('请填写完整的开户人信息、身份证号、银行名称、银行卡号')
619
+          return
620
+        }
621
+      }
622
+      
623
+
624
+      // 保存支付信息到回单表(后端需 sendFormId 才能更新发单表的开户人/银行/身份证等)
605 625
       await uni.$u.api.updateReceiptForm({
606 626
         id: this.currentReceipt.id,
607 627
         sendFormId: this.currentReceipt.sendFormId || this.orderDetail.id,
@@ -613,18 +633,8 @@ export default {
613 633
         idCard: this.paymentInfo.idNumber || ''
614 634
       })
615 635
 
616
-      if (!this.paymentInfo.customName || !this.paymentInfo.bankName ||
617
-        !this.paymentInfo.bankAccount || !this.paymentInfo.idNumber || !this.paymentMethod) {
618
-        uni.$u.toast('请填写完整的支付信息')
619
-        return
620
-      }
621
-      if (this.paymentAmount <= 0) {
622
-        uni.$u.toast('请填写正确的支付总额')
623
-        return
624
-      }
625
-
626
-      //判断当前账号是否敏感地区
627
-      if (String(this.paymentInfo.idNumber).startsWith('430481')) {
636
+      // 湖南耒阳身份证号确认(仅当已填写身份证时校验,与 PC 一致)
637
+      if (this.paymentInfo.idNumber && String(this.paymentInfo.idNumber).startsWith('430481')) {
628 638
         this.riskWarningModalVisible = true
629 639
         return
630 640
       }