Handy_Cao 1 سال پیش
والد
کامیت
acae1a6e1f
1فایلهای تغییر یافته به همراه17 افزوده شده و 6 حذف شده
  1. 17 6
      src/packages/mobile/views/user/register/Index.vue

+ 17 - 6
src/packages/mobile/views/user/register/Index.vue

@@ -53,14 +53,14 @@
 </template>
 
 <script lang="ts" setup>
-import { reactive, ref, computed, onMounted } from 'vue'
+import { reactive, ref, computed, onMounted, shallowRef } from 'vue'
 import { CellGroup, Cell, Button, Field, Form, FormInstance, Checkbox, showFailToast, showToast, FieldRule } from 'vant'
 import { useCountDown } from '@vant/use'
 import { fullloading, dialog } from '@/utils/vant'
 import { validateRules } from '@/constants/regex'
 import { useNavigation } from '@mobile/router/navigation'
 import { userRegister, sendRegisterVerifyCode, queryMyRegisterMoney } from '@/services/api/common'
-import { i18n, useGlobalStore } from '@/stores'
+import { i18n, useGlobalStore, useUserStore } from '@/stores'
 import cryptojs from 'crypto-js'
 import plus from '@/utils/h5plus'
 import AppReward from '@mobile/components/modules/reward/index.vue'
@@ -75,6 +75,9 @@ const isCountdown = ref(false) // 是否正在倒计时
 const showReward = ref(false) // 显示红包
 const redEnvelope = ref(0) // 红包金额
 
+const { getSystemParamValue } = useUserStore()
+const system_1010 = shallowRef(getSystemParamValue('1010') ?? '1')
+
 const { global: { t } } = i18n
 
 const confirmpassword = ref('') // 确认密码
@@ -110,10 +113,18 @@ const formRules: { [key: string]: FieldRule[] } = {
     required: true,
     message: t('user.register.tips1'),
     validator: (val) => {
-      if (validateRules.phone.validate(val)) {
-        return true
-      }
-      return validateRules.phone.message
+      /// 值为”0“ 时 只校验长度20位,不限字符
+      if (system_1010.value === '0') {
+          if (val.length <= 20) {
+              return true
+          }
+          return t('banksign.tips6')
+      } else {
+        if (validateRules.phone.validate(val)) {
+          return true
+        }
+        return validateRules.phone.message
+      } 
     }
   }],
   loginpwd: [{