Skip to content

Commit 86323f9

Browse files
committed
code review:拼团记录列表
1 parent 523784c commit 86323f9

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

src/api/mall/promotion/combination/combinationRecord.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,3 @@ export const getCombinationRecordPage = async (params) => {
2626
export const getCombinationRecordSummary = async () => {
2727
return await request.get({ url: '/promotion/combination-record/get-summary' })
2828
}
29-
30-
// 获得拼团记录分页 tab count
31-
export const getCombinationRecordCount = async () => {
32-
return await request.get({ url: '/promotion/combination-record/get-count' })
33-
}

src/views/mall/promotion/combination/record/index.vue

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@
6565
</ContentWrap>
6666
</el-col>
6767
</el-row>
68+
69+
<!-- 搜索工作栏 -->
6870
<ContentWrap>
69-
<!-- 搜索工作栏 -->
7071
<el-form
7172
ref="queryFormRef"
7273
:inline="true"
@@ -109,12 +110,13 @@
109110
</el-form-item>
110111
</el-form>
111112
</ContentWrap>
113+
114+
<!-- 分页列表数据展示 -->
112115
<ContentWrap>
113-
<!-- 分页列表数据展示 -->
114116
<el-table v-loading="loading" :data="pageList">
115117
<el-table-column align="center" label="编号" prop="id" />
116-
<!-- TODO 是否需要做一个点击用户头像跳转或查看用户信息的功能 -->
117118
<el-table-column align="center" label="头像" prop="avatar" />
119+
<el-table-column align="center" label="昵称" prop="nickname" />
118120
<el-table-column align="center" label="开团团长" prop="headId">
119121
<template #default="{ row }: { row: CombinationRecordApi.CombinationRecordVO }">
120122
{{
@@ -147,6 +149,13 @@
147149
</el-table-column>
148150
<el-table-column align="center" label="几人团" prop="userSize" />
149151
<el-table-column align="center" label="参与人数" prop="userCount" />
152+
<el-table-column
153+
:formatter="dateFormatter"
154+
align="center"
155+
label="参团时间"
156+
prop="createTime"
157+
width="180"
158+
/>
150159
<el-table-column
151160
:formatter="dateFormatter"
152161
align="center"
@@ -162,6 +171,7 @@
162171
/>
163172
</template>
164173
</el-table-column>
174+
<!-- TODO puhui999:这里加个查看拼团?点击后,查看完整的拼团列表? -->
165175
<el-table-column align="center" fixed="right" label="操作">
166176
<template #default></template>
167177
</el-table-column>
@@ -175,14 +185,14 @@
175185
/>
176186
</ContentWrap>
177187
</template>
178-
179188
<script lang="ts" setup>
180189
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
181190
import { dateFormatter } from '@/utils/formatTime'
182191
import { createImageViewer } from '@/components/ImageViewer'
183192
import * as CombinationRecordApi from '@/api/mall/promotion/combination/combinationRecord'
184193
185194
defineOptions({ name: 'CombinationRecord' })
195+
186196
const queryParams = ref({
187197
dateType: 0, // 日期类型
188198
status: undefined, // 拼团状态
@@ -216,6 +226,7 @@ const getSummary = async () => {
216226
recordSummary.value = await CombinationRecordApi.getCombinationRecordSummary()
217227
}
218228
// 日期快捷选项
229+
// TODO @puhui999:不用 dateType,而是 shortcuts 选择后,设置到对应的 date 就 ok 啦。直接通过它查询。然后,看看怎么把 shortcuts 变成一个公共变量,类似 defaultProps 一样
219230
const shortcuts = ref([
220231
{
221232
text: '今天',
@@ -246,7 +257,7 @@ const shortcuts = ref([
246257
}
247258
},
248259
{
249-
text: '最近30天',
260+
text: '最近 30 天',
250261
type: 'last30Days',
251262
value: () => {
252263
const date = new Date()
@@ -276,14 +287,6 @@ const shortcuts = ref([
276287
}
277288
])
278289
279-
/** 获得每个 Tab 的数量 */
280-
const getTabsCount = async () => {
281-
const res = await CombinationRecordApi.getCombinationRecordCount()
282-
shortcuts.value.forEach((tab) => {
283-
tab.text += `(${res[tab.type]})`
284-
})
285-
}
286-
287290
/** 搜索按钮操作 */
288291
const handleQuery = () => {
289292
queryParams.value.pageNo = 1
@@ -306,7 +309,6 @@ const imagePreview = (imgUrl: string) => {
306309
/** 初始化 **/
307310
onMounted(async () => {
308311
await getSummary()
309-
await getTabsCount()
310312
await getList()
311313
})
312314
</script>

0 commit comments

Comments
 (0)