1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
| export function promotionsStatusRender(h, params) {
| let text = "未知",
| color = "red";
| if (params.row.promotionStatus == "NEW") {
| text = "未开始";
| color = "geekblue";
| } else if (params.row.promotionStatus == "START") {
| text = "已开始";
| color = "green";
| } else if (params.row.promotionStatus == "END") {
| text = "已结束";
| color = "red";
| } else if (params.row.promotionStatus == "CLOSE") {
| text = "已关闭";
| color = "red";
| }
| return h("div", [
| h(
| "Tag",
| {
| props: {
| color: color,
| },
| },
| text
| ),
| ]);
| }
|
| export function promotionsScopeTypeRender(h, params) {
| let text = "未知",
| color = "red";
| if (params.row.scopeType == "ALL") {
| text = "全品类";
| color = "default";
| } else if (params.row.scopeType == "PORTION_GOODS_CATEGORY") {
| text = "商品分类";
| color = "yellow";
| } else if (params.row.scopeType == "PORTION_SHOP_CATEGORY") {
| text = "店铺分类";
| color = "pink";
| } else if (params.row.scopeType == "PORTION_GOODS") {
| text = "指定商品";
| color = "magenta";
| }
| return h("div", [
| h(
| "Tag",
| {
| props: {
| color: color,
| },
| },
| text
| ),
| ]);
| }
|
| export function memberPromotionsStatusRender(h, status) {
| let text = "未知",
| color = "red";
| if (status == "NEW") {
| text = "已领取";
| color = "geekblue";
| } else if (status == "USED") {
| text = "已使用";
| color = "green";
| } else if (status == "EXPIRE") {
| text = "已过期";
| color = "red";
| } else if (status == "CLOSED") {
| text = "已作废";
| color = "red";
| }
| return h("div", [
| h(
| "Tag",
| {
| props: {
| color: color,
| },
| },
| text
| ),
| ]);
| }
|
|