diff --git a/src/api/member/address/index.ts b/src/api/member/address/index.ts
new file mode 100644
index 00000000..a914f979
--- /dev/null
+++ b/src/api/member/address/index.ts
@@ -0,0 +1,15 @@
+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 })
+}
diff --git a/src/api/member/user/index.ts b/src/api/member/user/index.ts
index 3a789e9f..82d8d159 100644
--- a/src/api/member/user/index.ts
+++ b/src/api/member/user/index.ts
@@ -2,39 +2,20 @@ import request from '@/config/axios'
export interface UserVO {
id: number
- mobile: string
- password: string
- status: number
- registerIp: string
+ avatar: string | undefined
+ birthday: number | undefined
+ createTime: number | undefined
+ loginDate: number | undefined
loginIp: string
- loginDate: Date
- nickname: string
- avatar: string
- name: string
- sex: number
- areaId: number
- birthday: Date
mark: string
- createTime: Date
-}
-
-// TODO @梦:和 UserVO 搞成一个把。
-export interface UserBaseInfoVO {
- id: number | undefined | null
mobile: string
- password: string | null | undefined
- status: number
- registerIp: string | null | undefined
- loginIp: string | null | undefined
- loginDate: Date | null | undefined
- nickname: string | null | undefined
- avatar: string | null | undefined
- name: string | null | undefined
+ name: string | undefined
+ nickname: string | undefined
+ registerIp: string
sex: number
- areaId: number | null | undefined
- birthday: Date | null | undefined
- mark: string | null | undefined
- createTime: Date | null | undefined
+ status: number
+ areaId: number | undefined
+ areaName: string | undefined
}
// 查询会员用户列表
diff --git a/src/components/Card/index.ts b/src/components/Card/index.ts
new file mode 100644
index 00000000..f4c0d86c
--- /dev/null
+++ b/src/components/Card/index.ts
@@ -0,0 +1,3 @@
+import CardTitle from './src/CardTitle.vue'
+
+export { CardTitle }
diff --git a/src/views/member/user/components/card-title.vue b/src/components/Card/src/CardTitle.vue
similarity index 100%
rename from src/views/member/user/components/card-title.vue
rename to src/components/Card/src/CardTitle.vue
diff --git a/src/components/Descriptions/index.ts b/src/components/Descriptions/index.ts
index 91b0eb41..243bc397 100644
--- a/src/components/Descriptions/index.ts
+++ b/src/components/Descriptions/index.ts
@@ -1,3 +1,4 @@
import Descriptions from './src/Descriptions.vue'
+import DescriptionsItemLabel from './src/DescriptionsItemLabel.vue'
-export { Descriptions }
+export { Descriptions, DescriptionsItemLabel }
diff --git a/src/components/Descriptions/src/DescriptionsItemLabel.vue b/src/components/Descriptions/src/DescriptionsItemLabel.vue
new file mode 100644
index 00000000..35783351
--- /dev/null
+++ b/src/components/Descriptions/src/DescriptionsItemLabel.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts
index 2d8e2b44..40909f4a 100644
--- a/src/router/modules/remaining.ts
+++ b/src/router/modules/remaining.ts
@@ -434,7 +434,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
meta: { hidden: true },
children: [
{
- path: 'user/detail',
+ path: 'user/detail/:id',
name: 'MemberUserDetail',
meta: {
title: '会员详情',
diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts
index 5e5c854d..87409260 100644
--- a/src/utils/formatTime.ts
+++ b/src/utils/formatTime.ts
@@ -11,7 +11,7 @@ import dayjs from 'dayjs'
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
* @returns 返回拼接后的时间字符串
*/
-export function formatDate(date: Date, format?: string): string {
+export function formatDate(date: Date | number, format?: string): string {
// 日期不存在,则返回空
if (!date) {
return ''
diff --git a/src/views/member/user/components/address-list.vue b/src/views/member/user/components/address-list.vue
deleted file mode 100644
index 6d47bda5..00000000
--- a/src/views/member/user/components/address-list.vue
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- 收货地址列表
-
-
-
diff --git a/src/views/member/user/components/account-info.vue b/src/views/member/user/detail/UserAccountInfo.vue
similarity index 94%
rename from src/views/member/user/components/account-info.vue
rename to src/views/member/user/detail/UserAccountInfo.vue
index 252f3f10..4eaa2bab 100644
--- a/src/views/member/user/components/account-info.vue
+++ b/src/views/member/user/detail/UserAccountInfo.vue
@@ -46,11 +46,6 @@
-
diff --git a/src/views/member/user/detail/UserBasicInfo.vue b/src/views/member/user/detail/UserBasicInfo.vue
new file mode 100644
index 00000000..4f822613
--- /dev/null
+++ b/src/views/member/user/detail/UserBasicInfo.vue
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ user.name || '空' }}
+
+
+
+
+
+ {{ user.nickname }}
+
+
+
+
+
+ {{ user.mobile }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ user.areaName }}
+
+
+
+
+
+ {{ user.registerIp }}
+
+
+
+
+
+ {{ user.birthday ? formatDate(user.birthday) : '空' }}
+
+
+
+
+
+ {{ user.createTime ? formatDate(user.createTime) : '空' }}
+
+
+
+
+
+ {{ user.loginDate ? formatDate(user.loginDate) : '空' }}
+
+
+
+
+
+
+
+
diff --git a/src/views/member/user/components/point-list.vue b/src/views/member/user/detail/UserPointList.vue
similarity index 94%
rename from src/views/member/user/components/point-list.vue
rename to src/views/member/user/detail/UserPointList.vue
index 2b2b98e4..9754b297 100644
--- a/src/views/member/user/components/point-list.vue
+++ b/src/views/member/user/detail/UserPointList.vue
@@ -67,7 +67,6 @@
:formatter="dateFormatter"
width="180"
/>
-
@@ -101,8 +100,6 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import * as RecordApi from '@/api//member/point/record'
-defineOptions({ name: 'PointList' })
-
const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数据
@@ -112,7 +109,7 @@ const queryParams = reactive({
bizType: undefined,
title: null,
createDate: [],
- userId: null
+ userId: NaN
})
const queryFormRef = ref() // 搜索的表单
@@ -140,9 +137,8 @@ const resetQuery = () => {
handleQuery()
}
-// TODO @梦:改成 userId 哈
-const { memberId } = defineProps({
- memberId: {
+const { userId } = defineProps({
+ userId: {
type: Number,
required: true
}
@@ -150,7 +146,7 @@ const { memberId } = defineProps({
/** 初始化 **/
onMounted(() => {
- queryParams.userId = memberId
+ queryParams.userId = userId
getList()
})
diff --git a/src/views/member/user/components/sign-list.vue b/src/views/member/user/detail/UserSignList.vue
similarity index 93%
rename from src/views/member/user/components/sign-list.vue
rename to src/views/member/user/detail/UserSignList.vue
index 479e18a7..c8972741 100644
--- a/src/views/member/user/components/sign-list.vue
+++ b/src/views/member/user/detail/UserSignList.vue
@@ -48,7 +48,6 @@
-
{
handleQuery()
}
-// TODO @梦:改成 userId 哈
-const { memberId } = defineProps({
- memberId: {
+const { userId } = defineProps({
+ userId: {
type: Number,
required: true
}
@@ -132,7 +129,7 @@ const { memberId } = defineProps({
/** 初始化 **/
onMounted(() => {
- queryParams.userId = memberId
+ queryParams.userId = userId
getList()
})
diff --git a/src/views/member/user/detail/index.vue b/src/views/member/user/detail/index.vue
index c77934d1..937ca37a 100644
--- a/src/views/member/user/detail/index.vue
+++ b/src/views/member/user/detail/index.vue
@@ -1,220 +1,106 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
- 用户名
-
-
- {{ user.name || '空' }}
-
-
-
-
-
- 昵称
-
-
- {{ user.nickname }}
-
-
-
-
-
- 手机号
-
-
- {{ user.mobile }}
-
-
-
-
-
- 性别
-
-
-
-
-
-
-
-
- 所在地
-
-
-
- {{ user.areaId }}
-
-
-
-
-
- 注册 IP
-
-
- {{ user.registerIp }}
-
-
-
-
-
- 生日
-
-
- {{ user.birthday ? formatDate(user.birthday) : '空' }}
-
-
-
-
-
- 注册时间
-
-
- {{ user.createTime ? formatDate(user.createTime) : '空' }}
-
-
-
-
-
- 最后登录时间
-
-
- {{ user.loginDate ? formatDate(user.loginDate) : '空' }}
-
-
-
-
-
+
-
-
+
-
-
+
-
+
-
+
成长值(WIP)
余额(WIP)
+
+
+
+ 订单管理(WIP)
+ 售后管理(WIP)
+ 收藏记录(WIP)
+ 优惠劵(WIP)
-
+
diff --git a/src/views/member/user/index.vue b/src/views/member/user/index.vue
index 7ddc0538..bae5c048 100644
--- a/src/views/member/user/index.vue
+++ b/src/views/member/user/index.vue
@@ -109,8 +109,9 @@
:formatter="dateFormatter"
width="180px"
/>
-
+
+ 详情
import { dateFormatter } from '@/utils/formatTime'
import * as UserApi from '@/api/member/user'
-import UserForm from './UserForm.vue'
import { DICT_TYPE } from '@/utils/dict'
import MemberTagSelect from '@/views/member/tag/components/MemberTagSelect.vue'
import MemberLevelSelect from '@/views/member/level/components/MemberLevelSelect.vue'
@@ -198,10 +198,10 @@ const resetQuery = () => {
handleQuery()
}
-/** 添加/修改操作 */
-const formRef = ref()
-const openForm = (type: string, id?: number) => {
- formRef.value.open(type, id)
+/** 打开会员详情 */
+const { push } = useRouter()
+const openDetail = (id: number) => {
+ push({ name: 'MemberUserDetail', params: { id } })
}
/** 初始化 **/