ts-glitter 13.3.5 → 13.3.7
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/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-blog.js +2 -7
- package/lowcode/backend-manager/bg-blog.ts +8 -13
- package/lowcode/backend-manager/bg-graph-api.js +6 -11
- package/lowcode/backend-manager/bg-graph-api.ts +14 -20
- package/lowcode/backend-manager/bg-line.js +526 -1002
- package/lowcode/backend-manager/bg-line.ts +1815 -2354
- package/lowcode/backend-manager/bg-notify.js +392 -746
- package/lowcode/backend-manager/bg-notify.ts +436 -835
- package/lowcode/backend-manager/bg-project.js +176 -293
- package/lowcode/backend-manager/bg-project.ts +214 -344
- package/lowcode/backend-manager/bg-recommend.js +39 -148
- package/lowcode/backend-manager/bg-recommend.ts +43 -162
- package/lowcode/backend-manager/bg-sns.js +489 -814
- package/lowcode/backend-manager/bg-sns.ts +1876 -2238
- package/lowcode/backend-manager/bg-widget.js +301 -171
- package/lowcode/backend-manager/bg-widget.ts +324 -193
- package/lowcode/cms-plugin/ai-points.js +84 -67
- package/lowcode/cms-plugin/ai-points.ts +280 -247
- package/lowcode/cms-plugin/auto-reply.js +6 -7
- package/lowcode/cms-plugin/auto-reply.ts +6 -7
- package/lowcode/cms-plugin/data-analyze.js +5 -6
- package/lowcode/cms-plugin/data-analyze.ts +5 -6
- package/lowcode/cms-plugin/form-setting.js +122 -220
- package/lowcode/cms-plugin/form-setting.ts +124 -240
- package/lowcode/cms-plugin/line-auto-reply.js +17 -18
- package/lowcode/cms-plugin/line-auto-reply.ts +29 -36
- package/lowcode/cms-plugin/member-group-list.js +5 -2
- package/lowcode/cms-plugin/member-group-list.ts +5 -2
- package/lowcode/cms-plugin/member-type-list.js +36 -84
- package/lowcode/cms-plugin/member-type-list.ts +39 -92
- package/lowcode/cms-plugin/menus-setting.js +8 -73
- package/lowcode/cms-plugin/menus-setting.ts +8 -78
- package/lowcode/cms-plugin/permission-setting.js +73 -106
- package/lowcode/cms-plugin/permission-setting.ts +236 -278
- package/lowcode/cms-plugin/shopping-collections.js +95 -137
- package/lowcode/cms-plugin/shopping-collections.ts +103 -147
- package/lowcode/cms-plugin/shopping-discount-setting.js +310 -416
- package/lowcode/cms-plugin/shopping-discount-setting.ts +1269 -1386
- package/lowcode/cms-plugin/shopping-finance-setting.js +1 -0
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1 -0
- package/lowcode/cms-plugin/shopping-order-manager.js +742 -973
- package/lowcode/cms-plugin/shopping-order-manager.ts +1928 -2164
- package/lowcode/cms-plugin/shopping-order-return.js +147 -267
- package/lowcode/cms-plugin/shopping-order-return.ts +154 -292
- package/lowcode/cms-plugin/shopping-product-setting.js +6 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +8 -4
- package/lowcode/cms-plugin/shopping-product-stock.js +12 -92
- package/lowcode/cms-plugin/shopping-product-stock.ts +14 -94
- package/lowcode/cms-plugin/shopping-product-text.js +0 -3
- package/lowcode/cms-plugin/shopping-product-text.ts +0 -3
- package/lowcode/cms-plugin/shopping-rebate.js +95 -151
- package/lowcode/cms-plugin/shopping-rebate.ts +101 -159
- package/lowcode/cms-plugin/sms-points.js +83 -67
- package/lowcode/cms-plugin/sms-points.ts +281 -241
- package/lowcode/cms-plugin/sns-auto-reply.js +18 -18
- package/lowcode/cms-plugin/sns-auto-reply.ts +34 -40
- package/lowcode/cms-plugin/user-list.js +71 -90
- package/lowcode/cms-plugin/user-list.ts +76 -95
- package/lowcode/cms-plugin/web-config-setting.js +61 -111
- package/lowcode/cms-plugin/web-config-setting.ts +65 -124
- package/lowcode/css/editor.css +5 -2
- package/lowcode/glitter-base/route/shopping.js +1 -1
- package/lowcode/glitter-base/route/shopping.ts +19 -19
- package/lowcode/jspage/editor.js +1 -1
- package/lowcode/jspage/editor.ts +1 -1
- package/lowcode/jspage/main.js +3 -0
- package/lowcode/jspage/main.ts +3 -0
- package/package.json +1 -2
- package/src/api-public/controllers/ai-chat.js.map +5 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/chat.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/rebate.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/chat.js +3 -3
- package/src/api-public/services/chat.js.map +1 -1
- package/src/api-public/services/chat.ts +2 -3
- package/src/api-public/services/fb-message.js.map +5 -1
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/notify.js.map +1 -1
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/share-permission.js.map +1 -1
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/user.js +67 -66
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +212 -182
- package/src/helper/glitter-util.js.map +1 -1
- package/src/modules/firebase.d.ts +1 -0
- package/src/modules/firebase.js +1 -1
- package/src/modules/firebase.js.map +1 -1
|
@@ -19,15 +19,15 @@ import { Tool } from '../modules/tool.js';
|
|
|
19
19
|
export class ShoppingDiscountSetting {
|
|
20
20
|
static getLabel(voucher_type) {
|
|
21
21
|
switch (voucher_type) {
|
|
22
|
-
case
|
|
22
|
+
case 'giveaway':
|
|
23
23
|
return `贈品活動`;
|
|
24
|
-
case
|
|
24
|
+
case 'add_on_items':
|
|
25
25
|
return `加價購活動`;
|
|
26
|
-
case
|
|
26
|
+
case 'discount':
|
|
27
27
|
return `折扣活動`;
|
|
28
|
-
case
|
|
28
|
+
case 'rebate':
|
|
29
29
|
return `回饋金活動`;
|
|
30
|
-
case
|
|
30
|
+
case 'shipment_free':
|
|
31
31
|
return `免運費活動`;
|
|
32
32
|
}
|
|
33
33
|
return ``;
|
|
@@ -58,164 +58,111 @@ export class ShoppingDiscountSetting {
|
|
|
58
58
|
vm.type = 'add';
|
|
59
59
|
}))}
|
|
60
60
|
</div>
|
|
61
|
-
${BgWidget.container(BgWidget.mainCard(
|
|
62
|
-
gvc
|
|
63
|
-
getData: (vmi) => {
|
|
64
|
-
ApiShop.getVoucher({
|
|
65
|
-
page: vmi.page - 1,
|
|
66
|
-
limit: 20,
|
|
67
|
-
search: vm.query || undefined,
|
|
68
|
-
voucher_type: voucher_type
|
|
69
|
-
}).then((data) => {
|
|
70
|
-
vmi.pageSize = Math.ceil(data.response.total / 20);
|
|
71
|
-
vm.dataList = data.response.data;
|
|
72
|
-
function getDatalist() {
|
|
73
|
-
return data.response.data.map((dd) => {
|
|
74
|
-
return [
|
|
75
|
-
{
|
|
76
|
-
key: EditorElem.checkBoxOnly({
|
|
77
|
-
gvc: gvc,
|
|
78
|
-
def: !data.response.data.find((dd) => {
|
|
79
|
-
return !dd.checked;
|
|
80
|
-
}),
|
|
81
|
-
callback: (result) => {
|
|
82
|
-
data.response.data.map((dd) => {
|
|
83
|
-
dd.checked = result;
|
|
84
|
-
});
|
|
85
|
-
vmi.data = getDatalist();
|
|
86
|
-
vmi.callback();
|
|
87
|
-
gvc.notifyDataChange(filterID);
|
|
88
|
-
},
|
|
89
|
-
}),
|
|
90
|
-
value: EditorElem.checkBoxOnly({
|
|
91
|
-
gvc: gvc,
|
|
92
|
-
def: dd.checked,
|
|
93
|
-
callback: (result) => {
|
|
94
|
-
dd.checked = result;
|
|
95
|
-
vmi.data = getDatalist();
|
|
96
|
-
vmi.callback();
|
|
97
|
-
gvc.notifyDataChange(filterID);
|
|
98
|
-
},
|
|
99
|
-
style: 'height:25px;',
|
|
100
|
-
}),
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
key: '標題',
|
|
104
|
-
value: html `<span
|
|
105
|
-
class="fs-7">${dd.content.title}</span>`,
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
key: '狀態',
|
|
109
|
-
value: dd.content.status
|
|
110
|
-
? BgWidget.successInsignia('啟用中')
|
|
111
|
-
: BgWidget.secondaryInsignia('已停用'),
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
key: '觸發方式',
|
|
115
|
-
value: html `<span class="fs-7"
|
|
116
|
-
>${(() => {
|
|
117
|
-
switch (dd.content.trigger) {
|
|
118
|
-
case 'auto':
|
|
119
|
-
return '自動';
|
|
120
|
-
case 'code':
|
|
121
|
-
return '輸入代碼';
|
|
122
|
-
case 'distribution':
|
|
123
|
-
return '分銷 & 一頁式';
|
|
124
|
-
default:
|
|
125
|
-
return '尚未設定';
|
|
126
|
-
}
|
|
127
|
-
})()}</span
|
|
128
|
-
>`,
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
key: '對象',
|
|
132
|
-
value: html `<span
|
|
133
|
-
class="fs-7">${dd.content.for === 'product' ? `指定商品` : `商品分類`}</span>`,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
key: '折扣項目',
|
|
137
|
-
value: html `<span
|
|
138
|
-
class="fs-7">${dd.content.method === 'percent' ? `折扣${dd.content.value}%` : `折扣$${dd.content.value}`}</span>`,
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
vmi.data = getDatalist();
|
|
144
|
-
vmi.loading = false;
|
|
145
|
-
vmi.callback();
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
rowClick: (data, index) => {
|
|
149
|
-
vm.data = vm.dataList[index].content;
|
|
150
|
-
vm.type = 'replace';
|
|
151
|
-
},
|
|
152
|
-
filter: html ` ${BgWidget.searchPlace(gvc.event((e) => {
|
|
61
|
+
${BgWidget.container(BgWidget.mainCard([
|
|
62
|
+
BgWidget.searchPlace(gvc.event((e) => {
|
|
153
63
|
vm.query = e.value;
|
|
154
64
|
gvc.notifyDataChange(id);
|
|
155
|
-
}), vm.query || '', '搜尋所有折扣')
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
65
|
+
}), vm.query || '', '搜尋所有折扣'),
|
|
66
|
+
BgWidget.tableV3({
|
|
67
|
+
gvc: gvc,
|
|
68
|
+
getData: (vmi) => {
|
|
69
|
+
const limit = 20;
|
|
70
|
+
ApiShop.getVoucher({
|
|
71
|
+
page: vmi.page - 1,
|
|
72
|
+
limit: limit,
|
|
73
|
+
search: vm.query || undefined,
|
|
74
|
+
voucher_type: voucher_type,
|
|
75
|
+
}).then((data) => {
|
|
76
|
+
function getDatalist() {
|
|
77
|
+
return data.response.data.map((dd) => {
|
|
78
|
+
return [
|
|
79
|
+
{
|
|
80
|
+
key: '標題',
|
|
81
|
+
value: html `<span class="fs-7">${dd.content.title}</span>`,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
key: '狀態',
|
|
85
|
+
value: dd.content.status ? BgWidget.successInsignia('啟用中') : BgWidget.secondaryInsignia('已停用'),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: '觸發方式',
|
|
89
|
+
value: html `<span class="fs-7"
|
|
90
|
+
>${(() => {
|
|
91
|
+
switch (dd.content.trigger) {
|
|
92
|
+
case 'auto':
|
|
93
|
+
return '自動';
|
|
94
|
+
case 'code':
|
|
95
|
+
return '輸入代碼';
|
|
96
|
+
case 'distribution':
|
|
97
|
+
return '分銷 & 一頁式';
|
|
98
|
+
default:
|
|
99
|
+
return '尚未設定';
|
|
100
|
+
}
|
|
101
|
+
})()}</span
|
|
102
|
+
>`,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
key: '對象',
|
|
106
|
+
value: html `<span class="fs-7">${dd.content.for === 'product' ? `指定商品` : `商品分類`}</span>`,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: '折扣項目',
|
|
110
|
+
value: html `<span class="fs-7"
|
|
111
|
+
>${dd.content.method === 'percent' ? `折扣${dd.content.value}%` : `折扣$${dd.content.value}`}</span
|
|
112
|
+
>`,
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
});
|
|
165
116
|
}
|
|
166
|
-
|
|
117
|
+
vm.dataList = data.response.data;
|
|
118
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
119
|
+
vmi.originalData = vm.dataList;
|
|
120
|
+
vmi.tableData = getDatalist();
|
|
121
|
+
vmi.loading = false;
|
|
122
|
+
vmi.callback();
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
rowClick: (data, index) => {
|
|
126
|
+
vm.data = vm.dataList[index].content;
|
|
127
|
+
vm.type = 'replace';
|
|
128
|
+
},
|
|
129
|
+
filter: [
|
|
130
|
+
{
|
|
131
|
+
name: '批量移除',
|
|
132
|
+
event: () => {
|
|
167
133
|
const dialog = new ShareDialog(gvc.glitter);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
gvc.notifyDataChange(id);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
dialog.errorMessage({ text: '刪除失敗' });
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
},
|
|
134
|
+
dialog.checkYesOrNot({
|
|
135
|
+
text: '是否確認刪除所選項目?',
|
|
136
|
+
callback: (response) => {
|
|
137
|
+
if (response) {
|
|
138
|
+
dialog.dataLoading({ visible: true });
|
|
139
|
+
ApiShop.deleteVoucher({
|
|
140
|
+
id: vm.dataList
|
|
141
|
+
.filter((dd) => {
|
|
142
|
+
return dd.checked;
|
|
143
|
+
})
|
|
144
|
+
.map((dd) => {
|
|
145
|
+
return dd.id;
|
|
146
|
+
})
|
|
147
|
+
.join(`,`),
|
|
148
|
+
}).then((res) => {
|
|
149
|
+
dialog.dataLoading({ visible: false });
|
|
150
|
+
if (res.result) {
|
|
151
|
+
vm.dataList = undefined;
|
|
152
|
+
gvc.notifyDataChange(id);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
156
|
+
}
|
|
199
157
|
});
|
|
200
|
-
}
|
|
201
|
-
|
|
158
|
+
}
|
|
159
|
+
},
|
|
202
160
|
});
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
divCreate: () => {
|
|
206
|
-
return {
|
|
207
|
-
class: `d-flex align-items-center p-2 py-3 ${!vm.dataList ||
|
|
208
|
-
!vm.dataList.find((dd) => {
|
|
209
|
-
return dd.checked;
|
|
210
|
-
})
|
|
211
|
-
? `d-none`
|
|
212
|
-
: ``}`,
|
|
213
|
-
style: ``,
|
|
214
|
-
};
|
|
161
|
+
},
|
|
215
162
|
},
|
|
216
|
-
|
|
217
|
-
})
|
|
218
|
-
|
|
163
|
+
],
|
|
164
|
+
}),
|
|
165
|
+
].join('')))}
|
|
219
166
|
${BgWidget.mbContainer(120)}
|
|
220
167
|
`, BgWidget.getContainerWidth());
|
|
221
168
|
}
|
|
@@ -224,7 +171,7 @@ export class ShoppingDiscountSetting {
|
|
|
224
171
|
vm: vm,
|
|
225
172
|
gvc: gvc,
|
|
226
173
|
type: 'replace',
|
|
227
|
-
reBackType: voucher_type
|
|
174
|
+
reBackType: voucher_type,
|
|
228
175
|
});
|
|
229
176
|
}
|
|
230
177
|
else {
|
|
@@ -232,7 +179,7 @@ export class ShoppingDiscountSetting {
|
|
|
232
179
|
vm: vm,
|
|
233
180
|
gvc: gvc,
|
|
234
181
|
type: 'add',
|
|
235
|
-
reBackType: voucher_type
|
|
182
|
+
reBackType: voucher_type,
|
|
236
183
|
});
|
|
237
184
|
}
|
|
238
185
|
},
|
|
@@ -369,22 +316,18 @@ export class ShoppingDiscountSetting {
|
|
|
369
316
|
view: () => {
|
|
370
317
|
var _a;
|
|
371
318
|
return BgWidget.container([
|
|
372
|
-
html `
|
|
373
|
-
|
|
374
|
-
${BgWidget.goBack(gvc.event(() => {
|
|
319
|
+
html ` <div class="d-flex w-100 align-items-center">
|
|
320
|
+
${BgWidget.goBack(gvc.event(() => {
|
|
375
321
|
vm.type = 'list';
|
|
376
322
|
}))}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
html `
|
|
380
|
-
|
|
381
|
-
style="gap: 24px">
|
|
382
|
-
${BgWidget.container([
|
|
323
|
+
${BgWidget.title(obj.type === 'add' ? `新增${ShoppingDiscountSetting.getLabel(obj.reBackType)}` : `編輯${ShoppingDiscountSetting.getLabel(obj.reBackType)}`)}
|
|
324
|
+
</div>`,
|
|
325
|
+
html ` <div class="d-flex justify-content-center ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 24px">
|
|
326
|
+
${BgWidget.container([
|
|
383
327
|
BgWidget.mainCard([
|
|
384
|
-
html `
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
${BgWidget.editeInput({
|
|
328
|
+
html ` <div class="tx_700">活動標題</div>
|
|
329
|
+
${BgWidget.mbContainer(18)}
|
|
330
|
+
${BgWidget.editeInput({
|
|
388
331
|
gvc: gvc,
|
|
389
332
|
title: '',
|
|
390
333
|
default: voucherData.title,
|
|
@@ -393,22 +336,20 @@ export class ShoppingDiscountSetting {
|
|
|
393
336
|
voucherData.title = text;
|
|
394
337
|
},
|
|
395
338
|
})}
|
|
396
|
-
|
|
397
|
-
html `
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
${BgWidget.switchTextButton(gvc, voucherData.status === 1, {
|
|
339
|
+
${BgWidget.grayNote('顧客將會在「購物車」與「結帳」看見此標題', 'margin-left: 4px;')}`,
|
|
340
|
+
html ` <div class="tx_700">活動狀態</div>
|
|
341
|
+
${BgWidget.mbContainer(12)}
|
|
342
|
+
${BgWidget.switchTextButton(gvc, voucherData.status === 1, {
|
|
401
343
|
left: '關閉',
|
|
402
|
-
right: '啟用'
|
|
344
|
+
right: '啟用',
|
|
403
345
|
}, (bool) => {
|
|
404
346
|
voucherData.status = bool ? 1 : 0;
|
|
405
347
|
})}`,
|
|
406
348
|
].join(BgWidget.horizontalLine())),
|
|
407
349
|
BgWidget.mainCard([
|
|
408
|
-
html `
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
350
|
+
html ` <div class="tx_700">活動方式</div>
|
|
351
|
+
${BgWidget.mbContainer(18)}
|
|
352
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
412
353
|
{
|
|
413
354
|
key: 'auto',
|
|
414
355
|
name: '自動折扣',
|
|
@@ -433,14 +374,13 @@ export class ShoppingDiscountSetting {
|
|
|
433
374
|
callback: (text) => {
|
|
434
375
|
voucherData.code = text;
|
|
435
376
|
},
|
|
436
|
-
endText: html `
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
${BgWidget.blueNote(document.body.clientWidth > 768 ? '隨機產生優惠代碼' : '隨機產生', gvc.event(() => {
|
|
377
|
+
endText: html ` <div class="d-flex justify-content-end">
|
|
378
|
+
${BgWidget.mbContainer(8)}
|
|
379
|
+
${BgWidget.blueNote(document.body.clientWidth > 768 ? '隨機產生優惠代碼' : '隨機產生', gvc.event(() => {
|
|
440
380
|
voucherData.code = Tool.randomString(6).toUpperCase();
|
|
441
381
|
gvc.notifyDataChange(id);
|
|
442
382
|
}))}
|
|
443
|
-
|
|
383
|
+
</div>`,
|
|
444
384
|
}),
|
|
445
385
|
]);
|
|
446
386
|
},
|
|
@@ -461,18 +401,17 @@ export class ShoppingDiscountSetting {
|
|
|
461
401
|
voucherData.trigger = text[0];
|
|
462
402
|
gvc.notifyDataChange(viewID);
|
|
463
403
|
}, { single: true })}`,
|
|
464
|
-
html `
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
${gvc.bindView(() => {
|
|
404
|
+
html ` <div class="tx_700">活動對象</div>
|
|
405
|
+
${BgWidget.mbContainer(18)}
|
|
406
|
+
${gvc.bindView(() => {
|
|
468
407
|
const id = gvc.glitter.getUUID();
|
|
469
408
|
return {
|
|
470
409
|
bind: id,
|
|
471
410
|
view: () => {
|
|
472
411
|
var _a;
|
|
473
412
|
return html `
|
|
474
|
-
|
|
475
|
-
|
|
413
|
+
<div style="display: flex; flex-direction: column; gap: 8px;">
|
|
414
|
+
${BgWidget.selectFilter({
|
|
476
415
|
gvc: gvc,
|
|
477
416
|
callback: (text) => {
|
|
478
417
|
voucherData.target = text;
|
|
@@ -482,25 +421,25 @@ export class ShoppingDiscountSetting {
|
|
|
482
421
|
options: [
|
|
483
422
|
{
|
|
484
423
|
key: 'all',
|
|
485
|
-
value: '所有顧客'
|
|
424
|
+
value: '所有顧客',
|
|
486
425
|
},
|
|
487
426
|
{
|
|
488
427
|
key: 'customer',
|
|
489
|
-
value: '特定顧客'
|
|
428
|
+
value: '特定顧客',
|
|
490
429
|
},
|
|
491
430
|
{
|
|
492
431
|
key: 'levels',
|
|
493
|
-
value: '會員等級'
|
|
432
|
+
value: '會員等級',
|
|
494
433
|
},
|
|
495
434
|
{
|
|
496
435
|
key: 'group',
|
|
497
|
-
value: '顧客分群'
|
|
436
|
+
value: '顧客分群',
|
|
498
437
|
},
|
|
499
438
|
],
|
|
500
439
|
style: 'width: 100%;',
|
|
501
440
|
})}
|
|
502
|
-
|
|
503
|
-
|
|
441
|
+
<div>
|
|
442
|
+
${(() => {
|
|
504
443
|
switch (voucherData.target) {
|
|
505
444
|
case 'all':
|
|
506
445
|
return '';
|
|
@@ -518,18 +457,15 @@ export class ShoppingDiscountSetting {
|
|
|
518
457
|
return BgWidget.spinner();
|
|
519
458
|
}
|
|
520
459
|
return html `
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
</div>
|
|
531
|
-
</div>
|
|
532
|
-
${BgWidget.grayButton('查看全部', gvc.event(() => {
|
|
460
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
461
|
+
<div
|
|
462
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
463
|
+
style="justify-content: space-between;"
|
|
464
|
+
>
|
|
465
|
+
<div class="form-check-label c_updown_label">
|
|
466
|
+
<div class="tx_normal">顧客名稱</div>
|
|
467
|
+
</div>
|
|
468
|
+
${BgWidget.grayButton('查看全部', gvc.event(() => {
|
|
533
469
|
var _a;
|
|
534
470
|
BgWidget.selectDropDialog({
|
|
535
471
|
gvc: gvc,
|
|
@@ -566,18 +502,15 @@ export class ShoppingDiscountSetting {
|
|
|
566
502
|
style: 'width: 100%;',
|
|
567
503
|
});
|
|
568
504
|
}), { textStyle: 'font-weight: 400;' })}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
return html `
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
${opt.note ? html `
|
|
576
|
-
<span class="tx_gray_12 ms-2">${opt.note}</span> ` : ''}
|
|
577
|
-
</div>`;
|
|
505
|
+
</div>
|
|
506
|
+
${obj.gvc.map(customVM.dataList.map((opt, index) => {
|
|
507
|
+
return html ` <div class="form-check-label c_updown_label">
|
|
508
|
+
<span class="tx_normal">${index + 1} . ${opt.value}</span>
|
|
509
|
+
${opt.note ? html ` <span class="tx_gray_12 ms-2">${opt.note}</span> ` : ''}
|
|
510
|
+
</div>`;
|
|
578
511
|
}))}
|
|
579
|
-
|
|
580
|
-
|
|
512
|
+
</div>
|
|
513
|
+
`;
|
|
581
514
|
},
|
|
582
515
|
onCreate: () => {
|
|
583
516
|
if (customVM.loading) {
|
|
@@ -715,16 +648,15 @@ export class ShoppingDiscountSetting {
|
|
|
715
648
|
return '';
|
|
716
649
|
}
|
|
717
650
|
})()}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
651
|
+
</div>
|
|
652
|
+
</div>
|
|
653
|
+
`;
|
|
721
654
|
},
|
|
722
655
|
};
|
|
723
656
|
})}`,
|
|
724
|
-
html `
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
657
|
+
html ` <div class="tx_700">可使用訂單來源</div>
|
|
658
|
+
${BgWidget.mbContainer(18)}
|
|
659
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
728
660
|
{ key: 'normal', name: 'APP & 官網' },
|
|
729
661
|
{ key: 'pos', name: 'POS' },
|
|
730
662
|
], (_a = voucherData.device) !== null && _a !== void 0 ? _a : ['normal'], (text) => {
|
|
@@ -733,8 +665,7 @@ export class ShoppingDiscountSetting {
|
|
|
733
665
|
}, { single: false })}`,
|
|
734
666
|
]
|
|
735
667
|
.map((str) => {
|
|
736
|
-
return html `
|
|
737
|
-
<div>${str}</div>`;
|
|
668
|
+
return html ` <div>${str}</div>`;
|
|
738
669
|
})
|
|
739
670
|
.join(BgWidget.horizontalLine())),
|
|
740
671
|
BgWidget.mainCard(gvc.bindView(() => {
|
|
@@ -781,12 +712,10 @@ export class ShoppingDiscountSetting {
|
|
|
781
712
|
});
|
|
782
713
|
};
|
|
783
714
|
return [
|
|
784
|
-
html `
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
${BgWidget.mbContainer(18)}
|
|
789
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
715
|
+
html ` <div>
|
|
716
|
+
<div class="tx_700">折扣金額</div>
|
|
717
|
+
${BgWidget.mbContainer(18)}
|
|
718
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
790
719
|
{
|
|
791
720
|
key: 'fixed',
|
|
792
721
|
name: '固定金額',
|
|
@@ -802,7 +731,7 @@ export class ShoppingDiscountSetting {
|
|
|
802
731
|
voucherData.method = text[0];
|
|
803
732
|
gvc.notifyDataChange(pageVM.conditionId);
|
|
804
733
|
}, { single: true })}
|
|
805
|
-
|
|
734
|
+
</div>`,
|
|
806
735
|
];
|
|
807
736
|
})(),
|
|
808
737
|
...(() => {
|
|
@@ -812,11 +741,11 @@ export class ShoppingDiscountSetting {
|
|
|
812
741
|
}
|
|
813
742
|
return [
|
|
814
743
|
html `
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
744
|
+
<div class="tx_700">
|
|
745
|
+
套用至${voucherData.reBackType === 'shipment_free' ? BgWidget.grayNote('免運費僅限套用至所有商品', 'margin-left: 8px') : ''}
|
|
746
|
+
</div>
|
|
747
|
+
${BgWidget.mbContainer(18)}
|
|
748
|
+
${EditorElem.radio({
|
|
820
749
|
gvc: gvc,
|
|
821
750
|
title: '',
|
|
822
751
|
def: (_a = voucherData.for) !== null && _a !== void 0 ? _a : 'all',
|
|
@@ -829,8 +758,8 @@ export class ShoppingDiscountSetting {
|
|
|
829
758
|
oneLine: true,
|
|
830
759
|
readonly: voucherData.reBackType === 'shipment_free',
|
|
831
760
|
})}
|
|
832
|
-
|
|
833
|
-
|
|
761
|
+
${BgWidget.mbContainer(8)}
|
|
762
|
+
${(() => {
|
|
834
763
|
switch (voucherData.for) {
|
|
835
764
|
case 'collection':
|
|
836
765
|
return gvc.bindView(() => {
|
|
@@ -846,18 +775,15 @@ export class ShoppingDiscountSetting {
|
|
|
846
775
|
return BgWidget.spinner();
|
|
847
776
|
}
|
|
848
777
|
return html `
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
</div>
|
|
859
|
-
</div>
|
|
860
|
-
${BgWidget.grayButton('選擇分類', gvc.event(() => {
|
|
778
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
779
|
+
<div
|
|
780
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
781
|
+
style="gap: 24px; justify-content: space-between;"
|
|
782
|
+
>
|
|
783
|
+
<div class="form-check-label c_updown_label">
|
|
784
|
+
<div class="tx_normal">分類列表</div>
|
|
785
|
+
</div>
|
|
786
|
+
${BgWidget.grayButton('選擇分類', gvc.event(() => {
|
|
861
787
|
var _a;
|
|
862
788
|
BgProduct.collectionsDialog({
|
|
863
789
|
gvc: gvc,
|
|
@@ -871,20 +797,17 @@ export class ShoppingDiscountSetting {
|
|
|
871
797
|
}),
|
|
872
798
|
});
|
|
873
799
|
}), { textStyle: 'font-weight: 400;' })}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
return html `
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
${opt.note ? html `
|
|
883
|
-
<span class="tx_gray_12 ms-2">${opt.note}</span> ` : ''}
|
|
884
|
-
</div>`;
|
|
800
|
+
</div>
|
|
801
|
+
${obj.gvc.map(subVM.dataList.map((opt, index) => {
|
|
802
|
+
return html ` <div
|
|
803
|
+
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
804
|
+
>
|
|
805
|
+
<span class="tx_normal">${index + 1} . ${opt.value}</span>
|
|
806
|
+
${opt.note ? html ` <span class="tx_gray_12 ms-2">${opt.note}</span> ` : ''}
|
|
807
|
+
</div>`;
|
|
885
808
|
}))}
|
|
886
|
-
|
|
887
|
-
|
|
809
|
+
</div>
|
|
810
|
+
`;
|
|
888
811
|
},
|
|
889
812
|
onCreate: () => {
|
|
890
813
|
if (subVM.loading) {
|
|
@@ -922,18 +845,15 @@ export class ShoppingDiscountSetting {
|
|
|
922
845
|
return BgWidget.spinner();
|
|
923
846
|
}
|
|
924
847
|
return html `
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
</div>
|
|
935
|
-
</div>
|
|
936
|
-
${BgWidget.grayButton('選擇商品', gvc.event(() => {
|
|
848
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
849
|
+
<div
|
|
850
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
851
|
+
style="gap: 24px; justify-content: space-between;"
|
|
852
|
+
>
|
|
853
|
+
<div class="form-check-label c_updown_label">
|
|
854
|
+
<div class="tx_normal">商品列表</div>
|
|
855
|
+
</div>
|
|
856
|
+
${BgWidget.grayButton('選擇商品', gvc.event(() => {
|
|
937
857
|
var _a;
|
|
938
858
|
BgProduct.productsDialog({
|
|
939
859
|
gvc: gvc,
|
|
@@ -947,30 +867,25 @@ export class ShoppingDiscountSetting {
|
|
|
947
867
|
}),
|
|
948
868
|
});
|
|
949
869
|
}), { textStyle: 'font-weight: 400;' })}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
${BgWidget.validImageBox({
|
|
870
|
+
</div>
|
|
871
|
+
${subVM.dataList
|
|
872
|
+
.map((opt, index) => {
|
|
873
|
+
return html ` <div
|
|
874
|
+
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
875
|
+
>
|
|
876
|
+
<span class="tx_normal">${index + 1} .</span>
|
|
877
|
+
${BgWidget.validImageBox({
|
|
959
878
|
gvc: gvc,
|
|
960
879
|
image: opt.image,
|
|
961
|
-
width: 40
|
|
880
|
+
width: 40,
|
|
962
881
|
})}
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
</div>`;
|
|
971
|
-
}).join(``)}
|
|
972
|
-
</div>
|
|
973
|
-
`;
|
|
882
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''}">${opt.value}</div>
|
|
883
|
+
${opt.note ? html ` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
884
|
+
</div>`;
|
|
885
|
+
})
|
|
886
|
+
.join(``)}
|
|
887
|
+
</div>
|
|
888
|
+
`;
|
|
974
889
|
},
|
|
975
890
|
onCreate: () => {
|
|
976
891
|
if (subVM.loading) {
|
|
@@ -999,7 +914,7 @@ export class ShoppingDiscountSetting {
|
|
|
999
914
|
return '';
|
|
1000
915
|
}
|
|
1001
916
|
})()}
|
|
1002
|
-
|
|
917
|
+
`,
|
|
1003
918
|
];
|
|
1004
919
|
})(),
|
|
1005
920
|
].join(BgWidget.horizontalLine());
|
|
@@ -1009,9 +924,10 @@ export class ShoppingDiscountSetting {
|
|
|
1009
924
|
})),
|
|
1010
925
|
...(() => {
|
|
1011
926
|
if (['giveaway', 'add_on_items'].includes(voucherData.reBackType)) {
|
|
1012
|
-
return [
|
|
927
|
+
return [
|
|
928
|
+
BgWidget.mainCard(gvc.bindView(() => {
|
|
1013
929
|
const vm = {
|
|
1014
|
-
id: gvc.glitter.getUUID()
|
|
930
|
+
id: gvc.glitter.getUUID(),
|
|
1015
931
|
};
|
|
1016
932
|
if (!Array.isArray(voucherData.add_on_products)) {
|
|
1017
933
|
voucherData.add_on_products = [];
|
|
@@ -1020,7 +936,7 @@ export class ShoppingDiscountSetting {
|
|
|
1020
936
|
bind: vm.id,
|
|
1021
937
|
view: () => {
|
|
1022
938
|
return html `
|
|
1023
|
-
<div class="tx_700">${
|
|
939
|
+
<div class="tx_700">${voucherData.reBackType === 'add_on_items' ? `加購品項` : `贈品品項`}</div>
|
|
1024
940
|
${BgWidget.mbContainer(18)}
|
|
1025
941
|
${obj.gvc.bindView(() => {
|
|
1026
942
|
const id = gvc.glitter.getUUID();
|
|
@@ -1030,13 +946,11 @@ export class ShoppingDiscountSetting {
|
|
|
1030
946
|
try {
|
|
1031
947
|
return html `
|
|
1032
948
|
<div
|
|
1033
|
-
|
|
1034
|
-
|
|
949
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
950
|
+
style="gap: 24px; justify-content: space-between;"
|
|
1035
951
|
>
|
|
1036
952
|
<div class="form-check-label c_updown_label">
|
|
1037
|
-
<div class="tx_normal">
|
|
1038
|
-
商品列表
|
|
1039
|
-
</div>
|
|
953
|
+
<div class="tx_normal">商品列表</div>
|
|
1040
954
|
</div>
|
|
1041
955
|
${BgWidget.grayButton('選擇商品', gvc.event(() => {
|
|
1042
956
|
var _a;
|
|
@@ -1050,7 +964,7 @@ export class ShoppingDiscountSetting {
|
|
|
1050
964
|
filter: (dd) => {
|
|
1051
965
|
return true;
|
|
1052
966
|
},
|
|
1053
|
-
productType:
|
|
967
|
+
productType: voucherData.reBackType === 'add_on_items' ? 'addProduct' : 'giveaway',
|
|
1054
968
|
});
|
|
1055
969
|
}), { textStyle: 'font-weight: 400;' })}
|
|
1056
970
|
</div>
|
|
@@ -1058,7 +972,7 @@ export class ShoppingDiscountSetting {
|
|
|
1058
972
|
const vm = {
|
|
1059
973
|
id: gvc.glitter.getUUID(),
|
|
1060
974
|
loading: true,
|
|
1061
|
-
data: []
|
|
975
|
+
data: [],
|
|
1062
976
|
};
|
|
1063
977
|
BgProduct.getProductOpts(voucherData.add_on_products).then((res) => {
|
|
1064
978
|
vm.data = res;
|
|
@@ -1071,31 +985,27 @@ export class ShoppingDiscountSetting {
|
|
|
1071
985
|
if (vm.loading) {
|
|
1072
986
|
return BgWidget.spinner();
|
|
1073
987
|
}
|
|
1074
|
-
return vm.data
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
988
|
+
return vm.data
|
|
989
|
+
.map((opt, index) => {
|
|
990
|
+
return html ` <div
|
|
991
|
+
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
1078
992
|
>
|
|
1079
|
-
<span class="tx_normal">${index + 1}
|
|
1080
|
-
.</span>
|
|
993
|
+
<span class="tx_normal">${index + 1} .</span>
|
|
1081
994
|
${BgWidget.validImageBox({
|
|
1082
995
|
gvc: gvc,
|
|
1083
996
|
image: opt.image,
|
|
1084
|
-
width: 40
|
|
997
|
+
width: 40,
|
|
1085
998
|
})}
|
|
1086
|
-
<div class="tx_normal ${opt.note ? 'mb-1' : ''}">
|
|
1087
|
-
|
|
1088
|
-
</div>
|
|
1089
|
-
${opt.note ? html `
|
|
1090
|
-
<div class="tx_gray_12">
|
|
1091
|
-
${opt.note}
|
|
1092
|
-
</div> ` : ''}
|
|
999
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''}">${opt.value}</div>
|
|
1000
|
+
${opt.note ? html ` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
1093
1001
|
</div>`;
|
|
1094
|
-
})
|
|
1095
|
-
|
|
1002
|
+
})
|
|
1003
|
+
.join('');
|
|
1004
|
+
}),
|
|
1005
|
+
divCreate: {
|
|
1096
1006
|
class: `d-flex py-2 flex-column`,
|
|
1097
|
-
style: `gap:10px
|
|
1098
|
-
}
|
|
1007
|
+
style: `gap:10px;`,
|
|
1008
|
+
},
|
|
1099
1009
|
};
|
|
1100
1010
|
})}
|
|
1101
1011
|
`;
|
|
@@ -1106,14 +1016,15 @@ export class ShoppingDiscountSetting {
|
|
|
1106
1016
|
}
|
|
1107
1017
|
},
|
|
1108
1018
|
divCreate: {
|
|
1109
|
-
class: `w-100
|
|
1110
|
-
}
|
|
1019
|
+
class: `w-100`,
|
|
1020
|
+
},
|
|
1111
1021
|
};
|
|
1112
1022
|
})}
|
|
1113
1023
|
`;
|
|
1114
|
-
}
|
|
1024
|
+
},
|
|
1115
1025
|
};
|
|
1116
|
-
}))
|
|
1026
|
+
})),
|
|
1027
|
+
];
|
|
1117
1028
|
}
|
|
1118
1029
|
else {
|
|
1119
1030
|
return [];
|
|
@@ -1146,10 +1057,9 @@ export class ShoppingDiscountSetting {
|
|
|
1146
1057
|
voucherData.counting = voucherData.method === 'percent' || voucherData.reBackType === 'shipment_free' ? 'single' : voucherData.counting;
|
|
1147
1058
|
voucherData.conditionType = voucherData.reBackType === 'shipment_free' ? 'order' : voucherData.conditionType;
|
|
1148
1059
|
return [
|
|
1149
|
-
html `
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1060
|
+
html ` <div class="tx_700">消費條件</div>
|
|
1061
|
+
${BgWidget.mbContainer(18)}
|
|
1062
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1153
1063
|
{
|
|
1154
1064
|
key: 'min_price',
|
|
1155
1065
|
name: '最低消費金額',
|
|
@@ -1165,10 +1075,9 @@ export class ShoppingDiscountSetting {
|
|
|
1165
1075
|
voucherData.rule = text[0];
|
|
1166
1076
|
gvc.notifyDataChange(pageVM.conditionId);
|
|
1167
1077
|
}, { single: true })}`,
|
|
1168
|
-
html `
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1078
|
+
html ` <div class="tx_700">計算單位</div>
|
|
1079
|
+
${BgWidget.mbContainer(18)}
|
|
1080
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1172
1081
|
{
|
|
1173
1082
|
key: 'order',
|
|
1174
1083
|
name: '以整份訂單計算',
|
|
@@ -1189,12 +1098,11 @@ export class ShoppingDiscountSetting {
|
|
|
1189
1098
|
gvc.notifyDataChange(pageVM.conditionId);
|
|
1190
1099
|
}, {
|
|
1191
1100
|
single: true,
|
|
1192
|
-
readonly: voucherData.reBackType === 'shipment_free'
|
|
1101
|
+
readonly: voucherData.reBackType === 'shipment_free',
|
|
1193
1102
|
})}`,
|
|
1194
|
-
html `
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1103
|
+
html ` <div class="tx_700">重複觸發</div>
|
|
1104
|
+
${BgWidget.mbContainer(18)}
|
|
1105
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1198
1106
|
{
|
|
1199
1107
|
key: 'single',
|
|
1200
1108
|
name: '不重複',
|
|
@@ -1218,7 +1126,7 @@ export class ShoppingDiscountSetting {
|
|
|
1218
1126
|
gvc.notifyDataChange(pageVM.conditionId);
|
|
1219
1127
|
}, {
|
|
1220
1128
|
single: true,
|
|
1221
|
-
readonly: voucherData.method === 'percent' || voucherData.reBackType === 'shipment_free'
|
|
1129
|
+
readonly: voucherData.method === 'percent' || voucherData.reBackType === 'shipment_free',
|
|
1222
1130
|
})}`,
|
|
1223
1131
|
].join(BgWidget.horizontalLine());
|
|
1224
1132
|
},
|
|
@@ -1229,11 +1137,9 @@ export class ShoppingDiscountSetting {
|
|
|
1229
1137
|
return {
|
|
1230
1138
|
bind: id,
|
|
1231
1139
|
view: () => {
|
|
1232
|
-
return html `
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
${BgWidget.mbContainer(18)}
|
|
1236
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1140
|
+
return html ` <div class="tx_700">是否與其他優惠券疊加使用</div>
|
|
1141
|
+
${BgWidget.mbContainer(18)}
|
|
1142
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1237
1143
|
{
|
|
1238
1144
|
key: 'false',
|
|
1239
1145
|
name: '不可疊加',
|
|
@@ -1258,10 +1164,9 @@ export class ShoppingDiscountSetting {
|
|
|
1258
1164
|
var _a, _b;
|
|
1259
1165
|
const inputStyle = 'display: block; width:200px;';
|
|
1260
1166
|
return [
|
|
1261
|
-
html `
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1167
|
+
html ` <div class="tx_700">全館總使用次數</div>
|
|
1168
|
+
${BgWidget.mbContainer(18)}
|
|
1169
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1265
1170
|
{
|
|
1266
1171
|
key: 'noLimited',
|
|
1267
1172
|
name: '無限制',
|
|
@@ -1269,10 +1174,9 @@ export class ShoppingDiscountSetting {
|
|
|
1269
1174
|
{
|
|
1270
1175
|
key: 'hasLimited',
|
|
1271
1176
|
name: '限制次數',
|
|
1272
|
-
innerHtml: html `
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
${BgWidget.editeInput({
|
|
1177
|
+
innerHtml: html ` <div class="d-flex align-items-center">
|
|
1178
|
+
<span class="tx_normal me-2">可使用次數</span>
|
|
1179
|
+
${BgWidget.editeInput({
|
|
1276
1180
|
gvc: gvc,
|
|
1277
1181
|
title: '',
|
|
1278
1182
|
type: 'number',
|
|
@@ -1284,17 +1188,16 @@ export class ShoppingDiscountSetting {
|
|
|
1284
1188
|
},
|
|
1285
1189
|
endText: '次',
|
|
1286
1190
|
})}
|
|
1287
|
-
|
|
1191
|
+
</div>`,
|
|
1288
1192
|
},
|
|
1289
1193
|
], [voucherData.macroLimited === 0 ? 'noLimited' : 'hasLimited'], (text) => {
|
|
1290
1194
|
if (text[0] === 'noLimited') {
|
|
1291
1195
|
voucherData.macroLimited = 0;
|
|
1292
1196
|
}
|
|
1293
1197
|
}, { single: true })}`,
|
|
1294
|
-
html `
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1198
|
+
html ` <div class="tx_700">個人總使用次數</div>
|
|
1199
|
+
${BgWidget.mbContainer(18)}
|
|
1200
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1298
1201
|
{
|
|
1299
1202
|
key: 'noLimited',
|
|
1300
1203
|
name: '無限制',
|
|
@@ -1302,10 +1205,9 @@ export class ShoppingDiscountSetting {
|
|
|
1302
1205
|
{
|
|
1303
1206
|
key: 'hasLimited',
|
|
1304
1207
|
name: '限制次數',
|
|
1305
|
-
innerHtml: html `
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
${BgWidget.editeInput({
|
|
1208
|
+
innerHtml: html ` <div class="d-flex align-items-center">
|
|
1209
|
+
<span class="tx_normal me-2">可使用次數</span>
|
|
1210
|
+
${BgWidget.editeInput({
|
|
1309
1211
|
gvc: gvc,
|
|
1310
1212
|
title: '',
|
|
1311
1213
|
type: 'number',
|
|
@@ -1317,20 +1219,18 @@ export class ShoppingDiscountSetting {
|
|
|
1317
1219
|
},
|
|
1318
1220
|
endText: '次',
|
|
1319
1221
|
})}
|
|
1320
|
-
|
|
1222
|
+
</div>`,
|
|
1321
1223
|
},
|
|
1322
1224
|
], [voucherData.microLimited === 0 ? 'noLimited' : 'hasLimited'], (text) => {
|
|
1323
1225
|
if (text[0] === 'noLimited') {
|
|
1324
1226
|
voucherData.microLimited = 0;
|
|
1325
1227
|
}
|
|
1326
1228
|
}, { single: true })}`,
|
|
1327
|
-
html `
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
<span class="tx_normal me-2">開始日期</span>
|
|
1333
|
-
${BgWidget.editeInput({
|
|
1229
|
+
html ` <div class="tx_700">有效日期</div>
|
|
1230
|
+
<div class="d-flex mb-3 ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 12px">
|
|
1231
|
+
<div class="d-flex align-items-center">
|
|
1232
|
+
<span class="tx_normal me-2">開始日期</span>
|
|
1233
|
+
${BgWidget.editeInput({
|
|
1334
1234
|
gvc: gvc,
|
|
1335
1235
|
title: '',
|
|
1336
1236
|
type: 'date',
|
|
@@ -1341,10 +1241,10 @@ export class ShoppingDiscountSetting {
|
|
|
1341
1241
|
voucherData.startDate = text;
|
|
1342
1242
|
},
|
|
1343
1243
|
})}
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1244
|
+
</div>
|
|
1245
|
+
<div class="d-flex align-items-center">
|
|
1246
|
+
<span class="tx_normal me-2">開始時間</span>
|
|
1247
|
+
${BgWidget.editeInput({
|
|
1348
1248
|
gvc: gvc,
|
|
1349
1249
|
title: '',
|
|
1350
1250
|
type: 'time',
|
|
@@ -1355,9 +1255,9 @@ export class ShoppingDiscountSetting {
|
|
|
1355
1255
|
voucherData.startTime = text;
|
|
1356
1256
|
},
|
|
1357
1257
|
})}
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1258
|
+
</div>
|
|
1259
|
+
</div>
|
|
1260
|
+
${BgWidget.multiCheckboxContainer(gvc, [
|
|
1361
1261
|
{
|
|
1362
1262
|
key: 'noEnd',
|
|
1363
1263
|
name: '無期限',
|
|
@@ -1365,12 +1265,10 @@ export class ShoppingDiscountSetting {
|
|
|
1365
1265
|
{
|
|
1366
1266
|
key: 'withEnd',
|
|
1367
1267
|
name: '有效期限',
|
|
1368
|
-
innerHtml: html `
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
<span class="tx_normal me-2">結束日期</span>
|
|
1373
|
-
${BgWidget.editeInput({
|
|
1268
|
+
innerHtml: html ` <div class="d-flex mt-0 mt-md-3 ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 12px">
|
|
1269
|
+
<div class="d-flex align-items-center">
|
|
1270
|
+
<span class="tx_normal me-2">結束日期</span>
|
|
1271
|
+
${BgWidget.editeInput({
|
|
1374
1272
|
gvc: gvc,
|
|
1375
1273
|
title: '',
|
|
1376
1274
|
type: 'date',
|
|
@@ -1381,10 +1279,10 @@ export class ShoppingDiscountSetting {
|
|
|
1381
1279
|
voucherData.endDate = text;
|
|
1382
1280
|
},
|
|
1383
1281
|
})}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1282
|
+
</div>
|
|
1283
|
+
<div class="d-flex align-items-center">
|
|
1284
|
+
<span class="tx_normal me-2">結束時間</span>
|
|
1285
|
+
${BgWidget.editeInput({
|
|
1388
1286
|
gvc: gvc,
|
|
1389
1287
|
title: '',
|
|
1390
1288
|
type: 'time',
|
|
@@ -1395,8 +1293,8 @@ export class ShoppingDiscountSetting {
|
|
|
1395
1293
|
voucherData.endTime = text;
|
|
1396
1294
|
},
|
|
1397
1295
|
})}
|
|
1398
|
-
|
|
1399
|
-
|
|
1296
|
+
</div>
|
|
1297
|
+
</div>`,
|
|
1400
1298
|
},
|
|
1401
1299
|
], [voucherData.endDate ? `withEnd` : `noEnd`], (text) => {
|
|
1402
1300
|
if (text[0] === 'noEnd') {
|
|
@@ -1409,7 +1307,7 @@ export class ShoppingDiscountSetting {
|
|
|
1409
1307
|
};
|
|
1410
1308
|
})),
|
|
1411
1309
|
].join(BgWidget.mbContainer(24)), undefined, 'padding: 0 ; margin: 0 !important; width: 68.5%;')}
|
|
1412
|
-
|
|
1310
|
+
${BgWidget.container(gvc.bindView(() => {
|
|
1413
1311
|
const id = gvc.glitter.getUUID();
|
|
1414
1312
|
return {
|
|
1415
1313
|
bind: id,
|
|
@@ -1423,17 +1321,14 @@ export class ShoppingDiscountSetting {
|
|
|
1423
1321
|
bind: id,
|
|
1424
1322
|
view: () => {
|
|
1425
1323
|
return html `
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
return html `
|
|
1431
|
-
<div class="${text.length > 0 ? 'tx_normal' : 'gray-top-bottom-line-6'}">
|
|
1432
|
-
${text}
|
|
1433
|
-
</div>`;
|
|
1324
|
+
<div class="tx_700">摘要</div>
|
|
1325
|
+
${BgWidget.mbContainer(18)}
|
|
1326
|
+
<div style="display: flex; gap: 12px; flex-direction: column;">
|
|
1327
|
+
${gvc.map(getVoucherTextList().map((text) => {
|
|
1328
|
+
return html ` <div class="${text.length > 0 ? 'tx_normal' : 'gray-top-bottom-line-6'}">${text}</div>`;
|
|
1434
1329
|
}))}
|
|
1435
|
-
|
|
1436
|
-
|
|
1330
|
+
</div>
|
|
1331
|
+
`;
|
|
1437
1332
|
},
|
|
1438
1333
|
};
|
|
1439
1334
|
}));
|
|
@@ -1443,11 +1338,10 @@ export class ShoppingDiscountSetting {
|
|
|
1443
1338
|
},
|
|
1444
1339
|
};
|
|
1445
1340
|
}), undefined, 'padding: 0; margin: 0 !important; width: 26.5%;')}
|
|
1446
|
-
|
|
1341
|
+
</div>`,
|
|
1447
1342
|
BgWidget.mbContainer(240),
|
|
1448
|
-
html `
|
|
1449
|
-
|
|
1450
|
-
${obj.type === 'replace'
|
|
1343
|
+
html ` <div class="update-bar-container">
|
|
1344
|
+
${obj.type === 'replace'
|
|
1451
1345
|
? BgWidget.cancel(gvc.event(() => {
|
|
1452
1346
|
const dialog = new ShareDialog(obj.gvc.glitter);
|
|
1453
1347
|
dialog.checkYesOrNot({
|
|
@@ -1471,10 +1365,10 @@ export class ShoppingDiscountSetting {
|
|
|
1471
1365
|
});
|
|
1472
1366
|
}), '刪除優惠券')
|
|
1473
1367
|
: ''}
|
|
1474
|
-
|
|
1368
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
1475
1369
|
vm.type = 'list';
|
|
1476
1370
|
}))}
|
|
1477
|
-
|
|
1371
|
+
${BgWidget.save(gvc.event(() => {
|
|
1478
1372
|
voucherData.start_ISO_Date = '';
|
|
1479
1373
|
voucherData.end_ISO_Date = '';
|
|
1480
1374
|
glitter.ut.tryMethod([
|
|
@@ -1521,7 +1415,7 @@ export class ShoppingDiscountSetting {
|
|
|
1521
1415
|
});
|
|
1522
1416
|
}
|
|
1523
1417
|
}))}
|
|
1524
|
-
|
|
1418
|
+
</div>`,
|
|
1525
1419
|
].join(BgWidget.mbContainer(24)), BgWidget.getContainerWidth());
|
|
1526
1420
|
},
|
|
1527
1421
|
};
|