From 687c96bb0e2626019b87511f2dbe2a5d071f8dd9 Mon Sep 17 00:00:00 2001 From: GoldenZqqqq <1361001127@qq.com> Date: Sun, 18 Aug 2024 21:42:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=9A=E5=91=98=E8=AF=A6=E6=83=85-?= =?UTF-8?q?=E4=BD=99=E9=A2=9Dtab=E9=A1=B5=E9=9D=A2=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=EF=BC=9B=E5=B0=86=E6=9F=A5=E8=AF=A2=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E9=80=BB=E8=BE=91=E6=8A=BD=E5=8F=96=E5=88=B0=E7=88=B6?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=96=B9=E4=BE=BF=E4=BD=99=E9=A2=9D?= =?UTF-8?q?tab=E9=A1=B5=E9=9D=A2=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/user/detail/UserAccountInfo.vue | 26 +------ .../member/user/detail/UserBalanceList.vue | 68 +++++++++++++++++++ src/views/member/user/detail/index.vue | 26 ++++++- 3 files changed, 93 insertions(+), 27 deletions(-) create mode 100644 src/views/member/user/detail/UserBalanceList.vue diff --git a/src/views/member/user/detail/UserAccountInfo.vue b/src/views/member/user/detail/UserAccountInfo.vue index 56a6ab63..7b7d6622 100644 --- a/src/views/member/user/detail/UserAccountInfo.vue +++ b/src/views/member/user/detail/UserAccountInfo.vue @@ -50,31 +50,7 @@ import * as UserApi from '@/api/member/user' import * as WalletApi from '@/api/pay/wallet/balance' import { UserTypeEnum } from '@/utils/constants' import { fenToYuan } from '@/utils' - -const props = defineProps<{ user: UserApi.UserVO }>() // 用户信息 -const WALLET_INIT_DATA = { - balance: 0, - totalExpense: 0, - totalRecharge: 0 -} as WalletApi.WalletVO // 钱包初始化数据 -const wallet = ref(WALLET_INIT_DATA) // 钱包信息 - -/** 查询用户钱包信息 */ -const getUserWallet = async () => { - if (!props.user.id) { - wallet.value = WALLET_INIT_DATA - return - } - const params = { userId: props.user.id } - wallet.value = (await WalletApi.getWallet(params)) || WALLET_INIT_DATA -} - -/** 监听用户编号变化 */ -watch( - () => props.user.id, - () => getUserWallet(), - { immediate: true } -) +const props = defineProps<{ user: UserApi.UserVO; wallet: WalletApi.WalletVO }>() // 用户信息 diff --git a/src/views/member/user/detail/index.vue b/src/views/member/user/detail/index.vue index 52862c3c..c87c1253 100644 --- a/src/views/member/user/detail/index.vue +++ b/src/views/member/user/detail/index.vue @@ -20,7 +20,7 @@ - + @@ -40,7 +40,9 @@ - 余额(WIP) + + + @@ -68,6 +70,7 @@