ts-glitter 21.3.1 → 21.3.3
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-customer-message.js +4 -2
- package/lowcode/backend-manager/bg-customer-message.ts +4 -2
- package/lowcode/cms-plugin/module/product-excel.js +169 -129
- package/lowcode/cms-plugin/module/product-excel.ts +174 -130
- package/lowcode/cms-plugin/shopping-discount-setting.js +640 -600
- package/lowcode/cms-plugin/shopping-discount-setting.ts +782 -716
- package/lowcode/cms-plugin/shopping-finance-setting.js +372 -407
- package/lowcode/cms-plugin/shopping-finance-setting.ts +918 -968
- package/lowcode/glitter-base/global/language.js +12 -0
- package/lowcode/glitter-base/global/language.ts +12 -0
- package/lowcode/glitter-base/route/api-track.js +2 -2
- package/lowcode/glitter-base/route/api-track.ts +20 -20
- package/lowcode/public-components/checkout/index.js +27 -5
- package/lowcode/public-components/checkout/index.ts +34 -6
- package/lowcode/public-components/headers/header-class.js +13 -18
- package/lowcode/public-components/headers/header-class.ts +16 -20
- package/lowcode/public-components/modules/cart-module.js +6 -0
- package/lowcode/public-components/modules/cart-module.ts +6 -0
- package/lowcode/public-components/product/pd-class.js +1 -3
- package/lowcode/public-components/product/pd-class.ts +1 -3
- package/omr85cp878.json +1 -0
- package/package.json +1 -1
- package/src/api-public/services/checkout-event.js +26 -12
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +34 -12
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/post.js +7 -17
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/shopee.js +7 -17
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +44 -27
- package/src/api-public/services/shopping.js +56 -11
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +125 -58
- package/src/index.js +7 -17
- package/src/index.js.map +1 -1
|
@@ -31,8 +31,8 @@ type ShipmentGroupData = {
|
|
|
31
31
|
const html = String.raw;
|
|
32
32
|
|
|
33
33
|
export class ShoppingFinanceSetting {
|
|
34
|
-
static main(gvc: GVC,pos?:boolean) {
|
|
35
|
-
pos=
|
|
34
|
+
static main(gvc: GVC, pos?: boolean) {
|
|
35
|
+
pos = `${pos}` === 'true';
|
|
36
36
|
const dialog = new ShareDialog(gvc.glitter);
|
|
37
37
|
const saasConfig: { config: any; api: any } = (window.parent as any).saasConfig;
|
|
38
38
|
|
|
@@ -49,7 +49,7 @@ export class ShoppingFinanceSetting {
|
|
|
49
49
|
posBoxId: gvc.glitter.getUUID(),
|
|
50
50
|
offBoxId: gvc.glitter.getUUID(),
|
|
51
51
|
loading: true,
|
|
52
|
-
page: pos ? 'pos':'online',
|
|
52
|
+
page: pos ? 'pos' : 'online',
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
let keyData: any = { payment_info_custom: [] };
|
|
@@ -229,87 +229,115 @@ export class ShoppingFinanceSetting {
|
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
return BgWidget.container(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
${
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
try {
|
|
246
|
-
keyData.off_line_support = keyData.off_line_support ?? {
|
|
247
|
-
line: false,
|
|
248
|
-
atm: false,
|
|
249
|
-
cash_on_delivery: false,
|
|
250
|
-
...keyData.payment_info_custom.map((dd: any) => {
|
|
251
|
-
return {
|
|
252
|
-
[dd.id]: false,
|
|
253
|
-
};
|
|
254
|
-
}),
|
|
255
|
-
};
|
|
232
|
+
return BgWidget.container(
|
|
233
|
+
html`
|
|
234
|
+
${[
|
|
235
|
+
html` <div class="title-container ${pos ? `d-none` : ''}">
|
|
236
|
+
${BgWidget.title('金流設定')}
|
|
237
|
+
<div class="flex-fill"></div>
|
|
238
|
+
</div>`,
|
|
239
|
+
gvc.bindView({
|
|
240
|
+
bind: vm.id,
|
|
241
|
+
view: () => {
|
|
242
|
+
if (vm.loading) {
|
|
243
|
+
return BgWidget.spinner();
|
|
244
|
+
}
|
|
256
245
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
246
|
+
try {
|
|
247
|
+
keyData.off_line_support = keyData.off_line_support ?? {
|
|
248
|
+
line: false,
|
|
249
|
+
atm: false,
|
|
250
|
+
cash_on_delivery: false,
|
|
251
|
+
...keyData.payment_info_custom.map((dd: any) => {
|
|
252
|
+
return {
|
|
253
|
+
[dd.id]: false,
|
|
254
|
+
};
|
|
255
|
+
}),
|
|
256
|
+
};
|
|
266
257
|
|
|
267
|
-
|
|
268
|
-
|
|
258
|
+
Object.keys(keyData.off_line_support).map(key => {
|
|
259
|
+
if (
|
|
260
|
+
['line', 'atm', 'cash_on_delivery'].includes(key) ||
|
|
261
|
+
keyData.payment_info_custom.some((item: any) => item.id === key)
|
|
262
|
+
) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
delete keyData.off_line_support[key];
|
|
266
|
+
});
|
|
269
267
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
h = html` <div class="px-md-0 px-2 mb-2">
|
|
273
|
-
${BgWidget.normalInsignia('透過線上金流,消費者可於線上進行結帳付款')}
|
|
274
|
-
</div>
|
|
275
|
-
<div class="row">
|
|
276
|
-
${PaymentConfig.onlinePay
|
|
277
|
-
.filter(item => item.type !== 'pos')
|
|
278
|
-
.map(dd => {
|
|
279
|
-
keyData[dd.key] = keyData[dd.key] ?? {};
|
|
280
|
-
return html` <div class="col-12 col-xl-3 col-md-4 p-0 p-md-2">
|
|
281
|
-
<div
|
|
282
|
-
class="w-100 position-relative main-card"
|
|
283
|
-
style="padding: 24px 32px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
|
|
284
|
-
>
|
|
285
|
-
<div class="position-absolute fw-500" style="cursor:pointer;right:0px;top:0px;">
|
|
286
|
-
${BgWidget.customButton({
|
|
287
|
-
button: {
|
|
288
|
-
color: 'gray',
|
|
289
|
-
size: 'sm',
|
|
290
|
-
style:`border-top-left-radius: 0px !important;border-bottom-right-radius: 0px !important;`
|
|
291
|
-
},
|
|
292
|
-
text: {
|
|
293
|
-
name: '金流設定',
|
|
294
|
-
},
|
|
295
|
-
event: gvc.event(() => {
|
|
296
|
-
const payData = dd;
|
|
297
|
-
const key_d = structuredClone(keyData[payData.key]);
|
|
268
|
+
let h = '';
|
|
269
|
+
const cloneData = structuredClone(keyData);
|
|
298
270
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
271
|
+
// 線上金流
|
|
272
|
+
if (vm.page === 'online') {
|
|
273
|
+
h = html` <div class="px-md-0 px-2 mb-2">
|
|
274
|
+
${BgWidget.normalInsignia('透過線上金流,消費者可於線上進行結帳付款')}
|
|
275
|
+
</div>
|
|
276
|
+
<div class="row">
|
|
277
|
+
${PaymentConfig.onlinePay
|
|
278
|
+
.filter(item => item.type !== 'pos')
|
|
279
|
+
.map(dd => {
|
|
280
|
+
keyData[dd.key] = keyData[dd.key] ?? {};
|
|
281
|
+
return html` <div class="col-12 col-lg-3 col-md-4 p-0 p-md-2">
|
|
282
|
+
<div
|
|
283
|
+
class="w-100 position-relative main-card"
|
|
284
|
+
style=" background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: inline-flex;"
|
|
285
|
+
>
|
|
286
|
+
|
|
287
|
+
<div
|
|
288
|
+
style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex"
|
|
289
|
+
>
|
|
290
|
+
<div style="min-width: 46px;max-width: 46px;">
|
|
291
|
+
<img src="${dd.img || BgWidget.noImageURL}" />
|
|
292
|
+
</div>
|
|
293
|
+
<div
|
|
294
|
+
style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex"
|
|
295
|
+
>
|
|
296
|
+
<div class="tx_normal">${dd.name}</div>
|
|
297
|
+
<div class="d-flex align-items-center" style="gap:4px;">
|
|
298
|
+
<div class="tx_normal">${keyData[dd.key].toggle ? `開啟` : `關閉`}</div>
|
|
299
|
+
<div class="cursor_pointer form-check form-switch" style="margin-top: 10px;">
|
|
300
|
+
<input
|
|
301
|
+
class="form-check-input"
|
|
302
|
+
type="checkbox"
|
|
303
|
+
onchange="${gvc.event((e, event) => {
|
|
304
|
+
keyData[dd.key].toggle = !keyData[dd.key].toggle;
|
|
305
|
+
saveData();
|
|
306
|
+
})}"
|
|
307
|
+
${keyData[dd.key].toggle ? `checked` : ''}
|
|
308
|
+
/>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
<div class="border-top w-100"></div>
|
|
314
|
+
<div class="w-100 d-flex align-items-center justify-content-end fw-500" style="">
|
|
315
|
+
${BgWidget.customButton({
|
|
316
|
+
button: {
|
|
317
|
+
color: 'gray',
|
|
318
|
+
size: 'sm',
|
|
319
|
+
},
|
|
320
|
+
text: {
|
|
321
|
+
name: '金流設定',
|
|
322
|
+
},
|
|
323
|
+
event: gvc.event(() => {
|
|
324
|
+
const payData = dd;
|
|
325
|
+
const key_d = structuredClone(keyData[payData.key]);
|
|
326
|
+
|
|
327
|
+
BgWidget.settingDialog({
|
|
328
|
+
gvc: gvc,
|
|
329
|
+
title: '金流設定',
|
|
330
|
+
width: 800,
|
|
331
|
+
innerHTML: (gvc: GVC) => {
|
|
332
|
+
try {
|
|
333
|
+
const setting = {
|
|
334
|
+
key: 'setting',
|
|
335
|
+
title: '基本設定',
|
|
336
|
+
html: html` ${BgWidget.editeInput({
|
|
309
337
|
gvc: gvc,
|
|
310
338
|
title: html`<div>
|
|
311
|
-
|
|
312
|
-
|
|
339
|
+
自訂金流名稱 ${BgWidget.grayNote('未輸入則參照預設')}
|
|
340
|
+
</div>`,
|
|
313
341
|
default: key_d.custome_name,
|
|
314
342
|
callback: text => {
|
|
315
343
|
key_d.custome_name = text;
|
|
@@ -317,652 +345,633 @@ export class ShoppingFinanceSetting {
|
|
|
317
345
|
placeHolder: '請輸入自訂顯示名稱',
|
|
318
346
|
global_language: true,
|
|
319
347
|
})}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}),
|
|
373
|
-
array: [
|
|
374
|
-
{
|
|
375
|
-
title: '信用卡',
|
|
376
|
-
value: 'credit',
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
title: '一般 ATM',
|
|
380
|
-
value: 'atm',
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
title: '網路 ATM',
|
|
384
|
-
value: 'web_atm',
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
title: '超商代碼',
|
|
388
|
-
value: 'c_code',
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
title: '超商條碼',
|
|
392
|
-
value: 'c_bar_code',
|
|
393
|
-
},
|
|
394
|
-
],
|
|
395
|
-
callback: (array: any) => {
|
|
396
|
-
['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].map(
|
|
397
|
-
dd => {
|
|
398
|
-
(key_d as any)[dd] = !!array.find((d1: string) => {
|
|
399
|
-
return d1 === dd;
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
);
|
|
403
|
-
},
|
|
404
|
-
type: 'multiple',
|
|
405
|
-
}),
|
|
406
|
-
BgWidget.editeInput({
|
|
407
|
-
gvc: gvc,
|
|
408
|
-
title: '特店編號',
|
|
409
|
-
default: key_d.MERCHANT_ID,
|
|
410
|
-
callback: text => {
|
|
411
|
-
key_d.MERCHANT_ID = text;
|
|
412
|
-
},
|
|
413
|
-
placeHolder: '請輸入特店編號',
|
|
414
|
-
}),
|
|
415
|
-
BgWidget.editeInput({
|
|
416
|
-
gvc: gvc,
|
|
417
|
-
title: 'HASH_KEY',
|
|
418
|
-
default: key_d.HASH_KEY,
|
|
419
|
-
callback: text => {
|
|
420
|
-
key_d.HASH_KEY = text;
|
|
421
|
-
},
|
|
422
|
-
placeHolder: '請輸入HASH_KEY',
|
|
423
|
-
}),
|
|
424
|
-
BgWidget.editeInput({
|
|
425
|
-
gvc: gvc,
|
|
426
|
-
title: 'HASH_IV',
|
|
427
|
-
default: key_d.HASH_IV,
|
|
428
|
-
callback: text => {
|
|
429
|
-
key_d.HASH_IV = text;
|
|
430
|
-
},
|
|
431
|
-
placeHolder: '請輸入HASH_IV',
|
|
348
|
+
<div style="margin-top: 8px;">
|
|
349
|
+
${(() => {
|
|
350
|
+
switch (payData.key) {
|
|
351
|
+
case 'newWebPay':
|
|
352
|
+
case 'ecPay':
|
|
353
|
+
return [
|
|
354
|
+
BgWidget.inlineCheckBox({
|
|
355
|
+
title: '串接路徑',
|
|
356
|
+
gvc: gvc,
|
|
357
|
+
def: key_d.ActionURL,
|
|
358
|
+
array: (() => {
|
|
359
|
+
if (payData.key === 'newWebPay') {
|
|
360
|
+
return [
|
|
361
|
+
{
|
|
362
|
+
title: '正式站',
|
|
363
|
+
value: 'https://core.newebpay.com/MPG/mpg_gateway',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
title: '測試站',
|
|
367
|
+
value: 'https://ccore.newebpay.com/MPG/mpg_gateway',
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
} else {
|
|
371
|
+
return [
|
|
372
|
+
{
|
|
373
|
+
title: '正式站',
|
|
374
|
+
value:
|
|
375
|
+
'https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5',
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
title: '測試站',
|
|
379
|
+
value:
|
|
380
|
+
'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5',
|
|
381
|
+
},
|
|
382
|
+
];
|
|
383
|
+
}
|
|
384
|
+
})(),
|
|
385
|
+
callback: (text: any) => {
|
|
386
|
+
key_d.ActionURL = text;
|
|
387
|
+
},
|
|
388
|
+
}),
|
|
389
|
+
BgWidget.inlineCheckBox({
|
|
390
|
+
title: '開通付款方式',
|
|
391
|
+
gvc: gvc,
|
|
392
|
+
def: [
|
|
393
|
+
'credit',
|
|
394
|
+
'atm',
|
|
395
|
+
'web_atm',
|
|
396
|
+
'c_code',
|
|
397
|
+
'c_bar_code',
|
|
398
|
+
].filter(dd => {
|
|
399
|
+
return (key_d as any)[dd];
|
|
432
400
|
}),
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
callback: text => {
|
|
438
|
-
key_d.CreditCheckCode = text;
|
|
401
|
+
array: [
|
|
402
|
+
{
|
|
403
|
+
title: '信用卡',
|
|
404
|
+
value: 'credit',
|
|
439
405
|
},
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
case 'paypal':
|
|
444
|
-
return [
|
|
445
|
-
BgWidget.inlineCheckBox({
|
|
446
|
-
title: '串接路徑',
|
|
447
|
-
gvc: gvc,
|
|
448
|
-
def: `${key_d.BETA}`,
|
|
449
|
-
array: [
|
|
450
|
-
{
|
|
451
|
-
title: '正式站',
|
|
452
|
-
value: `false`,
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
title: '測試站',
|
|
456
|
-
value: `true`,
|
|
457
|
-
},
|
|
458
|
-
],
|
|
459
|
-
callback: (text: any) => {
|
|
460
|
-
key_d.BETA = text;
|
|
406
|
+
{
|
|
407
|
+
title: '一般 ATM',
|
|
408
|
+
value: 'atm',
|
|
461
409
|
},
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
title: 'CLIENT_ID',
|
|
466
|
-
default: key_d.PAYPAL_CLIENT_ID,
|
|
467
|
-
callback: text => {
|
|
468
|
-
key_d.PAYPAL_CLIENT_ID = text;
|
|
410
|
+
{
|
|
411
|
+
title: '網路 ATM',
|
|
412
|
+
value: 'web_atm',
|
|
469
413
|
},
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
gvc: gvc,
|
|
474
|
-
title: 'SECRET',
|
|
475
|
-
default: key_d.PAYPAL_SECRET,
|
|
476
|
-
callback: text => {
|
|
477
|
-
key_d.PAYPAL_SECRET = text;
|
|
414
|
+
{
|
|
415
|
+
title: '超商代碼',
|
|
416
|
+
value: 'c_code',
|
|
478
417
|
},
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
case 'line_pay':
|
|
483
|
-
return [
|
|
484
|
-
BgWidget.inlineCheckBox({
|
|
485
|
-
title: '串接路徑',
|
|
486
|
-
gvc: gvc,
|
|
487
|
-
def: `${key_d.BETA}`,
|
|
488
|
-
array: [
|
|
489
|
-
{
|
|
490
|
-
title: '正式站',
|
|
491
|
-
value: `false`,
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
title: '測試站',
|
|
495
|
-
value: `true`,
|
|
496
|
-
},
|
|
497
|
-
],
|
|
498
|
-
callback: (text: any) => {
|
|
499
|
-
key_d.BETA = text;
|
|
418
|
+
{
|
|
419
|
+
title: '超商條碼',
|
|
420
|
+
value: 'c_bar_code',
|
|
500
421
|
},
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
422
|
+
],
|
|
423
|
+
callback: (array: any) => {
|
|
424
|
+
['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].map(
|
|
425
|
+
dd => {
|
|
426
|
+
(key_d as any)[dd] = !!array.find((d1: string) => {
|
|
427
|
+
return d1 === dd;
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
},
|
|
432
|
+
type: 'multiple',
|
|
433
|
+
}),
|
|
434
|
+
BgWidget.editeInput({
|
|
435
|
+
gvc: gvc,
|
|
436
|
+
title: '特店編號',
|
|
437
|
+
default: key_d.MERCHANT_ID,
|
|
438
|
+
callback: text => {
|
|
439
|
+
key_d.MERCHANT_ID = text;
|
|
440
|
+
},
|
|
441
|
+
placeHolder: '請輸入特店編號',
|
|
442
|
+
}),
|
|
443
|
+
BgWidget.editeInput({
|
|
444
|
+
gvc: gvc,
|
|
445
|
+
title: 'HASH_KEY',
|
|
446
|
+
default: key_d.HASH_KEY,
|
|
447
|
+
callback: text => {
|
|
448
|
+
key_d.HASH_KEY = text;
|
|
449
|
+
},
|
|
450
|
+
placeHolder: '請輸入HASH_KEY',
|
|
451
|
+
}),
|
|
452
|
+
BgWidget.editeInput({
|
|
453
|
+
gvc: gvc,
|
|
454
|
+
title: 'HASH_IV',
|
|
455
|
+
default: key_d.HASH_IV,
|
|
456
|
+
callback: text => {
|
|
457
|
+
key_d.HASH_IV = text;
|
|
458
|
+
},
|
|
459
|
+
placeHolder: '請輸入HASH_IV',
|
|
460
|
+
}),
|
|
461
|
+
BgWidget.editeInput({
|
|
462
|
+
gvc: gvc,
|
|
463
|
+
title: '信用卡授權檢查碼',
|
|
464
|
+
default: key_d.CreditCheckCode,
|
|
465
|
+
callback: text => {
|
|
466
|
+
key_d.CreditCheckCode = text;
|
|
467
|
+
},
|
|
468
|
+
placeHolder: '請輸入信用卡檢查碼',
|
|
469
|
+
}),
|
|
470
|
+
].join('');
|
|
471
|
+
case 'paypal':
|
|
472
|
+
return [
|
|
473
|
+
BgWidget.inlineCheckBox({
|
|
474
|
+
title: '串接路徑',
|
|
475
|
+
gvc: gvc,
|
|
476
|
+
def: `${key_d.BETA}`,
|
|
477
|
+
array: [
|
|
478
|
+
{
|
|
479
|
+
title: '正式站',
|
|
480
|
+
value: `false`,
|
|
508
481
|
},
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
gvc: gvc,
|
|
513
|
-
title: 'SECRET',
|
|
514
|
-
default: key_d.SECRET,
|
|
515
|
-
callback: text => {
|
|
516
|
-
key_d.SECRET = text;
|
|
482
|
+
{
|
|
483
|
+
title: '測試站',
|
|
484
|
+
value: `true`,
|
|
517
485
|
},
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
486
|
+
],
|
|
487
|
+
callback: (text: any) => {
|
|
488
|
+
key_d.BETA = text;
|
|
489
|
+
},
|
|
490
|
+
}),
|
|
491
|
+
BgWidget.editeInput({
|
|
492
|
+
gvc: gvc,
|
|
493
|
+
title: 'CLIENT_ID',
|
|
494
|
+
default: key_d.PAYPAL_CLIENT_ID,
|
|
495
|
+
callback: text => {
|
|
496
|
+
key_d.PAYPAL_CLIENT_ID = text;
|
|
497
|
+
},
|
|
498
|
+
placeHolder: '請輸入CLIENT_ID',
|
|
499
|
+
}),
|
|
500
|
+
BgWidget.editeInput({
|
|
501
|
+
gvc: gvc,
|
|
502
|
+
title: 'SECRET',
|
|
503
|
+
default: key_d.PAYPAL_SECRET,
|
|
504
|
+
callback: text => {
|
|
505
|
+
key_d.PAYPAL_SECRET = text;
|
|
506
|
+
},
|
|
507
|
+
placeHolder: '請輸入SECRET',
|
|
508
|
+
}),
|
|
509
|
+
].join('');
|
|
510
|
+
case 'line_pay':
|
|
511
|
+
return [
|
|
512
|
+
BgWidget.inlineCheckBox({
|
|
513
|
+
title: '串接路徑',
|
|
514
|
+
gvc: gvc,
|
|
515
|
+
def: `${key_d.BETA}`,
|
|
516
|
+
array: [
|
|
517
|
+
{
|
|
518
|
+
title: '正式站',
|
|
519
|
+
value: `false`,
|
|
529
520
|
},
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
case 'paynow':
|
|
534
|
-
return [
|
|
535
|
-
BgWidget.inlineCheckBox({
|
|
536
|
-
title: '串接路徑',
|
|
537
|
-
gvc: gvc,
|
|
538
|
-
def: `${key_d.BETA}`,
|
|
539
|
-
array: [
|
|
540
|
-
{
|
|
541
|
-
title: '正式站',
|
|
542
|
-
value: `false`,
|
|
543
|
-
},
|
|
544
|
-
{
|
|
545
|
-
title: '測試站',
|
|
546
|
-
value: `true`,
|
|
547
|
-
},
|
|
548
|
-
],
|
|
549
|
-
callback: (text: any) => {
|
|
550
|
-
key_d.BETA = text;
|
|
521
|
+
{
|
|
522
|
+
title: '測試站',
|
|
523
|
+
value: `true`,
|
|
551
524
|
},
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
525
|
+
],
|
|
526
|
+
callback: (text: any) => {
|
|
527
|
+
key_d.BETA = text;
|
|
528
|
+
},
|
|
529
|
+
}),
|
|
530
|
+
BgWidget.editeInput({
|
|
531
|
+
gvc: gvc,
|
|
532
|
+
title: 'CLIENT_ID',
|
|
533
|
+
default: key_d.CLIENT_ID,
|
|
534
|
+
callback: text => {
|
|
535
|
+
key_d.CLIENT_ID = text;
|
|
536
|
+
},
|
|
537
|
+
placeHolder: '請輸入CLIENT_ID',
|
|
538
|
+
}),
|
|
539
|
+
BgWidget.editeInput({
|
|
540
|
+
gvc: gvc,
|
|
541
|
+
title: 'SECRET',
|
|
542
|
+
default: key_d.SECRET,
|
|
543
|
+
callback: text => {
|
|
544
|
+
key_d.SECRET = text;
|
|
545
|
+
},
|
|
546
|
+
placeHolder: '請輸入SECRET',
|
|
547
|
+
}),
|
|
548
|
+
].join('');
|
|
549
|
+
case 'jkopay':
|
|
550
|
+
return [
|
|
551
|
+
BgWidget.editeInput({
|
|
552
|
+
gvc: gvc,
|
|
553
|
+
title: 'STORE_ID',
|
|
554
|
+
default: key_d.STORE_ID,
|
|
555
|
+
callback: text => {
|
|
556
|
+
key_d.STORE_ID = text;
|
|
557
|
+
},
|
|
558
|
+
placeHolder: '請輸入STORE_ID',
|
|
559
|
+
}),
|
|
560
|
+
].join('');
|
|
561
|
+
case 'paynow':
|
|
562
|
+
return [
|
|
563
|
+
BgWidget.inlineCheckBox({
|
|
564
|
+
title: '串接路徑',
|
|
565
|
+
gvc: gvc,
|
|
566
|
+
def: `${key_d.BETA}`,
|
|
567
|
+
array: [
|
|
568
|
+
{
|
|
569
|
+
title: '正式站',
|
|
570
|
+
value: `false`,
|
|
559
571
|
},
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
gvc: gvc,
|
|
564
|
-
title: '串接密碼',
|
|
565
|
-
default: key_d.pwd,
|
|
566
|
-
callback: text => {
|
|
567
|
-
key_d.pwd = text;
|
|
572
|
+
{
|
|
573
|
+
title: '測試站',
|
|
574
|
+
value: `true`,
|
|
568
575
|
},
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
576
|
+
],
|
|
577
|
+
callback: (text: any) => {
|
|
578
|
+
key_d.BETA = text;
|
|
579
|
+
},
|
|
580
|
+
}),
|
|
581
|
+
BgWidget.editeInput({
|
|
582
|
+
gvc: gvc,
|
|
583
|
+
title: '串接帳號',
|
|
584
|
+
default: key_d.account,
|
|
585
|
+
callback: text => {
|
|
586
|
+
key_d.account = text;
|
|
587
|
+
},
|
|
588
|
+
placeHolder: '請輸入串接帳號',
|
|
589
|
+
}),
|
|
590
|
+
BgWidget.editeInput({
|
|
591
|
+
gvc: gvc,
|
|
592
|
+
title: '串接密碼',
|
|
593
|
+
default: key_d.pwd,
|
|
594
|
+
callback: text => {
|
|
595
|
+
key_d.pwd = text;
|
|
596
|
+
},
|
|
597
|
+
placeHolder: '請輸入串接密碼',
|
|
598
|
+
}),
|
|
599
|
+
].join('');
|
|
600
|
+
}
|
|
601
|
+
return '';
|
|
602
|
+
})()}
|
|
603
|
+
</div>`,
|
|
604
|
+
};
|
|
577
605
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
606
|
+
const shipment = {
|
|
607
|
+
key: 'shipment',
|
|
608
|
+
title: '指定物流',
|
|
609
|
+
html: gvc.bindView({
|
|
610
|
+
bind: gvc.glitter.getUUID(),
|
|
611
|
+
view: () => ShoppingFinanceSetting.setShipmentSupport(gvc, key_d),
|
|
612
|
+
}),
|
|
613
|
+
};
|
|
586
614
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
615
|
+
const cartSetting = {
|
|
616
|
+
key: 'cartSetting',
|
|
617
|
+
title: '購物車設定',
|
|
618
|
+
html: gvc.bindView({
|
|
619
|
+
bind: gvc.glitter.getUUID(),
|
|
620
|
+
view: () => ShoppingFinanceSetting.setCartSetting(gvc, key_d),
|
|
621
|
+
}),
|
|
622
|
+
};
|
|
595
623
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
624
|
+
return ShoppingFinanceSetting.tabView(gvc, [setting, shipment, cartSetting]);
|
|
625
|
+
} catch (e) {
|
|
626
|
+
console.error(e);
|
|
627
|
+
return `${e}`;
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
footer_html: gvc => {
|
|
631
|
+
return [
|
|
632
|
+
BgWidget.cancel(
|
|
633
|
+
gvc.event(() => {
|
|
634
|
+
keyData = cloneData;
|
|
635
|
+
gvc.closeDialog();
|
|
636
|
+
})
|
|
637
|
+
),
|
|
638
|
+
BgWidget.save(
|
|
639
|
+
gvc.event(() => {
|
|
640
|
+
//綠界支付的測試版切換
|
|
641
|
+
if (
|
|
642
|
+
payData.key == 'ecPay' &&
|
|
643
|
+
key_d.ActionURL ==
|
|
644
|
+
'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5'
|
|
645
|
+
) {
|
|
646
|
+
key_d.MERCHANT_ID = '3002607';
|
|
647
|
+
key_d.HASH_KEY = 'pwFHCqoQZGmho4w6';
|
|
648
|
+
key_d.HASH_IV = 'EkRm7iFT261dpevs';
|
|
649
|
+
}
|
|
650
|
+
keyData[payData.key] = key_d;
|
|
651
|
+
saveData();
|
|
652
|
+
gvc.closeDialog();
|
|
653
|
+
})
|
|
654
|
+
),
|
|
655
|
+
].join('');
|
|
656
|
+
},
|
|
657
|
+
closeCallback: () => {
|
|
658
|
+
keyData = cloneData;
|
|
659
|
+
},
|
|
660
|
+
});
|
|
661
|
+
}),
|
|
662
|
+
})}
|
|
663
|
+
</div>
|
|
631
664
|
</div>
|
|
665
|
+
|
|
666
|
+
</div>`;
|
|
667
|
+
})
|
|
668
|
+
.join('')}
|
|
669
|
+
</div>`;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// 線下金流
|
|
673
|
+
if (vm.page === 'offline') {
|
|
674
|
+
const offlinePayArray = [
|
|
675
|
+
// 系統線下金流
|
|
676
|
+
...PaymentConfig.defalutOfflinePay,
|
|
677
|
+
// 自訂線下金流
|
|
678
|
+
...keyData.payment_info_custom.map((dd: any) => {
|
|
679
|
+
return {
|
|
680
|
+
key: dd.id,
|
|
681
|
+
name: html`${Language.getLanguageCustomText(dd.name)}`,
|
|
682
|
+
custom: true,
|
|
683
|
+
};
|
|
684
|
+
}),
|
|
685
|
+
];
|
|
686
|
+
|
|
687
|
+
h = html` <div class="px-md-0 px-2 mb-2">
|
|
688
|
+
${BgWidget.normalInsignia(
|
|
689
|
+
'透過設定線下金流,結帳後訂單將進入手動核款的流程,亦可使用超商取貨付款'
|
|
690
|
+
)}
|
|
691
|
+
</div>
|
|
692
|
+
<div class="row">
|
|
693
|
+
${offlinePayArray
|
|
694
|
+
.map((dd: any) => {
|
|
695
|
+
return html` <div class="col-12 col-lg-3 col-md-4 p-0 p-md-2">
|
|
632
696
|
<div
|
|
633
|
-
|
|
697
|
+
class="w-100 position-relative main-card"
|
|
698
|
+
style=" background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start;gap:10px; display: inline-flex;"
|
|
634
699
|
>
|
|
635
|
-
<div style="min-width: 46px;max-width: 46px;">
|
|
636
|
-
<img src="${dd.img || BgWidget.noImageURL}" />
|
|
637
|
-
</div>
|
|
638
700
|
<div
|
|
639
|
-
style="
|
|
701
|
+
style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex"
|
|
640
702
|
>
|
|
641
|
-
<div
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
${keyData[dd.key]
|
|
653
|
-
|
|
703
|
+
<div style="min-width: 46px;max-width: 46px;">
|
|
704
|
+
${dd.img
|
|
705
|
+
? html`<img class="rounded-2" src="${dd.img}" />`
|
|
706
|
+
: html`<i class="fa-regular fa-puzzle-piece-simple fs-4" aria-hidden="true"></i>`}
|
|
707
|
+
</div>
|
|
708
|
+
<div
|
|
709
|
+
style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex"
|
|
710
|
+
>
|
|
711
|
+
<div class="tx_normal">${dd.name}</div>
|
|
712
|
+
<div class="d-flex align-items-center" style="gap:4px;">
|
|
713
|
+
<div class="tx_normal">
|
|
714
|
+
${(keyData.off_line_support as any)[dd.key] ? `開啟` : `關閉`}
|
|
715
|
+
</div>
|
|
716
|
+
<div class="cursor_pointer form-check form-switch" style="margin-top: 10px;">
|
|
717
|
+
<input
|
|
718
|
+
class="form-check-input"
|
|
719
|
+
type="checkbox"
|
|
720
|
+
onchange="${gvc.event((e, event) => {
|
|
721
|
+
(keyData.off_line_support as any)[dd.key] = !(
|
|
722
|
+
keyData.off_line_support as any
|
|
723
|
+
)[dd.key];
|
|
724
|
+
saveData();
|
|
725
|
+
})}"
|
|
726
|
+
${(keyData.off_line_support as any)[dd.key] ? `checked` : ''}
|
|
727
|
+
/>
|
|
728
|
+
</div>
|
|
654
729
|
</div>
|
|
655
730
|
</div>
|
|
656
731
|
</div>
|
|
657
|
-
|
|
658
|
-
</div>
|
|
659
|
-
</div>`;
|
|
660
|
-
})
|
|
661
|
-
.join('')}
|
|
662
|
-
</div>`;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
// 線下金流
|
|
666
|
-
if (vm.page === 'offline') {
|
|
667
|
-
const offlinePayArray = [
|
|
668
|
-
// 系統線下金流
|
|
669
|
-
...PaymentConfig.defalutOfflinePay,
|
|
670
|
-
// 自訂線下金流
|
|
671
|
-
...keyData.payment_info_custom.map((dd: any) => {
|
|
672
|
-
return {
|
|
673
|
-
key: dd.id,
|
|
674
|
-
name: html`${Language.getLanguageCustomText(dd.name)}`,
|
|
675
|
-
custom: true,
|
|
676
|
-
};
|
|
677
|
-
}),
|
|
678
|
-
];
|
|
679
|
-
|
|
680
|
-
h = html` <div class="px-md-0 px-2 mb-2">
|
|
681
|
-
${BgWidget.normalInsignia('透過設定線下金流,結帳後訂單將進入手動核款的流程,亦可使用超商取貨付款')}
|
|
682
|
-
</div>
|
|
683
|
-
<div class="row">
|
|
684
|
-
${offlinePayArray
|
|
685
|
-
.map((dd: any) => {
|
|
686
|
-
return html` <div class="col-12 col-xl-3 col-md-4 p-0 p-md-2">
|
|
687
|
-
<div
|
|
688
|
-
class="w-100 position-relative main-card"
|
|
689
|
-
style="padding: 24px 32px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
|
|
690
|
-
>
|
|
691
|
-
<div
|
|
692
|
-
class="position-absolute fw-500 ${dd.hide_setting ? `d-none` : ``}"
|
|
693
|
-
style="cursor:pointer;right:0px;top:0px;"
|
|
694
|
-
>
|
|
695
|
-
${BgWidget.customButton({
|
|
696
|
-
button: {
|
|
697
|
-
color: 'gray',
|
|
698
|
-
size: 'sm',
|
|
699
|
-
style:`border-top-left-radius: 0px !important;border-bottom-right-radius: 0px !important;`
|
|
700
|
-
},
|
|
701
|
-
text: {
|
|
702
|
-
name: '金流設定',
|
|
703
|
-
},
|
|
704
|
-
event: gvc.event(() => {
|
|
705
|
-
if (dd.custom) {
|
|
706
|
-
updateCustomFinance({
|
|
707
|
-
function: 'replace',
|
|
708
|
-
data: keyData.payment_info_custom.find((d1: any) => dd.key === d1.id),
|
|
709
|
-
});
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
BgWidget.settingDialog({
|
|
714
|
-
gvc: gvc,
|
|
715
|
-
title: '金流設定',
|
|
716
|
-
width: 800,
|
|
717
|
-
innerHTML: gvc => {
|
|
718
|
-
const keyMap: Record<string, string> = {
|
|
719
|
-
atm: this.atm(gvc, keyData),
|
|
720
|
-
line: this.lineIPassMoney(gvc, keyData),
|
|
721
|
-
cash_on_delivery: this.cashOnDelivery(gvc, keyData),
|
|
722
|
-
};
|
|
723
|
-
return html`<div>${keyMap[dd.key] || ''}</div>`;
|
|
724
|
-
},
|
|
725
|
-
footer_html: gvc => {
|
|
726
|
-
return [
|
|
727
|
-
BgWidget.cancel(
|
|
728
|
-
gvc.event(() => {
|
|
729
|
-
keyData = cloneData;
|
|
730
|
-
gvc.closeDialog();
|
|
731
|
-
})
|
|
732
|
-
),
|
|
733
|
-
BgWidget.save(
|
|
734
|
-
gvc.event(() => {
|
|
735
|
-
saveData();
|
|
736
|
-
gvc.closeDialog();
|
|
737
|
-
})
|
|
738
|
-
),
|
|
739
|
-
].join('');
|
|
740
|
-
},
|
|
741
|
-
closeCallback: () => {
|
|
742
|
-
keyData = cloneData;
|
|
743
|
-
},
|
|
744
|
-
});
|
|
745
|
-
}),
|
|
746
|
-
})}
|
|
747
|
-
</div>
|
|
748
|
-
<div
|
|
749
|
-
style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex"
|
|
750
|
-
>
|
|
751
|
-
<div style="min-width: 46px;max-width: 46px;">
|
|
752
|
-
${dd.img
|
|
753
|
-
? html` <img class="rounded-2" src="${dd.img}" />`
|
|
754
|
-
: html`<i class="fa-regular fa-puzzle-piece-simple fs-4" aria-hidden="true"></i>`}
|
|
755
|
-
</div>
|
|
732
|
+
<div class="border-top w-100"></div>
|
|
756
733
|
<div
|
|
757
|
-
|
|
734
|
+
class=" w-100 d-flex align-items-center justify-content-end fw-500 ${dd.hide_setting ? `d-none` : ''}"
|
|
735
|
+
style=""
|
|
758
736
|
>
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
737
|
+
${BgWidget.customButton({
|
|
738
|
+
button: {
|
|
739
|
+
color: 'gray',
|
|
740
|
+
size: 'sm',
|
|
741
|
+
},
|
|
742
|
+
text: {
|
|
743
|
+
name: '金流設定',
|
|
744
|
+
},
|
|
745
|
+
event: gvc.event(() => {
|
|
746
|
+
if (dd.custom) {
|
|
747
|
+
updateCustomFinance({
|
|
748
|
+
function: 'replace',
|
|
749
|
+
data: keyData.payment_info_custom.find((d1: any) => dd.key === d1.id),
|
|
750
|
+
});
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
BgWidget.settingDialog({
|
|
755
|
+
gvc: gvc,
|
|
756
|
+
title: '金流設定',
|
|
757
|
+
width: 800,
|
|
758
|
+
innerHTML: gvc => {
|
|
759
|
+
const keyMap: Record<string, string> = {
|
|
760
|
+
atm: this.atm(gvc, keyData),
|
|
761
|
+
line: this.lineIPassMoney(gvc, keyData),
|
|
762
|
+
cash_on_delivery: this.cashOnDelivery(gvc, keyData),
|
|
763
|
+
};
|
|
764
|
+
return html`<div>${keyMap[dd.key] || ''}</div>`;
|
|
765
|
+
},
|
|
766
|
+
footer_html: gvc => {
|
|
767
|
+
return [
|
|
768
|
+
BgWidget.cancel(
|
|
769
|
+
gvc.event(() => {
|
|
770
|
+
keyData = cloneData;
|
|
771
|
+
gvc.closeDialog();
|
|
772
|
+
})
|
|
773
|
+
),
|
|
774
|
+
BgWidget.save(
|
|
775
|
+
gvc.event(() => {
|
|
776
|
+
saveData();
|
|
777
|
+
gvc.closeDialog();
|
|
778
|
+
})
|
|
779
|
+
),
|
|
780
|
+
].join('');
|
|
781
|
+
},
|
|
782
|
+
closeCallback: () => {
|
|
783
|
+
keyData = cloneData;
|
|
784
|
+
},
|
|
785
|
+
});
|
|
786
|
+
}),
|
|
787
|
+
})}
|
|
778
788
|
</div>
|
|
779
789
|
</div>
|
|
780
|
-
</div
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
.join('')}
|
|
784
|
-
<div
|
|
785
|
-
class="col-12 col-xl-3 col-md-4 p-0 p-md-2"
|
|
786
|
-
style="cursor: pointer;"
|
|
787
|
-
onclick="${gvc.event(() => {
|
|
788
|
-
updateCustomFinance({ function: 'plus' });
|
|
789
|
-
})}"
|
|
790
|
-
>
|
|
790
|
+
</div>`;
|
|
791
|
+
})
|
|
792
|
+
.join('')}
|
|
791
793
|
<div
|
|
792
|
-
class="
|
|
793
|
-
style="
|
|
794
|
+
class="col-12 col-lg-3 col-md-4 p-0 p-md-2"
|
|
795
|
+
style="cursor: pointer;"
|
|
796
|
+
onclick="${gvc.event(() => {
|
|
797
|
+
updateCustomFinance({ function: 'plus' });
|
|
798
|
+
})}"
|
|
794
799
|
>
|
|
795
800
|
<div
|
|
796
|
-
class="
|
|
797
|
-
style="
|
|
801
|
+
class="w-100 main-card"
|
|
802
|
+
style="min-height:119.09px;padding: 24px; background: white; overflow: hidden; flex-direction: column; justify-content: center; align-items: center; gap: 18px; display: inline-flex"
|
|
798
803
|
>
|
|
799
|
-
<
|
|
800
|
-
|
|
804
|
+
<div
|
|
805
|
+
class="fw-bold"
|
|
806
|
+
style="align-self: stretch; justify-content: center; align-items: center; gap: 14px; display: inline-flex;color:#4D86DB;"
|
|
807
|
+
>
|
|
808
|
+
<i class="fa-regular fa-circle-plus fs-5"></i>
|
|
809
|
+
<div class="fs-5">新增自訂付款</div>
|
|
810
|
+
</div>
|
|
801
811
|
</div>
|
|
802
812
|
</div>
|
|
803
|
-
</div
|
|
804
|
-
|
|
805
|
-
}
|
|
813
|
+
</div>`;
|
|
814
|
+
}
|
|
806
815
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
816
|
+
// POS
|
|
817
|
+
if (vm.page === 'pos') {
|
|
818
|
+
h = html`<div class="px-md-0 px-2 mb-2">
|
|
819
|
+
${BgWidget.normalInsignia('設定實體店面所需串接的付款方式')}
|
|
820
|
+
</div>
|
|
821
|
+
<div class="row">
|
|
822
|
+
${PaymentConfig.onlinePay
|
|
823
|
+
.filter(item => item.type === 'pos')
|
|
824
|
+
.map(dd => {
|
|
825
|
+
return html` <div class="col-12 col-lg-3 col-md-4 p-0 p-md-2">
|
|
826
|
+
<div
|
|
827
|
+
class="w-100 position-relative main-card"
|
|
828
|
+
style=" background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: inline-flex;"
|
|
829
|
+
>
|
|
830
|
+
<div
|
|
831
|
+
style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex"
|
|
832
|
+
>
|
|
833
|
+
<div style="min-width: 46px;max-width: 46px;">
|
|
834
|
+
<img src="${dd.img || BgWidget.noImageURL}" />
|
|
835
|
+
</div>
|
|
836
|
+
<div
|
|
837
|
+
style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex"
|
|
838
|
+
>
|
|
839
|
+
<div class="tx_normal">${dd.name}</div>
|
|
840
|
+
<div class="d-flex align-items-center" style="gap:4px;">
|
|
841
|
+
<div class="tx_normal">${keyData[dd.key].toggle ? `開啟` : `關閉`}</div>
|
|
842
|
+
<div class="cursor_pointer form-check form-switch" style="margin-top: 10px;">
|
|
843
|
+
<input
|
|
844
|
+
class="form-check-input"
|
|
845
|
+
type="checkbox"
|
|
846
|
+
onchange="${gvc.event(() => {
|
|
847
|
+
keyData[dd.key].toggle = !keyData[dd.key].toggle;
|
|
848
|
+
saveData();
|
|
849
|
+
})}"
|
|
850
|
+
${keyData[dd.key].toggle ? `checked` : ''}
|
|
851
|
+
/>
|
|
852
|
+
</div>
|
|
853
|
+
</div>
|
|
854
|
+
</div>
|
|
855
|
+
</div>
|
|
856
|
+
<div class="border-top w-100"></div>
|
|
857
|
+
<div class="w-100 d-flex align-items-center justify-content-end fw-500" style="cursor:pointer;">
|
|
858
|
+
${BgWidget.customButton({
|
|
859
|
+
button: {
|
|
860
|
+
color: 'gray',
|
|
861
|
+
size: 'sm',
|
|
862
|
+
},
|
|
863
|
+
text: {
|
|
864
|
+
name: '金流設定',
|
|
865
|
+
},
|
|
866
|
+
event: gvc.event(() => {
|
|
867
|
+
const payData = dd;
|
|
868
|
+
const key_d = structuredClone(keyData[payData.key]);
|
|
869
|
+
BgWidget.settingDialog({
|
|
870
|
+
gvc: gvc,
|
|
871
|
+
title: '金流設定',
|
|
872
|
+
width: 800,
|
|
873
|
+
innerHTML: (gvc: GVC) => {
|
|
874
|
+
try {
|
|
875
|
+
return html`<div>
|
|
876
|
+
${(() => {
|
|
842
877
|
switch (payData.key) {
|
|
843
878
|
case 'line_pay_scan':
|
|
844
879
|
return this.linePayScan(gvc, key_d);
|
|
845
880
|
case 'ut_credit_card':
|
|
846
881
|
return this.utCreditCard(gvc, key_d);
|
|
847
|
-
// case 'my_pay':
|
|
848
|
-
// return this.myPayPos(gvc, key_d);
|
|
849
882
|
}
|
|
850
|
-
return
|
|
883
|
+
return '';
|
|
851
884
|
})()}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
</div>
|
|
882
|
-
<div
|
|
883
|
-
style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex"
|
|
884
|
-
>
|
|
885
|
-
<div style="min-width: 46px;max-width: 46px;">
|
|
886
|
-
<img src="${dd.img || BgWidget.noImageURL}" />
|
|
887
|
-
</div>
|
|
888
|
-
<div
|
|
889
|
-
style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex"
|
|
890
|
-
>
|
|
891
|
-
<div class="tx_normal">${dd.name}</div>
|
|
892
|
-
<div class="d-flex align-items-center" style="gap:4px;">
|
|
893
|
-
<div class="tx_normal">${keyData[dd.key].toggle ? `開啟` : `關閉`}</div>
|
|
894
|
-
<div class="cursor_pointer form-check form-switch" style="margin-top: 10px;">
|
|
895
|
-
<input
|
|
896
|
-
class="form-check-input"
|
|
897
|
-
type="checkbox"
|
|
898
|
-
onchange="${gvc.event(() => {
|
|
899
|
-
keyData[dd.key].toggle = !keyData[dd.key].toggle;
|
|
900
|
-
saveData();
|
|
901
|
-
})}"
|
|
902
|
-
${keyData[dd.key].toggle ? `checked` : ``}
|
|
903
|
-
/>
|
|
904
|
-
</div>
|
|
905
|
-
</div>
|
|
885
|
+
</div>`;
|
|
886
|
+
} catch (error) {
|
|
887
|
+
console.error(error);
|
|
888
|
+
return '';
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
footer_html: gvc => {
|
|
892
|
+
return [
|
|
893
|
+
BgWidget.cancel(
|
|
894
|
+
gvc.event(() => {
|
|
895
|
+
keyData = cloneData;
|
|
896
|
+
gvc.closeDialog();
|
|
897
|
+
})
|
|
898
|
+
),
|
|
899
|
+
BgWidget.save(
|
|
900
|
+
gvc.event(() => {
|
|
901
|
+
keyData[payData.key] = key_d;
|
|
902
|
+
saveData();
|
|
903
|
+
gvc.closeDialog();
|
|
904
|
+
})
|
|
905
|
+
),
|
|
906
|
+
].join('');
|
|
907
|
+
},
|
|
908
|
+
closeCallback: () => {
|
|
909
|
+
keyData = cloneData;
|
|
910
|
+
},
|
|
911
|
+
});
|
|
912
|
+
}),
|
|
913
|
+
})}
|
|
906
914
|
</div>
|
|
907
915
|
</div>
|
|
908
|
-
</div
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
}
|
|
916
|
+
</div>`;
|
|
917
|
+
})
|
|
918
|
+
.join('')}
|
|
919
|
+
</div>`;
|
|
920
|
+
}
|
|
914
921
|
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
922
|
+
return [
|
|
923
|
+
pos
|
|
924
|
+
? ''
|
|
925
|
+
: BgWidget.tab(
|
|
926
|
+
[
|
|
927
|
+
{ key: 'online', title: '線上金流' },
|
|
928
|
+
{ key: 'offline', title: '線下金流' },
|
|
929
|
+
],
|
|
930
|
+
gvc,
|
|
931
|
+
vm.page,
|
|
932
|
+
(key: any) => {
|
|
933
|
+
vm.page = key;
|
|
934
|
+
gvc.notifyDataChange(vm.id);
|
|
935
|
+
}
|
|
936
|
+
),
|
|
937
|
+
h,
|
|
938
|
+
].join('');
|
|
939
|
+
} catch (e) {
|
|
940
|
+
console.error(e);
|
|
941
|
+
return `${e}`;
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
onCreate: () => {
|
|
945
|
+
if (vm.loading) {
|
|
946
|
+
return new Promise<void>(async resolve => {
|
|
947
|
+
const data = await saasConfig.api.getPrivateConfig(saasConfig.config.appName, 'glitter_finance');
|
|
948
|
+
if (data.response.result[0]) {
|
|
949
|
+
keyData = {
|
|
950
|
+
...keyData,
|
|
951
|
+
...data.response.result[0].value,
|
|
952
|
+
};
|
|
927
953
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
vm.loading = false;
|
|
950
|
-
gvc.notifyDataChange(vm.id);
|
|
951
|
-
});
|
|
952
|
-
} else {
|
|
953
|
-
const handleBeforeUnload = (e: any) => {
|
|
954
|
-
e.preventDefault();
|
|
955
|
-
e.returnValue = '您確定要離開金流設定嗎?您將會失去未儲存的更改';
|
|
956
|
-
};
|
|
957
|
-
(window.parent as any).document.addEventListener('beforeunload', handleBeforeUnload);
|
|
958
|
-
}
|
|
959
|
-
},
|
|
960
|
-
}),
|
|
961
|
-
].join('')}
|
|
962
|
-
${pos ? ``:BgWidget.mbContainer(240)}
|
|
963
|
-
`,{
|
|
964
|
-
style: pos ? `margin-top: 0px !important;` : ``,
|
|
965
|
-
});
|
|
954
|
+
resolve();
|
|
955
|
+
}).then(() => {
|
|
956
|
+
vm.loading = false;
|
|
957
|
+
gvc.notifyDataChange(vm.id);
|
|
958
|
+
});
|
|
959
|
+
} else {
|
|
960
|
+
const handleBeforeUnload = (e: any) => {
|
|
961
|
+
e.preventDefault();
|
|
962
|
+
e.returnValue = '您確定要離開金流設定嗎?您將會失去未儲存的更改';
|
|
963
|
+
};
|
|
964
|
+
(window.parent as any).document.addEventListener('beforeunload', handleBeforeUnload);
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
}),
|
|
968
|
+
].join('')}
|
|
969
|
+
${pos ? '' : BgWidget.mbContainer(240)}
|
|
970
|
+
`,
|
|
971
|
+
{
|
|
972
|
+
style: pos ? `margin-top: 0px !important;` : '',
|
|
973
|
+
}
|
|
974
|
+
);
|
|
966
975
|
}
|
|
967
976
|
|
|
968
977
|
// 分頁模組
|
|
@@ -1135,6 +1144,7 @@ export class ShoppingFinanceSetting {
|
|
|
1135
1144
|
data.cartSetting = {
|
|
1136
1145
|
minimumTotal: 0,
|
|
1137
1146
|
maximumTotal: 0,
|
|
1147
|
+
freeShipmnetTarget: 0,
|
|
1138
1148
|
orderFormula: [],
|
|
1139
1149
|
...(data.cartSetting ?? {}),
|
|
1140
1150
|
};
|
|
@@ -1150,13 +1160,17 @@ export class ShoppingFinanceSetting {
|
|
|
1150
1160
|
);
|
|
1151
1161
|
}
|
|
1152
1162
|
|
|
1153
|
-
function checkTotalNumber(text: string, type: 'min' | 'max') {
|
|
1163
|
+
function checkTotalNumber(text: string, type: 'min' | 'max' | 'freeShipmnet') {
|
|
1154
1164
|
const n = parseInt(`${text}`, 10);
|
|
1155
1165
|
if (isNaN(n) || n < 0) {
|
|
1156
1166
|
dialog.errorMessage({ text: '請輸入正整數' });
|
|
1157
1167
|
gvc.notifyDataChange(id);
|
|
1158
1168
|
}
|
|
1159
1169
|
|
|
1170
|
+
if (type === 'freeShipmnet') {
|
|
1171
|
+
data.cartSetting.freeShipmnetTarget = n;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1160
1174
|
if (type === 'min') {
|
|
1161
1175
|
if (data.cartSetting.maximumTotal !== 0 && n > data.cartSetting.maximumTotal) {
|
|
1162
1176
|
dialog.errorMessage({ text: '數值需小於最高消費金額' });
|
|
@@ -1247,6 +1261,20 @@ export class ShoppingFinanceSetting {
|
|
|
1247
1261
|
},
|
|
1248
1262
|
placeHolder: '請輸入金額',
|
|
1249
1263
|
}),
|
|
1264
|
+
BgWidget.horizontalLine(),
|
|
1265
|
+
BgWidget.editeInput({
|
|
1266
|
+
gvc: gvc,
|
|
1267
|
+
title: html`<div class="d-flex align-items-center mt-2 gap-2">
|
|
1268
|
+
<div style="white-space: break-spaces;">達指定消費金額,訂單免運費(輸入0則不設定此功能)</div>
|
|
1269
|
+
${questionDialog(html`訂單中「所有商品小計(A)」若達到輸入的指定值,使用此物流則免運`)}
|
|
1270
|
+
</div>`,
|
|
1271
|
+
default: `${data.cartSetting.freeShipmnetTarget}`,
|
|
1272
|
+
type: 'number',
|
|
1273
|
+
callback: text => {
|
|
1274
|
+
checkTotalNumber(text, 'freeShipmnet');
|
|
1275
|
+
},
|
|
1276
|
+
placeHolder: '請輸入金額',
|
|
1277
|
+
}),
|
|
1250
1278
|
].join('');
|
|
1251
1279
|
},
|
|
1252
1280
|
});
|
|
@@ -1763,7 +1791,7 @@ export class ShoppingFinanceSetting {
|
|
|
1763
1791
|
let form: any = undefined;
|
|
1764
1792
|
BgWidget.settingDialog({
|
|
1765
1793
|
gvc: gvc,
|
|
1766
|
-
title: '新增自訂物流',
|
|
1794
|
+
title: custom_delivery.name ? `「${custom_delivery.name}」自訂表單設定` : '新增自訂物流',
|
|
1767
1795
|
innerHTML: gvc => {
|
|
1768
1796
|
form = BgWidget.customForm(gvc, [
|
|
1769
1797
|
{
|
|
@@ -1822,8 +1850,6 @@ export class ShoppingFinanceSetting {
|
|
|
1822
1850
|
form.view,
|
|
1823
1851
|
].join(BgWidget.mbContainer(12));
|
|
1824
1852
|
},
|
|
1825
|
-
divCreate: {},
|
|
1826
|
-
onCreate: () => {},
|
|
1827
1853
|
};
|
|
1828
1854
|
})()
|
|
1829
1855
|
);
|
|
@@ -1912,7 +1938,7 @@ export class ShoppingFinanceSetting {
|
|
|
1912
1938
|
)
|
|
1913
1939
|
.map(dd => {
|
|
1914
1940
|
return html`
|
|
1915
|
-
<div class="col-12 col-
|
|
1941
|
+
<div class="col-12 col-lg-4 col-md-6 p-0 p-md-2">
|
|
1916
1942
|
<div
|
|
1917
1943
|
class="w-100 position-relative main-card"
|
|
1918
1944
|
style="padding: 24px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
|
|
@@ -1954,7 +1980,7 @@ export class ShoppingFinanceSetting {
|
|
|
1954
1980
|
return dd.value === d1;
|
|
1955
1981
|
})
|
|
1956
1982
|
? `checked`
|
|
1957
|
-
:
|
|
1983
|
+
: ''}
|
|
1958
1984
|
/>
|
|
1959
1985
|
</div>
|
|
1960
1986
|
</div>
|
|
@@ -1969,7 +1995,7 @@ export class ShoppingFinanceSetting {
|
|
|
1969
1995
|
size: 'sm',
|
|
1970
1996
|
},
|
|
1971
1997
|
text: {
|
|
1972
|
-
name:
|
|
1998
|
+
name: html`<i class="fa-regular fa-gear me-1"></i>配送`,
|
|
1973
1999
|
},
|
|
1974
2000
|
event: gvc.event(async () => {
|
|
1975
2001
|
const log_config = (
|
|
@@ -1981,7 +2007,7 @@ export class ShoppingFinanceSetting {
|
|
|
1981
2007
|
).response.value;
|
|
1982
2008
|
BgWidget.settingDialog({
|
|
1983
2009
|
gvc: gvc,
|
|
1984
|
-
title:
|
|
2010
|
+
title: `「${dd.title}」配送設定`,
|
|
1985
2011
|
innerHTML: gvc => {
|
|
1986
2012
|
const view: string[] = [];
|
|
1987
2013
|
if (
|
|
@@ -2011,7 +2037,7 @@ export class ShoppingFinanceSetting {
|
|
|
2011
2037
|
log_config.bulk = !log_config.bulk;
|
|
2012
2038
|
gvc.recreateView();
|
|
2013
2039
|
})}"
|
|
2014
|
-
${log_config.bulk ? `checked` :
|
|
2040
|
+
${log_config.bulk ? `checked` : ''}
|
|
2015
2041
|
/>
|
|
2016
2042
|
</div>
|
|
2017
2043
|
</div>
|
|
@@ -2072,7 +2098,7 @@ export class ShoppingFinanceSetting {
|
|
|
2072
2098
|
size: 'sm',
|
|
2073
2099
|
},
|
|
2074
2100
|
text: {
|
|
2075
|
-
name:
|
|
2101
|
+
name: html`<i class="fa-regular fa-gear me-1"></i>購物車`,
|
|
2076
2102
|
},
|
|
2077
2103
|
event: gvc.event(async () => {
|
|
2078
2104
|
const vm = {
|
|
@@ -2083,7 +2109,7 @@ export class ShoppingFinanceSetting {
|
|
|
2083
2109
|
|
|
2084
2110
|
BgWidget.settingDialog({
|
|
2085
2111
|
gvc: gvc,
|
|
2086
|
-
title:
|
|
2112
|
+
title: `「${dd.title}」購物車設定`,
|
|
2087
2113
|
innerHTML: gvc => {
|
|
2088
2114
|
return gvc.bindView({
|
|
2089
2115
|
bind: id,
|
|
@@ -2098,7 +2124,6 @@ export class ShoppingFinanceSetting {
|
|
|
2098
2124
|
);
|
|
2099
2125
|
}
|
|
2100
2126
|
},
|
|
2101
|
-
divCreate: {},
|
|
2102
2127
|
onCreate: async () => {
|
|
2103
2128
|
if (vm.loading) {
|
|
2104
2129
|
const r = await ApiUser.getPublicConfig(
|
|
@@ -2141,15 +2166,63 @@ export class ShoppingFinanceSetting {
|
|
|
2141
2166
|
}),
|
|
2142
2167
|
];
|
|
2143
2168
|
|
|
2169
|
+
const shipment_fee = () => {
|
|
2170
|
+
return BgWidget.customButton({
|
|
2171
|
+
button: {
|
|
2172
|
+
color: 'gray',
|
|
2173
|
+
size: 'sm',
|
|
2174
|
+
},
|
|
2175
|
+
text: {
|
|
2176
|
+
name: html`<i class="fa-regular fa-gear me-1"></i>運費`,
|
|
2177
|
+
},
|
|
2178
|
+
event: gvc.event(() => {
|
|
2179
|
+
const vm = {
|
|
2180
|
+
gvc: gvc,
|
|
2181
|
+
key: dd.value,
|
|
2182
|
+
save_event: () => {
|
|
2183
|
+
return new Promise(resolve => resolve(true));
|
|
2184
|
+
},
|
|
2185
|
+
};
|
|
2186
|
+
BgWidget.settingDialog({
|
|
2187
|
+
gvc: gvc,
|
|
2188
|
+
width: 1200,
|
|
2189
|
+
height: document.body.clientHeight - 100,
|
|
2190
|
+
title: `「${dd.title}」運費設定`,
|
|
2191
|
+
d_main_style:
|
|
2192
|
+
document.body.clientWidth < 768 ? 'padding:0px !important;' : '',
|
|
2193
|
+
innerHTML: (gvc: GVC) => {
|
|
2194
|
+
vm.gvc = gvc;
|
|
2195
|
+
return ShoppingShipmentSetting.main(vm);
|
|
2196
|
+
},
|
|
2197
|
+
footer_html: gvc => {
|
|
2198
|
+
return [
|
|
2199
|
+
BgWidget.cancel(
|
|
2200
|
+
gvc.event(() => {
|
|
2201
|
+
gvc.closeDialog();
|
|
2202
|
+
})
|
|
2203
|
+
),
|
|
2204
|
+
BgWidget.save(
|
|
2205
|
+
gvc.event(() => {
|
|
2206
|
+
vm.save_event().then(() => {});
|
|
2207
|
+
})
|
|
2208
|
+
),
|
|
2209
|
+
].join('');
|
|
2210
|
+
},
|
|
2211
|
+
});
|
|
2212
|
+
}),
|
|
2213
|
+
});
|
|
2214
|
+
};
|
|
2215
|
+
|
|
2144
2216
|
if ((dd as any).custom) {
|
|
2145
2217
|
button_action = button_action.concat([
|
|
2218
|
+
shipment_fee(),
|
|
2146
2219
|
BgWidget.customButton({
|
|
2147
2220
|
button: {
|
|
2148
2221
|
color: 'gray',
|
|
2149
2222
|
size: 'sm',
|
|
2150
2223
|
},
|
|
2151
2224
|
text: {
|
|
2152
|
-
name:
|
|
2225
|
+
name: html`<i class="fa-regular fa-gear me-1"></i>自訂表單`,
|
|
2153
2226
|
},
|
|
2154
2227
|
event: gvc.event(() => {
|
|
2155
2228
|
updateCustomShipment({
|
|
@@ -2158,109 +2231,16 @@ export class ShoppingFinanceSetting {
|
|
|
2158
2231
|
});
|
|
2159
2232
|
}),
|
|
2160
2233
|
}),
|
|
2161
|
-
BgWidget.customButton({
|
|
2162
|
-
button: {
|
|
2163
|
-
color: 'gray',
|
|
2164
|
-
size: 'sm',
|
|
2165
|
-
},
|
|
2166
|
-
text: {
|
|
2167
|
-
name: `運費設定`,
|
|
2168
|
-
},
|
|
2169
|
-
event: gvc.event(() => {
|
|
2170
|
-
const vm = {
|
|
2171
|
-
gvc: gvc,
|
|
2172
|
-
key: dd.value,
|
|
2173
|
-
save_event: () => {
|
|
2174
|
-
return new Promise(resolve => {
|
|
2175
|
-
resolve(true);
|
|
2176
|
-
});
|
|
2177
|
-
},
|
|
2178
|
-
};
|
|
2179
|
-
BgWidget.settingDialog({
|
|
2180
|
-
gvc: gvc,
|
|
2181
|
-
width: 1200,
|
|
2182
|
-
height: document.body.clientHeight - 100,
|
|
2183
|
-
title: `『 ${dd.title} 』運費設定`,
|
|
2184
|
-
d_main_style:
|
|
2185
|
-
document.body.clientWidth < 768 ? 'padding:0px !important;' : ``,
|
|
2186
|
-
innerHTML: (gvc: GVC) => {
|
|
2187
|
-
vm.gvc = gvc;
|
|
2188
|
-
return ShoppingShipmentSetting.main(vm);
|
|
2189
|
-
},
|
|
2190
|
-
footer_html: gvc => {
|
|
2191
|
-
return [
|
|
2192
|
-
BgWidget.cancel(
|
|
2193
|
-
gvc.event(() => {
|
|
2194
|
-
gvc.closeDialog();
|
|
2195
|
-
})
|
|
2196
|
-
),
|
|
2197
|
-
BgWidget.save(
|
|
2198
|
-
gvc.event(() => {
|
|
2199
|
-
vm.save_event().then(() => {});
|
|
2200
|
-
})
|
|
2201
|
-
),
|
|
2202
|
-
].join('');
|
|
2203
|
-
},
|
|
2204
|
-
});
|
|
2205
|
-
}),
|
|
2206
|
-
}),
|
|
2207
2234
|
]);
|
|
2208
2235
|
return html`
|
|
2209
|
-
<div class="d-flex
|
|
2236
|
+
<div class="d-flex flex-wrap justify-content-end gap-1 cursor_pointer">
|
|
2210
2237
|
<div class="flex-fill"></div>
|
|
2211
2238
|
${button_action.join('')}
|
|
2212
2239
|
</div>
|
|
2213
2240
|
`;
|
|
2214
2241
|
} else {
|
|
2215
|
-
button_action = button_action.concat([
|
|
2216
|
-
|
|
2217
|
-
button: {
|
|
2218
|
-
color: 'gray',
|
|
2219
|
-
size: 'sm',
|
|
2220
|
-
},
|
|
2221
|
-
text: {
|
|
2222
|
-
name: `運費設定`,
|
|
2223
|
-
},
|
|
2224
|
-
event: gvc.event(() => {
|
|
2225
|
-
const vm = {
|
|
2226
|
-
gvc: gvc,
|
|
2227
|
-
key: dd.value,
|
|
2228
|
-
save_event: () => {
|
|
2229
|
-
return new Promise((resolve, reject) => {
|
|
2230
|
-
resolve(true);
|
|
2231
|
-
});
|
|
2232
|
-
},
|
|
2233
|
-
};
|
|
2234
|
-
BgWidget.settingDialog({
|
|
2235
|
-
gvc: gvc,
|
|
2236
|
-
width: 1200,
|
|
2237
|
-
height: document.body.clientHeight - 100,
|
|
2238
|
-
title: `『 ${dd.title} 』運費設定`,
|
|
2239
|
-
d_main_style:
|
|
2240
|
-
document.body.clientWidth < 768 ? 'padding:0px !important;' : ``,
|
|
2241
|
-
innerHTML: (gvc: GVC) => {
|
|
2242
|
-
vm.gvc = gvc;
|
|
2243
|
-
return ShoppingShipmentSetting.main(vm);
|
|
2244
|
-
},
|
|
2245
|
-
footer_html: gvc => {
|
|
2246
|
-
return [
|
|
2247
|
-
BgWidget.cancel(
|
|
2248
|
-
gvc.event(() => {
|
|
2249
|
-
gvc.closeDialog();
|
|
2250
|
-
})
|
|
2251
|
-
),
|
|
2252
|
-
BgWidget.save(
|
|
2253
|
-
gvc.event(() => {
|
|
2254
|
-
vm.save_event().then(() => {});
|
|
2255
|
-
})
|
|
2256
|
-
),
|
|
2257
|
-
].join('');
|
|
2258
|
-
},
|
|
2259
|
-
});
|
|
2260
|
-
}),
|
|
2261
|
-
}),
|
|
2262
|
-
]);
|
|
2263
|
-
return html` <div class="d-flex" style="cursor:pointer;gap:5px;">
|
|
2242
|
+
button_action = button_action.concat([shipment_fee()]);
|
|
2243
|
+
return html` <div class="d-flex flex-wrap justify-content-end gap-1 cursor_pointer">
|
|
2264
2244
|
<div class="flex-fill"></div>
|
|
2265
2245
|
${button_action.join('')}
|
|
2266
2246
|
</div>`;
|
|
@@ -2274,7 +2254,7 @@ export class ShoppingFinanceSetting {
|
|
|
2274
2254
|
})
|
|
2275
2255
|
.concat([
|
|
2276
2256
|
html` <div
|
|
2277
|
-
class="col-12 col-
|
|
2257
|
+
class="col-12 col-lg-4 col-md-6 p-0 p-md-2"
|
|
2278
2258
|
style="cursor: pointer;"
|
|
2279
2259
|
onclick="${gvc.event(() => {
|
|
2280
2260
|
updateCustomShipment({ function: 'plus' });
|
|
@@ -2303,163 +2283,154 @@ export class ShoppingFinanceSetting {
|
|
|
2303
2283
|
}),
|
|
2304
2284
|
]);
|
|
2305
2285
|
} else if (vm.page === 'delivery_note') {
|
|
2306
|
-
view.push(BgWidget.mbContainer(24));
|
|
2307
2286
|
view.push(
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
.
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
.replace(
|
|
2395
|
-
mark,
|
|
2396
|
-
html` <div class="d-flex flex-column">${imgHTML}</div>`
|
|
2397
|
-
)
|
|
2398
|
-
);
|
|
2399
|
-
editor.undo.saveStep();
|
|
2400
|
-
} else {
|
|
2401
|
-
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
2402
|
-
}
|
|
2403
|
-
},
|
|
2404
|
-
html` <div
|
|
2405
|
-
class="d-flex flex-column"
|
|
2406
|
-
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
2407
|
-
>
|
|
2408
|
-
圖片庫
|
|
2409
|
-
</div>`,
|
|
2410
|
-
{
|
|
2411
|
-
mul: true,
|
|
2412
|
-
cancelEvent: () => {
|
|
2413
|
-
editor.html.set(editor.html.get(0).replace(mark, ''));
|
|
2414
|
-
editor.undo.saveStep();
|
|
2287
|
+
[
|
|
2288
|
+
html` <div class="px-md-0 px-2">
|
|
2289
|
+
${BgWidget.normalInsignia('於結帳頁面中顯示,告知顧客配送所需要注意的事項')}
|
|
2290
|
+
</div>`,
|
|
2291
|
+
BgWidget.mainCard(
|
|
2292
|
+
[
|
|
2293
|
+
html` <div class="title-container px-0">
|
|
2294
|
+
<div class="d-flex align-items-center gap-1">
|
|
2295
|
+
<div class="tx_700">配送說明</div>
|
|
2296
|
+
${BgWidget.languageInsignia(vm.language, 'margin-left:5px;')}
|
|
2297
|
+
</div>
|
|
2298
|
+
<div class="flex-fill"></div>
|
|
2299
|
+
${LanguageBackend.switchBtn({
|
|
2300
|
+
gvc: gvc,
|
|
2301
|
+
language: vm.language,
|
|
2302
|
+
callback: language => {
|
|
2303
|
+
vm.language = language;
|
|
2304
|
+
gvc.notifyDataChange(vm.id);
|
|
2305
|
+
},
|
|
2306
|
+
})}
|
|
2307
|
+
</div>`,
|
|
2308
|
+
,
|
|
2309
|
+
BgWidget.mbContainer(18),
|
|
2310
|
+
html` <div class="guide3-4">
|
|
2311
|
+
${gvc.bindView(
|
|
2312
|
+
(() => {
|
|
2313
|
+
const id = gvc.glitter.getUUID();
|
|
2314
|
+
return {
|
|
2315
|
+
bind: id,
|
|
2316
|
+
view: () => {
|
|
2317
|
+
return html` <div
|
|
2318
|
+
class="d-flex justify-content-between align-items-center gap-3 mb-1"
|
|
2319
|
+
style="cursor: pointer;"
|
|
2320
|
+
onclick="${gvc.event(() => {
|
|
2321
|
+
const originContent = `${language_data.info}`;
|
|
2322
|
+
BgWidget.fullDialog({
|
|
2323
|
+
gvc: gvc,
|
|
2324
|
+
title: gvc2 => {
|
|
2325
|
+
return html`<div class="d-flex align-items-center" style="gap:10px;">
|
|
2326
|
+
${'配送資訊' +
|
|
2327
|
+
BgWidget.aiChatButton({
|
|
2328
|
+
gvc: gvc2,
|
|
2329
|
+
select: 'writer',
|
|
2330
|
+
click: () => {
|
|
2331
|
+
ProductAi.generateRichText(gvc, text => {
|
|
2332
|
+
language_data.info += text;
|
|
2333
|
+
gvc.notifyDataChange(vm.id);
|
|
2334
|
+
gvc2.recreateView();
|
|
2335
|
+
});
|
|
2336
|
+
},
|
|
2337
|
+
})}
|
|
2338
|
+
</div>`;
|
|
2339
|
+
},
|
|
2340
|
+
innerHTML: gvc2 => {
|
|
2341
|
+
return html` <div>
|
|
2342
|
+
${EditorElem.richText({
|
|
2343
|
+
gvc: gvc2,
|
|
2344
|
+
def: language_data.info,
|
|
2345
|
+
setHeight: '100vh',
|
|
2346
|
+
hiddenBorder: true,
|
|
2347
|
+
insertImageEvent: editor => {
|
|
2348
|
+
const mark = `{{${Tool.randomString(8)}}}`;
|
|
2349
|
+
editor.selection.setAtEnd(editor.$el.get(0));
|
|
2350
|
+
editor.html.insert(mark);
|
|
2351
|
+
editor.undo.saveStep();
|
|
2352
|
+
imageLibrary.selectImageLibrary(
|
|
2353
|
+
gvc,
|
|
2354
|
+
urlArray => {
|
|
2355
|
+
if (urlArray.length > 0) {
|
|
2356
|
+
const imgHTML = urlArray
|
|
2357
|
+
.map(url => {
|
|
2358
|
+
return html` <img src="${url.data}" />`;
|
|
2359
|
+
})
|
|
2360
|
+
.join('');
|
|
2361
|
+
editor.html.set(
|
|
2362
|
+
editor.html
|
|
2363
|
+
.get(0)
|
|
2364
|
+
.replace(
|
|
2365
|
+
mark,
|
|
2366
|
+
html` <div class="d-flex flex-column">${imgHTML}</div>`
|
|
2367
|
+
)
|
|
2368
|
+
);
|
|
2369
|
+
editor.undo.saveStep();
|
|
2370
|
+
} else {
|
|
2371
|
+
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
2372
|
+
}
|
|
2415
2373
|
},
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2374
|
+
html` <div
|
|
2375
|
+
class="d-flex flex-column"
|
|
2376
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
2377
|
+
>
|
|
2378
|
+
圖片庫
|
|
2379
|
+
</div>`,
|
|
2380
|
+
{
|
|
2381
|
+
mul: true,
|
|
2382
|
+
cancelEvent: () => {
|
|
2383
|
+
editor.html.set(editor.html.get(0).replace(mark, ''));
|
|
2384
|
+
editor.undo.saveStep();
|
|
2385
|
+
},
|
|
2386
|
+
}
|
|
2387
|
+
);
|
|
2388
|
+
},
|
|
2389
|
+
callback: text => {
|
|
2390
|
+
language_data.info = text;
|
|
2391
|
+
},
|
|
2392
|
+
rich_height: `calc(${(window.parent as any).innerHeight}px - 70px - 58px - 49px - 64px - 40px + ${
|
|
2393
|
+
document.body.clientWidth < 800 ? `70` : `0`
|
|
2394
|
+
}px)`,
|
|
2395
|
+
})}
|
|
2396
|
+
</div>`;
|
|
2397
|
+
},
|
|
2398
|
+
footer_html: (gvc2: GVC) => {
|
|
2399
|
+
return [
|
|
2400
|
+
BgWidget.cancel(
|
|
2401
|
+
gvc2.event(() => {
|
|
2402
|
+
language_data.info = originContent;
|
|
2403
|
+
gvc2.closeDialog();
|
|
2404
|
+
})
|
|
2405
|
+
),
|
|
2406
|
+
BgWidget.save(
|
|
2407
|
+
gvc2.event(() => {
|
|
2408
|
+
gvc2.closeDialog();
|
|
2409
|
+
gvc.notifyDataChange(id);
|
|
2410
|
+
save();
|
|
2411
|
+
})
|
|
2412
|
+
),
|
|
2413
|
+
].join('');
|
|
2414
|
+
},
|
|
2415
|
+
closeCallback: () => {
|
|
2416
|
+
language_data.info = originContent;
|
|
2417
|
+
},
|
|
2418
|
+
});
|
|
2419
|
+
})}"
|
|
2420
|
+
>
|
|
2421
|
+
${(() => {
|
|
2422
|
+
const text = gvc.glitter.utText.removeTag(language_data.info);
|
|
2423
|
+
return BgWidget.richTextView(Tool.truncateString(text, 100));
|
|
2424
|
+
})()}
|
|
2425
|
+
</div>`;
|
|
2426
|
+
},
|
|
2427
|
+
};
|
|
2428
|
+
})()
|
|
2429
|
+
)}
|
|
2430
|
+
</div>`,
|
|
2431
|
+
].join('')
|
|
2432
|
+
),
|
|
2433
|
+
].join(BgWidget.mbContainer(24))
|
|
2463
2434
|
);
|
|
2464
2435
|
} else if (vm.page === 'delivery_track') {
|
|
2465
2436
|
view = view.concat([
|
|
@@ -2509,7 +2480,7 @@ export class ShoppingFinanceSetting {
|
|
|
2509
2480
|
]
|
|
2510
2481
|
.map(dd => {
|
|
2511
2482
|
return html`
|
|
2512
|
-
<div class="col-12 col-
|
|
2483
|
+
<div class="col-12 col-lg-3 col-md-4 p-0 p-md-2">
|
|
2513
2484
|
<div
|
|
2514
2485
|
class="w-100 position-relative main-card"
|
|
2515
2486
|
style="padding: 24px 32px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
|
|
@@ -2620,8 +2591,6 @@ export class ShoppingFinanceSetting {
|
|
|
2620
2591
|
})(),
|
|
2621
2592
|
].join(BgWidget.mbContainer(12));
|
|
2622
2593
|
},
|
|
2623
|
-
divCreate: {},
|
|
2624
|
-
onCreate: () => {},
|
|
2625
2594
|
};
|
|
2626
2595
|
})()
|
|
2627
2596
|
);
|
|
@@ -2834,8 +2803,6 @@ export class ShoppingFinanceSetting {
|
|
|
2834
2803
|
})(),
|
|
2835
2804
|
].join(BgWidget.mbContainer(12));
|
|
2836
2805
|
},
|
|
2837
|
-
divCreate: {},
|
|
2838
|
-
onCreate: () => {},
|
|
2839
2806
|
};
|
|
2840
2807
|
})()
|
|
2841
2808
|
);
|
|
@@ -2888,7 +2855,7 @@ export class ShoppingFinanceSetting {
|
|
|
2888
2855
|
saveDelivery();
|
|
2889
2856
|
gvc.notifyDataChange(id);
|
|
2890
2857
|
})}"
|
|
2891
|
-
${vm.delivery[dd.value].toggle ? `checked` :
|
|
2858
|
+
${vm.delivery[dd.value].toggle ? `checked` : ''}
|
|
2892
2859
|
/>
|
|
2893
2860
|
</div>
|
|
2894
2861
|
</div>
|
|
@@ -3179,22 +3146,6 @@ export class ShoppingFinanceSetting {
|
|
|
3179
3146
|
]);
|
|
3180
3147
|
}
|
|
3181
3148
|
|
|
3182
|
-
// view.push(
|
|
3183
|
-
// html`<div
|
|
3184
|
-
// style="width: 100%;padding: 14px 16px;background: #FFF; display: flex;justify-content: end;position: fixed;bottom: 0;right: 0;z-index:1;gap:14px;"
|
|
3185
|
-
// >
|
|
3186
|
-
// ${BgWidget.save(
|
|
3187
|
-
// gvc.event(async () => {
|
|
3188
|
-
// await widget.event('loading', { visible: true });
|
|
3189
|
-
// save();
|
|
3190
|
-
// await widget.event('loading', { visible: false });
|
|
3191
|
-
// await widget.event('success', { title: '儲存成功' });
|
|
3192
|
-
// }),
|
|
3193
|
-
// '儲存',
|
|
3194
|
-
// 'guide3-5'
|
|
3195
|
-
// )}
|
|
3196
|
-
// </div>`
|
|
3197
|
-
// );
|
|
3198
3149
|
view.push(BgWidget.mbContainer(240));
|
|
3199
3150
|
return BgWidget.container(view.join(''));
|
|
3200
3151
|
},
|
|
@@ -3425,8 +3376,7 @@ export class ShoppingFinanceSetting {
|
|
|
3425
3376
|
`;
|
|
3426
3377
|
},
|
|
3427
3378
|
divCreate: {
|
|
3428
|
-
|
|
3429
|
-
class: `w-100`,
|
|
3379
|
+
class: 'w-100',
|
|
3430
3380
|
},
|
|
3431
3381
|
};
|
|
3432
3382
|
})
|