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
bce427f7
authored
Aug 26, 2023
by
owen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into owen_dev
parents
2c563458
1b6c9b2e
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
256 additions
and
231 deletions
+256
-231
src/api/member/address/index.ts
+15
-0
src/api/member/user/index.ts
+10
-29
src/components/Card/index.ts
+3
-0
src/components/Card/src/CardTitle.vue
+0
-0
src/components/Descriptions/index.ts
+2
-1
src/components/Descriptions/src/DescriptionsItemLabel.vue
+28
-0
src/router/modules/remaining.ts
+1
-1
src/utils/formatTime.ts
+1
-1
src/views/member/user/components/address-list.vue
+0
-14
src/views/member/user/detail/UserAccountInfo.vue
+0
-5
src/views/member/user/detail/UserAddressList.vue
+54
-0
src/views/member/user/detail/UserBasicInfo.vue
+90
-0
src/views/member/user/detail/UserPointList.vue
+4
-8
src/views/member/user/detail/UserSignList.vue
+4
-7
src/views/member/user/detail/index.vue
+38
-159
src/views/member/user/index.vue
+6
-6
No files found.
src/api/member/address/index.ts
0 → 100644
View file @
bce427f7
import
request
from
'@/config/axios'
export
interface
AddressVO
{
id
:
number
name
:
string
mobile
:
string
areaId
:
number
detailAddress
:
string
defaultStatus
:
boolean
}
// 查询用户收件地址列表
export
const
getAddressList
=
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/member/address/list`
,
params
})
}
src/api/member/user/index.ts
View file @
bce427f7
...
@@ -2,39 +2,20 @@ import request from '@/config/axios'
...
@@ -2,39 +2,20 @@ import request from '@/config/axios'
export
interface
UserVO
{
export
interface
UserVO
{
id
:
number
id
:
number
mobile
:
string
avatar
:
string
|
undefined
password
:
string
birthday
:
number
|
undefined
status
:
number
createTime
:
number
|
undefined
registerIp
:
string
loginDate
:
number
|
undefined
loginIp
:
string
loginIp
:
string
loginDate
:
Date
nickname
:
string
avatar
:
string
name
:
string
sex
:
number
areaId
:
number
birthday
:
Date
mark
:
string
mark
:
string
createTime
:
Date
}
// TODO @梦:和 UserVO 搞成一个把。
export
interface
UserBaseInfoVO
{
id
:
number
|
undefined
|
null
mobile
:
string
mobile
:
string
password
:
string
|
null
|
undefined
name
:
string
|
undefined
status
:
number
nickname
:
string
|
undefined
registerIp
:
string
|
null
|
undefined
registerIp
:
string
loginIp
:
string
|
null
|
undefined
loginDate
:
Date
|
null
|
undefined
nickname
:
string
|
null
|
undefined
avatar
:
string
|
null
|
undefined
name
:
string
|
null
|
undefined
sex
:
number
sex
:
number
areaId
:
number
|
null
|
undefined
status
:
number
birthday
:
Date
|
null
|
undefined
areaId
:
number
|
undefined
mark
:
string
|
null
|
undefined
areaName
:
string
|
undefined
createTime
:
Date
|
null
|
undefined
}
}
// 查询会员用户列表
// 查询会员用户列表
...
...
src/components/Card/index.ts
0 → 100644
View file @
bce427f7
import
CardTitle
from
'./src/CardTitle.vue'
export
{
CardTitle
}
src/
views/member/user/components/card-t
itle.vue
→
src/
components/Card/src/CardT
itle.vue
View file @
bce427f7
File moved
src/components/Descriptions/index.ts
View file @
bce427f7
import
Descriptions
from
'./src/Descriptions.vue'
import
Descriptions
from
'./src/Descriptions.vue'
import
DescriptionsItemLabel
from
'./src/DescriptionsItemLabel.vue'
export
{
Descriptions
}
export
{
Descriptions
,
DescriptionsItemLabel
}
src/components/Descriptions/src/DescriptionsItemLabel.vue
0 → 100644
View file @
bce427f7
<
script
setup
lang=
"ts"
>
const
{
label
}
=
defineProps
({
label
:
{
type
:
String
,
required
:
true
},
icon
:
{
type
:
String
,
required
:
false
}
})
</
script
>
<
template
>
<div
class=
"cell-item"
>
<Icon
:icon=
"icon"
/>
{{
label
}}
</div>
</
template
>
<
style
scoped
lang=
"scss"
>
.cell-item
{
display
:
inline
;
}
.cell-item
::after
{
content
:
':'
;
}
</
style
>
src/router/modules/remaining.ts
View file @
bce427f7
...
@@ -434,7 +434,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
...
@@ -434,7 +434,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
meta
:
{
hidden
:
true
},
meta
:
{
hidden
:
true
},
children
:
[
children
:
[
{
{
path
:
'user/detail'
,
path
:
'user/detail
/:id
'
,
name
:
'MemberUserDetail'
,
name
:
'MemberUserDetail'
,
meta
:
{
meta
:
{
title
:
'会员详情'
,
title
:
'会员详情'
,
...
...
src/utils/formatTime.ts
View file @
bce427f7
...
@@ -11,7 +11,7 @@ import dayjs from 'dayjs'
...
@@ -11,7 +11,7 @@ import dayjs from 'dayjs'
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
* @returns 返回拼接后的时间字符串
* @returns 返回拼接后的时间字符串
*/
*/
export
function
formatDate
(
date
:
Date
,
format
?:
string
):
string
{
export
function
formatDate
(
date
:
Date
|
number
,
format
?:
string
):
string
{
// 日期不存在,则返回空
// 日期不存在,则返回空
if
(
!
date
)
{
if
(
!
date
)
{
return
''
return
''
...
...
src/views/member/user/components/address-list.vue
deleted
100644 → 0
View file @
2c563458
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'vue'
export
default
defineComponent
({
name
:
'AddressList'
})
</
script
>
<!-- TODO @梦:可以读 address 表 -->
<
template
>
<div>
收货地址列表
</div>
</
template
>
<
style
scoped
lang=
"scss"
></
style
>
src/views/member/user/
components/account-i
nfo.vue
→
src/views/member/user/
detail/UserAccountI
nfo.vue
View file @
bce427f7
...
@@ -46,11 +46,6 @@
...
@@ -46,11 +46,6 @@
</el-descriptions-item>
</el-descriptions-item>
</el-descriptions>
</el-descriptions>
</template>
</template>
<
script
lang=
"ts"
setup
>
defineComponent
({
name
:
'AccountInfo'
})
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.cell-item
{
.cell-item
{
display
:
inline
;
display
:
inline
;
...
...
src/views/member/user/detail/UserAddressList.vue
0 → 100644
View file @
bce427f7
<
template
>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"地址编号"
align=
"center"
prop=
"id"
width=
"150px"
/>
<el-table-column
label=
"收件人名称"
align=
"center"
prop=
"name"
width=
"150px"
/>
<el-table-column
label=
"手机号"
align=
"center"
prop=
"mobile"
width=
"150px"
/>
<el-table-column
label=
"地区编码"
align=
"center"
prop=
"areaId"
width=
"150px"
/>
<el-table-column
label=
"收件详细地址"
align=
"center"
prop=
"detailAddress"
/>
<el-table-column
label=
"是否默认"
align=
"center"
prop=
"defaultStatus"
width=
"150px"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.COMMON_STATUS"
:value=
"Number(scope.row.defaultStatus)"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
:formatter=
"dateFormatter"
width=
"180px"
/>
</el-table>
</template>
<
script
lang=
"ts"
setup
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
*
as
AddressApi
from
'@/api/member/address'
const
{
userId
}:
{
userId
:
number
}
=
defineProps
({
userId
:
{
type
:
Number
,
required
:
true
}
})
const
loading
=
ref
(
true
)
// 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
/** 查询列表 */
const
getList
=
async
()
=>
{
loading
.
value
=
true
try
{
list
.
value
=
await
AddressApi
.
getAddressList
({
userId
})
}
finally
{
loading
.
value
=
false
}
}
/** 初始化 **/
onMounted
(()
=>
{
getList
()
})
</
script
>
<
style
scoped
lang=
"scss"
></
style
>
src/views/member/user/detail/UserBasicInfo.vue
0 → 100644
View file @
bce427f7
<
template
>
<el-card
shadow=
"never"
>
<template
#
header
>
<slot
name=
"header"
></slot>
</
template
>
<el-row>
<el-col
:span=
"4"
>
<ElAvatar
shape=
"square"
:size=
"140"
:src=
"user.avatar || undefined"
/>
</el-col>
<el-col
:span=
"20"
>
<el-descriptions
:column=
"2"
>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"用户名"
icon=
"ep:user"
/>
</
template
>
{{ user.name || '空' }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"昵称"
icon=
"ep:user"
/>
</
template
>
{{ user.nickname }}
</el-descriptions-item>
<el-descriptions-item
label=
"手机号"
>
<
template
#
label
>
<descriptions-item-label
label=
"手机号"
icon=
"ep:phone"
/>
</
template
>
{{ user.mobile }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"性别"
icon=
"fa:mars-double"
/>
</
template
>
<dict-tag
:type=
"DICT_TYPE.SYSTEM_USER_SEX"
:value=
"user.sex"
/>
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"所在地"
icon=
"ep:location"
/>
</
template
>
{{ user.areaName }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"注册 IP"
icon=
"ep:position"
/>
</
template
>
{{ user.registerIp }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"生日"
icon=
"fa:birthday-cake"
/>
</
template
>
{{ user.birthday ? formatDate(user.birthday) : '空' }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"注册时间"
icon=
"ep:calendar"
/>
</
template
>
{{ user.createTime ? formatDate(user.createTime) : '空' }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<descriptions-item-label
label=
"最后登录时间"
icon=
"ep:calendar"
/>
</
template
>
{{ user.loginDate ? formatDate(user.loginDate) : '空' }}
</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
</el-card>
</template>
<
script
setup
lang=
"ts"
>
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
formatDate
}
from
'@/utils/formatTime'
import
*
as
UserApi
from
'@/api/member/user'
import
{
DescriptionsItemLabel
}
from
'@/components/Descriptions/index'
const
{
user
}:
{
user
:
UserApi
.
UserVO
}
=
defineProps
({
user
:
{
type
:
UserApi
.
UserVO
,
required
:
true
}
})
</
script
>
<
style
scoped
lang=
"scss"
>
.card-header
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
</
style
>
src/views/member/user/
components/point-l
ist.vue
→
src/views/member/user/
detail/UserPointL
ist.vue
View file @
bce427f7
...
@@ -67,7 +67,6 @@
...
@@ -67,7 +67,6 @@
:formatter=
"dateFormatter"
:formatter=
"dateFormatter"
width=
"180"
width=
"180"
/>
/>
<el-table-column
label=
"用户"
align=
"center"
prop=
"nickname"
width=
"200"
/>
<el-table-column
label=
"获得积分"
align=
"center"
prop=
"point"
width=
"100"
>
<el-table-column
label=
"获得积分"
align=
"center"
prop=
"point"
width=
"100"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<el-tag
v-if=
"scope.row.point > 0"
class=
"ml-2"
type=
"success"
effect=
"dark"
>
<el-tag
v-if=
"scope.row.point > 0"
class=
"ml-2"
type=
"success"
effect=
"dark"
>
...
@@ -101,8 +100,6 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
...
@@ -101,8 +100,6 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
*
as
RecordApi
from
'@/api//member/point/record'
import
*
as
RecordApi
from
'@/api//member/point/record'
defineOptions
({
name
:
'PointList'
})
const
loading
=
ref
(
true
)
// 列表的加载中
const
loading
=
ref
(
true
)
// 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
list
=
ref
([])
// 列表的数据
...
@@ -112,7 +109,7 @@ const queryParams = reactive({
...
@@ -112,7 +109,7 @@ const queryParams = reactive({
bizType
:
undefined
,
bizType
:
undefined
,
title
:
null
,
title
:
null
,
createDate
:
[],
createDate
:
[],
userId
:
null
userId
:
NaN
})
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
...
@@ -140,9 +137,8 @@ const resetQuery = () => {
...
@@ -140,9 +137,8 @@ const resetQuery = () => {
handleQuery
()
handleQuery
()
}
}
// TODO @梦:改成 userId 哈
const
{
userId
}
=
defineProps
({
const
{
memberId
}
=
defineProps
({
userId
:
{
memberId
:
{
type
:
Number
,
type
:
Number
,
required
:
true
required
:
true
}
}
...
@@ -150,7 +146,7 @@ const { memberId } = defineProps({
...
@@ -150,7 +146,7 @@ const { memberId } = defineProps({
/** 初始化 **/
/** 初始化 **/
onMounted
(()
=>
{
onMounted
(()
=>
{
queryParams
.
userId
=
memb
erId
queryParams
.
userId
=
us
erId
getList
()
getList
()
})
})
</
script
>
</
script
>
src/views/member/user/
components/sign-l
ist.vue
→
src/views/member/user/
detail/UserSignL
ist.vue
View file @
bce427f7
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"签到用户"
align=
"center"
prop=
"nickname"
/>
<el-table-column
<el-table-column
label=
"签到天数"
label=
"签到天数"
align=
"center"
align=
"center"
...
@@ -84,14 +83,13 @@
...
@@ -84,14 +83,13 @@
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
*
as
SignInRecordApi
from
'@/api/member/signin/record'
import
*
as
SignInRecordApi
from
'@/api/member/signin/record'
defineOptions
({
name
:
'SignList'
})
const
loading
=
ref
(
true
)
// 列表的加载中
const
loading
=
ref
(
true
)
// 列表的加载中
const
total
=
ref
(
0
)
// 列表的总页数
const
total
=
ref
(
0
)
// 列表的总页数
const
list
=
ref
([])
// 列表的数据
const
list
=
ref
([])
// 列表的数据
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
userId
:
NaN
,
nickname
:
null
,
nickname
:
null
,
day
:
null
,
day
:
null
,
createTime
:
[]
createTime
:
[]
...
@@ -122,9 +120,8 @@ const resetQuery = () => {
...
@@ -122,9 +120,8 @@ const resetQuery = () => {
handleQuery
()
handleQuery
()
}
}
// TODO @梦:改成 userId 哈
const
{
userId
}
=
defineProps
({
const
{
memberId
}
=
defineProps
({
userId
:
{
memberId
:
{
type
:
Number
,
type
:
Number
,
required
:
true
required
:
true
}
}
...
@@ -132,7 +129,7 @@ const { memberId } = defineProps({
...
@@ -132,7 +129,7 @@ const { memberId } = defineProps({
/** 初始化 **/
/** 初始化 **/
onMounted
(()
=>
{
onMounted
(()
=>
{
queryParams
.
userId
=
memb
erId
queryParams
.
userId
=
us
erId
getList
()
getList
()
})
})
</
script
>
</
script
>
src/views/member/user/detail/index.vue
View file @
bce427f7
<
template
>
<
template
>
<div
v-loading=
"loading"
>
<div
v-loading=
"loading"
>
<el-row
:gutter=
"10"
class=
"detail-info-warp"
>
<el-row
:gutter=
"10"
>
<!-- 左上角:基本信息 -->
<!-- 左上角:基本信息 -->
<el-col
:span=
"14"
class=
"detail-info-item"
>
<el-col
:span=
"14"
class=
"detail-info-item"
>
<
el-card
shadow=
"nev
er"
>
<
UserBasicInfo
:user=
"us
er"
>
<template
#
header
>
<template
#
header
>
<div
class=
"card-header"
>
<div
class=
"card-header"
>
<!-- TODO @梦:如果不要小蓝线,是不是直接用 el-card 自带的 title 即可? -->
<CardTitle
title=
"基本信息"
/>
<CardTitle
title=
"基本信息"
/>
<el-button
<el-button
type=
"primary"
size=
"small"
text
@
click=
"openForm('update')"
>
v-if=
"user.id"
type=
"primary"
size=
"small"
text
@
click=
"openForm('update', user.id)"
>
编辑
编辑
</el-button>
</el-button>
</div>
</div>
</
template
>
</
template
>
<el-row>
</UserBasicInfo>
<el-col
:span=
"4"
>
<ElAvatar
shape=
"square"
:size=
"140"
:src=
"user.avatar || undefined"
/>
</el-col>
<el-col
:span=
"20"
>
<el-descriptions
:column=
"2"
>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"ep:user"
/>
用户名
</div>
</
template
>
{{ user.name || '空' }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"ep:user"
/>
昵称
</div>
</
template
>
{{ user.nickname }}
</el-descriptions-item>
<el-descriptions-item
label=
"手机号"
>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"ep:phone"
/>
手机号
</div>
</
template
>
{{ user.mobile }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"fa:mars-double"
/>
性别
</div>
</
template
>
<dict-tag
:type=
"DICT_TYPE.SYSTEM_USER_SEX"
:value=
"user.sex"
/>
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"ep:location"
/>
所在地
</div>
</
template
>
<!-- TODO @梦:这里后端返回的时候,要返回 areaName -->
{{ user.areaId }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"ep:position"
/>
注册 IP
</div>
</
template
>
{{ user.registerIp }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"fa:birthday-cake"
/>
生日
</div>
</
template
>
{{ user.birthday ? formatDate(user.birthday) : '空' }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"ep:calendar"
/>
注册时间
</div>
</
template
>
{{ user.createTime ? formatDate(user.createTime) : '空' }}
</el-descriptions-item>
<el-descriptions-item>
<
template
#
label
>
<div
class=
"cell-item"
>
<Icon
icon=
"ep:calendar"
/>
最后登录时间
</div>
</
template
>
{{ user.loginDate ? formatDate(user.loginDate) : '空' }}
</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
</el-card>
</el-col>
</el-col>
<!-- 右上角:账户信息 -->
<!-- 右上角:账户信息 -->
<el-col
:span=
"10"
class=
"detail-info-item"
>
<el-col
:span=
"10"
class=
"detail-info-item"
>
<el-card
shadow=
"never"
>
<el-card
shadow=
"never"
>
<
template
#
header
>
<
template
#
header
>
<CardTitle
title=
"账户信息"
/>
<CardTitle
title=
"账户信息"
/>
</
template
>
</
template
>
<AccountInfo
/>
<
User
AccountInfo
/>
</el-card>
</el-card>
</el-col>
</el-col>
<!-- 下边:账户明细 -->
<!-- 下边:账户明细 -->
<!-- TODO 芋艿:【
收货地址】【
订单管理】【售后管理】【收藏记录】【优惠劵】 -->
<!-- TODO 芋艿:【订单管理】【售后管理】【收藏记录】【优惠劵】 -->
<el-card
header=
"账户明细"
style=
"width: 100%; margin-top: 20px"
shadow=
"never"
>
<el-card
header=
"账户明细"
style=
"width: 100%; margin-top: 20px"
shadow=
"never"
>
<
template
#
header
>
<
template
#
header
>
<CardTitle
title=
"账户明细"
/>
<CardTitle
title=
"账户明细"
/>
</
template
>
</
template
>
<el-tabs
v-model=
"activeName"
>
<el-tabs
v-model=
"activeName"
>
<el-tab-pane
label=
"积分"
name=
"point"
>
<el-tab-pane
label=
"积分"
name=
"point"
>
<
PointList
v-if=
"user.id"
:member-id=
"user.
id"
/>
<
UserPointList
:user-id=
"
id"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"签到"
name=
"sign"
>
<el-tab-pane
label=
"签到"
name=
"sign"
>
<
SignList
v-if=
"user.id"
:member-id=
"user.
id"
/>
<
UserSignList
:user-id=
"
id"
/>
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"成长值"
name=
"third"
>
成长值(WIP)
</el-tab-pane>
<el-tab-pane
label=
"成长值"
name=
"third"
>
成长值(WIP)
</el-tab-pane>
<el-tab-pane
label=
"余额"
name=
"fourth"
>
余额(WIP)
</el-tab-pane>
<el-tab-pane
label=
"余额"
name=
"fourth"
>
余额(WIP)
</el-tab-pane>
<el-tab-pane
label=
"收货地址"
name=
"address"
>
<UserAddressList
:user-id=
"id"
/>
</el-tab-pane>
<el-tab-pane
label=
"订单管理"
name=
"fourth"
>
订单管理(WIP)
</el-tab-pane>
<el-tab-pane
label=
"售后管理"
name=
"fourth"
>
售后管理(WIP)
</el-tab-pane>
<el-tab-pane
label=
"收藏记录"
name=
"fourth"
>
收藏记录(WIP)
</el-tab-pane>
<el-tab-pane
label=
"优惠劵"
name=
"fourth"
>
优惠劵(WIP)
</el-tab-pane>
</el-tabs>
</el-tabs>
</el-card>
</el-card>
</el-row>
</el-row>
</div>
</div>
<!-- 表单弹窗:添加/修改 -->
<!-- 表单弹窗:添加/修改 -->
<UserForm
ref=
"formRef"
@
success=
"getUserData(
user.
id)"
/>
<UserForm
ref=
"formRef"
@
success=
"getUserData(id)"
/>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
// TODO @梦:组件对应的 vue,都大写
import
*
as
UserApi
from
'@/api/member/user'
import
PointList
from
'@/views/member/user/components/point-list.vue'
import
{
useTagsViewStore
}
from
'@/store/modules/tagsView'
import
SignList
from
'@/views/member/user/components/sign-list.vue'
import
UserBasicInfo
from
'./UserBasicInfo.vue'
import
CardTitle
from
'@/views/member/user/components/card-title.vue'
// TODO @梦:参考别的模块,UserApi 这样去引用
import
{
getUser
,
UserBaseInfoVO
}
from
'@/api/member/user'
import
{
formatDate
}
from
'@/utils/formatTime'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
UserForm
from
'@/views/member/user/UserForm.vue'
import
UserForm
from
'@/views/member/user/UserForm.vue'
// TODO @梦:把用户信息,也抽成一个组件,类似 AccountInfo
import
UserAccountInfo
from
'./UserAccountInfo.vue'
import
AccountInfo
from
'@/views/member/user/components/account-info.vue'
import
UserAddressList
from
'./UserAddressList.vue'
import
UserPointList
from
'./UserPointList.vue'
import
UserSignList
from
'./UserSignList.vue'
import
{
CardTitle
}
from
'@/components/Card/index'
defineOptions
({
name
:
'MemberDetail'
})
defineOptions
({
name
:
'MemberDetail'
})
const
activeName
=
ref
(
'point'
)
// 账户明细 选中的 tabs
const
activeName
=
ref
(
'point'
)
// 账户明细 选中的 tabs
const
loading
=
ref
(
true
)
// 加载中
const
loading
=
ref
(
true
)
// 加载中
let
user
=
ref
<
UserBaseInfoVO
>
({
let
user
=
ref
<
UserApi
.
UserVO
>
({})
areaId
:
undefined
,
avatar
:
undefined
,
/** 添加/修改操作 */
birthday
:
undefined
,
const
formRef
=
ref
()
createTime
:
undefined
,
const
openForm
=
(
type
:
string
)
=>
{
id
:
undefined
,
formRef
.
value
.
open
(
type
,
id
)
loginDate
:
undefined
,
}
loginIp
:
''
,
mark
:
''
,
mobile
:
''
,
name
:
''
,
nickname
:
''
,
password
:
null
,
registerIp
:
undefined
,
sex
:
0
,
status
:
0
})
/** 获得用户 */
/** 获得用户 */
const
getUserData
=
async
(
id
:
number
)
=>
{
const
getUserData
=
async
(
id
:
number
)
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
user
.
value
=
await
getUser
(
id
)
user
.
value
=
await
UserApi
.
getUser
(
id
)
}
finally
{
}
finally
{
loading
.
value
=
false
loading
.
value
=
false
}
}
}
}
/** 添加/修改操作 */
const
formRef
=
ref
()
const
openForm
=
(
type
:
string
,
id
?:
number
)
=>
{
formRef
.
value
.
open
(
type
,
id
)
}
/** 初始化 */
/** 初始化 */
const
{
push
,
currentRoute
}
=
useRouter
()
// 路由
const
{
delView
}
=
useTagsViewStore
()
// 视图操作
const
route
=
useRoute
()
const
route
=
useRoute
()
const
router
=
useRouter
()
const
id
=
route
.
params
.
id
as
number
// TODO @梦:改成 id 路径参数,而不是 query
// TODO @梦:会员列表,把【详情】按钮加上哈
const
member_id
=
route
.
query
.
member_id
as
number
onMounted
(()
=>
{
onMounted
(()
=>
{
if
(
!
member_id
)
{
if
(
!
id
)
{
// TODO
ElMessage
.
warning
(
'参数错误,会员编号不能为空!'
)
ElMessage
.
warning
(
'参数错误,会员编号不能为空!'
)
router
.
back
(
)
delView
(
unref
(
currentRoute
)
)
return
return
}
}
getUserData
(
member_
id
)
getUserData
(
id
)
})
})
</
script
>
</
script
>
<
style
scoped
lang=
"css"
>
<
style
scoped
lang=
"css"
>
/** TODO 这 3 个 css 貌似没用? */
.detail-info-item
:first-child
{
.detail-info-item
:first-child
{
padding-left
:
0
!important
;
padding-left
:
0
!important
;
}
}
...
@@ -227,11 +113,4 @@ onMounted(() => {
...
@@ -227,11 +113,4 @@ onMounted(() => {
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
}
}
.cell-item
{
display
:
inline
;
}
/** TODO 下面 css 貌似没啥用? */
.cell-item
::after
{
content
:
':'
;
}
</
style
>
</
style
>
src/views/member/user/index.vue
View file @
bce427f7
...
@@ -109,8 +109,9 @@
...
@@ -109,8 +109,9 @@
:formatter=
"dateFormatter"
:formatter=
"dateFormatter"
width=
"180px"
width=
"180px"
/>
/>
<el-table-column
label=
"操作"
align=
"center"
width=
"1
4
0px"
fixed=
"right"
>
<el-table-column
label=
"操作"
align=
"center"
width=
"1
8
0px"
fixed=
"right"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
link
type=
"primary"
@
click=
"openDetail(scope.row.id)"
>
详情
</el-button>
<el-button
<el-button
link
link
type=
"primary"
type=
"primary"
...
@@ -148,7 +149,6 @@
...
@@ -148,7 +149,6 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
*
as
UserApi
from
'@/api/member/user'
import
*
as
UserApi
from
'@/api/member/user'
import
UserForm
from
'./UserForm.vue'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
{
DICT_TYPE
}
from
'@/utils/dict'
import
MemberTagSelect
from
'@/views/member/tag/components/MemberTagSelect.vue'
import
MemberTagSelect
from
'@/views/member/tag/components/MemberTagSelect.vue'
import
MemberLevelSelect
from
'@/views/member/level/components/MemberLevelSelect.vue'
import
MemberLevelSelect
from
'@/views/member/level/components/MemberLevelSelect.vue'
...
@@ -198,10 +198,10 @@ const resetQuery = () => {
...
@@ -198,10 +198,10 @@ const resetQuery = () => {
handleQuery
()
handleQuery
()
}
}
/**
添加/修改操作
*/
/**
打开会员详情
*/
const
formRef
=
ref
()
const
{
push
}
=
useRouter
()
const
open
Form
=
(
type
:
string
,
id
?
:
number
)
=>
{
const
open
Detail
=
(
id
:
number
)
=>
{
formRef
.
value
.
open
(
type
,
id
)
push
({
name
:
'MemberUserDetail'
,
params
:
{
id
}
}
)
}
}
/** 初始化 **/
/** 初始化 **/
...
...
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