ソースを参照

feat: 移动端开发票手机号校验支持400开头手机号

cuiyalong 1 年間 前
コミット
0ea28685b2
1 ファイル変更9 行追加12 行削除
  1. 9 12
      apps/mobile/src/views/invoice/Invoicing.vue

+ 9 - 12
apps/mobile/src/views/invoice/Invoicing.vue

@@ -576,14 +576,14 @@ export default {
         const { status } = await ajaxInvoiceAavailable({
           order_code: this.order_code
         })
-        if (status === 0) {
-          // 不支持开票
-          if (this.$envs.inWX) {
-            window.location.replace('/front/invoice/cantInvoice?f=upgrade')
-          } else {
-            window.location.replace('/jyapp/front/cantInvoice?f=upgrade')
-          }
-        }
+        // if (status === 0) {
+        //   // 不支持开票
+        //   if (this.$envs.inWX) {
+        //     window.location.replace('/front/invoice/cantInvoice?f=upgrade')
+        //   } else {
+        //     window.location.replace('/jyapp/front/cantInvoice?f=upgrade')
+        //   }
+        // }
         this.infoMap.code = this.order_code
         const res = await ajaxInvoiceNewshow({
           stype: 1,
@@ -1133,10 +1133,7 @@ export default {
       }
     },
     checkPhone(val) {
-      return (
-        /^1[3-9]\d{9}$/.test(val) ||
-        /^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/.test(val)
-      )
+      return /^(1[3|4|5|6|7|8|9])\d{9}$|^0\d{2,3}-?\d{7,8}$|^400[016789]\d{6}$|^400-[016789]\d{2}-\d{4}$/.test(val)
     },
     highlightText(value, keyStr) {
       return replaceKeyword(