ts-glitter 18.3.2 → 18.3.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 (52) hide show
  1. package/lowcode/Entry.js +2 -1
  2. package/lowcode/Entry.ts +2 -1
  3. package/lowcode/backend-manager/bg-customer-message.js +0 -11
  4. package/lowcode/backend-manager/bg-customer-message.ts +0 -11
  5. package/lowcode/backend-manager/bg-line.js +2 -1
  6. package/lowcode/backend-manager/bg-line.ts +2 -1
  7. package/lowcode/backend-manager/bg-notify.js +2 -1
  8. package/lowcode/backend-manager/bg-notify.ts +2 -1
  9. package/lowcode/backend-manager/bg-product.js +70 -3
  10. package/lowcode/backend-manager/bg-product.ts +84 -3
  11. package/lowcode/backend-manager/bg-recommend.ts +0 -4
  12. package/lowcode/backend-manager/bg-sns.js +2 -1
  13. package/lowcode/backend-manager/bg-sns.ts +2 -1
  14. package/lowcode/cms-plugin/filter-options.js +133 -105
  15. package/lowcode/cms-plugin/filter-options.ts +155 -129
  16. package/lowcode/cms-plugin/module/form-module.js +29 -1
  17. package/lowcode/cms-plugin/module/form-module.ts +30 -1
  18. package/lowcode/cms-plugin/module/user-excel.js +110 -0
  19. package/lowcode/cms-plugin/module/user-excel.ts +138 -1
  20. package/lowcode/cms-plugin/shopping-information.js +454 -422
  21. package/lowcode/cms-plugin/shopping-information.ts +468 -429
  22. package/lowcode/cms-plugin/shopping-product-setting.js +1 -0
  23. package/lowcode/cms-plugin/shopping-product-setting.ts +1 -0
  24. package/lowcode/cms-plugin/shopping-setting-advance.js +157 -115
  25. package/lowcode/cms-plugin/shopping-setting-advance.ts +225 -191
  26. package/lowcode/cms-plugin/user-list.js +341 -335
  27. package/lowcode/cms-plugin/user-list.ts +416 -410
  28. package/lowcode/css/editor.css +4 -6
  29. package/lowcode/glitter-base/global/language.js +17 -0
  30. package/lowcode/glitter-base/global/language.ts +17 -0
  31. package/lowcode/glitter-base/route/user.js +18 -46
  32. package/lowcode/glitter-base/route/user.ts +22 -47
  33. package/lowcode/glitterBundle/plugins/html-render.js +19 -1
  34. package/lowcode/glitterBundle/plugins/html-render.ts +40 -19
  35. package/lowcode/jspage/function-page/setting_editor.js +1 -1
  36. package/lowcode/jspage/function-page/setting_editor.ts +1 -1
  37. package/lowcode/public-components/form-module/input.js +6 -0
  38. package/lowcode/public-components/form-module/input.ts +9 -0
  39. package/lowcode/public-components/user-manager/um-class.js +4 -6
  40. package/lowcode/public-components/user-manager/um-class.ts +4 -6
  41. package/lowcode/public-models/product.ts +1 -1
  42. package/package.json +1 -1
  43. package/src/api-public/controllers/user.js +99 -63
  44. package/src/api-public/controllers/user.js.map +1 -1
  45. package/src/api-public/controllers/user.ts +132 -70
  46. package/src/api-public/services/shopping.js +21 -15
  47. package/src/api-public/services/shopping.js.map +1 -1
  48. package/src/api-public/services/shopping.ts +26 -19
  49. package/src/api-public/services/user.d.ts +11 -1
  50. package/src/api-public/services/user.js +122 -64
  51. package/src/api-public/services/user.js.map +1 -1
  52. package/src/api-public/services/user.ts +157 -77
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 : clockF();
134
134
  console.log(`Entry-time:`, window.renderClock.stop());
135
- glitter.share.editerVersion = 'V_18.3.2';
135
+ glitter.share.editerVersion = 'V_18.3.4';
136
136
  glitter.share.start = new Date();
137
137
  const vm = {
138
138
  appConfig: [],
@@ -599,6 +599,7 @@ export class Entry {
599
599
  backGroundColor: `transparent;`,
600
600
  });
601
601
  }
602
+ console.log(`(window as any).memberType=>`, window.memberType);
602
603
  if (window.memberType !== 'noLimit' &&
603
604
  vm.appConfig.dead_line &&
604
605
  new Date(vm.appConfig.dead_line).getTime() < new Date().getTime() &&
package/lowcode/Entry.ts CHANGED
@@ -135,7 +135,7 @@ export class Entry {
135
135
  }
136
136
  (window as any).renderClock = (window as any).renderClock ?? clockF();
137
137
  console.log(`Entry-time:`, (window as any).renderClock.stop());
138
- glitter.share.editerVersion = 'V_18.3.2';
138
+ glitter.share.editerVersion = 'V_18.3.4';
139
139
  glitter.share.start = new Date();
140
140
  const vm: {
141
141
  appConfig: any;
@@ -659,6 +659,7 @@ export class Entry {
659
659
  });
660
660
  }
661
661
 
662
+ console.log(`(window as any).memberType=>`,(window as any).memberType)
662
663
  // 判斷APP是否過期
663
664
  if (
664
665
  (window as any).memberType !== 'noLimit' &&
@@ -362,17 +362,6 @@ export class BgCustomerMessage {
362
362
  </div>
363
363
  <div style="margin-top: 10px;" class="p-2">
364
364
  ${[
365
- html `
366
- <div class="mb-3"
367
- style="display:flex; align-items: center; gap: 4px; margin-bottom: 8px;">
368
- <div class="fw-500"
369
- style="color: #393939;font-size: 15px;">啟用客服功能
370
- </div>
371
- ${BgWidget.switchButton(gvc, keyData.toggle, (bool) => {
372
- keyData.toggle = bool;
373
- gvc.notifyDataChange(vO.id);
374
- })}
375
- </div>`,
376
365
  ...(() => {
377
366
  if (keyData.toggle) {
378
367
  return [
@@ -395,17 +395,6 @@ export class BgCustomerMessage {
395
395
  </div>
396
396
  <div style="margin-top: 10px;" class="p-2">
397
397
  ${[
398
- html`
399
- <div class="mb-3"
400
- style="display:flex; align-items: center; gap: 4px; margin-bottom: 8px;">
401
- <div class="fw-500"
402
- style="color: #393939;font-size: 15px;">啟用客服功能
403
- </div>
404
- ${BgWidget.switchButton(gvc, keyData.toggle, (bool) => {
405
- keyData.toggle = bool;
406
- gvc.notifyDataChange(vO.id)
407
- })}
408
- </div>`,
409
398
  ...(() => {
410
399
  if (keyData.toggle) {
411
400
  return [
@@ -704,7 +704,8 @@ export class BgLine {
704
704
  });
705
705
  }
706
706
  if (tag === 'birth') {
707
- const birthData = FilterOptions.userFunnel.find((data) => data.key === 'birth');
707
+ const userFunnel = yield FilterOptions.getUserFunnel();
708
+ const birthData = userFunnel.find((data) => data.key === 'birth');
708
709
  if (birthData && Array.isArray(birthData.data)) {
709
710
  return birthData.data.map((item) => {
710
711
  item.value = item.name;
@@ -804,7 +804,8 @@ export class BgLine {
804
804
  });
805
805
  }
806
806
  if (tag === 'birth') {
807
- const birthData = FilterOptions.userFunnel.find((data) => data.key === 'birth');
807
+ const userFunnel = await FilterOptions.getUserFunnel();
808
+ const birthData = userFunnel.find((data) => data.key === 'birth');
808
809
  if (birthData && Array.isArray(birthData.data)) {
809
810
  return birthData.data.map((item: any) => {
810
811
  item.value = item.name;
@@ -763,7 +763,8 @@ export class BgNotify {
763
763
  });
764
764
  }
765
765
  if (tag === 'birth') {
766
- const birthData = FilterOptions.userFunnel.find((data) => data.key === 'birth');
766
+ const userFunnel = yield FilterOptions.getUserFunnel();
767
+ const birthData = userFunnel.find((data) => data.key === 'birth');
767
768
  if (birthData && Array.isArray(birthData.data)) {
768
769
  return birthData.data.map((item) => {
769
770
  item.value = item.name;
@@ -860,7 +860,8 @@ export class BgNotify {
860
860
  });
861
861
  }
862
862
  if (tag === 'birth') {
863
- const birthData = FilterOptions.userFunnel.find((data) => data.key === 'birth');
863
+ const userFunnel = await FilterOptions.getUserFunnel();
864
+ const birthData = userFunnel.find((data) => data.key === 'birth');
864
865
  if (birthData && Array.isArray(birthData.data)) {
865
866
  return birthData.data.map((item: any) => {
866
867
  item.value = item.name;
@@ -69,7 +69,7 @@ export class BgProduct {
69
69
  <div class="c_dialog_body">
70
70
  <div class="c_dialog_main" style="gap: 24px; max-height: 500px;">
71
71
  <div class="d-flex" style="gap: 12px;">
72
- ${BgWidget.searchFilter(gvc.event((e, event) => {
72
+ ${BgWidget.searchFilter(gvc.event((e) => {
73
73
  vm.query = e.value;
74
74
  vm.loading = true;
75
75
  gvc.notifyDataChange(vm.id);
@@ -318,10 +318,13 @@ export class BgProduct {
318
318
  static replaceAngle(text) {
319
319
  return text.replace(/\//g, html `<i class="fa-solid fa-angle-right mx-1"></i>`);
320
320
  }
321
+ static getWidthHeigth(isDesktop) {
322
+ return isDesktop ? ['800px', '600px', 'calc(600px - 120px) !important'] : ['95vw', '70vh', 'calc(70vh - 120px) !important'];
323
+ }
321
324
  static setMemberPriceSetting(obj) {
322
325
  const { gvc, postData, callback } = obj;
323
326
  const isDesktop = document.body.clientWidth > 768;
324
- const [baseWidth, baseHeight, mainHeight] = isDesktop ? ['800px', '600px', 'calc(600px - 120px) !important'] : ['95vw', '70vh', 'calc(70vh - 120px) !important'];
327
+ const [baseWidth, baseHeight, mainHeight] = this.getWidthHeigth(isDesktop);
325
328
  const vm = {
326
329
  dataList: [],
327
330
  postData: [...postData],
@@ -389,7 +392,7 @@ export class BgProduct {
389
392
  static setStorePriceSetting(obj) {
390
393
  const { gvc, postData, callback } = obj;
391
394
  const isDesktop = document.body.clientWidth > 768;
392
- const [baseWidth, baseHeight, mainHeight] = isDesktop ? ['800px', '600px', 'calc(600px - 120px) !important'] : ['95vw', '70vh', 'calc(70vh - 120px) !important'];
395
+ const [baseWidth, baseHeight, mainHeight] = this.getWidthHeigth(isDesktop);
393
396
  const vm = {
394
397
  dataList: [],
395
398
  postData: [...postData],
@@ -459,6 +462,70 @@ export class BgProduct {
459
462
  });
460
463
  }, 'setMemberPriceSetting');
461
464
  }
465
+ static setUserTagPriceSetting(obj) {
466
+ const { gvc, postData, callback } = obj;
467
+ const isDesktop = document.body.clientWidth > 768;
468
+ const [baseWidth, baseHeight, mainHeight] = this.getWidthHeigth(isDesktop);
469
+ const vm = {
470
+ dataList: [],
471
+ postData: [...postData],
472
+ loading: true,
473
+ };
474
+ return gvc.glitter.innerDialog((gvc) => {
475
+ const id = gvc.glitter.getUUID();
476
+ ApiUser.getPublicConfig('user_general_tags', 'manager').then((r) => {
477
+ if (r.result && Array.isArray(r.response.value.list)) {
478
+ vm.dataList = r.response.value.list.map((tag) => ({ key: tag, name: tag }));
479
+ }
480
+ vm.loading = false;
481
+ gvc.notifyDataChange(id);
482
+ });
483
+ return gvc.bindView({
484
+ bind: id,
485
+ view: () => html ` <div class="bg-white shadow ${isDesktop ? 'rounded-3' : ''}" style="overflow-y: auto; width: ${baseWidth}; height: ${baseHeight};">
486
+ <div class="h-100">
487
+ ${vm.loading
488
+ ? html `<div class="h-100 d-flex">${BgWidget.spinner()}</div>`
489
+ : html ` <div class="bg-white shadow rounded-3" style="width: 100%; max-height: 100%; overflow-y: auto; position: relative;">
490
+ <div class="w-100 d-flex align-items-center p-3 border-bottom" style="position: sticky; top: 0; z-index: 2; background: #fff;">
491
+ <div class="tx_700">顧客標籤價格設定</div>
492
+ <div class="flex-fill"></div>
493
+ <i class="fa-regular fa-circle-xmark fs-5 text-dark cursor_pointer" onclick="${gvc.event(() => gvc.closeDialog())}"></i>
494
+ </div>
495
+ <div class="c_dialog h-100">
496
+ <div class="c_dialog_body h-100">
497
+ <div class="c_dialog_main h-100" style="min-height: ${mainHeight}; padding: 20px; gap: 0;">
498
+ ${BgWidget.tripletCheckboxContainer(gvc, '顧客標籤', (() => {
499
+ if (vm.postData.length === 0)
500
+ return -1;
501
+ return vm.postData.length === vm.dataList.length ? 1 : 0;
502
+ })(), (r) => {
503
+ vm.postData = r === 1 ? vm.dataList.map(({ key }) => key) : [];
504
+ gvc.notifyDataChange(id);
505
+ })}
506
+ ${BgWidget.horizontalLine()}
507
+ ${BgWidget.multiCheckboxContainer(gvc, vm.dataList, vm.postData, (text) => {
508
+ vm.postData = text;
509
+ gvc.notifyDataChange(id);
510
+ })}
511
+ ${BgWidget.grayNote('※只有被選取的會員才能設置專屬價格,其餘依售價計算', 'margin-top: 12px;')}
512
+ </div>
513
+ <div class="c_dialog_bar" style="z-index: 2;">
514
+ ${BgWidget.cancel(gvc.event(() => gvc.closeDialog()))}
515
+ ${BgWidget.save(gvc.event(() => {
516
+ callback(vm.postData);
517
+ gvc.closeDialog();
518
+ }), '確認')}
519
+ </div>
520
+ </div>
521
+ </div>
522
+ </div>`}
523
+ </div>
524
+ </div>`,
525
+ divCreate: {},
526
+ });
527
+ }, 'setUserTagPriceSetting');
528
+ }
462
529
  }
463
530
  BgProduct.getProductOpts = (def, productType) => {
464
531
  return new Promise((resolve) => {
@@ -105,7 +105,7 @@ export class BgProduct {
105
105
  <div class="c_dialog_main" style="gap: 24px; max-height: 500px;">
106
106
  <div class="d-flex" style="gap: 12px;">
107
107
  ${BgWidget.searchFilter(
108
- gvc.event((e, event) => {
108
+ gvc.event((e) => {
109
109
  vm.query = e.value;
110
110
  vm.loading = true;
111
111
  gvc.notifyDataChange(vm.id);
@@ -449,10 +449,14 @@ export class BgProduct {
449
449
  return text.replace(/\//g, html`<i class="fa-solid fa-angle-right mx-1"></i>`);
450
450
  }
451
451
 
452
+ static getWidthHeigth(isDesktop: boolean): [string, string, string] {
453
+ return isDesktop ? ['800px', '600px', 'calc(600px - 120px) !important'] : ['95vw', '70vh', 'calc(70vh - 120px) !important'];
454
+ }
455
+
452
456
  static setMemberPriceSetting(obj: { gvc: GVC; postData: string[]; callback: (data: string[]) => void }) {
453
457
  const { gvc, postData, callback } = obj;
454
458
  const isDesktop = document.body.clientWidth > 768;
455
- const [baseWidth, baseHeight, mainHeight] = isDesktop ? ['800px', '600px', 'calc(600px - 120px) !important'] : ['95vw', '70vh', 'calc(70vh - 120px) !important'];
459
+ const [baseWidth, baseHeight, mainHeight] = this.getWidthHeigth(isDesktop);
456
460
 
457
461
  const vm = {
458
462
  dataList: [] as { key: string; name: string }[],
@@ -532,7 +536,7 @@ export class BgProduct {
532
536
  static setStorePriceSetting(obj: { gvc: GVC; postData: string[]; callback: (data: string[]) => void }) {
533
537
  const { gvc, postData, callback } = obj;
534
538
  const isDesktop = document.body.clientWidth > 768;
535
- const [baseWidth, baseHeight, mainHeight] = isDesktop ? ['800px', '600px', 'calc(600px - 120px) !important'] : ['95vw', '70vh', 'calc(70vh - 120px) !important'];
539
+ const [baseWidth, baseHeight, mainHeight] = this.getWidthHeigth(isDesktop);
536
540
 
537
541
  const vm = {
538
542
  dataList: [] as { key: string; name: string }[],
@@ -614,4 +618,81 @@ export class BgProduct {
614
618
  });
615
619
  }, 'setMemberPriceSetting');
616
620
  }
621
+
622
+ static setUserTagPriceSetting(obj: { gvc: GVC; postData: string[]; callback: (data: string[]) => void }) {
623
+ const { gvc, postData, callback } = obj;
624
+ const isDesktop = document.body.clientWidth > 768;
625
+ const [baseWidth, baseHeight, mainHeight] = this.getWidthHeigth(isDesktop);
626
+
627
+ const vm = {
628
+ dataList: [] as { key: string; name: string }[],
629
+ postData: [...postData],
630
+ loading: true,
631
+ };
632
+
633
+ return gvc.glitter.innerDialog((gvc) => {
634
+ const id = gvc.glitter.getUUID();
635
+
636
+ ApiUser.getPublicConfig('user_general_tags', 'manager').then((r: any) => {
637
+ if (r.result && Array.isArray(r.response.value.list)) {
638
+ vm.dataList = r.response.value.list.map((tag: string) => ({ key: tag, name: tag }));
639
+ }
640
+ vm.loading = false;
641
+ gvc.notifyDataChange(id);
642
+ });
643
+
644
+ return gvc.bindView({
645
+ bind: id,
646
+ view: () =>
647
+ html` <div class="bg-white shadow ${isDesktop ? 'rounded-3' : ''}" style="overflow-y: auto; width: ${baseWidth}; height: ${baseHeight};">
648
+ <div class="h-100">
649
+ ${vm.loading
650
+ ? html`<div class="h-100 d-flex">${BgWidget.spinner()}</div>`
651
+ : html` <div class="bg-white shadow rounded-3" style="width: 100%; max-height: 100%; overflow-y: auto; position: relative;">
652
+ <div class="w-100 d-flex align-items-center p-3 border-bottom" style="position: sticky; top: 0; z-index: 2; background: #fff;">
653
+ <div class="tx_700">顧客標籤價格設定</div>
654
+ <div class="flex-fill"></div>
655
+ <i class="fa-regular fa-circle-xmark fs-5 text-dark cursor_pointer" onclick="${gvc.event(() => gvc.closeDialog())}"></i>
656
+ </div>
657
+ <div class="c_dialog h-100">
658
+ <div class="c_dialog_body h-100">
659
+ <div class="c_dialog_main h-100" style="min-height: ${mainHeight}; padding: 20px; gap: 0;">
660
+ ${BgWidget.tripletCheckboxContainer(
661
+ gvc,
662
+ '顧客標籤',
663
+ (() => {
664
+ if (vm.postData.length === 0) return -1;
665
+ return vm.postData.length === vm.dataList.length ? 1 : 0;
666
+ })(),
667
+ (r) => {
668
+ vm.postData = r === 1 ? vm.dataList.map(({ key }) => key) : [];
669
+ gvc.notifyDataChange(id);
670
+ }
671
+ )}
672
+ ${BgWidget.horizontalLine()}
673
+ ${BgWidget.multiCheckboxContainer(gvc, vm.dataList, vm.postData, (text) => {
674
+ vm.postData = text;
675
+ gvc.notifyDataChange(id);
676
+ })}
677
+ ${BgWidget.grayNote('※只有被選取的會員才能設置專屬價格,其餘依售價計算', 'margin-top: 12px;')}
678
+ </div>
679
+ <div class="c_dialog_bar" style="z-index: 2;">
680
+ ${BgWidget.cancel(gvc.event(() => gvc.closeDialog()))}
681
+ ${BgWidget.save(
682
+ gvc.event(() => {
683
+ callback(vm.postData);
684
+ gvc.closeDialog();
685
+ }),
686
+ '確認'
687
+ )}
688
+ </div>
689
+ </div>
690
+ </div>
691
+ </div>`}
692
+ </div>
693
+ </div>`,
694
+ divCreate: {},
695
+ });
696
+ }, 'setUserTagPriceSetting');
697
+ }
617
698
  }
@@ -443,10 +443,6 @@ export class BgRecommend {
443
443
  vm.query || '',
444
444
  '搜尋推薦人'
445
445
  ),
446
- // BgWidget.funnelFilter({
447
- // gvc,
448
- // callback: () => ListComp.showRightMenu(FilterOptions.userFunnel),
449
- // }),
450
446
  BgWidget.updownFilter({
451
447
  gvc,
452
448
  callback: (value: any) => {
@@ -731,7 +731,8 @@ export class BgSNS {
731
731
  });
732
732
  }
733
733
  if (tag === 'birth') {
734
- const birthData = FilterOptions.userFunnel.find((data) => data.key === 'birth');
734
+ const userFunnel = yield FilterOptions.getUserFunnel();
735
+ const birthData = userFunnel.find((data) => data.key === 'birth');
735
736
  if (birthData && Array.isArray(birthData.data)) {
736
737
  return birthData.data.map((item) => {
737
738
  item.value = item.name;
@@ -831,7 +831,8 @@ export class BgSNS {
831
831
  });
832
832
  }
833
833
  if (tag === 'birth') {
834
- const birthData = FilterOptions.userFunnel.find((data) => data.key === 'birth');
834
+ const userFunnel = await FilterOptions.getUserFunnel();
835
+ const birthData = userFunnel.find((data) => data.key === 'birth');
835
836
  if (birthData && Array.isArray(birthData.data)) {
836
837
  return birthData.data.map((item: any) => {
837
838
  item.value = item.name;