leisure-core 0.4.17 → 0.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/le-coupon/src/details.vue +23 -5
- package/le-coupon/src/sub.vue +4 -4
- package/package.json +1 -1
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
<el-table-column prop="title" label="优惠券标题"></el-table-column>
|
|
66
66
|
<el-table-column prop="caption" label="优惠券描述"></el-table-column>
|
|
67
67
|
<el-table-column
|
|
68
|
-
prop="
|
|
68
|
+
prop="date_start"
|
|
69
69
|
label="领用时间"
|
|
70
70
|
show-overflow-tooltip
|
|
71
71
|
tooltip-effect="dark"
|
|
@@ -74,6 +74,8 @@
|
|
|
74
74
|
<el-table-column
|
|
75
75
|
prop="udate"
|
|
76
76
|
label="使用时间"
|
|
77
|
+
show-overflow-tooltip
|
|
78
|
+
tooltip-effect="dark"
|
|
77
79
|
:formatter="dateFormatter"
|
|
78
80
|
></el-table-column>
|
|
79
81
|
<el-table-column
|
|
@@ -85,10 +87,7 @@
|
|
|
85
87
|
></el-table-column>
|
|
86
88
|
<el-table-column label="是否已经使用">
|
|
87
89
|
<template slot-scope="scope">
|
|
88
|
-
<span
|
|
89
|
-
<span v-if="scope.row.status == 1">已经使用</span>
|
|
90
|
-
<span v-if="scope.row.status == 2">已经过期</span>
|
|
91
|
-
<span v-if="scope.row.status == 3">已经作废</span>
|
|
90
|
+
<span>{{ currentStatus(scope.row) }}</span>
|
|
92
91
|
</template>
|
|
93
92
|
</el-table-column>
|
|
94
93
|
<el-table-column prop="note" label="备注"></el-table-column>
|
|
@@ -107,6 +106,7 @@
|
|
|
107
106
|
</template>
|
|
108
107
|
<script>
|
|
109
108
|
import moment from "moment";
|
|
109
|
+
import dayjs from "dayjs";
|
|
110
110
|
import { listByUid } from "@/api/coupon";
|
|
111
111
|
export default {
|
|
112
112
|
name: "le-coupon-details",
|
|
@@ -142,6 +142,24 @@ export default {
|
|
|
142
142
|
dateFormatter(row, column, cellValue, index) {
|
|
143
143
|
if (cellValue) return moment.unix(cellValue).format("YYYY-MM-DD HH:mm");
|
|
144
144
|
},
|
|
145
|
+
currentStatus(item) {
|
|
146
|
+
let status = item.status;
|
|
147
|
+
let date_end = item.date_end;
|
|
148
|
+
let now = dayjs().unix();
|
|
149
|
+
if (now > date_end) {
|
|
150
|
+
return "已经过期";
|
|
151
|
+
} else if (status == 0) {
|
|
152
|
+
return "未使用";
|
|
153
|
+
} else if (status == 1) {
|
|
154
|
+
return "已经使用";
|
|
155
|
+
} else if (status == 3) {
|
|
156
|
+
return "已经作废";
|
|
157
|
+
} else if (status == 2) {
|
|
158
|
+
return "已经过期";
|
|
159
|
+
} else {
|
|
160
|
+
return "未知状态";
|
|
161
|
+
}
|
|
162
|
+
},
|
|
145
163
|
current_change(currentPage) {
|
|
146
164
|
this.searchData.pageNo = currentPage;
|
|
147
165
|
this.list();
|
package/le-coupon/src/sub.vue
CHANGED
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
</el-col>
|
|
60
60
|
</el-row>
|
|
61
61
|
</el-form-item>
|
|
62
|
-
<el-form-item
|
|
62
|
+
<el-form-item label="优惠券有效期" prop="period">
|
|
63
63
|
<el-row>
|
|
64
64
|
<el-input-number
|
|
65
65
|
v-model="form.period"
|
|
66
|
-
:min="
|
|
66
|
+
:min="30"
|
|
67
67
|
:max="9999"
|
|
68
68
|
label="描述文字"
|
|
69
69
|
></el-input-number>
|
|
70
|
-
<span style="margin-left: 6px"
|
|
70
|
+
<span style="margin-left: 6px">单位:天(默认30天内有效)</span>
|
|
71
71
|
</el-row>
|
|
72
72
|
</el-form-item>
|
|
73
73
|
<!-- <el-form-item label="优惠券使用范围" prop="rang">
|
|
@@ -359,4 +359,4 @@ export default {
|
|
|
359
359
|
height: calc(100vh - 130px);
|
|
360
360
|
overflow: auto;
|
|
361
361
|
}
|
|
362
|
-
</style>
|
|
362
|
+
</style>
|