From 05e6668322e7a2b06d99a4ce5ac300290814107a Mon Sep 17 00:00:00 2001 From: owen Date: Sat, 30 Sep 2023 12:40:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=92=B1=E5=8C=85=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 675f3df5cbc8623058ae75ef5a4ca4a92334b8d0) --- src/api/pay/wallet/index.ts | 22 +++++++++ src/utils/constants.ts | 49 ++++++++++++------- .../member/user/detail/UserAccountInfo.vue | 35 +++++++++++-- 3 files changed, 83 insertions(+), 23 deletions(-) create mode 100644 src/api/pay/wallet/index.ts diff --git a/src/api/pay/wallet/index.ts b/src/api/pay/wallet/index.ts new file mode 100644 index 00000000..0e5469db --- /dev/null +++ b/src/api/pay/wallet/index.ts @@ -0,0 +1,22 @@ +import request from '@/config/axios' + +/** 用户钱包查询参数 */ +export interface PayWalletUserReqVO { + userId: number + userType: number +} +/** 钱包 VO */ +export interface WalletVO { + id: number + userId: number + userType: number + balance: number + totalExpense: number + totalRecharge: number + freezePrice: number +} + +/** 查询用户钱包详情 */ +export const getUserWallet = async (params: PayWalletUserReqVO) => { + return await request.get({ url: `/pay/wallet/user-wallet`, params }) +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 80bb3e9d..8c57ecd3 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -4,12 +4,20 @@ * 枚举类 */ +// ========== COMMON 模块 ========== // 全局通用状态枚举 export const CommonStatusEnum = { ENABLE: 0, // 开启 DISABLE: 1 // 禁用 } +// 全局用户类型枚举 +export const UserTypeEnum = { + MEMBER: 1, // 会员 + ADMIN: 2 // 管理员 +} + +// ========== SYSTEM 模块 ========== /** * 菜单的类型枚举 */ @@ -38,6 +46,25 @@ export const SystemDataScopeEnum = { DEPT_SELF: 5 // 仅本人数据权限 } +/** + * 用户的社交平台的类型枚举 + */ +export const SystemUserSocialTypeEnum = { + DINGTALK: { + title: '钉钉', + type: 20, + source: 'dingtalk', + img: 'https://s1.ax1x.com/2022/05/22/OzMDRs.png' + }, + WECHAT_ENTERPRISE: { + title: '企业微信', + type: 30, + source: 'wechat_enterprise', + img: 'https://s1.ax1x.com/2022/05/22/OzMrzn.png' + } +} + +// ========== INFRA 模块 ========== /** * 代码生成模板类型 */ @@ -65,24 +92,7 @@ export const InfraApiErrorLogProcessStatusEnum = { IGNORE: 2 // 已忽略 } -/** - * 用户的社交平台的类型枚举 - */ -export const SystemUserSocialTypeEnum = { - DINGTALK: { - title: '钉钉', - type: 20, - source: 'dingtalk', - img: 'https://s1.ax1x.com/2022/05/22/OzMDRs.png' - }, - WECHAT_ENTERPRISE: { - title: '企业微信', - type: 30, - source: 'wechat_enterprise', - img: 'https://s1.ax1x.com/2022/05/22/OzMrzn.png' - } -} - +// ========== PAY 模块 ========== /** * 支付渠道枚举 */ @@ -177,6 +187,7 @@ export const PayOrderStatusEnum = { } } +// ========== MALL - 商品模块 ========== /** * 商品 SPU 状态 */ @@ -195,6 +206,7 @@ export const ProductSpuStatusEnum = { } } +// ========== MALL - 营销模块 ========== /** * 优惠劵模板的有限期类型的枚举 */ @@ -273,6 +285,7 @@ export const PromotionDiscountTypeEnum = { } } +// ========== MALL - 交易模块 ========== /** * 分销关系绑定模式枚举 */ diff --git a/src/views/member/user/detail/UserAccountInfo.vue b/src/views/member/user/detail/UserAccountInfo.vue index 3075fa96..90bf2246 100644 --- a/src/views/member/user/detail/UserAccountInfo.vue +++ b/src/views/member/user/detail/UserAccountInfo.vue @@ -24,31 +24,56 @@ {{ user.totalPoint || 0 }} - - {{ 0 }} + {{ wallet.balance || 0 }} - {{ 0 }} + {{ wallet.totalExpense || 0 }} - {{ 0 }} + {{ wallet.totalRecharge || 0 }}