diff --git a/src/api/member/config/index.ts b/src/api/member/config/index.ts new file mode 100644 index 00000000..7ddca16b --- /dev/null +++ b/src/api/member/config/index.ts @@ -0,0 +1,19 @@ +import request from '@/config/axios' + +export interface ConfigVO { + id: number + pointTradeDeductEnable: number + pointTradeDeductUnitPrice: number + pointTradeDeductMaxPrice: number + pointTradeGivePoint: number +} + +// 查询积分设置详情 +export const getConfig = async () => { + return await request.get({ url: `/member/config/get` }) +} + +// 新增修改积分设置 +export const saveConfig = async (data: ConfigVO) => { + return await request.put({ url: `/member/config/save`, data }) +} diff --git a/src/api/member/point/config/index.ts b/src/api/member/point/config/index.ts deleted file mode 100644 index 9a3c4c48..00000000 --- a/src/api/member/point/config/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -import request from '@/config/axios' - -export interface ConfigVO { - id: number - tradeDeductEnable: number - tradeDeductUnitPrice: number - tradeDeductMaxPrice: number - tradeGivePoint: number -} - -// 查询积分设置详情 -export const getConfig = async () => { - return await request.get({ url: `/member/point/config/get` }) -} - -// 新增修改积分设置 -export const saveConfig = async (data: ConfigVO) => { - return await request.put({ url: `/member/point/config/save`, data }) -} diff --git a/src/api/member/signin/config/index.ts b/src/api/member/signin/config/index.ts index 558bdc70..50a7d63c 100644 --- a/src/api/member/signin/config/index.ts +++ b/src/api/member/signin/config/index.ts @@ -1,10 +1,11 @@ import request from '@/config/axios' export interface SignInConfigVO { - id: number - day: number | null - point: number | null - enable: boolean | null + id?: number + day?: number + point?: number + experience?: number + status?: number } // 查询积分签到规则列表 diff --git a/src/api/member/user/index.ts b/src/api/member/user/index.ts index 4d60988c..e38206a8 100644 --- a/src/api/member/user/index.ts +++ b/src/api/member/user/index.ts @@ -41,3 +41,13 @@ export const updateUser = async (data: UserVO) => { export const updateUserLevel = async (data: any) => { return await request.put({ url: `/member/user/update-level`, data }) } + +// 修改会员用户积分 +export const updateUserPoint = async (data: any) => { + return await request.put({ url: `/member/user/update-point`, data }) +} + +// 修改会员用户余额 +export const updateUserBalance = async (data: any) => { + return await request.put({ url: `/member/user/update-balance`, data }) +} 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/point/config/index.vue b/src/views/member/config/index.vue similarity index 70% rename from src/views/member/point/config/index.vue rename to src/views/member/config/index.vue index ed000537..38196690 100644 --- a/src/views/member/point/config/index.vue +++ b/src/views/member/config/index.vue @@ -13,13 +13,13 @@ - - + + 下单积分是否抵用订单金额 - + @@ -27,18 +27,18 @@ 积分抵用比例(1 积分抵多少金额),单位:元 - + 单次下单积分使用上限,0 不限制 - + @@ -55,9 +55,9 @@ diff --git a/src/views/member/user/components/growth-list.vue b/src/views/member/user/components/growth-list.vue deleted file mode 100644 index 51fe72af..00000000 --- a/src/views/member/user/components/growth-list.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - diff --git a/src/views/member/user/detail/UserAccountInfo.vue b/src/views/member/user/detail/UserAccountInfo.vue index 3a609fe0..80beae6d 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 }}