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
675f3df5
authored
Sep 30, 2023
by
owen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员详情,查询钱包信息
parent
6475f815
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
23 deletions
+83
-23
src/api/pay/wallet/index.ts
+22
-0
src/utils/constants.ts
+31
-18
src/views/member/user/detail/UserAccountInfo.vue
+30
-5
No files found.
src/api/pay/wallet/index.ts
0 → 100644
View file @
675f3df5
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
<
WalletVO
>
({
url
:
`/pay/wallet/user-wallet`
,
params
})
}
src/utils/constants.ts
View file @
675f3df5
...
@@ -4,12 +4,20 @@
...
@@ -4,12 +4,20 @@
* 枚举类
* 枚举类
*/
*/
// ========== COMMON 模块 ==========
// 全局通用状态枚举
// 全局通用状态枚举
export
const
CommonStatusEnum
=
{
export
const
CommonStatusEnum
=
{
ENABLE
:
0
,
// 开启
ENABLE
:
0
,
// 开启
DISABLE
:
1
// 禁用
DISABLE
:
1
// 禁用
}
}
// 全局用户类型枚举
export
const
UserTypeEnum
=
{
MEMBER
:
1
,
// 会员
ADMIN
:
2
// 管理员
}
// ========== SYSTEM 模块 ==========
/**
/**
* 菜单的类型枚举
* 菜单的类型枚举
*/
*/
...
@@ -39,6 +47,25 @@ export const SystemDataScopeEnum = {
...
@@ -39,6 +47,25 @@ export const SystemDataScopeEnum = {
}
}
/**
/**
* 用户的社交平台的类型枚举
*/
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 模块 ==========
/**
* 代码生成模板类型
* 代码生成模板类型
*/
*/
export
const
InfraCodegenTemplateTypeEnum
=
{
export
const
InfraCodegenTemplateTypeEnum
=
{
...
@@ -65,24 +92,7 @@ export const InfraApiErrorLogProcessStatusEnum = {
...
@@ -65,24 +92,7 @@ export const InfraApiErrorLogProcessStatusEnum = {
IGNORE
:
2
// 已忽略
IGNORE
:
2
// 已忽略
}
}
/**
// ========== PAY 模块 ==========
* 用户的社交平台的类型枚举
*/
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'
}
}
/**
/**
* 支付渠道枚举
* 支付渠道枚举
*/
*/
...
@@ -177,6 +187,7 @@ export const PayOrderStatusEnum = {
...
@@ -177,6 +187,7 @@ export const PayOrderStatusEnum = {
}
}
}
}
// ========== MALL - 商品模块 ==========
/**
/**
* 商品 SPU 状态
* 商品 SPU 状态
*/
*/
...
@@ -195,6 +206,7 @@ export const ProductSpuStatusEnum = {
...
@@ -195,6 +206,7 @@ export const ProductSpuStatusEnum = {
}
}
}
}
// ========== MALL - 营销模块 ==========
/**
/**
* 优惠劵模板的有限期类型的枚举
* 优惠劵模板的有限期类型的枚举
*/
*/
...
@@ -273,6 +285,7 @@ export const PromotionDiscountTypeEnum = {
...
@@ -273,6 +285,7 @@ export const PromotionDiscountTypeEnum = {
}
}
}
}
// ========== MALL - 交易模块 ==========
/**
/**
* 分销关系绑定模式枚举
* 分销关系绑定模式枚举
*/
*/
...
...
src/views/member/user/detail/UserAccountInfo.vue
View file @
675f3df5
...
@@ -24,31 +24,56 @@
...
@@ -24,31 +24,56 @@
</
template
>
</
template
>
{{ user.totalPoint || 0 }}
{{ user.totalPoint || 0 }}
</el-descriptions-item>
</el-descriptions-item>
<!-- TODO @疯狂:从 wallet 读取下对应字段 -->
<el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<
template
#
label
>
<descriptions-item-label
label=
" 当前余额 "
icon=
"svg-icon:member_balance"
/>
<descriptions-item-label
label=
" 当前余额 "
icon=
"svg-icon:member_balance"
/>
</
template
>
</
template
>
{{ 0 }}
{{
wallet.balance ||
0 }}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<
template
#
label
>
<descriptions-item-label
label=
" 支出金额 "
icon=
"svg-icon:member_expenditure_balance"
/>
<descriptions-item-label
label=
" 支出金额 "
icon=
"svg-icon:member_expenditure_balance"
/>
</
template
>
</
template
>
{{ 0 }}
{{
wallet.totalExpense ||
0 }}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<
template
#
label
>
<descriptions-item-label
label=
" 充值金额 "
icon=
"svg-icon:member_recharge_balance"
/>
<descriptions-item-label
label=
" 充值金额 "
icon=
"svg-icon:member_recharge_balance"
/>
</
template
>
</
template
>
{{ 0 }}
{{
wallet.totalRecharge ||
0 }}
</el-descriptions-item>
</el-descriptions-item>
</el-descriptions>
</el-descriptions>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
DescriptionsItemLabel
}
from
'@/components/Descriptions'
import
{
DescriptionsItemLabel
}
from
'@/components/Descriptions'
import
*
as
UserApi
from
'@/api/member/user'
import
*
as
UserApi
from
'@/api/member/user'
const
{
user
}
=
defineProps
<
{
user
:
UserApi
.
UserVO
}
>
()
import
*
as
WalletApi
from
'@/api/pay/wallet'
import
{
UserTypeEnum
}
from
'@/utils/constants'
const
props
=
defineProps
<
{
user
:
UserApi
.
UserVO
}
>
()
// 用户信息
const
WALLET_INIT_DATA
=
{
balance
:
0
,
totalExpense
:
0
,
totalRecharge
:
0
}
as
WalletApi
.
WalletVO
// 钱包初始化数据
const
wallet
=
ref
<
WalletApi
.
WalletVO
>
(
WALLET_INIT_DATA
)
// 钱包信息
/** 查询用户钱包信息 */
const
getUserWallet
=
async
()
=>
{
if
(
!
props
.
user
.
id
)
{
wallet
.
value
=
WALLET_INIT_DATA
return
}
const
params
=
{
userId
:
props
.
user
.
id
,
userType
:
UserTypeEnum
.
MEMBER
}
wallet
.
value
=
(
await
WalletApi
.
getUserWallet
(
params
))
||
WALLET_INIT_DATA
}
/** 监听用户编号变化 */
watch
(
()
=>
props
.
user
.
id
,
()
=>
getUserWallet
(),
{
immediate
:
true
}
)
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.cell-item
{
.cell-item
{
...
...
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