feat: member detail add UserBalanceList

pull/119/head
xingyu4j 2025-05-29 01:00:25 +08:00
parent 4da3510db8
commit 42c001c1c3
2 changed files with 72 additions and 1 deletions

View File

@ -0,0 +1,68 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { WalletTransactionApi } from '#/api/pay/wallet/transaction';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getTransactionPage } from '#/api/pay/wallet/transaction';
const props = defineProps<{
walletId: number | undefined;
}>();
const [Grid] = useVbenVxeGrid({
gridOptions: {
columns: [
{
field: 'id',
title: '编号',
},
{
field: 'title',
title: '关联业务标题',
},
{
field: 'price',
title: '交易金额',
formatter: 'formatFraction',
},
{
field: 'balance',
title: '钱包余额',
formatter: 'formatFraction',
},
{
field: 'createTime',
title: '交易时间',
formatter: 'formatDateTime',
},
],
keepSource: true,
pagerConfig: {
pageSize: 10,
},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
return await getTransactionPage({
pageNo: page.currentPage,
pageSize: page.pageSize,
walletId: props.walletId,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
toolbarConfig: {
refresh: { code: 'query' },
search: true,
},
} as VxeTableGridOptions<WalletTransactionApi.Transaction>,
});
</script>
<template>
<Grid />
</template>

View File

@ -15,6 +15,7 @@ import { getWallet } from '#/api/pay/wallet/balance';
import { $t } from '#/locales';
import UserAccountInfo from '../components/user-account-info.vue';
import UserBalanceList from '../components/user-balance-list.vue';
import UserBasicInfo from '../components/user-basic-info.vue';
import UserExperienceRecordList from '../components/user-experience-record-list.vue';
import UserPointList from '../components/user-point-list.vue';
@ -90,7 +91,9 @@ onMounted(async () => {
<TabPane tab="成长值" key="UserExperienceRecordList">
<UserExperienceRecordList class="h-full" :user-id="userId" />
</TabPane>
<TabPane tab="余额" key="UserBalanceList" />
<TabPane tab="余额" key="UserBalanceList">
<UserBalanceList class="h-full" :wallet-id="wallet?.id" />
</TabPane>
<TabPane tab="收货地址" key="UserAddressList" />
<TabPane tab="订单管理" key="UserOrderList" />
<TabPane tab="售后管理" key="UserAfterSaleList" />