ts-glitter 21.1.8 → 21.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/lowcode/Entry.js +14 -1
  2. package/lowcode/Entry.ts +13 -1
  3. package/lowcode/backend-manager/bg-line.js +18 -10
  4. package/lowcode/backend-manager/bg-line.ts +19 -10
  5. package/lowcode/backend-manager/bg-list-component.js +1 -2
  6. package/lowcode/backend-manager/bg-list-component.ts +1 -1
  7. package/lowcode/backend-manager/bg-notify.js +17 -10
  8. package/lowcode/backend-manager/bg-notify.ts +19 -11
  9. package/lowcode/backend-manager/bg-recommend.js +15 -9
  10. package/lowcode/backend-manager/bg-recommend.ts +16 -9
  11. package/lowcode/backend-manager/bg-sns.js +16 -9
  12. package/lowcode/backend-manager/bg-sns.ts +18 -11
  13. package/lowcode/backend-manager/bg-widget.js +325 -261
  14. package/lowcode/backend-manager/bg-widget.ts +117 -45
  15. package/lowcode/cms-plugin/auto-fcm-history.js +15 -6
  16. package/lowcode/cms-plugin/auto-fcm-history.ts +18 -11
  17. package/lowcode/cms-plugin/auto-reply.js +17 -1
  18. package/lowcode/cms-plugin/auto-reply.ts +16 -1
  19. package/lowcode/cms-plugin/exhibition-list.js +11 -2
  20. package/lowcode/cms-plugin/exhibition-list.ts +12 -2
  21. package/lowcode/cms-plugin/live_capture.js +2 -2
  22. package/lowcode/cms-plugin/live_capture.ts +2 -2
  23. package/lowcode/cms-plugin/model/order.d.ts +1 -0
  24. package/lowcode/cms-plugin/module/order-excel.js +15 -1
  25. package/lowcode/cms-plugin/module/order-excel.ts +22 -2
  26. package/lowcode/cms-plugin/module/table-storage.js +11 -0
  27. package/lowcode/cms-plugin/module/table-storage.ts +12 -0
  28. package/lowcode/cms-plugin/permission-setting.js +16 -9
  29. package/lowcode/cms-plugin/permission-setting.ts +18 -10
  30. package/lowcode/cms-plugin/reconciliation-area.js +12 -3
  31. package/lowcode/cms-plugin/reconciliation-area.ts +13 -3
  32. package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -3
  33. package/lowcode/cms-plugin/shopping-allowance-manager.ts +13 -3
  34. package/lowcode/cms-plugin/shopping-invoice-manager.js +12 -3
  35. package/lowcode/cms-plugin/shopping-invoice-manager.ts +13 -4
  36. package/lowcode/cms-plugin/shopping-order-manager.js +12 -3
  37. package/lowcode/cms-plugin/shopping-order-manager.ts +13 -4
  38. package/lowcode/cms-plugin/shopping-product-setting.js +16 -10
  39. package/lowcode/cms-plugin/shopping-product-setting.ts +17 -10
  40. package/lowcode/cms-plugin/shopping-product-stock.js +17 -11
  41. package/lowcode/cms-plugin/shopping-product-stock.ts +18 -11
  42. package/lowcode/cms-plugin/shopping-setting-basic.js +129 -38
  43. package/lowcode/cms-plugin/shopping-setting-basic.ts +134 -38
  44. package/lowcode/cms-plugin/stock-history.js +14 -7
  45. package/lowcode/cms-plugin/stock-history.ts +15 -7
  46. package/lowcode/cms-plugin/stock-stores.js +13 -6
  47. package/lowcode/cms-plugin/stock-stores.ts +14 -6
  48. package/lowcode/cms-plugin/stock-vendors.js +13 -6
  49. package/lowcode/cms-plugin/stock-vendors.ts +14 -6
  50. package/lowcode/cms-plugin/user-list.js +24 -7
  51. package/lowcode/cms-plugin/user-list.ts +25 -7
  52. package/lowcode/css/editor.css +9 -4
  53. package/lowcode/public-components/product/pd-class.js +11 -2
  54. package/lowcode/public-components/product/pd-class.ts +16 -3
  55. package/lowcode/public-components/public/ad.js +42 -10
  56. package/lowcode/public-components/public/ad.ts +28 -1
  57. package/lowcode/public-models/product.ts +1 -0
  58. package/lowcode/view-model/saas-view-model.js +394 -379
  59. package/lowcode/view-model/saas-view-model.ts +1451 -1405
  60. package/package.json +1 -1
  61. package/src/api-public/controllers/user.js +4 -4
  62. package/src/api-public/controllers/user.js.map +1 -1
  63. package/src/api-public/controllers/user.ts +4 -4
  64. package/src/api-public/services/checkout-event.js +7 -17
  65. package/src/api-public/services/checkout-event.js.map +1 -1
  66. package/src/api-public/services/fb-api.d.ts +4 -3
  67. package/src/api-public/services/fb-api.js +72 -27
  68. package/src/api-public/services/fb-api.js.map +1 -1
  69. package/src/api-public/services/fb-api.ts +183 -127
  70. package/src/api-public/services/user.d.ts +6 -5
  71. package/src/api-public/services/user.js +19 -27
  72. package/src/api-public/services/user.js.map +1 -1
  73. package/src/api-public/services/user.ts +14 -10
  74. package/src/seo-config.js +1 -0
  75. package/src/seo-config.js.map +1 -1
  76. package/src/seo-config.ts +1 -0
  77. package/src/services/app.js +7 -17
  78. package/src/services/app.js.map +1 -1
@@ -7,6 +7,7 @@ import { ApiUser } from '../glitter-base/route/user.js';
7
7
  import { ApiStock } from '../glitter-base/route/stock.js';
8
8
  import { CheckInput } from '../modules/checkInput.js';
9
9
  import { Tool } from '../modules/tool.js';
10
+ import { TableStorage } from './module/table-storage.js';
10
11
  const html = String.raw;
11
12
  export class StockStores {
12
13
  static main(gvc, isShop) {
@@ -22,6 +23,7 @@ export class StockStores {
22
23
  filter: {},
23
24
  orderString: '',
24
25
  isShop: isShop,
26
+ listLimit: TableStorage.getLimit(),
25
27
  };
26
28
  return gvc.bindView({
27
29
  bind: vm.id,
@@ -96,8 +98,7 @@ export class StockStores {
96
98
  gvc,
97
99
  callback: (value) => {
98
100
  vm.queryType = value;
99
- gvc.notifyDataChange(vm.tableId);
100
- gvc.notifyDataChange(id);
101
+ gvc.notifyDataChange([vm.tableId, id]);
101
102
  },
102
103
  default: vm.queryType || 'name',
103
104
  options: isShop
@@ -111,9 +112,16 @@ export class StockStores {
111
112
  }),
112
113
  BgWidget.searchFilter(gvc.event(e => {
113
114
  vm.query = `${e.value}`.trim();
114
- gvc.notifyDataChange(vm.tableId);
115
- gvc.notifyDataChange(id);
115
+ gvc.notifyDataChange([vm.tableId, id]);
116
116
  }), vm.query || '', isShop ? '搜尋門市名稱' : '搜尋庫存點名稱'),
117
+ BgWidget.countingFilter({
118
+ gvc,
119
+ callback: value => {
120
+ vm.listLimit = value;
121
+ gvc.notifyDataChange([vm.tableId, id]);
122
+ },
123
+ default: vm.listLimit,
124
+ }),
117
125
  ];
118
126
  const filterTags = ListComp.getFilterTags(FilterOptions.storesFunnel);
119
127
  return BgListComponent.listBarRWD(filterList, filterTags);
@@ -127,10 +135,9 @@ export class StockStores {
127
135
  gvc: gvc,
128
136
  getData: vd => {
129
137
  vmi = vd;
130
- const limit = 100;
131
138
  function callback(list) {
132
139
  vm.dataList = list;
133
- vmi.pageSize = Math.ceil(list.length / limit);
140
+ vmi.pageSize = Math.ceil(list.length / vm.listLimit);
134
141
  vmi.originalData = vm.dataList;
135
142
  vmi.tableData = getDatalist();
136
143
  vmi.loading = false;
@@ -8,6 +8,7 @@ import { ApiUser } from '../glitter-base/route/user.js';
8
8
  import { ApiStock } from '../glitter-base/route/stock.js';
9
9
  import { CheckInput } from '../modules/checkInput.js';
10
10
  import { Tool } from '../modules/tool.js';
11
+ import { TableStorage } from './module/table-storage.js';
11
12
 
12
13
  const html = String.raw;
13
14
 
@@ -32,6 +33,7 @@ type VM = {
32
33
  queryType: string;
33
34
  orderString: string;
34
35
  isShop: boolean;
36
+ listLimit: number;
35
37
  };
36
38
 
37
39
  export class StockStores {
@@ -48,6 +50,7 @@ export class StockStores {
48
50
  filter: {},
49
51
  orderString: '',
50
52
  isShop: isShop,
53
+ listLimit: TableStorage.getLimit(),
51
54
  };
52
55
 
53
56
  return gvc.bindView({
@@ -134,8 +137,7 @@ export class StockStores {
134
137
  gvc,
135
138
  callback: (value: any) => {
136
139
  vm.queryType = value;
137
- gvc.notifyDataChange(vm.tableId);
138
- gvc.notifyDataChange(id);
140
+ gvc.notifyDataChange([vm.tableId, id]);
139
141
  },
140
142
  default: vm.queryType || 'name',
141
143
  options: isShop
@@ -150,12 +152,19 @@ export class StockStores {
150
152
  BgWidget.searchFilter(
151
153
  gvc.event(e => {
152
154
  vm.query = `${e.value}`.trim();
153
- gvc.notifyDataChange(vm.tableId);
154
- gvc.notifyDataChange(id);
155
+ gvc.notifyDataChange([vm.tableId, id]);
155
156
  }),
156
157
  vm.query || '',
157
158
  isShop ? '搜尋門市名稱' : '搜尋庫存點名稱'
158
159
  ),
160
+ BgWidget.countingFilter({
161
+ gvc,
162
+ callback: value => {
163
+ vm.listLimit = value;
164
+ gvc.notifyDataChange([vm.tableId, id]);
165
+ },
166
+ default: vm.listLimit,
167
+ }),
159
168
  ];
160
169
 
161
170
  const filterTags = ListComp.getFilterTags(FilterOptions.storesFunnel);
@@ -170,11 +179,10 @@ export class StockStores {
170
179
  gvc: gvc,
171
180
  getData: vd => {
172
181
  vmi = vd;
173
- const limit = 100;
174
182
 
175
183
  function callback(list: StoreData[]) {
176
184
  vm.dataList = list;
177
- vmi.pageSize = Math.ceil(list.length / limit);
185
+ vmi.pageSize = Math.ceil(list.length / vm.listLimit);
178
186
  vmi.originalData = vm.dataList;
179
187
  vmi.tableData = getDatalist();
180
188
  vmi.loading = false;
@@ -6,6 +6,7 @@ import { FilterOptions } from './filter-options.js';
6
6
  import { ApiUser } from '../glitter-base/route/user.js';
7
7
  import { CheckInput } from '../modules/checkInput.js';
8
8
  import { Tool } from '../modules/tool.js';
9
+ import { TableStorage } from './module/table-storage.js';
9
10
  const html = String.raw;
10
11
  export class StockVendors {
11
12
  static main(gvc) {
@@ -20,6 +21,7 @@ export class StockVendors {
20
21
  queryType: '',
21
22
  filter: {},
22
23
  orderString: '',
24
+ listLimit: TableStorage.getLimit(),
23
25
  };
24
26
  return gvc.bindView({
25
27
  bind: vm.id,
@@ -83,17 +85,23 @@ export class StockVendors {
83
85
  gvc,
84
86
  callback: (value) => {
85
87
  vm.queryType = value;
86
- gvc.notifyDataChange(vm.tableId);
87
- gvc.notifyDataChange(id);
88
+ gvc.notifyDataChange([vm.tableId, id]);
88
89
  },
89
90
  default: vm.queryType || 'name',
90
91
  options: FilterOptions.vendorsSelect,
91
92
  }),
92
93
  BgWidget.searchFilter(gvc.event(e => {
93
94
  vm.query = `${e.value}`.trim();
94
- gvc.notifyDataChange(vm.tableId);
95
- gvc.notifyDataChange(id);
95
+ gvc.notifyDataChange([vm.tableId, id]);
96
96
  }), vm.query || '', '搜尋庫存點名稱'),
97
+ BgWidget.countingFilter({
98
+ gvc,
99
+ callback: value => {
100
+ vm.listLimit = value;
101
+ gvc.notifyDataChange([vm.tableId, id]);
102
+ },
103
+ default: vm.listLimit,
104
+ }),
97
105
  ];
98
106
  const filterTags = ListComp.getFilterTags(FilterOptions.vendorsFunnel);
99
107
  return BgListComponent.listBarRWD(filterList, filterTags);
@@ -107,14 +115,13 @@ export class StockVendors {
107
115
  gvc: gvc,
108
116
  getData: vd => {
109
117
  vmi = vd;
110
- const limit = 100;
111
118
  this.getPublicData().then((data) => {
112
119
  if (data.list) {
113
120
  data.list = data.list.filter((item) => {
114
121
  return vm.query === '' || item.name.includes(vm.query);
115
122
  });
116
123
  vm.dataList = data.list;
117
- vmi.pageSize = Math.ceil(data.list.length / limit);
124
+ vmi.pageSize = Math.ceil(data.list.length / vm.listLimit);
118
125
  vmi.originalData = vm.dataList;
119
126
  vmi.tableData = getDatalist();
120
127
  }
@@ -7,6 +7,7 @@ import { FilterOptions } from './filter-options.js';
7
7
  import { ApiUser } from '../glitter-base/route/user.js';
8
8
  import { CheckInput } from '../modules/checkInput.js';
9
9
  import { Tool } from '../modules/tool.js';
10
+ import { TableStorage } from './module/table-storage.js';
10
11
 
11
12
  const html = String.raw;
12
13
 
@@ -29,6 +30,7 @@ type VM = {
29
30
  query: string;
30
31
  queryType: string;
31
32
  orderString: string;
33
+ listLimit: number;
32
34
  };
33
35
 
34
36
  export class StockVendors {
@@ -45,6 +47,7 @@ export class StockVendors {
45
47
  queryType: '',
46
48
  filter: {},
47
49
  orderString: '',
50
+ listLimit: TableStorage.getLimit(),
48
51
  };
49
52
 
50
53
  return gvc.bindView({
@@ -133,8 +136,7 @@ export class StockVendors {
133
136
  gvc,
134
137
  callback: (value: any) => {
135
138
  vm.queryType = value;
136
- gvc.notifyDataChange(vm.tableId);
137
- gvc.notifyDataChange(id);
139
+ gvc.notifyDataChange([vm.tableId, id]);
138
140
  },
139
141
  default: vm.queryType || 'name',
140
142
  options: FilterOptions.vendorsSelect,
@@ -142,12 +144,19 @@ export class StockVendors {
142
144
  BgWidget.searchFilter(
143
145
  gvc.event(e => {
144
146
  vm.query = `${e.value}`.trim();
145
- gvc.notifyDataChange(vm.tableId);
146
- gvc.notifyDataChange(id);
147
+ gvc.notifyDataChange([vm.tableId, id]);
147
148
  }),
148
149
  vm.query || '',
149
150
  '搜尋庫存點名稱'
150
151
  ),
152
+ BgWidget.countingFilter({
153
+ gvc,
154
+ callback: value => {
155
+ vm.listLimit = value;
156
+ gvc.notifyDataChange([vm.tableId, id]);
157
+ },
158
+ default: vm.listLimit,
159
+ }),
151
160
  ];
152
161
 
153
162
  const filterTags = ListComp.getFilterTags(FilterOptions.vendorsFunnel);
@@ -162,14 +171,13 @@ export class StockVendors {
162
171
  gvc: gvc,
163
172
  getData: vd => {
164
173
  vmi = vd;
165
- const limit = 100;
166
174
  this.getPublicData().then((data: any) => {
167
175
  if (data.list) {
168
176
  data.list = data.list.filter((item: VendorData) => {
169
177
  return vm.query === '' || item.name.includes(vm.query);
170
178
  });
171
179
  vm.dataList = data.list;
172
- vmi.pageSize = Math.ceil(data.list.length / limit);
180
+ vmi.pageSize = Math.ceil(data.list.length / vm.listLimit);
173
181
  vmi.originalData = vm.dataList;
174
182
  vmi.tableData = getDatalist();
175
183
  }
@@ -26,6 +26,7 @@ import { UserExcel } from './module/user-excel.js';
26
26
  import { GlobalUser } from '../glitter-base/global/global-user.js';
27
27
  import { ListHeaderOption } from './list-header-option.js';
28
28
  import { UserModule } from './user/user-module.js';
29
+ import { TableStorage } from './module/table-storage.js';
29
30
  const html = String.raw;
30
31
  export class UserList {
31
32
  static main(gvc, obj) {
@@ -53,6 +54,7 @@ export class UserList {
53
54
  headerConfig: [],
54
55
  apiJSON: {},
55
56
  checkedData: [],
57
+ listLimit: TableStorage.getLimit(),
56
58
  };
57
59
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.userFilterFrame);
58
60
  vm.filter = ListComp.getFilterObject();
@@ -300,6 +302,14 @@ export class UserList {
300
302
  vm.query = `${e.value}`.trim();
301
303
  gvc.notifyDataChange([vm.barId, vm.tableId]);
302
304
  }), vm.query || '', '搜尋所有用戶'),
305
+ BgWidget.countingFilter({
306
+ gvc,
307
+ callback: value => {
308
+ vm.listLimit = value;
309
+ gvc.notifyDataChange([vm.barId, vm.tableId]);
310
+ },
311
+ default: vm.listLimit,
312
+ }),
303
313
  BgWidget.funnelFilter({
304
314
  gvc,
305
315
  callback: () => ListComp.showRightMenu(userFunnel),
@@ -358,10 +368,9 @@ export class UserList {
358
368
  vmi = vd;
359
369
  vm.tabLoading = true;
360
370
  UserList.vm.page = vmi.page;
361
- const limit = 20;
362
371
  vm.apiJSON = {
363
372
  page: vmi.page - 1,
364
- limit: limit,
373
+ limit: vm.listLimit,
365
374
  search: vm.query || undefined,
366
375
  searchType: vm.queryType || 'name',
367
376
  orderString: vm.orderString || '',
@@ -371,8 +380,8 @@ export class UserList {
371
380
  };
372
381
  ApiUser.getUserListOrders(vm.apiJSON).then(data => {
373
382
  vm.dataList = data.response.data;
374
- vmi.limit = limit;
375
- vmi.pageSize = Math.ceil(data.response.total / limit);
383
+ vmi.limit = vm.listLimit;
384
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
376
385
  vmi.originalData = vm.dataList;
377
386
  vmi.tableData = getUserlist();
378
387
  vmi.allResult = () => __awaiter(this, void 0, void 0, function* () {
@@ -495,6 +504,7 @@ export class UserList {
495
504
  headerConfig: [],
496
505
  apiJSON: {},
497
506
  checkedData: [],
507
+ listLimit: TableStorage.getLimit(),
498
508
  };
499
509
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.userFilterFrame);
500
510
  vm.filter = ListComp.getFilterObject();
@@ -558,6 +568,14 @@ export class UserList {
558
568
  vm.query = `${e.value}`.trim();
559
569
  gvc.notifyDataChange([vm.barId, vm.tableId]);
560
570
  }), vm.query || '', '搜尋會員電話/編號/名稱'),
571
+ BgWidget.countingFilter({
572
+ gvc,
573
+ callback: value => {
574
+ vm.listLimit = value;
575
+ gvc.notifyDataChange([vm.barId, vm.tableId]);
576
+ },
577
+ default: vm.listLimit,
578
+ }),
561
579
  BgWidget.funnelFilter({
562
580
  gvc,
563
581
  callback: () => ListComp.showRightMenu(userFunnel),
@@ -584,10 +602,9 @@ export class UserList {
584
602
  gvc: gvc,
585
603
  getData: vd => {
586
604
  vmi = vd;
587
- const limit = 20;
588
605
  vm.apiJSON = {
589
606
  page: vmi.page - 1,
590
- limit: limit,
607
+ limit: vm.listLimit,
591
608
  search: vm.query || undefined,
592
609
  searchType: vm.queryType || 'name',
593
610
  orderString: vm.orderString || '',
@@ -597,7 +614,7 @@ export class UserList {
597
614
  };
598
615
  ApiUser.getUserListOrders(vm.apiJSON).then(data => {
599
616
  vm.dataList = data.response.data;
600
- vmi.pageSize = Math.ceil(data.response.total / limit);
617
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
601
618
  vmi.originalData = vm.dataList;
602
619
  vmi.tableData = getDatalist();
603
620
  vmi.loading = false;
@@ -18,6 +18,7 @@ import { UserExcel } from './module/user-excel.js';
18
18
  import { GlobalUser } from '../glitter-base/global/global-user.js';
19
19
  import { ListHeaderOption } from './list-header-option.js';
20
20
  import { UserModule } from './user/user-module.js';
21
+ import { TableStorage } from './module/table-storage.js';
21
22
 
22
23
  const html = String.raw;
23
24
 
@@ -43,6 +44,7 @@ type ViewModel = {
43
44
  headerConfig: string[];
44
45
  apiJSON: any;
45
46
  checkedData: any[];
47
+ listLimit: number;
46
48
  };
47
49
 
48
50
  export class UserList {
@@ -89,6 +91,7 @@ export class UserList {
89
91
  headerConfig: [],
90
92
  apiJSON: {},
91
93
  checkedData: [],
94
+ listLimit: TableStorage.getLimit(),
92
95
  };
93
96
 
94
97
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.userFilterFrame);
@@ -369,6 +372,14 @@ export class UserList {
369
372
  vm.query || '',
370
373
  '搜尋所有用戶'
371
374
  ),
375
+ BgWidget.countingFilter({
376
+ gvc,
377
+ callback: value => {
378
+ vm.listLimit = value;
379
+ gvc.notifyDataChange([vm.barId, vm.tableId]);
380
+ },
381
+ default: vm.listLimit,
382
+ }),
372
383
  BgWidget.funnelFilter({
373
384
  gvc,
374
385
  callback: () => ListComp.showRightMenu(userFunnel),
@@ -433,11 +444,10 @@ export class UserList {
433
444
  vmi = vd;
434
445
  vm.tabLoading = true;
435
446
  UserList.vm.page = vmi.page;
436
- const limit = 20;
437
447
 
438
448
  vm.apiJSON = {
439
449
  page: vmi.page - 1,
440
- limit: limit,
450
+ limit: vm.listLimit,
441
451
  search: vm.query || undefined,
442
452
  searchType: vm.queryType || 'name',
443
453
  orderString: vm.orderString || '',
@@ -448,8 +458,8 @@ export class UserList {
448
458
 
449
459
  ApiUser.getUserListOrders(vm.apiJSON).then(data => {
450
460
  vm.dataList = data.response.data;
451
- vmi.limit = limit;
452
- vmi.pageSize = Math.ceil(data.response.total / limit);
461
+ vmi.limit = vm.listLimit;
462
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
453
463
  vmi.originalData = vm.dataList;
454
464
  vmi.tableData = getUserlist();
455
465
 
@@ -588,6 +598,7 @@ export class UserList {
588
598
  headerConfig: [],
589
599
  apiJSON: {},
590
600
  checkedData: [],
601
+ listLimit: TableStorage.getLimit(),
591
602
  };
592
603
 
593
604
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.userFilterFrame);
@@ -660,6 +671,14 @@ export class UserList {
660
671
  vm.query || '',
661
672
  '搜尋會員電話/編號/名稱'
662
673
  ),
674
+ BgWidget.countingFilter({
675
+ gvc,
676
+ callback: value => {
677
+ vm.listLimit = value;
678
+ gvc.notifyDataChange([vm.barId, vm.tableId]);
679
+ },
680
+ default: vm.listLimit,
681
+ }),
663
682
  BgWidget.funnelFilter({
664
683
  gvc,
665
684
  callback: () => ListComp.showRightMenu(userFunnel),
@@ -687,10 +706,9 @@ export class UserList {
687
706
  gvc: gvc,
688
707
  getData: vd => {
689
708
  vmi = vd;
690
- const limit = 20;
691
709
  vm.apiJSON = {
692
710
  page: vmi.page - 1,
693
- limit: limit,
711
+ limit: vm.listLimit,
694
712
  search: vm.query || undefined,
695
713
  searchType: vm.queryType || 'name',
696
714
  orderString: vm.orderString || '',
@@ -700,7 +718,7 @@ export class UserList {
700
718
  };
701
719
  ApiUser.getUserListOrders(vm.apiJSON).then(data => {
702
720
  vm.dataList = data.response.data;
703
- vmi.pageSize = Math.ceil(data.response.total / limit);
721
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
704
722
  vmi.originalData = vm.dataList;
705
723
  vmi.tableData = getDatalist();
706
724
  vmi.loading = false;
@@ -588,6 +588,10 @@ h6 {
588
588
  background: var(--background-orange);
589
589
  }
590
590
 
591
+ .form-switch .form-check-input {
592
+ box-shadow: 1px 1px 2.5px rgba(0, 0, 0, 0.2);
593
+ }
594
+
591
595
  .form-switch .form-check-input:checked {
592
596
  background-color: var(--main-black) !important;
593
597
  box-shadow: 1px 1px 2.5px rgba(0, 0, 0, 0.2);
@@ -902,7 +906,7 @@ h6 {
902
906
  color: var(--main-black);
903
907
  }
904
908
 
905
- .c_funnel {
909
+ .c_filter_view {
906
910
  display: flex;
907
911
  padding: 9px;
908
912
  min-width: 40px;
@@ -941,6 +945,7 @@ h6 {
941
945
  color: var(--main-black);
942
946
  font-size: 16px;
943
947
  font-weight: 400;
948
+ padding-top: 1px;
944
949
  }
945
950
 
946
951
  .c_dropdown {
@@ -1277,9 +1282,9 @@ h6 {
1277
1282
  }
1278
1283
 
1279
1284
  .c_absolute {
1280
- width: 200px;
1281
- height: 250px;
1282
- padding: 12px;
1285
+ width: 220px;
1286
+ height: 280px;
1287
+ padding: 16px;
1283
1288
  }
1284
1289
 
1285
1290
  .btn-gray,
@@ -283,6 +283,7 @@ export class PdClass {
283
283
  });
284
284
  }
285
285
  static showSwiper(obj) {
286
+ var _a;
286
287
  const isPhone = document.body.clientWidth < 768;
287
288
  obj.gvc.glitter.addStyleLink(['https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css']);
288
289
  obj.gvc.glitter.addMtScript([
@@ -300,8 +301,10 @@ export class PdClass {
300
301
  }
301
302
  });
302
303
  PdClass.addSpecStyle(obj.gvc);
303
- if (obj.vm.specs.length === 0) {
304
- obj.vm.specs = obj.vm.specs.map((spec) => spec.option[0].title);
304
+ const invisibleVariants = obj.prod.variants.filter(v => v.invisible);
305
+ const visibleVariants = obj.prod.variants.filter(v => !v.invisible);
306
+ if (obj.vm.specs.length === 0 || invisibleVariants.find(iv => Tool.ObjCompare(iv.spec, obj.vm.specs))) {
307
+ obj.vm.specs = (_a = visibleVariants === null || visibleVariants === void 0 ? void 0 : visibleVariants[0].spec) !== null && _a !== void 0 ? _a : [];
305
308
  }
306
309
  obj.prod.preview_image = obj.prod.preview_image.filter(image => {
307
310
  return image !== 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';
@@ -648,6 +651,7 @@ export class PdClass {
648
651
  return {
649
652
  bind: ids.ids_spec,
650
653
  view: () => {
654
+ const invisibleVariants = prod.variants.filter(v => v.invisible).map(v => v.spec);
651
655
  return prod.specs
652
656
  .map((spec, index1) => {
653
657
  return html ` <div>
@@ -656,6 +660,11 @@ export class PdClass {
656
660
  </h5>
657
661
  <div class="d-flex gap-2 flex-wrap">
658
662
  ${gvc.map(spec.option.map((opt) => {
663
+ const cloneSpecs = vm.specs.slice();
664
+ cloneSpecs[index1] = opt.title;
665
+ if (invisibleVariants.find(iv => Tool.ObjCompare(iv, cloneSpecs))) {
666
+ return '';
667
+ }
659
668
  return html ` <div
660
669
  gvc-option="spec-option-${index1}"
661
670
  class="spec-option ${vm.specs[index1] === opt.title ? 'selected-option' : ''}"
@@ -437,9 +437,13 @@ export class PdClass {
437
437
  });
438
438
  PdClass.addSpecStyle(obj.gvc);
439
439
 
440
+ // 可顯示與不可顯示產品規格
441
+ const invisibleVariants = obj.prod.variants.filter(v => v.invisible);
442
+ const visibleVariants = obj.prod.variants.filter(v => !v.invisible);
443
+
440
444
  // 更新規格
441
- if (obj.vm.specs.length === 0) {
442
- obj.vm.specs = obj.vm.specs.map((spec: any) => spec.option[0].title);
445
+ if (obj.vm.specs.length === 0 || invisibleVariants.find(iv => Tool.ObjCompare(iv.spec, obj.vm.specs))) {
446
+ obj.vm.specs = visibleVariants?.[0].spec ?? [];
443
447
  }
444
448
 
445
449
  // 過濾預覽圖片
@@ -830,6 +834,8 @@ export class PdClass {
830
834
  return {
831
835
  bind: ids.ids_spec,
832
836
  view: () => {
837
+ const invisibleVariants = prod.variants.filter(v => v.invisible).map(v => v.spec);
838
+
833
839
  return prod.specs
834
840
  .map((spec, index1) => {
835
841
  return html` <div>
@@ -839,6 +845,14 @@ export class PdClass {
839
845
  <div class="d-flex gap-2 flex-wrap">
840
846
  ${gvc.map(
841
847
  spec.option.map((opt: any) => {
848
+ // 排除不可顯示的規格選項
849
+ const cloneSpecs = vm.specs.slice();
850
+ cloneSpecs[index1] = opt.title;
851
+
852
+ if (invisibleVariants.find(iv => Tool.ObjCompare(iv, cloneSpecs))) {
853
+ return '';
854
+ }
855
+
842
856
  return html` <div
843
857
  gvc-option="spec-option-${index1}"
844
858
  class="spec-option ${vm.specs[index1] === opt.title ? 'selected-option' : ''}"
@@ -1052,7 +1066,6 @@ export class PdClass {
1052
1066
  });
1053
1067
  }
1054
1068
  );
1055
- // gvc.glitter.getModule('',(module)=>{
1056
1069
  })}"
1057
1070
  >
1058
1071
  <i class="fa-brands fa-rocketchat"></i>
@@ -1,4 +1,14 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { ApiTrack } from '../../glitter-base/route/api-track.js';
11
+ import { GlobalUser } from '../../glitter-base/global/global-user.js';
2
12
  export class Ad {
3
13
  static gtagEvent(name, obj) {
4
14
  const gtag = window.gtag;
@@ -7,16 +17,38 @@ export class Ad {
7
17
  }
8
18
  }
9
19
  static fbqEvent(name, obj) {
10
- const fbq = window.fbq;
11
- obj.eventID = obj.eventID || window.glitter.getUUID();
12
- if (fbq) {
13
- fbq('track', name, JSON.parse(JSON.stringify(obj)));
14
- }
15
- obj.event_id = obj.eventID;
16
- delete obj.eventID;
17
- ApiTrack.track({
18
- event_name: name,
19
- custom_data: obj,
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const fbq = window.fbq;
22
+ obj.eventID = obj.eventID || window.glitter.getUUID();
23
+ if (fbq) {
24
+ if (GlobalUser.userInfo) {
25
+ function hashSHA256(input) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const encoder = new TextEncoder();
28
+ const data = encoder.encode(input.trim().toLowerCase());
29
+ const hashBuffer = yield crypto.subtle.digest('SHA-256', data);
30
+ return Array.from(new Uint8Array(hashBuffer))
31
+ .map(b => b.toString(16).padStart(2, '0'))
32
+ .join('');
33
+ });
34
+ }
35
+ const obj = {};
36
+ if (GlobalUser.userInfo.email) {
37
+ obj.email = yield hashSHA256(GlobalUser.userInfo.email);
38
+ }
39
+ if (GlobalUser.userInfo.phone) {
40
+ obj.phone = yield hashSHA256(GlobalUser.userInfo.phone);
41
+ }
42
+ fbq('init', window.fb_pixel_id, obj);
43
+ }
44
+ fbq('track', name, JSON.parse(JSON.stringify(obj)));
45
+ }
46
+ obj.event_id = obj.eventID;
47
+ delete obj.eventID;
48
+ ApiTrack.track({
49
+ event_name: name,
50
+ custom_data: obj,
51
+ });
20
52
  });
21
53
  }
22
54
  }