From 55772cbba0d0729fd864f9cf338baabcba1e41d0 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 23 Aug 2023 01:41:25 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/member/point/record/index.ts | 11 --- src/api/member/signin/record/index.ts | 9 -- src/api/member/user/index.ts | 3 + src/router/modules/remaining.ts | 20 +++- .../member/user/components/account-info.vue | 48 +++++++--- .../member/user/components/address-list.vue | 1 + .../member/user/components/balance-list.vue | 1 + .../member/user/components/card-title.vue | 2 +- .../member/user/components/growth-list.vue | 1 + .../member/user/components/point-list.vue | 7 +- .../member/user/components/sign-list.vue | 6 +- src/views/member/user/detail/index.vue | 96 +++++++++++-------- 12 files changed, 126 insertions(+), 79 deletions(-) diff --git a/src/api/member/point/record/index.ts b/src/api/member/point/record/index.ts index 869421f1..f47ae467 100644 --- a/src/api/member/point/record/index.ts +++ b/src/api/member/point/record/index.ts @@ -8,20 +8,9 @@ export interface RecordVO { description: string point: number totalPoint: number - status: number userId: number - freezingTime: Date - thawingTime: Date createDate: Date } -export interface RecordQueryVO { - bizType: string | null | undefined - title: string | null | undefined - pageNo: number - pageSize: number - userId: number | null | undefined - createDate: string[] -} // 查询用户积分记录列表 export const getRecordPage = async (params) => { diff --git a/src/api/member/signin/record/index.ts b/src/api/member/signin/record/index.ts index 77016ddf..7d137029 100644 --- a/src/api/member/signin/record/index.ts +++ b/src/api/member/signin/record/index.ts @@ -6,15 +6,6 @@ export interface SignInRecordVO { day: number point: number } -export interface SignInRecordQueryVO { - pageNo: number - pageSize: number - userId?: number - nickname: number | undefined | null - day?: number | null | undefined - point?: number | null | undefined - createTime: string[] | null | undefined -} // 查询用户签到积分列表 export const getSignInRecordPage = async (params) => { diff --git a/src/api/member/user/index.ts b/src/api/member/user/index.ts index e9315370..432a0fb5 100644 --- a/src/api/member/user/index.ts +++ b/src/api/member/user/index.ts @@ -17,6 +17,8 @@ export interface UserVO { mark: string createTime: Date } + +// TODO @梦:和 UserVO 搞成一个把。 export interface UserBaseInfoVO { id: number | undefined | null mobile: string @@ -34,6 +36,7 @@ export interface UserBaseInfoVO { mark: string | null | undefined createTime: Date | null | undefined } + // 查询会员用户列表 export const getUserPage = async (params) => { return await request.get({ url: `/member/user/page`, params }) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 2e85b357..2d8e2b44 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -347,7 +347,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ ] }, { - path: '/property', + path: '/property', // TODO @puhui999:这里的 path 有问题,应该是 /product/property component: Layout, name: 'Property', meta: { @@ -427,6 +427,24 @@ const remainingRouter: AppRouteRecordRaw[] = [ } ] }, + { + path: '/member', + component: Layout, + name: 'member', + meta: { hidden: true }, + children: [ + { + path: 'user/detail', + name: 'MemberUserDetail', + meta: { + title: '会员详情', + noCache: true, + hidden: true + }, + component: () => import('@/views/member/user/detail/index.vue') + } + ] + }, { path: '/pay', component: Layout, diff --git a/src/views/member/user/components/account-info.vue b/src/views/member/user/components/account-info.vue index 50bf8e6a..252f3f10 100644 --- a/src/views/member/user/components/account-info.vue +++ b/src/views/member/user/components/account-info.vue @@ -1,20 +1,10 @@ {{ 0 }} + + + {{ 0 }} + + + + {{ 0 }} + + + + {{ 0 }} + + + + {{ 0 }} + + + + {{ 0 }} + + diff --git a/src/views/member/user/components/balance-list.vue b/src/views/member/user/components/balance-list.vue index 437714a0..3e9d1785 100644 --- a/src/views/member/user/components/balance-list.vue +++ b/src/views/member/user/components/balance-list.vue @@ -6,6 +6,7 @@ export default defineComponent({ }) + diff --git a/src/views/member/user/components/card-title.vue b/src/views/member/user/components/card-title.vue index 4bd3ee93..041c116a 100644 --- a/src/views/member/user/components/card-title.vue +++ b/src/views/member/user/components/card-title.vue @@ -1,8 +1,8 @@ + diff --git a/src/views/member/user/components/point-list.vue b/src/views/member/user/components/point-list.vue index 7a454562..2b2b98e4 100644 --- a/src/views/member/user/components/point-list.vue +++ b/src/views/member/user/components/point-list.vue @@ -100,13 +100,13 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { dateFormatter } from '@/utils/formatTime' import * as RecordApi from '@/api//member/point/record' -import { RecordQueryVO } from '@/api//member/point/record' defineOptions({ name: 'PointList' }) + const loading = ref(true) // 列表的加载中 const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数据 -const queryParams = reactive({ +const queryParams = reactive({ pageNo: 1, pageSize: 10, bizType: undefined, @@ -139,12 +139,15 @@ const resetQuery = () => { queryFormRef.value.resetFields() handleQuery() } + +// TODO @梦:改成 userId 哈 const { memberId } = defineProps({ memberId: { type: Number, required: true } }) + /** 初始化 **/ onMounted(() => { queryParams.userId = memberId diff --git a/src/views/member/user/components/sign-list.vue b/src/views/member/user/components/sign-list.vue index ee57a951..479e18a7 100644 --- a/src/views/member/user/components/sign-list.vue +++ b/src/views/member/user/components/sign-list.vue @@ -83,14 +83,13 @@ -