【代码优化】MALL: 会员修改余额
parent
5dc11f844d
commit
c45a5228e1
2560
pnpm-lock.yaml
2560
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -46,8 +46,3 @@ export const updateUserLevel = async (data: any) => {
|
||||||
export const updateUserPoint = async (data: any) => {
|
export const updateUserPoint = async (data: any) => {
|
||||||
return await request.put({ url: `/member/user/update-point`, data })
|
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 })
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import request from '@/config/axios'
|
||||||
export interface PayWalletUserReqVO {
|
export interface PayWalletUserReqVO {
|
||||||
userId: number
|
userId: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 钱包 VO */
|
/** 钱包 VO */
|
||||||
export interface WalletVO {
|
export interface WalletVO {
|
||||||
id: number
|
id: number
|
||||||
|
@ -20,7 +21,12 @@ export const getWallet = async (params: PayWalletUserReqVO) => {
|
||||||
return await request.get<WalletVO>({ url: `/pay/wallet/get`, params })
|
return await request.get<WalletVO>({ url: `/pay/wallet/get`, params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询会员钱包列表
|
/** 查询会员钱包列表 */
|
||||||
export const getWalletPage = async (params) => {
|
export const getWalletPage = async (params: any) => {
|
||||||
return await request.get({ url: `/pay/wallet/page`, params })
|
return await request.get({ url: `/pay/wallet/page`, params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 修改会员钱包余额 */
|
||||||
|
export const updateWalletBalance = async (data: any) => {
|
||||||
|
return await request.put({ url: `/pay/wallet/update-balance`, data })
|
||||||
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<el-input v-model="formData.nickname" class="!w-240px" disabled />
|
<el-input v-model="formData.nickname" class="!w-240px" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变动前余额(元)" prop="balance">
|
<el-form-item label="变动前余额(元)" prop="balance">
|
||||||
<el-input-number v-model="formData.balance" class="!w-240px" disabled />
|
<el-input :model-value="formData.balance" class="!w-240px" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变动类型" prop="changeType">
|
<el-form-item label="变动类型" prop="changeType">
|
||||||
<el-radio-group v-model="formData.changeType">
|
<el-radio-group v-model="formData.changeType">
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="变动后余额(元)">
|
<el-form-item label="变动后余额(元)">
|
||||||
<el-input-number v-model="balanceResult" class="!w-240px" disabled />
|
<el-input :model-value="balanceResult" class="!w-240px" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -57,7 +57,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
nickname: undefined,
|
nickname: undefined,
|
||||||
balance: '0', // TODO @puhui999:貌似有 el-input-number 的报错,看看怎么解决。应该可以
|
balance: '0',
|
||||||
changeBalance: 0,
|
changeBalance: 0,
|
||||||
changeType: 1
|
changeType: 1
|
||||||
})
|
})
|
||||||
|
@ -108,8 +108,8 @@ const submitForm = async () => {
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
await UserApi.updateUserBalance({
|
await WalletApi.updateWalletBalance({
|
||||||
id: formData.value.id,
|
userId: formData.value.id,
|
||||||
balance: convertToInteger(formData.value.changeBalance) * formData.value.changeType
|
balance: convertToInteger(formData.value.changeBalance) * formData.value.changeType
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue