ts-glitter 20.6.8 → 20.7.0

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 (175) hide show
  1. package/lowcode/Entry.js +2 -2
  2. package/lowcode/Entry.ts +2 -2
  3. package/lowcode/backend-manager/bg-blog.js +617 -621
  4. package/lowcode/backend-manager/bg-blog.ts +2323 -2325
  5. package/lowcode/backend-manager/bg-line.js +5 -4
  6. package/lowcode/backend-manager/bg-line.ts +5 -4
  7. package/lowcode/backend-manager/bg-list-component.js +9 -0
  8. package/lowcode/backend-manager/bg-list-component.ts +15 -1
  9. package/lowcode/backend-manager/bg-notify.js +6 -4
  10. package/lowcode/backend-manager/bg-notify.ts +6 -4
  11. package/lowcode/backend-manager/bg-product.js +145 -0
  12. package/lowcode/backend-manager/bg-product.ts +153 -0
  13. package/lowcode/backend-manager/bg-sns.js +5 -3
  14. package/lowcode/backend-manager/bg-sns.ts +5 -3
  15. package/lowcode/backend-manager/bg-widget.js +92 -4
  16. package/lowcode/backend-manager/bg-widget.ts +122 -6
  17. package/lowcode/backend-manager/splitPage.js +0 -39
  18. package/lowcode/backend-manager/splitPage.ts +0 -40
  19. package/lowcode/cms-plugin/auto-fcm-advertise.js +17 -5
  20. package/lowcode/cms-plugin/auto-fcm-advertise.ts +19 -6
  21. package/lowcode/cms-plugin/auto-fcm-history.js +2732 -0
  22. package/lowcode/cms-plugin/auto-fcm-history.ts +2995 -0
  23. package/lowcode/cms-plugin/cms-router.js +5 -0
  24. package/lowcode/cms-plugin/cms-router.ts +6 -0
  25. package/lowcode/cms-plugin/filter-options.js +80 -27
  26. package/lowcode/cms-plugin/filter-options.ts +83 -27
  27. package/lowcode/cms-plugin/language-backend.js +50 -39
  28. package/lowcode/cms-plugin/language-backend.ts +109 -95
  29. package/lowcode/cms-plugin/menus-setting.js +175 -151
  30. package/lowcode/cms-plugin/menus-setting.ts +620 -591
  31. package/lowcode/cms-plugin/model/order.d.ts +1 -0
  32. package/lowcode/cms-plugin/module/data.js +7 -7
  33. package/lowcode/cms-plugin/module/data.ts +262 -233
  34. package/lowcode/cms-plugin/module/delivery-html.js +18 -10
  35. package/lowcode/cms-plugin/module/delivery-html.ts +26 -10
  36. package/lowcode/cms-plugin/module/order-setting.js +458 -328
  37. package/lowcode/cms-plugin/module/order-setting.ts +622 -351
  38. package/lowcode/cms-plugin/module/product-excel.js +1 -1
  39. package/lowcode/cms-plugin/module/product-excel.ts +2 -1
  40. package/lowcode/cms-plugin/order/order-module.js +90 -1
  41. package/lowcode/cms-plugin/order/order-module.ts +106 -1
  42. package/lowcode/cms-plugin/pos-pages/payment-page.js +11 -8
  43. package/lowcode/cms-plugin/pos-pages/payment-page.ts +28 -15
  44. package/lowcode/cms-plugin/pos-pages/products-page.js +0 -39
  45. package/lowcode/cms-plugin/pos-pages/products-page.ts +0 -40
  46. package/lowcode/cms-plugin/shopping-collections.ts +1 -3
  47. package/lowcode/cms-plugin/shopping-finance-setting.js +19 -80
  48. package/lowcode/cms-plugin/shopping-finance-setting.ts +19 -87
  49. package/lowcode/cms-plugin/shopping-order-manager.js +122 -38
  50. package/lowcode/cms-plugin/shopping-order-manager.ts +160 -58
  51. package/lowcode/cms-plugin/shopping-product-setting.js +364 -376
  52. package/lowcode/cms-plugin/shopping-product-setting.ts +406 -415
  53. package/lowcode/cms-plugin/shopping-setting-advance.js +57 -16
  54. package/lowcode/cms-plugin/shopping-setting-advance.ts +69 -18
  55. package/lowcode/cms-plugin/stock-history.js +75 -63
  56. package/lowcode/cms-plugin/stock-history.ts +390 -376
  57. package/lowcode/cms-plugin/user/user-module.js +2 -43
  58. package/lowcode/cms-plugin/user/user-module.ts +2 -46
  59. package/lowcode/cms-plugin/user-list.js +4 -6
  60. package/lowcode/cms-plugin/user-list.ts +35 -38
  61. package/lowcode/css/editor.css +42 -3
  62. package/lowcode/glitter-base/global/language.js +6 -1
  63. package/lowcode/glitter-base/global/language.ts +10 -4
  64. package/lowcode/glitter-base/global/payment-config.js +19 -16
  65. package/lowcode/glitter-base/global/payment-config.ts +22 -16
  66. package/lowcode/glitter-base/global/shipment-config.js +6 -5
  67. package/lowcode/glitter-base/global/shipment-config.ts +12 -10
  68. package/lowcode/glitter-base/route/fcm.js +21 -1
  69. package/lowcode/glitter-base/route/fcm.ts +22 -2
  70. package/lowcode/glitter-base/route/shopping.js +8 -32
  71. package/lowcode/glitter-base/route/shopping.ts +10 -33
  72. package/lowcode/glitter-base/route/stock.ts +1 -0
  73. package/lowcode/glitter-base/route/user.js +11 -2
  74. package/lowcode/glitter-base/route/user.ts +23 -12
  75. package/lowcode/jspage/function-page/setting_editor.js +9 -0
  76. package/lowcode/jspage/function-page/setting_editor.ts +9 -0
  77. package/lowcode/public-components/blogs/list.js +223 -195
  78. package/lowcode/public-components/blogs/list.ts +383 -352
  79. package/lowcode/public-components/product/product-list.js +8 -4
  80. package/lowcode/public-components/product/product-list.ts +9 -4
  81. package/lowcode/public-components/terms-related/index.js +1 -1
  82. package/lowcode/public-components/terms-related/index.ts +1 -1
  83. package/lowcode/public-components/user-manager/um-login.js +1 -1
  84. package/lowcode/public-components/user-manager/um-login.ts +2 -2
  85. package/lowcode/public-components/user-manager/um-order.js +41 -5
  86. package/lowcode/public-components/user-manager/um-order.ts +58 -20
  87. package/lowcode/public-components/user-manager/um-voucher.ts +2 -2
  88. package/nhi4veq3gk.json +1 -0
  89. package/package.json +1 -1
  90. package/src/Language.d.ts +2 -0
  91. package/src/Language.js +66 -65
  92. package/src/Language.js.map +1 -1
  93. package/src/Language.ts +719 -715
  94. package/src/api-public/config/shipment-config.js +3 -2
  95. package/src/api-public/config/shipment-config.js.map +1 -1
  96. package/src/api-public/config/shipment-config.ts +3 -2
  97. package/src/api-public/controllers/ai-chat.js.map +1 -1
  98. package/src/api-public/controllers/ai-chat.ts +1 -2
  99. package/src/api-public/controllers/fcm.js +23 -58
  100. package/src/api-public/controllers/fcm.js.map +1 -1
  101. package/src/api-public/controllers/fcm.ts +28 -56
  102. package/src/api-public/controllers/shop.js +7 -1
  103. package/src/api-public/controllers/shop.js.map +1 -1
  104. package/src/api-public/controllers/shop.ts +17 -10
  105. package/src/api-public/controllers/user.js +1 -0
  106. package/src/api-public/controllers/user.js.map +1 -1
  107. package/src/api-public/controllers/user.ts +2 -0
  108. package/src/api-public/services/auto-send-email.js +247 -187
  109. package/src/api-public/services/auto-send-email.js.map +1 -1
  110. package/src/api-public/services/auto-send-email.ts +568 -505
  111. package/src/api-public/services/delivery.js +1 -1
  112. package/src/api-public/services/delivery.js.map +1 -1
  113. package/src/api-public/services/delivery.ts +6 -5
  114. package/src/api-public/services/financial-service.js +1 -2
  115. package/src/api-public/services/financial-service.js.map +1 -1
  116. package/src/api-public/services/financial-service.ts +4 -6
  117. package/src/api-public/services/manager.d.ts +4 -3
  118. package/src/api-public/services/manager.js +8 -12
  119. package/src/api-public/services/manager.js.map +1 -1
  120. package/src/api-public/services/manager.ts +57 -59
  121. package/src/api-public/services/model/handlePaymentTransaction.d.ts +1 -1
  122. package/src/api-public/services/model/handlePaymentTransaction.js +23 -3
  123. package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
  124. package/src/api-public/services/model/handlePaymentTransaction.ts +25 -36
  125. package/src/api-public/services/schedule.d.ts +1 -0
  126. package/src/api-public/services/schedule.js +27 -0
  127. package/src/api-public/services/schedule.js.map +1 -1
  128. package/src/api-public/services/schedule.ts +30 -0
  129. package/src/api-public/services/shopping.d.ts +22 -2
  130. package/src/api-public/services/shopping.js +371 -95
  131. package/src/api-public/services/shopping.js.map +1 -1
  132. package/src/api-public/services/shopping.ts +499 -141
  133. package/src/api-public/services/stock.js +0 -3
  134. package/src/api-public/services/stock.js.map +1 -1
  135. package/src/api-public/services/stock.ts +3 -3
  136. package/src/api-public/services/user.d.ts +1 -0
  137. package/src/api-public/services/user.js +32 -12
  138. package/src/api-public/services/user.js.map +1 -1
  139. package/src/api-public/services/user.ts +38 -19
  140. package/src/api-public/services/workers.js +3 -3
  141. package/src/api-public/services/workers.js.map +1 -1
  142. package/src/api-public/services/workers.ts +103 -103
  143. package/src/app-project/ios/proshake/AppDelegate.swift +51 -7
  144. package/src/app-project/ios/proshake/Info.plist +11 -9
  145. package/src/app-project/ios/proshake/SceneDelegate.swift +18 -0
  146. package/src/app-project/ios/proshake/glitter-interface/BasicUtil.swift +43 -2
  147. package/src/app-project/ios/proshake/glitter-interface/Ecommerce.swift +56 -0
  148. package/src/app-project/ios/proshake.xcodeproj/project.xcworkspace/xcuserdata/jianzhi.wang.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  149. package/src/app-project/serverless/src/modules/database.js +1 -1
  150. package/src/app-project/serverless/src/modules/database.js.map +1 -1
  151. package/src/app-project/serverless/src/modules/database.ts +171 -171
  152. package/src/controllers/template.d.ts +1 -1
  153. package/src/controllers/template.js +16 -16
  154. package/src/controllers/template.js.map +1 -1
  155. package/src/controllers/template.ts +98 -84
  156. package/src/modules/database.js +3 -1
  157. package/src/modules/database.js.map +1 -1
  158. package/src/modules/database.ts +185 -181
  159. package/src/modules/firebase.d.ts +17 -0
  160. package/src/modules/firebase.js +126 -0
  161. package/src/modules/firebase.js.map +1 -1
  162. package/src/modules/firebase.ts +169 -0
  163. package/src/public-config-initial/auto-fcm.js +8 -2
  164. package/src/public-config-initial/auto-fcm.js.map +1 -1
  165. package/src/public-config-initial/auto-fcm.ts +15 -6
  166. package/src/services/app.d.ts +2 -1
  167. package/src/services/app.js.map +1 -1
  168. package/src/services/app.ts +2 -1
  169. package/src/services/ios-project.js +12 -6
  170. package/src/services/ios-project.js.map +1 -1
  171. package/src/services/ios-project.ts +12 -6
  172. package/src/services/template.d.ts +3 -2
  173. package/src/services/template.js +2 -1
  174. package/src/services/template.js.map +1 -1
  175. package/src/services/template.ts +13 -20
@@ -56,6 +56,11 @@ export class CmsRouter {
56
56
  resolve(cl.main(gvc));
57
57
  });
58
58
  break;
59
+ case 'auto_fcm_history':
60
+ gvc.glitter.getModule(new URL('./cms-plugin/auto-fcm-history.js', gvc.glitter.root_path).href, (cl) => {
61
+ resolve(cl.emailHistory(gvc));
62
+ });
63
+ break;
59
64
  case 'auto_fcm_advertise':
60
65
  gvc.glitter.getModule(new URL('./cms-plugin/auto-fcm-advertise.js', gvc.glitter.root_path).href, (cl) => {
61
66
  resolve(cl.main(gvc));
@@ -72,6 +72,12 @@ export class CmsRouter{
72
72
  resolve(cl.main(gvc))
73
73
  })
74
74
  break
75
+ case 'auto_fcm_history':
76
+ // resolve('12345')
77
+ gvc.glitter.getModule(new URL('./cms-plugin/auto-fcm-history.js', gvc.glitter.root_path).href, (cl) => {
78
+ resolve(cl.emailHistory(gvc))
79
+ })
80
+ break
75
81
  case 'auto_fcm_advertise':
76
82
  gvc.glitter.getModule(new URL('./cms-plugin/auto-fcm-advertise.js', gvc.glitter.root_path).href, (cl) => {
77
83
  resolve(cl.main(gvc))
@@ -11,7 +11,19 @@ import { ShipmentConfig } from '../glitter-base/global/shipment-config.js';
11
11
  import { ApiUser } from '../glitter-base/route/user.js';
12
12
  import { PaymentConfig } from '../glitter-base/global/payment-config.js';
13
13
  import { BgWidget } from '../backend-manager/bg-widget.js';
14
+ import { BgProduct } from '../backend-manager/bg-product.js';
15
+ import { OrderModule } from './order/order-module.js';
16
+ const html = String.raw;
14
17
  export class FilterOptions {
18
+ static getLevelData() {
19
+ var _a, _b, _c;
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const normalMember = ApiUser.normalMember;
22
+ normalMember.id = 'null';
23
+ const levelConfig = yield ApiUser.getPublicConfig('member_level_config', 'manager');
24
+ return [normalMember, ...((_c = (_b = (_a = levelConfig === null || levelConfig === void 0 ? void 0 : levelConfig.response) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.levels) !== null && _c !== void 0 ? _c : [])];
25
+ });
26
+ }
15
27
  static getUserFunnel() {
16
28
  return __awaiter(this, void 0, void 0, function* () {
17
29
  const generalTags = yield new Promise(resolve => {
@@ -25,7 +37,7 @@ export class FilterOptions {
25
37
  }
26
38
  });
27
39
  });
28
- const levelData = (yield ApiUser.getPublicConfig('member_level_config', 'manager')).response.value.levels;
40
+ const levelData = yield this.getLevelData();
29
41
  return [
30
42
  {
31
43
  key: 'created_time',
@@ -137,6 +149,7 @@ export class FilterOptions {
137
149
  }
138
150
  static getOrderFunnel() {
139
151
  return __awaiter(this, void 0, void 0, function* () {
152
+ const levelData = yield this.getLevelData();
140
153
  return [
141
154
  { key: 'orderStatus', type: 'multi_checkbox', name: '訂單狀態', data: this.orderStatusOptions },
142
155
  { key: 'payload', type: 'multi_checkbox', name: '付款狀態', data: this.payloadStatusOptions },
@@ -148,7 +161,9 @@ export class FilterOptions {
148
161
  data: (yield PaymentConfig.getSupportPayment()).map(dd => {
149
162
  if (dd.type === 'pos' && !dd.name.includes('POS')) {
150
163
  const name = dd.name;
151
- dd.name = `<div class="d-flex">${[BgWidget.warningInsignia('POS'), name].join(`<div class="mx-1"></div>`)}</div>`;
164
+ dd.name = html `<div class="d-flex">
165
+ ${[BgWidget.warningInsignia('POS'), name].join(html `<div class="mx-1"></div>`)}
166
+ </div>`;
152
167
  }
153
168
  return dd;
154
169
  }),
@@ -158,9 +173,7 @@ export class FilterOptions {
158
173
  key: 'shipment',
159
174
  type: 'multi_checkbox',
160
175
  name: '運送方式',
161
- data: yield ShipmentConfig.shipmentMethod({
162
- type: 'support',
163
- }),
176
+ data: yield ShipmentConfig.shipmentMethod({ type: 'support' }),
164
177
  },
165
178
  {
166
179
  key: 'created_time',
@@ -186,6 +199,20 @@ export class FilterOptions {
186
199
  ],
187
200
  },
188
201
  },
202
+ {
203
+ key: 'member_levels',
204
+ type: 'multi_checkbox',
205
+ name: '會員等級',
206
+ data: levelData.map((dd) => {
207
+ return { key: dd.id, name: dd.tag_name };
208
+ }),
209
+ },
210
+ {
211
+ key: 'manager_tag',
212
+ type: 'search_and_select',
213
+ name: '訂單管理標籤',
214
+ data: yield OrderModule.getOrderManagerTag(),
215
+ },
189
216
  ];
190
217
  });
191
218
  }
@@ -241,6 +268,50 @@ export class FilterOptions {
241
268
  ];
242
269
  });
243
270
  }
271
+ static getProductFunnel() {
272
+ return __awaiter(this, void 0, void 0, function* () {
273
+ return [
274
+ {
275
+ key: 'status',
276
+ type: 'multi_checkbox',
277
+ name: '商品狀態',
278
+ data: [
279
+ { key: 'inRange', name: '上架' },
280
+ { key: 'beforeStart', name: '待上架' },
281
+ { key: 'afterEnd', name: '下架' },
282
+ { key: 'draft', name: '草稿' },
283
+ ],
284
+ },
285
+ {
286
+ key: 'channel',
287
+ type: 'multi_checkbox',
288
+ name: '銷售管道',
289
+ data: [
290
+ { key: 'normal', name: 'APP & 官網' },
291
+ { key: 'pos', name: 'POS' },
292
+ ],
293
+ },
294
+ {
295
+ key: 'collection',
296
+ type: 'multi_checkbox',
297
+ name: '商品分類',
298
+ data: yield BgProduct.getCollectonCheckData(),
299
+ },
300
+ {
301
+ key: 'general_tag',
302
+ type: 'search_and_select',
303
+ name: '商品標籤',
304
+ data: yield BgProduct.getProductGeneralTag(),
305
+ },
306
+ {
307
+ key: 'manager_tag',
308
+ type: 'search_and_select',
309
+ name: '商品管理標籤',
310
+ data: yield BgProduct.getProductManagerTag(),
311
+ },
312
+ ];
313
+ });
314
+ }
244
315
  }
245
316
  FilterOptions.userFilterFrame = {
246
317
  created_time: ['', ''],
@@ -281,6 +352,8 @@ FilterOptions.orderFilterFrame = {
281
352
  payment_select: [],
282
353
  shipment: [],
283
354
  created_time: ['', ''],
355
+ manager_tag: [],
356
+ member_levels: [],
284
357
  };
285
358
  FilterOptions.returnOrderFilterFrame = {
286
359
  progress: [],
@@ -486,29 +559,9 @@ FilterOptions.productFilterFrame = {
486
559
  status: [],
487
560
  channel: [],
488
561
  collection: [],
562
+ general_tag: [],
563
+ manager_tag: [],
489
564
  };
490
- FilterOptions.productFunnel = [
491
- {
492
- key: 'status',
493
- type: 'multi_checkbox',
494
- name: '商品狀態',
495
- data: [
496
- { key: 'inRange', name: '上架' },
497
- { key: 'beforeStart', name: '待上架' },
498
- { key: 'afterEnd', name: '下架' },
499
- { key: 'draft', name: '草稿' },
500
- ],
501
- },
502
- {
503
- key: 'channel',
504
- type: 'multi_checkbox',
505
- name: '銷售管道',
506
- data: [
507
- { key: 'normal', name: 'APP & 官網' },
508
- { key: 'pos', name: 'POS' },
509
- ],
510
- },
511
- ];
512
565
  FilterOptions.productOrderBy = [
513
566
  { key: 'default', value: '預設' },
514
567
  { key: 'max_price', value: '價格高 > 低' },
@@ -2,6 +2,10 @@ import { ShipmentConfig } from '../glitter-base/global/shipment-config.js';
2
2
  import { ApiUser } from '../glitter-base/route/user.js';
3
3
  import { PaymentConfig } from '../glitter-base/global/payment-config.js';
4
4
  import { BgWidget } from '../backend-manager/bg-widget.js';
5
+ import { BgProduct } from '../backend-manager/bg-product.js';
6
+ import { OrderModule } from './order/order-module.js';
7
+
8
+ const html = String.raw;
5
9
 
6
10
  export class FilterOptions {
7
11
  static userFilterFrame = {
@@ -17,6 +21,15 @@ export class FilterOptions {
17
21
  last_order_total: { key: '', value: '' },
18
22
  };
19
23
 
24
+ static async getLevelData() {
25
+ const normalMember = ApiUser.normalMember;
26
+ normalMember.id = 'null';
27
+
28
+ const levelConfig = await ApiUser.getPublicConfig('member_level_config', 'manager');
29
+
30
+ return [normalMember, ...(levelConfig?.response?.value?.levels ?? [])];
31
+ }
32
+
20
33
  static async getUserFunnel() {
21
34
  const generalTags = await new Promise<{ key: string; name: string }[]>(resolve => {
22
35
  ApiUser.getPublicConfig('user_general_tags', 'manager').then((dd: any) => {
@@ -27,7 +40,9 @@ export class FilterOptions {
27
40
  }
28
41
  });
29
42
  });
30
- const levelData = (await ApiUser.getPublicConfig('member_level_config', 'manager')).response.value.levels;
43
+
44
+ const levelData = await this.getLevelData();
45
+
31
46
  return [
32
47
  {
33
48
  key: 'created_time',
@@ -166,6 +181,8 @@ export class FilterOptions {
166
181
  payment_select: [],
167
182
  shipment: [],
168
183
  created_time: ['', ''],
184
+ manager_tag: [],
185
+ member_levels: [],
169
186
  };
170
187
 
171
188
  static returnOrderFilterFrame = {
@@ -225,6 +242,8 @@ export class FilterOptions {
225
242
  ];
226
243
 
227
244
  static async getOrderFunnel() {
245
+ const levelData = await this.getLevelData();
246
+
228
247
  return [
229
248
  { key: 'orderStatus', type: 'multi_checkbox', name: '訂單狀態', data: this.orderStatusOptions },
230
249
  { key: 'payload', type: 'multi_checkbox', name: '付款狀態', data: this.payloadStatusOptions },
@@ -236,7 +255,9 @@ export class FilterOptions {
236
255
  data: (await PaymentConfig.getSupportPayment()).map(dd => {
237
256
  if (dd.type === 'pos' && !dd.name.includes('POS')) {
238
257
  const name = dd.name;
239
- dd.name = `<div class="d-flex">${[BgWidget.warningInsignia('POS'), name].join(`<div class="mx-1"></div>`)}</div>`;
258
+ dd.name = html`<div class="d-flex">
259
+ ${[BgWidget.warningInsignia('POS'), name].join(html`<div class="mx-1"></div>`)}
260
+ </div>`;
240
261
  }
241
262
  return dd;
242
263
  }),
@@ -246,9 +267,7 @@ export class FilterOptions {
246
267
  key: 'shipment',
247
268
  type: 'multi_checkbox',
248
269
  name: '運送方式',
249
- data: await ShipmentConfig.shipmentMethod({
250
- type: 'support',
251
- }),
270
+ data: await ShipmentConfig.shipmentMethod({ type: 'support' }),
252
271
  },
253
272
  {
254
273
  key: 'created_time',
@@ -274,6 +293,20 @@ export class FilterOptions {
274
293
  ],
275
294
  },
276
295
  },
296
+ {
297
+ key: 'member_levels',
298
+ type: 'multi_checkbox',
299
+ name: '會員等級',
300
+ data: levelData.map((dd: any) => {
301
+ return { key: dd.id, name: dd.tag_name };
302
+ }),
303
+ },
304
+ {
305
+ key: 'manager_tag',
306
+ type: 'search_and_select',
307
+ name: '訂單管理標籤',
308
+ data: await OrderModule.getOrderManagerTag(),
309
+ },
277
310
  ];
278
311
  }
279
312
 
@@ -503,30 +536,52 @@ export class FilterOptions {
503
536
  status: [],
504
537
  channel: [],
505
538
  collection: [],
539
+ general_tag: [],
540
+ manager_tag: [],
506
541
  };
507
542
 
508
- static productFunnel = [
509
- {
510
- key: 'status',
511
- type: 'multi_checkbox',
512
- name: '商品狀態',
513
- data: [
514
- { key: 'inRange', name: '上架' },
515
- { key: 'beforeStart', name: '待上架' },
516
- { key: 'afterEnd', name: '下架' },
517
- { key: 'draft', name: '草稿' },
518
- ],
519
- },
520
- {
521
- key: 'channel',
522
- type: 'multi_checkbox',
523
- name: '銷售管道',
524
- data: [
525
- { key: 'normal', name: 'APP & 官網' },
526
- { key: 'pos', name: 'POS' },
527
- ],
528
- },
529
- ];
543
+ static async getProductFunnel() {
544
+ return [
545
+ {
546
+ key: 'status',
547
+ type: 'multi_checkbox',
548
+ name: '商品狀態',
549
+ data: [
550
+ { key: 'inRange', name: '上架' },
551
+ { key: 'beforeStart', name: '待上架' },
552
+ { key: 'afterEnd', name: '下架' },
553
+ { key: 'draft', name: '草稿' },
554
+ ],
555
+ },
556
+ {
557
+ key: 'channel',
558
+ type: 'multi_checkbox',
559
+ name: '銷售管道',
560
+ data: [
561
+ { key: 'normal', name: 'APP & 官網' },
562
+ { key: 'pos', name: 'POS' },
563
+ ],
564
+ },
565
+ {
566
+ key: 'collection',
567
+ type: 'multi_checkbox',
568
+ name: '商品分類',
569
+ data: await BgProduct.getCollectonCheckData(),
570
+ },
571
+ {
572
+ key: 'general_tag',
573
+ type: 'search_and_select',
574
+ name: '商品標籤',
575
+ data: await BgProduct.getProductGeneralTag(),
576
+ },
577
+ {
578
+ key: 'manager_tag',
579
+ type: 'search_and_select',
580
+ name: '商品管理標籤',
581
+ data: await BgProduct.getProductManagerTag(),
582
+ },
583
+ ];
584
+ }
530
585
 
531
586
  static productOrderBy = [
532
587
  { key: 'default', value: '預設' },
@@ -629,6 +684,7 @@ export class FilterOptions {
629
684
  { key: 'title', value: '內容' },
630
685
  ];
631
686
 
687
+
632
688
  static emailOptions = [
633
689
  { key: 'def', value: '請選擇根據的條件' },
634
690
  { key: 'all', value: '所有會員' },
@@ -1,14 +1,15 @@
1
- import { BgWidget } from "../backend-manager/bg-widget.js";
2
- import { Language } from "../glitter-base/global/language.js";
1
+ import { BgWidget } from '../backend-manager/bg-widget.js';
2
+ import { Language } from '../glitter-base/global/language.js';
3
+ const html = String.raw;
3
4
  export class LanguageBackend {
4
5
  static switchBtn(cf) {
5
6
  const gvc = cf.gvc;
6
- return BgWidget.grayButton(`<div class="d-flex align-items-center" style="gap:5px;">
7
- <i class="fa-duotone fa-solid fa-earth-americas"></i>${Language.getLanguageText({
7
+ return BgWidget.grayButton(html `<div class="d-flex align-items-center" style="gap:5px;">
8
+ <i class="fa-duotone fa-solid fa-earth-americas"></i>${Language.getLanguageText({
8
9
  local: true,
9
- compare: cf.language
10
+ compare: cf.language,
10
11
  })}
11
- </div>`, gvc.event(() => {
12
+ </div>`, gvc.event(() => {
12
13
  BgWidget.settingDialog({
13
14
  gvc: gvc,
14
15
  innerHTML: (gvc) => {
@@ -20,10 +21,9 @@ export class LanguageBackend {
20
21
  return {
21
22
  bind: id,
22
23
  view: () => {
23
- return html `
24
- <div style="position: relative;word-break: break-all;white-space: normal;">
25
- ${BgWidget.grayNote('前往商店設定->商店訊息中,設定支援的語言。')}
26
- ${gvc.bindView(() => {
24
+ return html ` <div style="position: relative;word-break: break-all;white-space: normal;">
25
+ ${BgWidget.grayNote('前往商店設定->商店訊息中,設定支援的語言。')}
26
+ ${gvc.bindView(() => {
27
27
  const html = String.raw;
28
28
  return {
29
29
  bind: glitter.getUUID(),
@@ -31,57 +31,68 @@ export class LanguageBackend {
31
31
  const sup = [
32
32
  {
33
33
  key: 'en-US',
34
- value: '英文'
34
+ value: '英文',
35
35
  },
36
36
  {
37
37
  key: 'zh-CN',
38
- value: '簡體中文'
38
+ value: '簡體中文',
39
39
  },
40
40
  {
41
41
  key: 'zh-TW',
42
- value: '繁體中文'
43
- }
44
- ].filter((dd) => {
42
+ value: '繁體中文',
43
+ },
44
+ ]
45
+ .filter(dd => {
45
46
  return window.parent.store_info.language_setting.support.includes(dd.key);
46
- }).sort((dd) => {
47
+ })
48
+ .sort((dd) => {
47
49
  return dd.key === cf.language ? -1 : 1;
48
50
  });
49
- return html `
50
- <div class="d-flex mt-3 flex-wrap align-items-center justify-content-center"
51
- style="gap:15px;">
52
- ${sup.map((dd) => {
51
+ return html ` <div
52
+ class="d-flex mt-3 flex-wrap align-items-center justify-content-center"
53
+ style="gap:15px;"
54
+ >
55
+ ${sup
56
+ .map((dd) => {
53
57
  return html `
54
- <div class="px-3 py-1 text-white position-relative d-flex align-items-center justify-content-center"
55
- style="border-radius: 20px;background: #393939;cursor: pointer;width:100px;"
56
- onclick="${gvc.event(() => {
58
+ <div
59
+ class="px-3 py-1 text-white position-relative d-flex align-items-center justify-content-center"
60
+ style="border-radius: 20px;background: #393939;cursor: pointer;width:100px;"
61
+ onclick="${gvc.event(() => {
57
62
  cf.callback(dd.key);
58
63
  gvc.closeDialog();
59
- })}">
60
- ${dd.value}
61
- <div class="position-absolute text-white rounded-2 px-2 d-flex align-items-center rounded-3 ${dd.key !== cf.language ? `d-none` : ``}"
62
- style="top: -12px;right: -10px; height:20px;font-size: 11px;background: #ff6c02;">
63
- 已選擇
64
- </div>
65
- </div>
66
- `;
67
- }).join('')}
68
- </div>`;
69
- }
64
+ })}"
65
+ >
66
+ ${dd.value}
67
+ <div
68
+ class="position-absolute text-white rounded-2 px-2 d-flex align-items-center rounded-3 ${dd.key !==
69
+ cf.language
70
+ ? `d-none`
71
+ : ``}"
72
+ style="top: -12px;right: -10px; height:20px;font-size: 11px;background: #ff6c02;"
73
+ >
74
+ 已選擇
75
+ </div>
76
+ </div>
77
+ `;
78
+ })
79
+ .join('')}
80
+ </div>`;
81
+ },
70
82
  };
71
83
  })}
72
- </div>`;
84
+ </div>`;
73
85
  },
74
86
  divCreate: {},
75
- onCreate: () => {
76
- },
87
+ onCreate: () => { },
77
88
  };
78
89
  })());
79
90
  },
80
91
  title: '切換語系',
81
- footer_html: (gvc) => {
92
+ footer_html: gvc => {
82
93
  return ``;
83
94
  },
84
- width: 350
95
+ width: 350,
85
96
  });
86
97
  }));
87
98
  }