Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kadycui
game-admin
提交
42dd8d80
game-admin
项目概览
kadycui
/
game-admin
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
game-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
42dd8d80
编写于
9月 19, 2023
作者:
kadycui
💻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ADD: 优惠券名称样式
上级
f0c34c15
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
5 deletion
+36
-5
src/pages/coupon/list.vue
src/pages/coupon/list.vue
+36
-5
未找到文件。
src/pages/coupon/list.vue
浏览文件 @
42dd8d80
...
...
@@ -10,7 +10,8 @@
v-loading=
"loading"
>
<el-table-column
label=
"优惠券名称"
width=
"350"
>
<template
#default
="
{ row }">
<div
class=
"border border-dashed py-2 px-4 rounded"
>
<div
class=
"border border-dashed py-2 px-4 rounded"
:class=
"row.statusText == '领取中' ? 'active' : 'inactive'"
>
<h5
class=
"font-bold text-md"
>
{{
row
.
name
}}
</h5>
<small>
{{
row
.
start_time
}}
~
{{
row
.
end_time
}}
</small>
</div>
...
...
@@ -72,6 +73,22 @@ import FormDrawer from "@/components/FormDrawer.vue"
import
ListHeader
from
"
@/components/ListHeader.vue
"
import
{
useInitTable
,
useInitForm
}
from
"
@/composables/useCommon.js
"
function
formStatus
(
row
){
let
s
=
"
领取中
"
let
start_time
=
(
new
Date
(
row
.
start_time
)).
getTime
()
let
now
=
(
new
Date
()).
getTime
()
let
end_time
=
(
new
Date
(
row
.
end_time
)).
getTime
()
if
(
start_time
>
now
){
s
=
"
未开始
"
}
else
if
(
end_time
<
now
){
s
=
"
已结束
"
}
else
if
(
end_time
<
now
){
s
=
"
已失效
"
}
return
s
}
const
{
tableData
,
...
...
@@ -84,6 +101,15 @@ const {
}
=
useInitTable
({
getList
:
getCouponList
,
onGetListSuccess
:(
res
)
=>
{
tableData
.
value
=
res
.
list
.
map
(
o
=>
{
// 转化优惠券状态
o
.
statusText
=
formStatus
(
o
)
return
o
})
total
.
value
=
res
.
totalCount
},
delete
:
deleteCoupon
})
...
...
@@ -125,9 +151,14 @@ const {
create
:
createCoupon
})
</
script
>
<
style
scoped
>
.active
{
@apply
border-rose-200
bg-rose-50
text-red-400;
}
</
script
>
\ No newline at end of file
.inactive
{
@apply
border-gray-200
bg-gray-50
text-gray-400;
}
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录