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