|
|
@@ -95,12 +95,12 @@
|
|
|
<Iconfont icon="g-icon-sign">签约账户</Iconfont>
|
|
|
</template>
|
|
|
</Cell>
|
|
|
- <Cell is-link :to="{ name: 'account-protocol', query: { memberUserId: getMemberUserId() } }"
|
|
|
+ <!-- <Cell is-link :to="{ name: 'account-protocol', query: { memberUserId: getMemberUserId() } }"
|
|
|
v-if="userStore.userType != 2 && authStatus === AuthStatus.Certified">
|
|
|
<template #title>
|
|
|
<Iconfont icon="g-icon-order--line">合同签署</Iconfont>
|
|
|
</template>
|
|
|
- </Cell>
|
|
|
+ </Cell> -->
|
|
|
<Cell is-link :to="{ name: 'mine-profile' }">
|
|
|
<template #title>
|
|
|
<Iconfont icon="g-icon-profile">公司信息</Iconfont>
|
|
|
@@ -148,10 +148,12 @@ import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { AuthStatus } from '@/constants/account'
|
|
|
import { queryBankAccountSign } from '@/services/api/bank'
|
|
|
import { useLoginStore, useAccountStore, useUserStore } from '@/stores'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { getMemberUserId, getUserId } from '@/services/methods/user'
|
|
|
+import { queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
+import { requestInitMdUserSwapProtocol } from '@/services/api/account'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import Iconfont from '@/components/base/iconfont/index.vue'
|
|
|
-import { getMemberUserId } from '@/services/methods/user'
|
|
|
-import { queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
|
|
|
const { router, routerTo } = useNavigation()
|
|
|
const loginStore = useLoginStore()
|
|
|
@@ -225,6 +227,19 @@ const userLogout = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+/// 创建电子签合同
|
|
|
+const { run: initMdUserSwapProtocol } = useRequest(requestInitMdUserSwapProtocol, {
|
|
|
+ manual: true,
|
|
|
+ params: {
|
|
|
+ userId: getUserId(),
|
|
|
+ memberUserId: getMemberUserId()
|
|
|
+ },
|
|
|
+ onSuccess: () => {
|
|
|
+ /// 可以交易
|
|
|
+ canBankSign.value = true
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
onActivated(() => {
|
|
|
if (authStatus.value !== AuthStatus.Certified) {
|
|
|
userStore.getUserData()
|
|
|
@@ -243,8 +258,12 @@ onActivated(() => {
|
|
|
userId: loginStore.userId
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
- /// 判断是否能签约
|
|
|
- canBankSign.value = res.data.some(e => e.protocolstatus === 4)
|
|
|
+ if (res.data.length === 0) {
|
|
|
+ initMdUserSwapProtocol()
|
|
|
+ } else {
|
|
|
+ /// 判断是否能签约
|
|
|
+ canBankSign.value = res.data.some(e => e.protocolstatus === 4)
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
</script>
|