Jelajahi Sumber

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/THJ_Mobile

li.shaoyi 3 tahun lalu
induk
melakukan
70c648d764

+ 2 - 2
src/business/bank/index.ts

@@ -353,7 +353,7 @@ export function doCancelBankSign() {
         }
     })
 
-    const formSubmit = async () => {
+    const cancelSubmit = async () => {
         await request
         const { cusbankid, currency, accountcode, bankaccountno2, bankaccountname2 } = bankAccountSign.value[0]
         loading.value = true
@@ -377,7 +377,7 @@ export function doCancelBankSign() {
 
     return {
         loading,
-        formSubmit,
+        cancelSubmit,
         formData,
         sign
     }

+ 0 - 1
src/business/common/index.ts

@@ -3,7 +3,6 @@ import { useStore } from '@/stores'
 import { tokenCheck } from '@/services/api/account'
 import eventBus from '@/services/bus'
 import socket from '@/services/socket'
-import { uploadFile } from '@/services/api/common'
 
 /**
  * 退出登录

+ 4 - 0
src/constants/regex.ts

@@ -25,5 +25,9 @@ export const validateRules = {
     cardno: {
         validate: (val: string) => /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(val),
         message: '身份证号码不合规',
+    },
+    bankcardno: {
+        validate: (val: string) => /^([1-9]{1})(\d{15}|\d{16}|\d{18})$/.test(val),
+        message: '银行卡号码不合规',
     }
 }

+ 6 - 0
src/packages/mobile/views/account/certification/index.vue

@@ -99,6 +99,12 @@ const formRules: { [key in keyof Model.AddAuthReq]?: FieldRule[] } = {
         required: true,
         message: '请输入用户姓名',
     }],
+    cardtype: [{
+        message: '请选择证件类型',
+        validator:()=>{
+            return !!formData.cardtype
+        }
+    }],
     cardnum: [{
         required: true,
         message: '请输入证件号码',

+ 7 - 1
src/packages/mobile/views/bank/sign/components/edit/index.vue

@@ -14,7 +14,6 @@
         </Form>
         <template #footer>
             <div class="g-form__footer">
-                <!-- <Button type="success" round block>解约</Button> -->
                 <Button type="primary" round block @click="formRef?.submit()">提交</Button>
             </div>
         </template>
@@ -29,6 +28,7 @@ import { fullloading, dialog } from '@/utils/vant'
 import { doBankSign, } from '@/business/bank'
 import { useNavigation } from '@/hooks/navigation'
 import AppSelect from '@mobile/components/base/select/index.vue'
+import { validateRules } from '@/constants/regex'
 
 const {router}=useNavigation()
 const { formData, onSubmit, cusSignBank } = doBankSign()
@@ -52,6 +52,12 @@ const formRules: { [key in keyof Proto.t2bBankSignReq]?: FieldRule[] } = {
     BankAccountNo: [{
         required: true,
         message: '请输入银行卡账号',
+        validator: (val) => {
+            if (validateRules.bankcardno.validate(val)) {
+                return true
+            }
+            return validateRules.bankcardno.message
+        }
     }],
     BankAccountName: [{
         required: true,

+ 26 - 2
src/packages/mobile/views/home/components/mine/index.vue

@@ -67,7 +67,7 @@
     </div>
     <div class="g-navmenu">
       <CellGroup>
-        <Cell is-link  :to="{ name: 'account-certification' }">
+        <Cell is-link  @click="hasAuth">
           <template #title>
             <app-iconfont icon="icon-shimingrenzheng">实名认证</app-iconfont>
           </template>
@@ -117,24 +117,48 @@
 
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
-import { Cell, CellGroup, Button } from 'vant'
+import { Cell, CellGroup, Button, Toast } from 'vant'
 import { dialog } from '@/utils/vant'
 import { useNavigation } from '@/hooks/navigation'
 import { useLoginStore, useAccountStore } from '@/stores'
 import { useAuth } from '@/business/auth'
 import AppIconfont from '@mobile/components/base/iconfont/index.vue'
+import { queryUserAccount } from '@/services/api/account'
 
 const { routerTo } = useNavigation()
 const { getLoginId, getUserId, getFirstAccountId } = useLoginStore()
 const { logout } = useAuth()
 const { accountInfo } = useAccountStore()
 const headerRef = shallowRef<HTMLDivElement>()
+const userAccount = shallowRef<Partial<Model.UserAccount>>({})
+
 
 const onReady = (el: HTMLDivElement) => {
   // 设置背景图位置
   headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
 }
 
+const hasAuth = () => {
+  /// 当前已实名
+  if (userAccount.value.hasauth === 1) {
+    Toast('当前已实名');
+    return
+  } 
+  routerTo('account-certification')
+}
+
+const getUserAccount = () => {
+    queryUserAccount({
+        data: {
+            userID: getUserId()
+        },
+        success: (res) => {
+            userAccount.value = res.data
+        }
+    })
+}
+getUserAccount()
+
 const userLogout = () => {
   dialog('是否退出当前账号?', {
     showCancelButton: true