Skip to content

Commit 40f44fc

Browse files
committed
promotion:优化优惠劵的界面
1 parent 59ab621 commit 40f44fc

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

src/views/mall/promotion/coupon/formatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const discountFormat = (row: CouponTemplateVO) => {
99
return `¥${floatToFixed2(row.discountPrice)}`
1010
}
1111
if (row.discountType === PromotionDiscountTypeEnum.PERCENT.type) {
12-
return `${row.discountPrice}%`
12+
return `${row.discountPercent}%`
1313
}
1414
return '未知【' + row.discountType + '】'
1515
}

src/views/mall/promotion/coupon/index.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@keyup="handleQuery"
2020
/>
2121
</el-form-item>
22-
<el-form-item label="创建时间" prop="createTime">
22+
<el-form-item label="领取时间" prop="createTime">
2323
<el-date-picker
2424
v-model="queryParams.createTime"
2525
value-format="YYYY-MM-DD HH:mm:ss"
@@ -50,12 +50,17 @@
5050

5151
<!-- 列表 -->
5252
<el-table v-loading="loading" :data="list">
53-
<el-table-column label="会员信息" align="center" prop="nickname" />
54-
<!-- TODO 芋艿:以后支持头像,支持跳转 -->
55-
<el-table-column label="优惠劵" align="center" prop="name" />
56-
<el-table-column label="优惠券类型" align="center" prop="discountType">
53+
<el-table-column label="会员昵称" align="center" min-width="100" prop="nickname" />
54+
<el-table-column label="优惠券名称" align="center" min-width="140" prop="name" />
55+
<el-table-column label="类型" align="center" prop="discountType">
56+
<template #default="scope">
57+
<dict-tag :type="DICT_TYPE.PROMOTION_PRODUCT_SCOPE" :value="scope.row.productScope" />
58+
</template>
59+
</el-table-column>
60+
<el-table-column label="优惠" min-width="100" prop="discount">
5761
<template #default="scope">
5862
<dict-tag :type="DICT_TYPE.PROMOTION_DISCOUNT_TYPE" :value="scope.row.discountType" />
63+
{{ discountFormat(scope.row) }}
5964
</template>
6065
</el-table-column>
6166
<el-table-column label="领取方式" align="center" prop="takeType">
@@ -109,6 +114,7 @@
109114
import { deleteCoupon, getCouponPage } from '@/api/mall/promotion/coupon/coupon'
110115
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
111116
import { dateFormatter } from '@/utils/formatTime'
117+
import { discountFormat } from '@/views/mall/promotion/coupon/formatter'
112118
113119
defineOptions({ name: 'PromotionCoupon' })
114120

src/views/mall/promotion/coupon/template/index.vue

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@keyup="handleQuery"
2020
/>
2121
</el-form-item>
22-
<el-form-item label="优惠券类型" prop="discountType">
22+
<el-form-item label="优惠类型" prop="discountType">
2323
<el-select
2424
v-model="queryParams.discountType"
2525
class="!w-240px"
@@ -71,32 +71,36 @@
7171
>
7272
<Icon class="mr-5px" icon="ep:plus" /> 新增
7373
</el-button>
74-
<el-button
75-
plain
76-
type="success"
77-
@click="$router.push('/promotion/coupon')"
78-
v-hasPermi="['promotion:coupon:query']"
79-
>
80-
<Icon icon="ep:operation" class="mr-5px" />会员优惠劵
81-
</el-button>
8274
</el-form-item>
8375
</el-form>
8476
</ContentWrap>
8577

8678
<!-- 列表 -->
8779
<ContentWrap>
8880
<el-table v-loading="loading" :data="list">
89-
<el-table-column label="优惠券名称" align="center" prop="name" />
90-
<el-table-column label="优惠券类型" align="center" prop="discountType">
81+
<el-table-column label="优惠券名称" min-width="140" prop="name" />
82+
<el-table-column label="类型" min-width="80" prop="productScope">
83+
<template #default="scope">
84+
<dict-tag :type="DICT_TYPE.PROMOTION_PRODUCT_SCOPE" :value="scope.row.productScope" />
85+
</template>
86+
</el-table-column>
87+
<el-table-column label="优惠" min-width="100" prop="discount">
9188
<template #default="scope">
9289
<dict-tag :type="DICT_TYPE.PROMOTION_DISCOUNT_TYPE" :value="scope.row.discountType" />
90+
{{ discountFormat(scope.row) }}
91+
</template>
92+
</el-table-column>
93+
<el-table-column label="领取方式" min-width="100" prop="takeType">
94+
<template #default="scope">
95+
<dict-tag :type="DICT_TYPE.PROMOTION_COUPON_TAKE_TYPE" :value="scope.row.takeType" />
9396
</template>
9497
</el-table-column>
9598
<el-table-column
96-
label="优惠金额 / 折扣"
99+
label="使用时间"
97100
align="center"
98-
prop="discount"
99-
:formatter="discountFormat"
101+
prop="validityType"
102+
width="185"
103+
:formatter="validityTypeFormat"
100104
/>
101105
<el-table-column label="发放数量" align="center" prop="totalCount" />
102106
<el-table-column
@@ -111,13 +115,6 @@
111115
prop="takeLimitCount"
112116
:formatter="takeLimitCountFormat"
113117
/>
114-
<el-table-column
115-
label="有效期限"
116-
align="center"
117-
prop="validityType"
118-
width="190"
119-
:formatter="validityTypeFormat"
120-
/>
121118
<el-table-column label="状态" align="center" prop="status">
122119
<template #default="scope">
123120
<el-switch

0 commit comments

Comments
 (0)