|
|
@@ -29,28 +29,29 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, defineAsyncComponent, onMounted } from 'vue'
|
|
|
+import { shallowRef, defineAsyncComponent, onMounted,computed } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
import { formatDecimal, handlePriceColor } from '@/filters'
|
|
|
-import { useAccountStore } from '@/stores'
|
|
|
+import { useAccountStore, useUserStore } from '@/stores'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { getTradeStatusName } from '@/constants/order'
|
|
|
import { AuthStatus } from '@/constants/account'
|
|
|
import { queryBankAccountSign } from '@/services/api/bank'
|
|
|
-import { queryUserAccount } from '@/services/api/account'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['deposit', defineAsyncComponent(() => import('./deposit/index.vue'))], // 入金
|
|
|
['withdraw', defineAsyncComponent(() => import('./withdraw/index.vue'))], // 出金
|
|
|
])
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
const accountStore = useAccountStore()
|
|
|
-const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态
|
|
|
const { selectedRow, rowKey, expandKeys, rowClick } = useComposeTable<Model.TaAccountsRsp>({ rowKey: 'accountid' })
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
|
|
|
+const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
|
|
|
+
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'accountid', label: '资金账号', width: 160 },
|
|
|
{ prop: 'balance', label: '期初余额', decimal: 2 },
|
|
|
@@ -85,12 +86,9 @@ const doInOutMoney = (code: string) => {
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- accountStore.getAccountList()
|
|
|
if (authStatus.value !== AuthStatus.Certified) {
|
|
|
- // 获取用户账号信息
|
|
|
- queryUserAccount().then((res) => {
|
|
|
- authStatus.value = res.data.hasauth
|
|
|
- })
|
|
|
+ userStore.getUserData()
|
|
|
}
|
|
|
+ accountStore.getAccountList()
|
|
|
})
|
|
|
</script>
|