Handy_Cao %!s(int64=3) %!d(string=hai) anos
pai
achega
3878f52024
Modificáronse 1 ficheiros con 42 adicións e 24 borrados
  1. 42 24
      src/packages/mobile/views/home/components/mine/index.vue

+ 42 - 24
src/packages/mobile/views/home/components/mine/index.vue

@@ -72,7 +72,7 @@
             <app-iconfont icon="icon-shimingrenzheng">实名认证</app-iconfont>
           </template>
         </Cell>
-        <Cell is-link :to="{ name: 'bank-sign' }">
+        <Cell is-link @click="doBankAccountSign">
           <template #title>
             <app-iconfont icon="icon-qianyuezhanghu">签约账户</app-iconfont>
           </template>
@@ -118,7 +118,7 @@
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { Cell, CellGroup, Button, Toast } from 'vant'
-import { fullloading, dialog } from '@/utils/vant'
+import { dialog } from '@/utils/vant'
 import { useNavigation } from '@/hooks/navigation'
 import { useLoginStore, useAccountStore } from '@/stores'
 import { useAuth } from '@/business/auth'
@@ -132,6 +132,7 @@ const { logout } = useAuth()
 const { accountInfo } = useAccountStore()
 const headerRef = shallowRef<HTMLDivElement>()
 const { getBankAccountList, dataList } = useBankAccountSign()
+const userAccount = shallowRef<Partial<Model.UserAccount>>({})
 
 getBankAccountList()
 
@@ -141,39 +142,56 @@ const onReady = (el: HTMLDivElement) => {
 }
 
 /// 进行出入金操作判断
-const doInOutMoney = (tab: string) => {
+const doInOutMoney = (active: number) => {
+  /// 当前未实名
+  if (userAccount.value.hasauth == 0 || userAccount.value.hasauth == 3) {
+    dialog('请先实名认证,再进行出入金操作业务!')
+  } else {
+    /// 当前未签约
+    if (dataList.value.length === 0 || dataList.value[0].signstatus === 1 ) {
+      dialog('当前未签约,请先进行账户签约才进行出入金操作')
+      return
+    }
 
-  console.log('xxxx', dataList.value)
-  /// 当前未签约
-  if (dataList.value.length === 0 || dataList.value[0].signstatus === 1) {
-    dialog('当前未签约,请先进行账户签约才进行出入金操作')
-    return
+    if (active == 0) {
+      router.push({ name: 'bank-wallet', query: { tab: '0' } })
+    } else {
+      router.push({ name: 'bank-wallet', query: { tab: '1' } })
+    }
   }
+}
 
-  router.push({ name: 'bank-wallet', query: { tab } })
+const doBankAccountSign = () => {
+  /// 当前未实名
+  if (userAccount.value.hasauth == 0 || userAccount.value.hasauth == 3) {
+    dialog('请先实名认证,再进行银行签约操作!')
+  } else {
+    /// 当前未签约
+    router.push({ name: 'bank-sign'})
+  }
+>>>>>>> 967b84d (update)
 }
 
 // 检查是否已实名认证
 const hasAuth = () => {
-  fullloading((hideLoading) => {
+  if (userAccount.value.hasauth == 1 || userAccount.value.hasauth == 2) {
+    Toast('当前已实名')
+  } else {
+    routerTo('account-certification')
+  }
+}
+
+const getUserAccount = () => {
     queryUserAccount({
-      data: {
-        userID: getUserId()
-      },
-      success: (res) => {
-        hideLoading()
-        if (res.data.hasauth) {
-          dialog('当前已实名')
-        } else {
-          routerTo('account-certification')
+        data: {
+            userID: getUserId()
+        },
+        success: (res) => {
+            userAccount.value = res.data
         }
-      },
-      fail: (err) => {
-        Toast.fail('加载失败')
-      }
     })
-  }, '正在加载...')
 }
+getUserAccount()
 
 const userLogout = () => {
   dialog('是否退出当前账号?', {