|
@@ -12,8 +12,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="profile-user__info">
|
|
<div class="profile-user__info">
|
|
|
<div>
|
|
<div>
|
|
|
- <Tag type="success" v-if="hasAuth">已实名</Tag>
|
|
|
|
|
- <Tag type="primary" v-else>未实名</Tag>
|
|
|
|
|
|
|
+ <Tag :type="authStatus ? 'success' : 'primary'">{{ getAuthStatusName(authStatus) }}</Tag>
|
|
|
</div>
|
|
</div>
|
|
|
<span>{{ getLoginId() }}</span>
|
|
<span>{{ getLoginId() }}</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -30,11 +29,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bank-item">
|
|
<div class="bank-item">
|
|
|
<span>冻结</span>
|
|
<span>冻结</span>
|
|
|
- <span>{{ accountInfo.freezemargin }}</span>
|
|
|
|
|
|
|
+ <span>{{ freezeMargin }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bank-item">
|
|
<div class="bank-item">
|
|
|
<span>可用</span>
|
|
<span>可用</span>
|
|
|
- <span>{{ accountInfo.usedmargin }}</span>
|
|
|
|
|
|
|
+ <span>{{ avaiableMoney }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bank-item">
|
|
<div class="bank-item">
|
|
|
<span>
|
|
<span>
|
|
@@ -70,12 +69,13 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="g-navmenu">
|
|
<div class="g-navmenu">
|
|
|
<CellGroup>
|
|
<CellGroup>
|
|
|
- <Cell is-link :to="{ name: 'account-certification' }" v-if="!hasAuth">
|
|
|
|
|
|
|
+ <Cell is-link :to="{ name: 'account-certification' }"
|
|
|
|
|
+ v-if="[AuthStatus.Uncertified, AuthStatus.Rejected].includes(authStatus)">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<app-iconfont icon="icon-shimingrenzheng">实名认证</app-iconfont>
|
|
<app-iconfont icon="icon-shimingrenzheng">实名认证</app-iconfont>
|
|
|
</template>
|
|
</template>
|
|
|
</Cell>
|
|
</Cell>
|
|
|
- <Cell is-link :to="{ name: 'bank-sign' }">
|
|
|
|
|
|
|
+ <Cell is-link :to="{ name: 'bank-sign' }" v-if="authStatus === AuthStatus.Certified">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<app-iconfont icon="icon-qianyuezhanghu">签约账户</app-iconfont>
|
|
<app-iconfont icon="icon-qianyuezhanghu">签约账户</app-iconfont>
|
|
|
</template>
|
|
</template>
|
|
@@ -119,21 +119,23 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
|
|
|
|
+import { shallowRef, onActivated } from 'vue'
|
|
|
import { Cell, CellGroup, Button, Tag, Toast } from 'vant'
|
|
import { Cell, CellGroup, Button, Tag, Toast } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
-import { useLoginStore, useUserStore, useAccountStore, } from '@/stores'
|
|
|
|
|
|
|
+import { useLoginStore, useAccountStore, } from '@/stores'
|
|
|
import { useAuth } from '@/business/auth'
|
|
import { useAuth } from '@/business/auth'
|
|
|
import AppIconfont from '@mobile/components/base/iconfont/index.vue'
|
|
import AppIconfont from '@mobile/components/base/iconfont/index.vue'
|
|
|
import { useBankAccountSign } from '@/business/bank'
|
|
import { useBankAccountSign } from '@/business/bank'
|
|
|
|
|
+import { queryUserAccount } from '@/services/api/account'
|
|
|
|
|
+import { AuthStatus, getAuthStatusName } from '@/constants/account';
|
|
|
|
|
|
|
|
const { router, routerTo } = useNavigation()
|
|
const { router, routerTo } = useNavigation()
|
|
|
-const { getLoginId, getFirstAccountId } = useLoginStore()
|
|
|
|
|
-const { hasAuth } = useUserStore()
|
|
|
|
|
|
|
+const { getUserId, getLoginId, getFirstAccountId } = useLoginStore()
|
|
|
const { getBankAccountList, bankInfo } = useBankAccountSign()
|
|
const { getBankAccountList, bankInfo } = useBankAccountSign()
|
|
|
const { logout } = useAuth()
|
|
const { logout } = useAuth()
|
|
|
-const { accountInfo } = useAccountStore()
|
|
|
|
|
|
|
+const { accountInfo, freezeMargin, avaiableMoney } = useAccountStore()
|
|
|
|
|
+const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态
|
|
|
const headerRef = shallowRef<HTMLDivElement>()
|
|
const headerRef = shallowRef<HTMLDivElement>()
|
|
|
|
|
|
|
|
const onReady = (el: HTMLDivElement) => {
|
|
const onReady = (el: HTMLDivElement) => {
|
|
@@ -143,7 +145,7 @@ const onReady = (el: HTMLDivElement) => {
|
|
|
|
|
|
|
|
/// 进行出入金操作判断
|
|
/// 进行出入金操作判断
|
|
|
const doInOutMoney = (tab: string) => {
|
|
const doInOutMoney = (tab: string) => {
|
|
|
- if (hasAuth) {
|
|
|
|
|
|
|
+ if (authStatus.value === AuthStatus.Certified) {
|
|
|
fullloading((hideLoading) => {
|
|
fullloading((hideLoading) => {
|
|
|
getBankAccountList().then(() => {
|
|
getBankAccountList().then(() => {
|
|
|
hideLoading()
|
|
hideLoading()
|
|
@@ -151,14 +153,24 @@ const doInOutMoney = (tab: string) => {
|
|
|
if (signstatus && signstatus !== 1) {
|
|
if (signstatus && signstatus !== 1) {
|
|
|
router.push({ name: 'bank-wallet', query: { tab } })
|
|
router.push({ name: 'bank-wallet', query: { tab } })
|
|
|
} else {
|
|
} else {
|
|
|
- dialog('当前未签约,请先进行账户签约才进行出入金操作')
|
|
|
|
|
|
|
+ dialog('请先添加签约账户信息。', {
|
|
|
|
|
+ showCancelButton: true,
|
|
|
|
|
+ confirmButtonText: '去签约'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ router.push({ name: 'bank-sign' })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
Toast.fail('加载失败')
|
|
Toast.fail('加载失败')
|
|
|
})
|
|
})
|
|
|
}, '正在加载...')
|
|
}, '正在加载...')
|
|
|
} else {
|
|
} else {
|
|
|
- dialog('请先实名认证,再进行出入金操作业务!')
|
|
|
|
|
|
|
+ dialog('请先实名认证,再进行出入金操作业务。', {
|
|
|
|
|
+ showCancelButton: true,
|
|
|
|
|
+ confirmButtonText: '去实名'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ router.push({ name: 'account-certification' })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -169,6 +181,20 @@ const userLogout = () => {
|
|
|
logout()
|
|
logout()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+onActivated(() => {
|
|
|
|
|
+ if (authStatus.value !== AuthStatus.Certified) {
|
|
|
|
|
+ // 获取用户账号信息
|
|
|
|
|
+ queryUserAccount({
|
|
|
|
|
+ data: {
|
|
|
|
|
+ userID: getUserId()
|
|
|
|
|
+ },
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ authStatus.value = res.data.hasauth
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|