ts-glitter 19.2.2 → 19.2.4

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.
Files changed (39) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/cms-plugin/shopping-information.js +136 -30
  4. package/lowcode/cms-plugin/shopping-information.ts +149 -29
  5. package/lowcode/css/editor.css +1 -1
  6. package/lowcode/jspage/main.js +1 -1
  7. package/lowcode/jspage/main.ts +1 -1
  8. package/lowcode/public-components/checkout/index.js +209 -196
  9. package/lowcode/public-components/checkout/index.ts +235 -223
  10. package/package.json +1 -1
  11. package/src/api-public/controllers/delivery.js.map +1 -1
  12. package/src/api-public/controllers/index.js.map +1 -1
  13. package/src/api-public/controllers/shop.js.map +1 -1
  14. package/src/api-public/services/ai-robot.d.ts +0 -1
  15. package/src/api-public/services/fb-api.d.ts +0 -1
  16. package/src/api-public/services/fb-message.d.ts +0 -1
  17. package/src/api-public/services/financial-service.d.ts +1 -1
  18. package/src/api-public/services/financial-service.js +22 -11
  19. package/src/api-public/services/financial-service.js.map +1 -1
  20. package/src/api-public/services/financial-service.ts +30 -15
  21. package/src/api-public/services/invoice.js.map +1 -1
  22. package/src/api-public/services/line-message.d.ts +0 -1
  23. package/src/api-public/services/public-table-check.d.ts +7 -0
  24. package/src/api-public/services/public-table-check.js +10 -1
  25. package/src/api-public/services/public-table-check.js.map +1 -5
  26. package/src/api-public/services/public-table-check.ts +13 -2
  27. package/src/api-public/services/schedule.js.map +1 -1
  28. package/src/api-public/services/share-permission.d.ts +1 -1
  29. package/src/api-public/services/shopee.d.ts +0 -1
  30. package/src/api-public/services/shopping.js.map +1 -1
  31. package/src/api-public/services/shopping.ts +1 -0
  32. package/src/helper/glitter-util.d.ts +3 -2
  33. package/src/helper/glitter-util.js +5 -0
  34. package/src/helper/glitter-util.js.map +1 -1
  35. package/src/helper/glitter-util.ts +6 -2
  36. package/src/index.js +146 -98
  37. package/src/index.js.map +1 -1
  38. package/src/index.ts +763 -685
  39. package/src/services/app.js.map +1 -1
package/lowcode/Entry.js CHANGED
@@ -132,7 +132,7 @@ export class Entry {
132
132
  }
133
133
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
134
134
  console.log(`Entry-time:`, window.renderClock.stop());
135
- glitter.share.editerVersion = 'V_19.2.2';
135
+ glitter.share.editerVersion = 'V_19.2.4';
136
136
  glitter.share.start = new Date();
137
137
  const vm = { appConfig: [] };
138
138
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -132,7 +132,7 @@ export class Entry {
132
132
  }
133
133
  (window as any).renderClock = (window as any).renderClock ?? createClock();
134
134
  console.log(`Entry-time:`, (window as any).renderClock.stop());
135
- glitter.share.editerVersion = 'V_19.2.2';
135
+ glitter.share.editerVersion = 'V_19.2.4';
136
136
  glitter.share.start = new Date();
137
137
  const vm = { appConfig: [] };
138
138
  (window as any).saasConfig = {
@@ -368,47 +368,153 @@ export class ShoppingInformation {
368
368
  })}
369
369
  <div style="margin-top: 24px;"></div>
370
370
  ${BgWidget.card([
371
- html `<div class="d-flex align-items-center">
371
+ html ` <div class="d-flex align-items-center">
372
372
  <div class="d-flex flex-column">
373
373
  <div class="tx_normal fw-bold">301轉址</div>
374
374
  <div style="color: #8D8D8D; font-size: 13px; padding-right: 10px;">
375
- 設定301轉址,搬移舊有網站項目
375
+ 設定301轉址,將舊有連結導向至新連結
376
376
  </div>
377
377
  </div>
378
378
  <div class="flex-fill"></div>
379
379
  ${BgWidget.customButton({
380
380
  button: { color: 'snow', size: 'md' },
381
- text: { name: '新增' },
382
- event: gvc.event(() => {
383
- const plus_data = {
384
- legacy_url: '',
385
- new_url: '',
386
- };
381
+ text: { name: '設定' },
382
+ event: gvc.event(() => __awaiter(this, void 0, void 0, function* () {
383
+ var _a;
384
+ let domain_301 = (_a = (yield ApiUser.getPublicConfig('domain_301', 'manager')).response.value.list) !== null && _a !== void 0 ? _a : [];
385
+ function plusEvent() {
386
+ const plus_data = {
387
+ legacy_url: '',
388
+ new_url: '',
389
+ };
390
+ BgWidget.settingDialog({
391
+ gvc,
392
+ title: '新增網址',
393
+ width: 600,
394
+ innerHTML: gvc => {
395
+ return [
396
+ BgWidget.editeInput({
397
+ gvc: gvc,
398
+ title: '舊網址',
399
+ default: plus_data.legacy_url || '',
400
+ placeHolder: '請輸入相對路徑(例如:/blogs/sample-page)',
401
+ callback: text => {
402
+ plus_data.legacy_url = text;
403
+ },
404
+ }),
405
+ BgWidget.editeInput({
406
+ gvc: gvc,
407
+ title: '新網址',
408
+ default: plus_data.new_url || '',
409
+ placeHolder: '請輸入相對路徑(例如:/blogs/sample-page)',
410
+ callback: text => {
411
+ plus_data.new_url = text;
412
+ },
413
+ }),
414
+ ].join('');
415
+ },
416
+ footer_html: gvc => {
417
+ return [
418
+ BgWidget.cancel(gvc.event(() => {
419
+ gvc.closeDialog();
420
+ })),
421
+ BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
422
+ if (domain_301.find((dd) => dd.legacy_url === plus_data.legacy_url || dd.new_url === plus_data.new_url)) {
423
+ dialog.errorMessage({ text: '此網址已設定過' });
424
+ return;
425
+ }
426
+ if (!plus_data.legacy_url) {
427
+ dialog.errorMessage({ text: '請輸入原先網址' });
428
+ return;
429
+ }
430
+ if (!plus_data.new_url) {
431
+ dialog.errorMessage({ text: '請輸入新網址' });
432
+ return;
433
+ }
434
+ if (plus_data.legacy_url === plus_data.new_url) {
435
+ dialog.errorMessage({ text: '網址不可相同' });
436
+ return;
437
+ }
438
+ dialog.dataLoading({ visible: true });
439
+ ApiUser.setPublicConfig({
440
+ key: 'domain_301',
441
+ user_id: 'manager',
442
+ value: {
443
+ list: [
444
+ {
445
+ new_url: plus_data.new_url,
446
+ legacy_url: plus_data.legacy_url,
447
+ },
448
+ ...domain_301,
449
+ ],
450
+ },
451
+ }).then(res => {
452
+ dialog.dataLoading({ visible: false });
453
+ dialog.successMessage({ text: '設定成功' });
454
+ gvc.closeDialog();
455
+ });
456
+ })), '新增'),
457
+ ].join('');
458
+ },
459
+ });
460
+ }
387
461
  BgWidget.settingDialog({
388
462
  gvc,
389
- title: '新增網址',
463
+ title: '301轉址設定',
390
464
  width: 600,
391
465
  innerHTML: gvc => {
392
- return [
393
- BgWidget.editeInput({
394
- gvc: gvc,
395
- title: '舊網址',
396
- default: plus_data.legacy_url || '',
397
- placeHolder: '請輸入舊網址',
398
- callback: text => {
399
- plus_data.legacy_url = text;
400
- },
401
- }),
402
- BgWidget.editeInput({
466
+ if (domain_301.length) {
467
+ return BgWidget.tableV3({
403
468
  gvc: gvc,
404
- title: '新網址',
405
- default: plus_data.new_url || '',
406
- placeHolder: '請輸入新網址',
407
- callback: text => {
408
- plus_data.new_url = text;
469
+ getData: vd => {
470
+ vd.pageSize = 1;
471
+ vd.originalData = domain_301;
472
+ vd.tableData = domain_301.map((dd) => {
473
+ var _a, _b;
474
+ return [
475
+ { key: '舊網址', value: `${(_a = dd.legacy_url) !== null && _a !== void 0 ? _a : ''}` },
476
+ { key: '新網址', value: `${(_b = dd.new_url) !== null && _b !== void 0 ? _b : ''}` },
477
+ ];
478
+ });
479
+ setTimeout(() => {
480
+ vd.callback();
481
+ });
409
482
  },
410
- }),
411
- ].join('');
483
+ rowClick: (data, index) => { },
484
+ filter: [
485
+ {
486
+ name: '批量移除',
487
+ event: checkedData => {
488
+ dialog.checkYesOrNot({
489
+ text: '是否確認移除?',
490
+ callback: (response) => {
491
+ dialog.dataLoading({ visible: true });
492
+ domain_301 = domain_301.filter((dd) => {
493
+ return !(checkedData.find((d1) => {
494
+ return d1.legacy_url === dd.legacy_url || d1.new_url === dd.new_url;
495
+ }));
496
+ });
497
+ ApiUser.setPublicConfig({
498
+ key: 'domain_301',
499
+ user_id: 'manager',
500
+ value: {
501
+ list: domain_301,
502
+ },
503
+ }).then(res => {
504
+ dialog.dataLoading({ visible: false });
505
+ dialog.successMessage({ text: '設定成功' });
506
+ gvc.recreateView();
507
+ });
508
+ }
509
+ });
510
+ },
511
+ },
512
+ ],
513
+ });
514
+ }
515
+ else {
516
+ return BgWidget.warningInsignia('尚未新增轉址連結,點擊右下角新增');
517
+ }
412
518
  },
413
519
  footer_html: gvc => {
414
520
  return [
@@ -416,13 +522,13 @@ export class ShoppingInformation {
416
522
  gvc.closeDialog();
417
523
  })),
418
524
  BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
419
- dialog.dataLoading({ visible: true });
420
525
  gvc.closeDialog();
421
- }))),
526
+ plusEvent();
527
+ })), '新增'),
422
528
  ].join('');
423
529
  },
424
530
  });
425
- }),
531
+ })),
426
532
  })}
427
533
  </div>`,
428
534
  ].join(`<div class="mt-2"></div>`))}
@@ -6,6 +6,7 @@ import { Currency } from '../glitter-base/global/currency.js';
6
6
  import { LanguageBackend } from './language-backend.js';
7
7
  import { GlobalUser } from '../glitter-base/global/global-user.js';
8
8
  import { FilterOptions } from './filter-options.js';
9
+ import { Article } from '../glitter-base/route/article.js';
9
10
 
10
11
  const html = String.raw;
11
12
 
@@ -429,47 +430,165 @@ export class ShoppingInformation {
429
430
  <div style="margin-top: 24px;"></div>
430
431
  ${BgWidget.card(
431
432
  [
432
- html`<div class="d-flex align-items-center">
433
+ html` <div class="d-flex align-items-center">
433
434
  <div class="d-flex flex-column">
434
435
  <div class="tx_normal fw-bold">301轉址</div>
435
436
  <div style="color: #8D8D8D; font-size: 13px; padding-right: 10px;">
436
- 設定301轉址,搬移舊有網站項目
437
+ 設定301轉址,將舊有連結導向至新連結
437
438
  </div>
438
439
  </div>
439
440
  <div class="flex-fill"></div>
440
441
  ${BgWidget.customButton({
441
442
  button: { color: 'snow', size: 'md' },
442
- text: { name: '新增' },
443
- event: gvc.event(() => {
444
- const plus_data = {
445
- legacy_url: '',
446
- new_url: '',
447
- };
443
+ text: { name: '設定' },
444
+ event: gvc.event(async () => {
445
+ let domain_301 =
446
+ (await ApiUser.getPublicConfig('domain_301', 'manager')).response.value.list ?? [];
447
+
448
+ function plusEvent() {
449
+ const plus_data = {
450
+ legacy_url: '',
451
+ new_url: '',
452
+ };
453
+ BgWidget.settingDialog({
454
+ gvc,
455
+ title: '新增網址',
456
+ width: 600,
457
+ innerHTML: gvc => {
458
+ return [
459
+ BgWidget.editeInput({
460
+ gvc: gvc,
461
+ title: '舊網址',
462
+ default: plus_data.legacy_url || '',
463
+ placeHolder: '請輸入相對路徑(例如:/blogs/sample-page)',
464
+ callback: text => {
465
+ plus_data.legacy_url = text;
466
+ },
467
+ }),
468
+ BgWidget.editeInput({
469
+ gvc: gvc,
470
+ title: '新網址',
471
+ default: plus_data.new_url || '',
472
+ placeHolder: '請輸入相對路徑(例如:/blogs/sample-page)',
473
+ callback: text => {
474
+ plus_data.new_url = text;
475
+ },
476
+ }),
477
+ ].join('');
478
+ },
479
+ footer_html: gvc => {
480
+ return [
481
+ BgWidget.cancel(
482
+ gvc.event(() => {
483
+ gvc.closeDialog();
484
+ })
485
+ ),
486
+ BgWidget.save(
487
+ gvc.event(async () => {
488
+ if (
489
+ domain_301.find(
490
+ (dd: any) =>
491
+ dd.legacy_url === plus_data.legacy_url || dd.new_url === plus_data.new_url
492
+ )
493
+ ) {
494
+ dialog.errorMessage({ text: '此網址已設定過' });
495
+ return;
496
+ }
497
+ if (!plus_data.legacy_url) {
498
+ dialog.errorMessage({ text: '請輸入原先網址' });
499
+ return;
500
+ }
501
+ if (!plus_data.new_url) {
502
+ dialog.errorMessage({ text: '請輸入新網址' });
503
+ return;
504
+ }
505
+
506
+ if (plus_data.legacy_url === plus_data.new_url) {
507
+ dialog.errorMessage({ text: '網址不可相同' });
508
+ return;
509
+ }
510
+
511
+ dialog.dataLoading({ visible: true });
512
+ ApiUser.setPublicConfig({
513
+ key: 'domain_301',
514
+ user_id: 'manager',
515
+ value: {
516
+ list: [
517
+ {
518
+ new_url: plus_data.new_url,
519
+ legacy_url: plus_data.legacy_url,
520
+ },
521
+ ...domain_301,
522
+ ],
523
+ },
524
+ }).then(res => {
525
+ dialog.dataLoading({ visible: false });
526
+ dialog.successMessage({ text: '設定成功' });
527
+ gvc.closeDialog();
528
+ });
529
+ }),
530
+ '新增'
531
+ ),
532
+ ].join('');
533
+ },
534
+ });
535
+ }
536
+
448
537
  BgWidget.settingDialog({
449
538
  gvc,
450
- title: '新增網址',
539
+ title: '301轉址設定',
451
540
  width: 600,
452
541
  innerHTML: gvc => {
453
- return [
454
- BgWidget.editeInput({
455
- gvc: gvc,
456
- title: '舊網址',
457
- default: plus_data.legacy_url || '',
458
- placeHolder: '請輸入舊網址',
459
- callback: text => {
460
- plus_data.legacy_url = text;
461
- },
462
- }),
463
- BgWidget.editeInput({
542
+ if (domain_301.length) {
543
+ return BgWidget.tableV3({
464
544
  gvc: gvc,
465
- title: '新網址',
466
- default: plus_data.new_url || '',
467
- placeHolder: '請輸入新網址',
468
- callback: text => {
469
- plus_data.new_url = text;
545
+ getData: vd => {
546
+ vd.pageSize = 1;
547
+ vd.originalData = domain_301;
548
+ vd.tableData = domain_301.map((dd: any) => {
549
+ return [
550
+ { key: '舊網址', value: `${dd.legacy_url ?? ''}` },
551
+ { key: '新網址', value: `${dd.new_url ?? ''}` },
552
+ ];
553
+ });
554
+ setTimeout(() => {
555
+ vd.callback();
556
+ });
470
557
  },
471
- }),
472
- ].join('');
558
+ rowClick: (data, index) => {},
559
+ filter: [
560
+ {
561
+ name: '批量移除',
562
+ event: checkedData => {
563
+ dialog.checkYesOrNot({
564
+ text:'是否確認移除?',
565
+ callback:(response)=>{
566
+ dialog.dataLoading({visible:true})
567
+ domain_301=domain_301.filter((dd:any)=>{
568
+ return !(checkedData.find((d1:any)=>{
569
+ return d1.legacy_url===dd.legacy_url || d1.new_url===dd.new_url
570
+ }))
571
+ })
572
+ ApiUser.setPublicConfig({
573
+ key: 'domain_301',
574
+ user_id: 'manager',
575
+ value: {
576
+ list: domain_301,
577
+ },
578
+ }).then(res => {
579
+ dialog.dataLoading({ visible: false });
580
+ dialog.successMessage({ text: '設定成功' });
581
+ gvc.recreateView()
582
+ })
583
+ }
584
+ })
585
+ },
586
+ },
587
+ ],
588
+ });
589
+ } else {
590
+ return BgWidget.warningInsignia('尚未新增轉址連結,點擊右下角新增');
591
+ }
473
592
  },
474
593
  footer_html: gvc => {
475
594
  return [
@@ -480,9 +599,10 @@ export class ShoppingInformation {
480
599
  ),
481
600
  BgWidget.save(
482
601
  gvc.event(async () => {
483
- dialog.dataLoading({ visible: true });
484
602
  gvc.closeDialog();
485
- })
603
+ plusEvent();
604
+ }),
605
+ '新增'
486
606
  ),
487
607
  ].join('');
488
608
  },
@@ -952,7 +952,7 @@ h6 {
952
952
  display: flex;
953
953
  flex-direction: column;
954
954
  gap: 18px;
955
- padding: 20px;
955
+ padding: 12px;
956
956
  overflow-y: auto;
957
957
  max-height: 400px;
958
958
  }
@@ -609,7 +609,7 @@ ${Storage.page_setting_item === `${da.index}` ? `background:${EditorConfig.edito
609
609
  .join('')}`;
610
610
  },
611
611
  divCreate: {
612
- style: `width:50px;gap:20px;padding-top: 15px;min-width:50px;`,
612
+ style: `width:60px;gap:20px;padding-top: 15px;min-width:60px;`,
613
613
  class: `${Storage.select_function === 'user-editor' || Storage.select_function === 'page-editor' ? `` : `d-none`} h-120 border-end d-flex flex-column align-items-center`,
614
614
  },
615
615
  onCreate: () => {
@@ -644,7 +644,7 @@ ${Storage.page_setting_item === `${da.index}` ? `background:${EditorConfig.edito
644
644
  .join('')}`;
645
645
  },
646
646
  divCreate: {
647
- style: `width:50px;gap:20px;padding-top: 15px;min-width:50px;`,
647
+ style: `width:60px;gap:20px;padding-top: 15px;min-width:60px;`,
648
648
  class: `${
649
649
  Storage.select_function === 'user-editor' || Storage.select_function === 'page-editor' ? `` : `d-none`
650
650
  } h-120 border-end d-flex flex-column align-items-center`,