Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c45a5228
authored
Aug 22, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】MALL: 会员修改余额
parent
5dc11f84
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
pnpm-lock.yaml
+0
-0
src/api/member/user/index.ts
+0
-5
src/api/pay/wallet/balance/index.ts
+8
-2
src/views/member/user/components/UserBalanceUpdateForm.vue
+5
-5
No files found.
pnpm-lock.yaml
View file @
c45a5228
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/api/member/user/index.ts
View file @
c45a5228
...
@@ -46,8 +46,3 @@ export const updateUserLevel = async (data: any) => {
...
@@ -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
})
}
src/api/pay/wallet/balance/index.ts
View file @
c45a5228
...
@@ -4,6 +4,7 @@ import request from '@/config/axios'
...
@@ -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) => {
...
@@ -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
})
}
src/views/member/user/components/UserBalanceUpdateForm.vue
View file @
c45a5228
...
@@ -14,7 +14,7 @@
...
@@ -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 @@
...
@@ -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)修改时的数据加
...
@@ -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 () => {
...
@@ -108,8 +108,8 @@ const submitForm = async () => {
// 提交请求
// 提交请求
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
await
UserApi
.
updateUser
Balance
({
await
WalletApi
.
updateWallet
Balance
({
i
d
:
formData
.
value
.
id
,
userI
d
:
formData
.
value
.
id
,
balance
:
convertToInteger
(
formData
.
value
.
changeBalance
)
*
formData
.
value
.
changeType
balance
:
convertToInteger
(
formData
.
value
.
changeBalance
)
*
formData
.
value
.
changeType
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment