|
|
@@ -60,7 +60,7 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="button">
|
|
|
- <Button type="danger" size="small" round @click="doInOutMoney('0')">入金</Button>
|
|
|
+ <Button type="danger" size="small" round @click="showComponent('apply')">代扣入金</Button>
|
|
|
<Button size="small" round @click="doInOutMoney('1')">出金</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -100,12 +100,17 @@
|
|
|
</Cell>
|
|
|
<Cell is-link :to="{ name: 'hold-sign' }" v-if="authStatus === AuthStatus.Certified">
|
|
|
<template #title>
|
|
|
- <Iconfont icon="g-icon-signing"> 代扣签约申请</Iconfont>
|
|
|
+ <Iconfont icon="g-icon-signing"> 代扣签约</Iconfont>
|
|
|
</template>
|
|
|
</Cell>
|
|
|
<Cell is-link :to="{ name: 'hold-deposit' }" v-if="authStatus === AuthStatus.Certified">
|
|
|
<template #title>
|
|
|
- <Iconfont icon="g-icon-wallet">入金代扣申请</Iconfont>
|
|
|
+ <Iconfont icon="g-icon-wallet">代扣查询</Iconfont>
|
|
|
+ </template>
|
|
|
+ </Cell>
|
|
|
+ <Cell is-link @click="doInOutMoney('0')" v-if="authStatus === AuthStatus.Certified">
|
|
|
+ <template #title>
|
|
|
+ <Iconfont icon="g-icon-wallet">银行入金</Iconfont>
|
|
|
</template>
|
|
|
</Cell>
|
|
|
<Cell is-link :to="{ name: 'mine-profile' }">
|
|
|
@@ -143,21 +148,33 @@
|
|
|
<div class="mine-footer">
|
|
|
<Button class="button-logout" type="danger" size="small" round @click="userLogout">退出登录</Button>
|
|
|
</div>
|
|
|
+ <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, onActivated, computed } from 'vue'
|
|
|
+import { shallowRef, onActivated, computed, defineAsyncComponent } from 'vue'
|
|
|
import { Cell, CellGroup, Button, Icon } from 'vant'
|
|
|
import { parsePercent } from '@/filters'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { AuthStatus } from '@/constants/account'
|
|
|
import { queryBankAccountSign } from '@/services/api/bank'
|
|
|
import { useLoginStore, useAccountStore, useUserStore } from '@/stores'
|
|
|
+import { queryGetGtwithholdsigninfo } from '@/services/api/bank'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { SignStatus } from '@/constants/bank'
|
|
|
import eventBus from '@/services/bus'
|
|
|
import Iconfont from '@/components/base/iconfont/index.vue'
|
|
|
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['apply', defineAsyncComponent(() => import('../holdbank/holddeposit/components/apply/Index.vue'))],
|
|
|
+])
|
|
|
+
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
+
|
|
|
const { router, routerTo } = useNavigation()
|
|
|
const loginStore = useLoginStore()
|
|
|
const userStore = useUserStore()
|
|
|
@@ -166,12 +183,23 @@ const { currentAccount } = accountStore.$toRefs()
|
|
|
|
|
|
const headerRef = shallowRef<HTMLDivElement>()
|
|
|
const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
|
|
|
+const signStatus = shallowRef(SignStatus.Unsigned)
|
|
|
|
|
|
const onReady = (el: HTMLDivElement) => {
|
|
|
// 设置背景图位置
|
|
|
headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
|
|
|
}
|
|
|
|
|
|
+// 查询已经入金代扣申请签约
|
|
|
+useRequest(queryGetGtwithholdsigninfo, {
|
|
|
+ onSuccess: (res) => {
|
|
|
+ /// 签约状态
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ signStatus.value = res.data[0].accountsignstatus
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
/// 进行出入金操作判断
|
|
|
const doInOutMoney = (tab: string) => {
|
|
|
if (authStatus.value === AuthStatus.Certified) {
|
|
|
@@ -206,6 +234,20 @@ const doInOutMoney = (tab: string) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const showComponent = (companyName: string) => {
|
|
|
+ if (signStatus.value != SignStatus.Signed) {
|
|
|
+ dialog({
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: '签约申请',
|
|
|
+ message: '未进行入金代扣签约申请'
|
|
|
+ }).then(() => {
|
|
|
+ router.push({ name: 'hold-sign' })
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ openComponent(companyName)
|
|
|
+}
|
|
|
+
|
|
|
const userLogout = () => {
|
|
|
dialog({
|
|
|
message: '是否退出当前账号?',
|