ts-glitter 22.4.7 → 22.4.9
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/lib/glitterBundle/Glitter.css +74 -62
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +49 -32
- package/lowcode/backend-manager/bg-product.ts +57 -39
- package/lowcode/backend-manager/bg-widget.js +17 -0
- package/lowcode/backend-manager/bg-widget.ts +18 -0
- package/lowcode/cms-plugin/information/information-module.js +5 -5
- package/lowcode/cms-plugin/information/information-module.ts +9 -5
- package/lowcode/cms-plugin/menus-setting.js +69 -55
- package/lowcode/cms-plugin/menus-setting.ts +77 -61
- package/lowcode/cms-plugin/module/form-module.js +109 -89
- package/lowcode/cms-plugin/module/form-module.ts +680 -650
- package/lowcode/cms-plugin/module/product-excel.js +1 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +28 -10
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +29 -10
- package/lowcode/cms-plugin/shopping-allowance-manager.js +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +0 -1
- package/lowcode/cms-plugin/shopping-collections.js +367 -193
- package/lowcode/cms-plugin/shopping-collections.ts +664 -243
- package/lowcode/cms-plugin/shopping-information.js +392 -38
- package/lowcode/cms-plugin/shopping-information.ts +479 -87
- package/lowcode/cms-plugin/shopping-product-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-setting-advance.js +906 -766
- package/lowcode/cms-plugin/shopping-setting-advance.ts +977 -841
- package/lowcode/cms-plugin/shopping-setting-basic.js +1547 -1285
- package/lowcode/cms-plugin/shopping-setting-basic.ts +1742 -1466
- package/lowcode/cms-plugin/stock-stores.js +1 -0
- package/lowcode/cms-plugin/stock-stores.ts +1 -0
- package/lowcode/cms-plugin/user-list.js +47 -12
- package/lowcode/cms-plugin/user-list.ts +52 -14
- package/lowcode/css/editor.css +6 -0
- package/lowcode/glitterBundle/Glitter.css +74 -62
- package/lowcode/jslib/nestable/index.html +317 -0
- package/lowcode/jslib/nestable/jquery.nestable.js +484 -0
- package/lowcode/official_view_component/form-widget/input-custom.js +98 -6
- package/lowcode/official_view_component/form-widget/input-custom.ts +121 -16
- package/lowcode/public-components/headers/header-class.js +63 -0
- package/lowcode/public-components/headers/header-class.ts +65 -0
- package/lowcode/public-components/headers/sy-02.js +386 -400
- package/lowcode/public-components/headers/sy-02.ts +482 -492
- package/lowcode/public-components/headers/sy-03.js +42 -43
- package/lowcode/public-components/headers/sy-03.ts +46 -43
- package/lowcode/public-components/headers/sy-04.js +43 -41
- package/lowcode/public-components/headers/sy-04.ts +48 -41
- package/lowcode/public-components/headers/sy-05.js +30 -27
- package/lowcode/public-components/headers/sy-05.ts +33 -27
- package/lowcode/public-components/product/product-list.js +160 -148
- package/lowcode/public-components/product/product-list.ts +186 -165
- package/lowcode/public-models/product.ts +26 -1
- package/lowcode/src/glitterBundle/Glitter.css +74 -62
- package/package.json +1 -1
- package/rxmnt81tnk.json +1 -0
- package/src/api-public/controllers/shop.js +10 -4
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -9
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/mail.js +1 -1
- package/src/api-public/services/mail.js.map +1 -1
- package/src/api-public/services/mail.ts +1 -1
- package/src/api-public/services/schedule.d.ts +0 -1
- package/src/api-public/services/schedule.js +12 -35
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +15 -39
- package/src/api-public/services/shopee.js +7 -17
- package/src/api-public/services/shopping.d.ts +27 -6
- package/src/api-public/services/shopping.js +364 -85
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +510 -101
- package/src/api-public/services/updated-table-checked.js +58 -1
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +62 -1
- package/src/api-public/services/user-update.js +14 -0
- package/src/api-public/services/user-update.js.map +1 -1
- package/src/api-public/services/user-update.ts +15 -0
- package/src/api-public/services/user.js +1 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/helper/glitter-util.d.ts +1 -0
- package/src/index.js +7 -5
- package/src/index.js.map +1 -1
- package/src/index.ts +45 -38
- package/src/modules/firebase.js +1 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +1 -0
- package/src/seo-config.d.ts +1 -1
- package/src/seo-config.js +1 -2
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +1 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +4 -3
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/src/services/system-schedule.ts +1 -0
|
@@ -15,6 +15,7 @@ import { LanguageBackend } from './language-backend.js';
|
|
|
15
15
|
import { GlobalUser } from '../glitter-base/global/global-user.js';
|
|
16
16
|
import { InformationModule } from './information/information-module.js';
|
|
17
17
|
const html = String.raw;
|
|
18
|
+
const css = String.raw;
|
|
18
19
|
export class ShoppingInformation {
|
|
19
20
|
static main(gvc) {
|
|
20
21
|
const glitter = gvc.glitter;
|
|
@@ -23,6 +24,9 @@ export class ShoppingInformation {
|
|
|
23
24
|
id: glitter.getUUID(),
|
|
24
25
|
tableId: glitter.getUUID(),
|
|
25
26
|
filterId: glitter.getUUID(),
|
|
27
|
+
webTypeId: glitter.getUUID(),
|
|
28
|
+
reverseId: glitter.getUUID(),
|
|
29
|
+
reverseEditId: glitter.getUUID(),
|
|
26
30
|
type: 'basic',
|
|
27
31
|
data: {
|
|
28
32
|
ubn: '',
|
|
@@ -126,6 +130,11 @@ export class ShoppingInformation {
|
|
|
126
130
|
bind: vm.id,
|
|
127
131
|
dataList: [{ obj: vm, key: 'type' }],
|
|
128
132
|
view: () => {
|
|
133
|
+
gvc.glitter.addMtScript([
|
|
134
|
+
{
|
|
135
|
+
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
136
|
+
},
|
|
137
|
+
], () => { }, () => { });
|
|
129
138
|
if (vm.mainLoading) {
|
|
130
139
|
ApiUser.getPublicConfig('store-information', 'manager').then((response) => {
|
|
131
140
|
const data = response.response.value;
|
|
@@ -137,7 +146,9 @@ export class ShoppingInformation {
|
|
|
137
146
|
const infoModule = new InformationModule(gvc, vm, ShoppingInformation);
|
|
138
147
|
function createSection(title, description) {
|
|
139
148
|
return html `
|
|
140
|
-
<div class="d-flex" style="font-weight: 700;color: #393939; font-size: 16px;line-height: 1.4;gap: 6px;"
|
|
149
|
+
<div class="d-flex" style="font-weight: 700;color: #393939; font-size: 16px;line-height: 1.4;gap: 6px;">
|
|
150
|
+
${title}
|
|
151
|
+
</div>
|
|
141
152
|
${description
|
|
142
153
|
? html ` <div style="color: #8D8D8D; font-size: 14px; padding-right: 10px;">${description}</div>`
|
|
143
154
|
: ''}
|
|
@@ -145,14 +156,15 @@ export class ShoppingInformation {
|
|
|
145
156
|
}
|
|
146
157
|
function createToggle(title, description, key) {
|
|
147
158
|
const toggleHtml = html ` <div class="cursor_pointer form-check form-switch m-0 p-0" style="min-width: 50px;">
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
return createRow(html
|
|
159
|
+
<input
|
|
160
|
+
class="form-check-input m-0"
|
|
161
|
+
type="checkbox"
|
|
162
|
+
onchange="${gvc.event(() => (vm.data[key] = !vm.data[key]))}"
|
|
163
|
+
${vm.data[key] ? 'checked' : ''}
|
|
164
|
+
/>
|
|
165
|
+
</div>`;
|
|
166
|
+
return createRow(html ` <div>${title}</div>
|
|
167
|
+
${toggleHtml}`, description, '');
|
|
156
168
|
}
|
|
157
169
|
function createSelect(title, description, key) {
|
|
158
170
|
return createRow(title, description, html ` <div class="d-flex align-items-center justify-content-center" style="min-width: 150px;">
|
|
@@ -198,6 +210,345 @@ export class ShoppingInformation {
|
|
|
198
210
|
event: infoModule.invoiceMode(title),
|
|
199
211
|
}));
|
|
200
212
|
}
|
|
213
|
+
function drawReserveSection() {
|
|
214
|
+
return gvc.bindView({
|
|
215
|
+
bind: vm.reverseId,
|
|
216
|
+
view: () => {
|
|
217
|
+
var _a;
|
|
218
|
+
function drawQuest() {
|
|
219
|
+
return BgWidget.questionButton(gvc.event(() => {
|
|
220
|
+
BgWidget.quesDialog({
|
|
221
|
+
gvc: gvc,
|
|
222
|
+
style: '',
|
|
223
|
+
innerHTML(gvc) {
|
|
224
|
+
const hint = '若是商店的每日營業時間為 上午09:00~上午12:00 且星期一固定公休' +
|
|
225
|
+
'作法:新增規則「幾點到幾點」指定時間、再設置「特定星期」指定星期一' +
|
|
226
|
+
'切記公休的規則要再下方,才能覆蓋掉上面的規則';
|
|
227
|
+
return html `
|
|
228
|
+
<div class="d-flex flex-column text-white">
|
|
229
|
+
<div>若是商店的每日營業時間為 上午09:00~上午12:00 且星期一固定公休,</div>
|
|
230
|
+
<div>作法:新增規則「幾點到幾點」指定時間、再設置「特定星期」指定星期一</div>
|
|
231
|
+
<div>切記公休的規則要再下方,才能覆蓋掉上面的規則</div>
|
|
232
|
+
<img src="${img}" alt="hintImg" style="margin-top:8px;" />
|
|
233
|
+
</div>
|
|
234
|
+
`;
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
function drawEdition() {
|
|
240
|
+
return gvc.bindView({
|
|
241
|
+
bind: vm.reverseEditId,
|
|
242
|
+
view: () => {
|
|
243
|
+
gvc.addStyle(css `
|
|
244
|
+
.range-input {
|
|
245
|
+
padding: 0 18px;
|
|
246
|
+
border-radius: 10px;
|
|
247
|
+
border: 1px solid #ddd;
|
|
248
|
+
background: #fff;
|
|
249
|
+
height: 40px;
|
|
250
|
+
gap: 10px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.range-input-raw {
|
|
254
|
+
display: flex;
|
|
255
|
+
gap: 18px;
|
|
256
|
+
}
|
|
257
|
+
`);
|
|
258
|
+
try {
|
|
259
|
+
const toggleHtml = (ruleIndex) => {
|
|
260
|
+
let toggle = ruleData[ruleIndex].enabled;
|
|
261
|
+
return html `
|
|
262
|
+
${toggle ? "開啟" : "關閉"}
|
|
263
|
+
<div
|
|
264
|
+
class="cursor_pointer form-check form-switch m-0 p-0"
|
|
265
|
+
style="min-width: 50px;"
|
|
266
|
+
>
|
|
267
|
+
<input
|
|
268
|
+
class="form-check-input m-0"
|
|
269
|
+
type="checkbox"
|
|
270
|
+
onchange="${gvc.event(e => {
|
|
271
|
+
ruleData[ruleIndex].enabled = !toggle;
|
|
272
|
+
gvc.notifyDataChange(vm.reverseEditId);
|
|
273
|
+
})}"
|
|
274
|
+
${toggle ? 'checked' : ''}
|
|
275
|
+
/>
|
|
276
|
+
</div>`;
|
|
277
|
+
};
|
|
278
|
+
const rangeView = {
|
|
279
|
+
date: (ruleIndex) => {
|
|
280
|
+
const dateInput = (dateString, index) => {
|
|
281
|
+
const date = dateString.split(',');
|
|
282
|
+
return html `
|
|
283
|
+
<div class="d-flex range-input flex-fill">
|
|
284
|
+
<input
|
|
285
|
+
class="border-0 w-100"
|
|
286
|
+
value="${date[index]}"
|
|
287
|
+
type="time"
|
|
288
|
+
onchange="${gvc.event(e => {
|
|
289
|
+
function isValidTimeRange(timeRange) {
|
|
290
|
+
const [start, end] = timeRange.split(',');
|
|
291
|
+
const startTime = new Date(`2023-01-01T${start}:00`);
|
|
292
|
+
const endTime = new Date(`2023-01-01T${end}:00`);
|
|
293
|
+
return endTime > startTime;
|
|
294
|
+
}
|
|
295
|
+
date[index] = e.value;
|
|
296
|
+
ruleData[ruleIndex].range = isValidTimeRange(`${date[0]},${date[1]}`) ? `${date[0]},${date[1]}` : `${date[1]},${date[0]}`;
|
|
297
|
+
gvc.notifyDataChange(vm.reverseEditId);
|
|
298
|
+
})}"
|
|
299
|
+
/>
|
|
300
|
+
</div>
|
|
301
|
+
`;
|
|
302
|
+
};
|
|
303
|
+
return html `
|
|
304
|
+
<div class="h-100 d-flex range-input-raw">
|
|
305
|
+
${dateInput(ruleData[ruleIndex].range, 0)} ${dateInput(ruleData[ruleIndex].range, 1)}
|
|
306
|
+
</div>
|
|
307
|
+
`;
|
|
308
|
+
},
|
|
309
|
+
week: (ruleIndex) => {
|
|
310
|
+
return BgWidget.select({
|
|
311
|
+
callback(value) {
|
|
312
|
+
ruleData[ruleIndex].range = value;
|
|
313
|
+
console.log(vm.data);
|
|
314
|
+
},
|
|
315
|
+
default: ruleData[ruleIndex].range,
|
|
316
|
+
gvc: gvc,
|
|
317
|
+
options: [
|
|
318
|
+
{ key: "1", value: "禮拜一" },
|
|
319
|
+
{ key: "2", value: "禮拜二" },
|
|
320
|
+
{ key: "3", value: "禮拜三" },
|
|
321
|
+
{ key: "4", value: "禮拜四" },
|
|
322
|
+
{ key: "5", value: "禮拜五" },
|
|
323
|
+
{ key: "6", value: "禮拜六" },
|
|
324
|
+
{ key: "7", value: "禮拜日" }
|
|
325
|
+
]
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
month: (ruleIndex) => {
|
|
329
|
+
const monthInput = (monthString, index) => {
|
|
330
|
+
const month = monthString.split(',');
|
|
331
|
+
return html `
|
|
332
|
+
<div class="d-flex range-input flex-fill">
|
|
333
|
+
<input
|
|
334
|
+
class="border-0 w-100"
|
|
335
|
+
value="${month[index]}"
|
|
336
|
+
type="number"
|
|
337
|
+
onchange="${gvc.event(e => {
|
|
338
|
+
const numberValue = Number(e.value);
|
|
339
|
+
if (numberValue > 12 || numberValue < 1) {
|
|
340
|
+
dialog.infoMessage({
|
|
341
|
+
text: '請輸入正確的月份數字',
|
|
342
|
+
callback: () => {
|
|
343
|
+
e.value = month[index];
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
month[index] = e.value;
|
|
349
|
+
ruleData[ruleIndex].range = `${month[0]},${month[1]}`;
|
|
350
|
+
}
|
|
351
|
+
})}"
|
|
352
|
+
/>
|
|
353
|
+
<div class="tx_gray_16 d-flex align-items-center">月</div>
|
|
354
|
+
</div>
|
|
355
|
+
`;
|
|
356
|
+
};
|
|
357
|
+
return html `
|
|
358
|
+
<div class="h-100 d-flex range-input-raw">
|
|
359
|
+
${monthInput(ruleData[ruleIndex].range, 0)} ${monthInput(ruleData[ruleIndex].range, 1)}
|
|
360
|
+
</div>
|
|
361
|
+
`;
|
|
362
|
+
},
|
|
363
|
+
};
|
|
364
|
+
return ruleData
|
|
365
|
+
.map((rule, index) => {
|
|
366
|
+
var _a, _b;
|
|
367
|
+
return html ` <li
|
|
368
|
+
class="w-100 mb-2 d-flex align-items-center "
|
|
369
|
+
style="overflow: hidden;padding-bottom: 18px;height:58px;"
|
|
370
|
+
>
|
|
371
|
+
<div class="d-flex align-items-center pe-5 flex-shrink-0" style="width:33%">
|
|
372
|
+
<i class="fa-sharp fa-solid fa-grip-dots-vertical me-3 dragItem cursor_move"></i>
|
|
373
|
+
${BgWidget.select({
|
|
374
|
+
gvc: gvc,
|
|
375
|
+
callback(value) {
|
|
376
|
+
rule.rule = value;
|
|
377
|
+
const initData = {
|
|
378
|
+
month: () => {
|
|
379
|
+
return "1,12";
|
|
380
|
+
},
|
|
381
|
+
date: () => {
|
|
382
|
+
return `00:00,23:59`;
|
|
383
|
+
},
|
|
384
|
+
week: () => {
|
|
385
|
+
return "1";
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
rule.range = initData[rule.rule]();
|
|
389
|
+
gvc.notifyDataChange(vm.reverseEditId);
|
|
390
|
+
},
|
|
391
|
+
style: 'color:#393939',
|
|
392
|
+
default: (_a = rule.rule) !== null && _a !== void 0 ? _a : 'month',
|
|
393
|
+
options: [
|
|
394
|
+
{ key: 'month', value: '月份區間' },
|
|
395
|
+
{ key: 'week', value: '特定星期' },
|
|
396
|
+
{ key: 'date', value: '日期區間' },
|
|
397
|
+
],
|
|
398
|
+
})}
|
|
399
|
+
</div>
|
|
400
|
+
<div class="h-100 pe-5" style="width:52%" >${rangeView[(_b = rule.rule) !== null && _b !== void 0 ? _b : 'month'](index)}</div>
|
|
401
|
+
<div class="d-flex flex-shrink-0 position-relative" style="width:15%;gap:6px;">${toggleHtml(index)}
|
|
402
|
+
<i class="ms-auto fa-solid fa-xmark-large cursor_pointer" style="color:#B0B0B0" onclick="${gvc.event(() => {
|
|
403
|
+
ruleData.splice(index, 1);
|
|
404
|
+
gvc.notifyDataChange(vm.reverseEditId);
|
|
405
|
+
})}"></i>
|
|
406
|
+
</div>
|
|
407
|
+
|
|
408
|
+
</li>`;
|
|
409
|
+
})
|
|
410
|
+
.join('');
|
|
411
|
+
}
|
|
412
|
+
catch (e) {
|
|
413
|
+
console.log(e);
|
|
414
|
+
return e;
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
divCreate: {
|
|
418
|
+
elem: 'ul',
|
|
419
|
+
option: [{ key: 'id', value: vm.reverseEditId }],
|
|
420
|
+
class: 'd-flex flex-column m-0',
|
|
421
|
+
style: 'padding-top:24px;',
|
|
422
|
+
},
|
|
423
|
+
onCreate: () => {
|
|
424
|
+
let n = 0;
|
|
425
|
+
const interval = setInterval(() => {
|
|
426
|
+
n++;
|
|
427
|
+
if (gvc.glitter.window.Sortable) {
|
|
428
|
+
try {
|
|
429
|
+
function swapArr(arr, index1, index2) {
|
|
430
|
+
const data = arr[index1];
|
|
431
|
+
arr.splice(index1, 1);
|
|
432
|
+
arr.splice(index2, 0, data);
|
|
433
|
+
}
|
|
434
|
+
let startIndex = 0;
|
|
435
|
+
gvc.glitter.window.Sortable.create(gvc.glitter.document.getElementById(vm.reverseEditId), {
|
|
436
|
+
group: gvc.glitter.getUUID(),
|
|
437
|
+
animation: 100,
|
|
438
|
+
handle: '.dragItem',
|
|
439
|
+
onChange: function (evt) { },
|
|
440
|
+
onStart: function (evt) {
|
|
441
|
+
startIndex = evt.oldIndex;
|
|
442
|
+
},
|
|
443
|
+
onEnd: (evt) => {
|
|
444
|
+
swapArr(ruleData, startIndex, evt.newIndex);
|
|
445
|
+
},
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
catch (e) { }
|
|
449
|
+
clearInterval(interval);
|
|
450
|
+
}
|
|
451
|
+
if (n > 100) {
|
|
452
|
+
clearInterval(interval);
|
|
453
|
+
}
|
|
454
|
+
}, 100);
|
|
455
|
+
},
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
gvc.addStyle(css `
|
|
459
|
+
.quest-Dialog {
|
|
460
|
+
padding: 10px;
|
|
461
|
+
border-radius: 10px;
|
|
462
|
+
}
|
|
463
|
+
`);
|
|
464
|
+
let ruleData = (_a = vm.data.ruleData) !== null && _a !== void 0 ? _a : [];
|
|
465
|
+
const emptyData = {
|
|
466
|
+
enabled: false,
|
|
467
|
+
range: '1,12',
|
|
468
|
+
rule: 'month',
|
|
469
|
+
};
|
|
470
|
+
const img = 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/sizeoriginal_s*px$_sasas8s7sfscs5s0_messageImage_1748238444050.jpg';
|
|
471
|
+
const sectionText = {
|
|
472
|
+
first: {
|
|
473
|
+
title: '營業/預約時段管理',
|
|
474
|
+
subTitle: '管理商店的營業時段與公休日,活動預約時間將依此設定自動生成',
|
|
475
|
+
quest: drawQuest(),
|
|
476
|
+
},
|
|
477
|
+
section: {
|
|
478
|
+
rawTitle: [
|
|
479
|
+
{ key: 'rule', text: '規則', width: 'width:33%' },
|
|
480
|
+
{
|
|
481
|
+
key: 'range',
|
|
482
|
+
text: '區間',
|
|
483
|
+
width: 'flex-grow:1',
|
|
484
|
+
},
|
|
485
|
+
{ key: 'enabled', text: '預約功能', width: 'width:15%' },
|
|
486
|
+
],
|
|
487
|
+
data: ruleData,
|
|
488
|
+
},
|
|
489
|
+
third: {
|
|
490
|
+
text: '※ 下方的規則優先覆蓋上方的規則',
|
|
491
|
+
btn: BgWidget.save(gvc.event(() => {
|
|
492
|
+
ruleData.push(structuredClone(emptyData));
|
|
493
|
+
vm.data.ruleData = ruleData;
|
|
494
|
+
gvc.notifyDataChange(vm.reverseEditId);
|
|
495
|
+
}), '新增規則'),
|
|
496
|
+
},
|
|
497
|
+
};
|
|
498
|
+
return BgWidget.mainCard(html `
|
|
499
|
+
<div class="d-flex flex-column" style="gap: 24px;">
|
|
500
|
+
<!-- reverse first section-->
|
|
501
|
+
<div class="d-flex flex-column">
|
|
502
|
+
<div class="tx_700">${sectionText.first.title} ${sectionText.first.quest}</div>
|
|
503
|
+
<div class="tx_gray_14">${sectionText.first.subTitle}</div>
|
|
504
|
+
</div>
|
|
505
|
+
<!-- reverse second section-->
|
|
506
|
+
<div class="d-flex flex-column">
|
|
507
|
+
<div class="d-flex">
|
|
508
|
+
${sectionText.section.rawTitle
|
|
509
|
+
.map(rawTitle => {
|
|
510
|
+
return html ` <div class="d-flex tx_700" style="${rawTitle.width}">${rawTitle.text}</div> `;
|
|
511
|
+
})
|
|
512
|
+
.join('')}
|
|
513
|
+
</div>
|
|
514
|
+
<div class="d-flex flex-column" style="gap:33px;">${drawEdition()}</div>
|
|
515
|
+
</div>
|
|
516
|
+
<!-- reverse third section-->
|
|
517
|
+
<div class="d-flex" style="padding: 12px 20px;background: #F7F7F7;">
|
|
518
|
+
<div class="tx_700 d-flex align-items-center">${sectionText.third.text}</div>
|
|
519
|
+
<div class="ms-auto">${sectionText.third.btn}</div>
|
|
520
|
+
</div>
|
|
521
|
+
</div>
|
|
522
|
+
`);
|
|
523
|
+
},
|
|
524
|
+
divCreate: {},
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
function drawWebTypeSection() {
|
|
528
|
+
return gvc.bindView({
|
|
529
|
+
bind: vm.webTypeId,
|
|
530
|
+
view: () => {
|
|
531
|
+
const webTypeSection = {
|
|
532
|
+
reserve: drawReserveSection(),
|
|
533
|
+
};
|
|
534
|
+
return html `
|
|
535
|
+
<div class="d-flex flex-column">
|
|
536
|
+
${vm.data.web_type
|
|
537
|
+
.map((web_type) => {
|
|
538
|
+
if (webTypeSection[web_type]) {
|
|
539
|
+
return webTypeSection[web_type];
|
|
540
|
+
}
|
|
541
|
+
return ``;
|
|
542
|
+
})
|
|
543
|
+
.filter((item) => item !== '')
|
|
544
|
+
.join(BgWidget.mbContainer(24))}
|
|
545
|
+
${BgWidget.mbContainer(24)}
|
|
546
|
+
</div>
|
|
547
|
+
`;
|
|
548
|
+
},
|
|
549
|
+
divCreate: {},
|
|
550
|
+
});
|
|
551
|
+
}
|
|
201
552
|
const typeMap = {
|
|
202
553
|
basic: () => {
|
|
203
554
|
return html `
|
|
@@ -314,9 +665,11 @@ export class ShoppingInformation {
|
|
|
314
665
|
.shopnex.tw
|
|
315
666
|
</div>
|
|
316
667
|
</div>
|
|
317
|
-
${domainType === 'custom'
|
|
318
|
-
|
|
319
|
-
|
|
668
|
+
${domainType === 'custom'
|
|
669
|
+
? (() => {
|
|
670
|
+
return ``;
|
|
671
|
+
})()
|
|
672
|
+
: ``}
|
|
320
673
|
<div class="d-flex justify-content-end">${BgWidget.save(gvc.event(applyDomain), '申請')}</div>
|
|
321
674
|
</div>
|
|
322
675
|
`, 'guide6-5'),
|
|
@@ -504,14 +857,15 @@ export class ShoppingInformation {
|
|
|
504
857
|
],
|
|
505
858
|
callback: (array) => {
|
|
506
859
|
vm.data.web_type = array;
|
|
860
|
+
gvc.notifyDataChange('web_type');
|
|
507
861
|
},
|
|
508
862
|
type: 'multiple',
|
|
509
863
|
})}
|
|
510
864
|
`);
|
|
511
|
-
return BgWidget.mainCard(html `
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
865
|
+
return (BgWidget.mainCard(html `
|
|
866
|
+
<div class="tx_700">商店類型</div>
|
|
867
|
+
<div class="tx_gray_14">系統將根據您勾選的項目,開放相對應的功能</div>
|
|
868
|
+
${BgWidget.inlineCheckBox({
|
|
515
869
|
title: '',
|
|
516
870
|
gvc,
|
|
517
871
|
def: vm.data.web_type,
|
|
@@ -527,28 +881,28 @@ export class ShoppingInformation {
|
|
|
527
881
|
},
|
|
528
882
|
type: 'multiple',
|
|
529
883
|
})}
|
|
530
|
-
|
|
531
|
-
BgWidget.mbContainer(24)
|
|
532
|
-
+
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
884
|
+
`) +
|
|
885
|
+
BgWidget.mbContainer(24) +
|
|
886
|
+
drawWebTypeSection() +
|
|
887
|
+
BgWidget.mainCard(html `
|
|
888
|
+
<div class="d-flex flex-column " style="gap:18px;">
|
|
889
|
+
<div class="tx_700">商店功能</div>
|
|
890
|
+
${createToggle('啟用 AI 選品', '透過 AI 選品功能,用戶可以使用自然語言描述找到所需商品', 'ai_search')}
|
|
891
|
+
${GlobalUser.getPlan().id > 0
|
|
892
|
+
? createToggle('啟用聊聊功能', '啟用聊聊功能,方便客戶直接於官網前台與您聯繫,並詢問商品詳細內容', 'chat_toggle')
|
|
893
|
+
: ''}
|
|
894
|
+
${createToggle('啟用心願單功能', '方便客戶收藏並管理喜愛的商品清單,隨時查看心儀商品,提升購物體驗與轉換率', 'wishlist')}
|
|
895
|
+
${createToggle('啟用顧客評論功能', '顧客可以對您的商品進行評論', 'customer_comment')}
|
|
896
|
+
${createToggle('啟用 Cookie 聲明', '如需使用廣告追蹤行為,必須啟用 Cookie 聲明,才可發送廣告', 'cookie_check')}
|
|
897
|
+
${createToggle('顯示商品剩餘庫存', '啟用此功能,顧客會在商品頁面看到此商品剩餘的庫存數', 'stock_view')}
|
|
898
|
+
${createToggle('線上商店開放預購商品', '啟用此功能,顧客可以在線上商店的商品無庫存時,進行預購', 'pre_order_status')}
|
|
899
|
+
${createToggle('商品卡片顯示區間價格', '啟用後,若商品有多個規格、不同價位,前台商品卡片將會使用價格區間來顯示,關閉則顯示該商品規格中最低價者', 'interval_price_card')}
|
|
900
|
+
${createToggle('單獨顯示商品特價', '啟用此功能,會將含有特價的商品價格或區間,單獨使用紅字顯示,關閉則採用刪改線的方式呈現特價', 'independent_special_price')}
|
|
901
|
+
${createPickUpModeDialog('取貨號碼', '針對特店取貨功能,開啟取貨號碼功能消費者需告知商家取貨號碼並前往特店取貨')}
|
|
902
|
+
${createCheckoutModeDialog('訂單結算模式', '設定訂單結算模式,可調整顧客累積消費金額、會員等級、數據分析的統計機制')}
|
|
903
|
+
${createInvoiceModeDialog('發票開立時機', '設定發票開立的時機,可在商家想要的時間點,開立並發送訂單發票')}
|
|
904
|
+
</div>
|
|
905
|
+
`));
|
|
552
906
|
},
|
|
553
907
|
global: () => {
|
|
554
908
|
return BgWidget.mainCard(html `
|