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
40f44fc7
authored
Oct 03, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promotion:优化优惠劵的界面
parent
59ab6218
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
27 deletions
+30
-27
src/views/mall/promotion/coupon/formatter.ts
+1
-1
src/views/mall/promotion/coupon/index.vue
+11
-5
src/views/mall/promotion/coupon/template/index.vue
+18
-21
No files found.
src/views/mall/promotion/coupon/formatter.ts
View file @
40f44fc7
...
@@ -9,7 +9,7 @@ export const discountFormat = (row: CouponTemplateVO) => {
...
@@ -9,7 +9,7 @@ export const discountFormat = (row: CouponTemplateVO) => {
return
`¥
${
floatToFixed2
(
row
.
discountPrice
)}
`
return
`¥
${
floatToFixed2
(
row
.
discountPrice
)}
`
}
}
if
(
row
.
discountType
===
PromotionDiscountTypeEnum
.
PERCENT
.
type
)
{
if
(
row
.
discountType
===
PromotionDiscountTypeEnum
.
PERCENT
.
type
)
{
return
`
${
row
.
discountP
rice
}
%`
return
`
${
row
.
discountP
ercent
}
%`
}
}
return
'未知【'
+
row
.
discountType
+
'】'
return
'未知【'
+
row
.
discountType
+
'】'
}
}
...
...
src/views/mall/promotion/coupon/index.vue
View file @
40f44fc7
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
@
keyup=
"handleQuery"
@
keyup=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
创建
时间"
prop=
"createTime"
>
<el-form-item
label=
"
领取
时间"
prop=
"createTime"
>
<el-date-picker
<el-date-picker
v-model=
"queryParams.createTime"
v-model=
"queryParams.createTime"
value-format=
"YYYY-MM-DD HH:mm:ss"
value-format=
"YYYY-MM-DD HH:mm:ss"
...
@@ -50,12 +50,17 @@
...
@@ -50,12 +50,17 @@
<!-- 列表 -->
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"会员信息"
align=
"center"
prop=
"nickname"
/>
<el-table-column
label=
"会员昵称"
align=
"center"
min-width=
"100"
prop=
"nickname"
/>
<!-- TODO 芋艿:以后支持头像,支持跳转 -->
<el-table-column
label=
"优惠券名称"
align=
"center"
min-width=
"140"
prop=
"name"
/>
<el-table-column
label=
"优惠劵"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"类型"
align=
"center"
prop=
"discountType"
>
<el-table-column
label=
"优惠券类型"
align=
"center"
prop=
"discountType"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.PROMOTION_PRODUCT_SCOPE"
:value=
"scope.row.productScope"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"优惠"
min-width=
"100"
prop=
"discount"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.PROMOTION_DISCOUNT_TYPE"
:value=
"scope.row.discountType"
/>
<dict-tag
:type=
"DICT_TYPE.PROMOTION_DISCOUNT_TYPE"
:value=
"scope.row.discountType"
/>
{{
discountFormat
(
scope
.
row
)
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"领取方式"
align=
"center"
prop=
"takeType"
>
<el-table-column
label=
"领取方式"
align=
"center"
prop=
"takeType"
>
...
@@ -109,6 +114,7 @@
...
@@ -109,6 +114,7 @@
import
{
deleteCoupon
,
getCouponPage
}
from
'@/api/mall/promotion/coupon/coupon'
import
{
deleteCoupon
,
getCouponPage
}
from
'@/api/mall/promotion/coupon/coupon'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
DICT_TYPE
,
getIntDictOptions
}
from
'@/utils/dict'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
discountFormat
}
from
'@/views/mall/promotion/coupon/formatter'
defineOptions
({
name
:
'PromotionCoupon'
})
defineOptions
({
name
:
'PromotionCoupon'
})
...
...
src/views/mall/promotion/coupon/template/index.vue
View file @
40f44fc7
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
@
keyup=
"handleQuery"
@
keyup=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"优惠
券
类型"
prop=
"discountType"
>
<el-form-item
label=
"优惠类型"
prop=
"discountType"
>
<el-select
<el-select
v-model=
"queryParams.discountType"
v-model=
"queryParams.discountType"
class=
"!w-240px"
class=
"!w-240px"
...
@@ -71,14 +71,6 @@
...
@@ -71,14 +71,6 @@
>
>
<Icon
class=
"mr-5px"
icon=
"ep:plus"
/>
新增
<Icon
class=
"mr-5px"
icon=
"ep:plus"
/>
新增
</el-button>
</el-button>
<el-button
plain
type=
"success"
@
click=
"$router.push('/promotion/coupon')"
v-hasPermi=
"['promotion:coupon:query']"
>
<Icon
icon=
"ep:operation"
class=
"mr-5px"
/>
会员优惠劵
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</ContentWrap>
</ContentWrap>
...
@@ -86,17 +78,29 @@
...
@@ -86,17 +78,29 @@
<!-- 列表 -->
<!-- 列表 -->
<ContentWrap>
<ContentWrap>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
label=
"优惠券名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"优惠券名称"
min-width=
"140"
prop=
"name"
/>
<el-table-column
label=
"优惠券类型"
align=
"center"
prop=
"discountType"
>
<el-table-column
label=
"类型"
min-width=
"80"
prop=
"productScope"
>
<template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.PROMOTION_PRODUCT_SCOPE"
:value=
"scope.row.productScope"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"优惠"
min-width=
"100"
prop=
"discount"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.PROMOTION_DISCOUNT_TYPE"
:value=
"scope.row.discountType"
/>
<dict-tag
:type=
"DICT_TYPE.PROMOTION_DISCOUNT_TYPE"
:value=
"scope.row.discountType"
/>
{{
discountFormat
(
scope
.
row
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"领取方式"
min-width=
"100"
prop=
"takeType"
>
<
template
#
default=
"scope"
>
<dict-tag
:type=
"DICT_TYPE.PROMOTION_COUPON_TAKE_TYPE"
:value=
"scope.row.takeType"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
label=
"
优惠金额 / 折扣
"
label=
"
使用时间
"
align=
"center"
align=
"center"
prop=
"discount"
prop=
"validityType"
:formatter=
"discountFormat"
width=
"185"
:formatter=
"validityTypeFormat"
/>
/>
<el-table-column
label=
"发放数量"
align=
"center"
prop=
"totalCount"
/>
<el-table-column
label=
"发放数量"
align=
"center"
prop=
"totalCount"
/>
<el-table-column
<el-table-column
...
@@ -111,13 +115,6 @@
...
@@ -111,13 +115,6 @@
prop=
"takeLimitCount"
prop=
"takeLimitCount"
:formatter=
"takeLimitCountFormat"
:formatter=
"takeLimitCountFormat"
/>
/>
<el-table-column
label=
"有效期限"
align=
"center"
prop=
"validityType"
width=
"190"
:formatter=
"validityTypeFormat"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-switch
<el-switch
...
...
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