ts-glitter 20.6.8 → 20.6.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 (160) 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/user/user-module.js +2 -43
  56. package/lowcode/cms-plugin/user/user-module.ts +2 -46
  57. package/lowcode/cms-plugin/user-list.js +4 -6
  58. package/lowcode/cms-plugin/user-list.ts +35 -38
  59. package/lowcode/css/editor.css +42 -3
  60. package/lowcode/glitter-base/global/language.js +6 -1
  61. package/lowcode/glitter-base/global/language.ts +10 -4
  62. package/lowcode/glitter-base/global/payment-config.js +19 -16
  63. package/lowcode/glitter-base/global/payment-config.ts +22 -16
  64. package/lowcode/glitter-base/global/shipment-config.js +6 -5
  65. package/lowcode/glitter-base/global/shipment-config.ts +12 -10
  66. package/lowcode/glitter-base/route/fcm.js +21 -1
  67. package/lowcode/glitter-base/route/fcm.ts +22 -2
  68. package/lowcode/glitter-base/route/shopping.js +8 -32
  69. package/lowcode/glitter-base/route/shopping.ts +10 -33
  70. package/lowcode/glitter-base/route/user.js +11 -2
  71. package/lowcode/glitter-base/route/user.ts +23 -12
  72. package/lowcode/jspage/function-page/setting_editor.js +9 -0
  73. package/lowcode/jspage/function-page/setting_editor.ts +9 -0
  74. package/lowcode/public-components/blogs/list.js +223 -195
  75. package/lowcode/public-components/blogs/list.ts +383 -352
  76. package/lowcode/public-components/product/product-list.js +8 -4
  77. package/lowcode/public-components/product/product-list.ts +9 -4
  78. package/lowcode/public-components/terms-related/index.js +1 -1
  79. package/lowcode/public-components/terms-related/index.ts +1 -1
  80. package/lowcode/public-components/user-manager/um-login.js +1 -1
  81. package/lowcode/public-components/user-manager/um-login.ts +2 -2
  82. package/lowcode/public-components/user-manager/um-order.js +41 -5
  83. package/lowcode/public-components/user-manager/um-order.ts +58 -20
  84. package/lowcode/public-components/user-manager/um-voucher.ts +2 -2
  85. package/nhi4veq3gk.json +1 -0
  86. package/package.json +1 -1
  87. package/src/Language.d.ts +2 -0
  88. package/src/Language.js +66 -65
  89. package/src/Language.js.map +1 -1
  90. package/src/Language.ts +719 -715
  91. package/src/api-public/config/shipment-config.js +3 -2
  92. package/src/api-public/config/shipment-config.js.map +1 -1
  93. package/src/api-public/config/shipment-config.ts +3 -2
  94. package/src/api-public/controllers/ai-chat.js.map +1 -1
  95. package/src/api-public/controllers/ai-chat.ts +1 -2
  96. package/src/api-public/controllers/fcm.js +23 -58
  97. package/src/api-public/controllers/fcm.js.map +1 -1
  98. package/src/api-public/controllers/fcm.ts +28 -56
  99. package/src/api-public/controllers/shop.js +7 -1
  100. package/src/api-public/controllers/shop.js.map +1 -1
  101. package/src/api-public/controllers/shop.ts +17 -10
  102. package/src/api-public/controllers/user.js +1 -0
  103. package/src/api-public/controllers/user.js.map +1 -1
  104. package/src/api-public/controllers/user.ts +2 -0
  105. package/src/api-public/services/auto-send-email.js +247 -187
  106. package/src/api-public/services/auto-send-email.js.map +1 -1
  107. package/src/api-public/services/auto-send-email.ts +568 -505
  108. package/src/api-public/services/delivery.js +1 -1
  109. package/src/api-public/services/delivery.js.map +1 -1
  110. package/src/api-public/services/delivery.ts +6 -5
  111. package/src/api-public/services/financial-service.js +1 -2
  112. package/src/api-public/services/financial-service.js.map +1 -1
  113. package/src/api-public/services/financial-service.ts +4 -6
  114. package/src/api-public/services/manager.d.ts +4 -3
  115. package/src/api-public/services/manager.js +8 -12
  116. package/src/api-public/services/manager.js.map +1 -1
  117. package/src/api-public/services/manager.ts +57 -59
  118. package/src/api-public/services/model/handlePaymentTransaction.d.ts +1 -1
  119. package/src/api-public/services/model/handlePaymentTransaction.js +23 -3
  120. package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
  121. package/src/api-public/services/model/handlePaymentTransaction.ts +25 -36
  122. package/src/api-public/services/schedule.d.ts +1 -0
  123. package/src/api-public/services/schedule.js +27 -0
  124. package/src/api-public/services/schedule.js.map +1 -1
  125. package/src/api-public/services/schedule.ts +30 -0
  126. package/src/api-public/services/shopping.d.ts +22 -2
  127. package/src/api-public/services/shopping.js +362 -90
  128. package/src/api-public/services/shopping.js.map +1 -1
  129. package/src/api-public/services/shopping.ts +481 -134
  130. package/src/api-public/services/user.d.ts +1 -0
  131. package/src/api-public/services/user.js +32 -12
  132. package/src/api-public/services/user.js.map +1 -1
  133. package/src/api-public/services/user.ts +38 -19
  134. package/src/api-public/services/workers.js +3 -3
  135. package/src/api-public/services/workers.js.map +1 -1
  136. package/src/api-public/services/workers.ts +103 -103
  137. package/src/app-project/serverless/src/modules/database.js +1 -1
  138. package/src/app-project/serverless/src/modules/database.js.map +1 -1
  139. package/src/app-project/serverless/src/modules/database.ts +171 -171
  140. package/src/controllers/template.d.ts +1 -1
  141. package/src/controllers/template.js +16 -16
  142. package/src/controllers/template.js.map +1 -1
  143. package/src/controllers/template.ts +98 -84
  144. package/src/modules/database.js +3 -1
  145. package/src/modules/database.js.map +1 -1
  146. package/src/modules/database.ts +185 -181
  147. package/src/modules/firebase.d.ts +17 -0
  148. package/src/modules/firebase.js +126 -0
  149. package/src/modules/firebase.js.map +1 -1
  150. package/src/modules/firebase.ts +169 -0
  151. package/src/public-config-initial/auto-fcm.js +8 -2
  152. package/src/public-config-initial/auto-fcm.js.map +1 -1
  153. package/src/public-config-initial/auto-fcm.ts +15 -6
  154. package/src/services/app.d.ts +2 -1
  155. package/src/services/app.js.map +1 -1
  156. package/src/services/app.ts +2 -1
  157. package/src/services/template.d.ts +3 -2
  158. package/src/services/template.js +2 -1
  159. package/src/services/template.js.map +1 -1
  160. package/src/services/template.ts +13 -20
@@ -12,6 +12,7 @@ import { Language } from '../glitter-base/global/language.js';
12
12
  import { ShoppingShipmentSetting } from './shopping-shipment-setting.js';
13
13
  import { ShipmentConfig } from '../glitter-base/global/shipment-config.js';
14
14
  import { ApiUser } from '../glitter-base/route/user.js';
15
+ import { PaymentConfig } from '../glitter-base/global/payment-config.js';
15
16
 
16
17
  type CustomFinance = {
17
18
  name: string;
@@ -260,9 +261,12 @@ export class ShoppingFinanceSetting {
260
261
 
261
262
  // 線上金流
262
263
  if (vm.page === 'online') {
263
- h = html` <div class="my-2">${BgWidget.blueNote('透過線上金流,消費者可於線上進行結帳付款')}</div>
264
+ h = html` <div class="px-md-0 px-2 mb-2">
265
+ ${BgWidget.normalInsignia('透過線上金流,消費者可於線上進行結帳付款')}
266
+ </div>
264
267
  <div class="row">
265
- ${this.onlinePayArray()
268
+ ${PaymentConfig.onlinePay
269
+ .filter(item => item.type !== 'pos')
266
270
  .map(dd => {
267
271
  keyData[dd.key] = keyData[dd.key] ?? {};
268
272
  return html` <div class="col-12 col-lg-3 col-md-4 p-0 p-md-2">
@@ -515,7 +519,7 @@ export class ShoppingFinanceSetting {
515
519
  key_d.STORE_ID = text;
516
520
  },
517
521
  placeHolder: '請輸入STORE_ID',
518
- })
522
+ }),
519
523
  ].join('');
520
524
  case 'paynow':
521
525
  return [
@@ -647,7 +651,7 @@ export class ShoppingFinanceSetting {
647
651
  if (vm.page === 'offline') {
648
652
  const offlinePayArray = [
649
653
  // 系統線下金流
650
- ...this.offlinePayArray(),
654
+ ...PaymentConfig.defalutOfflinePay,
651
655
  // 自訂線下金流
652
656
  ...keyData.payment_info_custom.map((dd: any) => {
653
657
  return {
@@ -658,8 +662,8 @@ export class ShoppingFinanceSetting {
658
662
  }),
659
663
  ];
660
664
 
661
- h = html` <div class="my-2">
662
- ${BgWidget.blueNote('透過設定線下金流,結帳後訂單將進入手動核款的流程,亦可使用超商取貨付款')}
665
+ h = html` <div class="px-md-0 px-2 mb-2">
666
+ ${BgWidget.normalInsignia('透過設定線下金流,結帳後訂單將進入手動核款的流程,亦可使用超商取貨付款')}
663
667
  </div>
664
668
  <div class="row">
665
669
  ${offlinePayArray
@@ -786,9 +790,12 @@ export class ShoppingFinanceSetting {
786
790
 
787
791
  // POS
788
792
  if (vm.page === 'pos') {
789
- h = html`<div class="my-2">${BgWidget.blueNote('設定實體店面所需串接的付款方式')}</div>
793
+ h = html` <div class="px-md-0 px-2 mb-2">
794
+ ${BgWidget.normalInsignia('設定實體店面所需串接的付款方式')}
795
+ </div>
790
796
  <div class="row">
791
- ${this.posPayArray()
797
+ ${PaymentConfig.onlinePay
798
+ .filter(item => item.type === 'pos')
792
799
  .map(dd => {
793
800
  return html` <div class="col-12 col-lg-3 col-md-4 p-0 p-md-2">
794
801
  <div
@@ -898,8 +905,7 @@ export class ShoppingFinanceSetting {
898
905
  (key: any) => {
899
906
  vm.page = key;
900
907
  gvc.notifyDataChange(vm.id);
901
- },
902
- 'margin-top: 0px; margin-bottom: 0px;'
908
+ }
903
909
  ),
904
910
  h,
905
911
  ].join('');
@@ -932,7 +938,7 @@ export class ShoppingFinanceSetting {
932
938
  }
933
939
  },
934
940
  }),
935
- ].join(BgWidget.mbContainer(24))}
941
+ ].join('')}
936
942
  ${BgWidget.mbContainer(240)}
937
943
  `);
938
944
  }
@@ -1224,80 +1230,6 @@ export class ShoppingFinanceSetting {
1224
1230
  });
1225
1231
  }
1226
1232
 
1227
- // 金流種類 (線上)
1228
- static onlinePayArray = () => {
1229
- return [
1230
- {
1231
- key: 'newWebPay',
1232
- name: '藍新金流',
1233
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/logo.jpg',
1234
- },
1235
- {
1236
- key: 'ecPay',
1237
- name: '綠界金流',
1238
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/52415944_122858408.428215.png',
1239
- },
1240
- {
1241
- key: 'paynow',
1242
- name: 'PayNow 立吉富',
1243
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/download.png',
1244
- },
1245
- {
1246
- key: 'paypal',
1247
- name: 'PayPal',
1248
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/174861.png',
1249
- },
1250
- {
1251
- key: 'line_pay',
1252
- name: 'Line Pay',
1253
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/tw-11134207-7r98t-ltrond04grjj74.jpeg',
1254
- },
1255
- {
1256
- key: 'jkopay',
1257
- name: '街口支付',
1258
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/1200x630waw.png',
1259
- },
1260
- ];
1261
- };
1262
-
1263
- // 金流種類 (線下)
1264
- static offlinePayArray = () => {
1265
- return [
1266
- {
1267
- key: 'atm',
1268
- name: 'ATM銀行轉帳',
1269
- customerClass: 'guide2-3',
1270
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/20200804163522idfs9.jpg',
1271
- },
1272
- {
1273
- key: 'line',
1274
- name: 'LINE 轉帳',
1275
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/unnamed.webp',
1276
- },
1277
- {
1278
- key: 'cash_on_delivery',
1279
- name: '貨到付款',
1280
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/images.png',
1281
- },
1282
- ];
1283
- };
1284
-
1285
- // 金流種類 (POS)
1286
- static posPayArray = () => {
1287
- return [
1288
- {
1289
- key: 'line_pay_scan',
1290
- name: 'Line Pay',
1291
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/tw-11134207-7r98t-ltrond04grjj74.jpeg',
1292
- },
1293
- {
1294
- key: 'ut_credit_card',
1295
- name: '聯合信用卡',
1296
- img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/unnamed (1) copy.jpg',
1297
- },
1298
- ];
1299
- };
1300
-
1301
1233
  // 彈窗: 貨到付款 (線下)
1302
1234
  static cashOnDelivery(gvc: GVC, keyData: any) {
1303
1235
  keyData.cash_on_delivery = keyData.cash_on_delivery ?? { shipmentSupport: [] };
@@ -1737,7 +1669,7 @@ export class ShoppingFinanceSetting {
1737
1669
  ];
1738
1670
  if (vm.page === 'delivery_setting') {
1739
1671
  view = view.concat([
1740
- html`<div class="mx-2 mx-sm-0 mt-3 mb-0">
1672
+ html`<div class="px-md-0 px-2">
1741
1673
  ${BgWidget.normalInsignia(
1742
1674
  '設定支援的配送方式,供消費者於前臺自行選擇合適的物流,另外可於商品頁面設定特定商品支援的配送'
1743
1675
  )}
@@ -2471,7 +2403,7 @@ export class ShoppingFinanceSetting {
2471
2403
  );
2472
2404
  } else if (vm.page === 'delivery_track') {
2473
2405
  view = view.concat([
2474
- html` <div class="mx-2 mx-sm-0 mt-3 mb-0">
2406
+ html` <div class="px-md-0 px-2">
2475
2407
  ${BgWidget.normalInsignia('透過設定物流追蹤,可直接列印托運單進行出貨,並自動追蹤貨態')}
2476
2408
  </div>`,
2477
2409
  gvc.bindView(() => {
@@ -34,6 +34,7 @@ import { ListHeaderOption } from './list-header-option.js';
34
34
  import { ShoppingInvoiceManager } from './shopping-invoice-manager.js';
35
35
  import { OrderModule } from './order/order-module.js';
36
36
  const html = String.raw;
37
+ const css = String.raw;
37
38
  class OrderDetail {
38
39
  constructor(subtotal, shipment, newVoucher) {
39
40
  this.subtotal = subtotal;
@@ -208,8 +209,7 @@ export class ShoppingOrderManager {
208
209
  </div>
209
210
  </div>
210
211
  <div class="${query.isShipment ? '' : 'd-none'} mb-3"></div>
211
- <div class="${query.isShipment ? 'd-none' : ''}">
212
- ${BgWidget.tab(query.isPOS
212
+ ${BgWidget.tab(query.isPOS
213
213
  ? [
214
214
  { title: '所有訂單', key: 'all' },
215
215
  { title: 'POS訂單', key: 'pos' },
@@ -222,8 +222,7 @@ export class ShoppingOrderManager {
222
222
  ], gvc, vm.filter_type, text => {
223
223
  vm.filter_type = text;
224
224
  gvc.notifyDataChange(vm.id);
225
- })}
226
- </div>
225
+ }, query.isShipment ? 'display: none;' : '')}
227
226
  ${BgWidget.mainCard([
228
227
  gvc.bindView({
229
228
  bind: glitter.getUUID(),
@@ -289,7 +288,7 @@ export class ShoppingOrderManager {
289
288
  }),
290
289
  }),
291
290
  ];
292
- const filterTags = ListComp.getFilterTags(yield FilterOptions.getOrderFunnel());
291
+ const filterTags = ListComp.getFilterTags(orderFunnel);
293
292
  return BgListComponent.listBarRWD(filterList, filterTags);
294
293
  }),
295
294
  }),
@@ -866,6 +865,9 @@ export class ShoppingOrderManager {
866
865
  }
867
866
  gvc.closeDialog();
868
867
  orders.forEach(order => {
868
+ if (['wait', 'returns', undefined].includes(progress)) {
869
+ order.orderData.user_info.shipment_number = '';
870
+ }
869
871
  order.orderData.progress = progress;
870
872
  });
871
873
  updateOrders(orders);
@@ -1024,7 +1026,6 @@ export class ShoppingOrderManager {
1024
1026
  });
1025
1027
  orderData = structuredClone(orderDataNew.response.data[0]);
1026
1028
  originData = structuredClone(orderData);
1027
- console.log('orderDataNew.response.data -- ', orderDataNew.response.data);
1028
1029
  }
1029
1030
  orderData.orderData.progress = (_b = orderData.orderData.progress) !== null && _b !== void 0 ? _b : 'wait';
1030
1031
  if (orderData.orderData.shipment_selector &&
@@ -1086,9 +1087,19 @@ export class ShoppingOrderManager {
1086
1087
  });
1087
1088
  }
1088
1089
  const funBTN = () => {
1089
- gvc.addStyle(html `
1090
- .funInsignia{ border-radius: 10px; background: #EAEAEA; display: flex; padding: 6px 18px; justify-content:
1091
- center; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; cursor: pointer; }
1090
+ gvc.addStyle(css `
1091
+ .funInsignia {
1092
+ border-radius: 10px;
1093
+ background: #eaeaea;
1094
+ display: flex;
1095
+ padding: 6px 18px;
1096
+ justify-content: center;
1097
+ align-items: center;
1098
+ gap: 8px;
1099
+ font-size: 16px;
1100
+ font-weight: 700;
1101
+ cursor: pointer;
1102
+ }
1092
1103
  `);
1093
1104
  return {
1094
1105
  splitOrder: () => {
@@ -1096,7 +1107,9 @@ export class ShoppingOrderManager {
1096
1107
  class="funInsignia"
1097
1108
  style=""
1098
1109
  onclick="${gvc.event(() => {
1099
- console.log('orderData -- ', orderData);
1110
+ if (orderData.orderData.orderSource == 'split') {
1111
+ return;
1112
+ }
1100
1113
  OrderSetting.splitOrder(gvc, orderData.orderData, () => gvc.notifyDataChange(vm.id));
1101
1114
  })}"
1102
1115
  >
@@ -1190,27 +1203,41 @@ export class ShoppingOrderManager {
1190
1203
  </div>
1191
1204
  ${BgWidget.mbContainer(12)}
1192
1205
  <div class="ms-auto w-100">
1193
- ${EditorElem.select({
1194
- title: '',
1195
- gvc: gvc,
1196
- def: `${orderData.orderData.progress}`,
1197
- array: ApiShop.getProgressArray(orderData.orderData.user_info.shipment_number),
1198
- readonly: orderData.orderData.user_info.shipment_refer === 'paynow' || is_archive,
1199
- callback: text => {
1206
+ ${BgWidget.select({
1207
+ gvc,
1208
+ default: (() => {
1209
+ if (!orderData.orderData.progress) {
1210
+ return 'wait';
1211
+ }
1212
+ if (orderData.orderData.progress === 'wait' &&
1213
+ orderData.orderData.user_info.shipment_number) {
1214
+ return 'in_stock';
1215
+ }
1216
+ return orderData.orderData.progress;
1217
+ })(),
1218
+ options: OrderSetting.getShippmentOpt(),
1219
+ callback: (text) => {
1220
+ const emptyStatus = ['wait', 'returns', undefined, ''];
1221
+ const addNumberStatus = ['arrived', 'finish', 'shipping', 'in_stock'];
1200
1222
  function next() {
1201
1223
  if (text && text !== `${orderData.orderData.progress}`) {
1202
1224
  orderData.orderData.progress = text;
1203
1225
  }
1204
1226
  }
1205
- if (['', 'wait'].includes(orderData.orderData.progress) &&
1206
- !orderData.orderData.user_info.shipment_number &&
1207
- text !== 'pre_order') {
1227
+ if (emptyStatus.includes(orderData.orderData.progress) &&
1228
+ addNumberStatus.includes(text) &&
1229
+ !orderData.orderData.user_info.shipment_number) {
1208
1230
  dialog.checkYesOrNot({
1209
1231
  text: '尚未新增出貨單,是否隨機取號並變更出貨狀態?',
1210
1232
  callback: response => {
1211
1233
  if (response) {
1212
- orderData.orderData.user_info.shipment_number = new Date().getTime();
1213
1234
  next();
1235
+ orderData.orderData.user_info.shipment_number = emptyStatus.includes(text)
1236
+ ? ''
1237
+ : `${new Date().getTime()}`;
1238
+ if (orderData.orderData.progress === 'in_stock') {
1239
+ orderData.orderData.progress = 'wait';
1240
+ }
1214
1241
  saveEvent();
1215
1242
  }
1216
1243
  gvc.notifyDataChange('Edit');
@@ -1221,6 +1248,7 @@ export class ShoppingOrderManager {
1221
1248
  next();
1222
1249
  }
1223
1250
  },
1251
+ readonly: orderData.orderData.user_info.shipment_refer === 'paynow' || is_archive,
1224
1252
  })}
1225
1253
  </div>`,
1226
1254
  html ` <div class="tx_700">配送方式</div>
@@ -1444,8 +1472,9 @@ export class ShoppingOrderManager {
1444
1472
  'FAMIC2C',
1445
1473
  'OKMARTC2C',
1446
1474
  'HILIFEC2C',
1447
- 'normal',
1448
1475
  'UNIMARTFREEZE',
1476
+ 'FAMIC2CFREEZE',
1477
+ 'normal',
1449
1478
  'black_cat',
1450
1479
  'black_cat_freezing',
1451
1480
  ].includes(orderData.orderData.user_info.shipment)
@@ -1508,7 +1537,14 @@ export class ShoppingOrderManager {
1508
1537
  const formData = (orderData.orderData.shipment_selector || OrderModule.supportShipmentMethod()).find(dd => {
1509
1538
  return dd.value === orderData.orderData.user_info.shipment;
1510
1539
  });
1511
- if (['UNIMARTC2C', 'FAMIC2C', 'OKMARTC2C', 'HILIFEC2C', 'UNIMARTFREEZE'].includes(orderData.orderData.user_info.shipment)) {
1540
+ if ([
1541
+ 'UNIMARTC2C',
1542
+ 'FAMIC2C',
1543
+ 'OKMARTC2C',
1544
+ 'HILIFEC2C',
1545
+ 'UNIMARTFREEZE',
1546
+ 'FAMIC2CFREEZE',
1547
+ ].includes(orderData.orderData.user_info.shipment)) {
1512
1548
  return html `
1513
1549
  <div class="d-flex flex-wrap">
1514
1550
  <span class="me-2">門市名稱:</span>
@@ -1769,7 +1805,7 @@ export class ShoppingOrderManager {
1769
1805
  ${document.body.clientWidth > 768 ? getBadgeList() : ''}
1770
1806
  </div>
1771
1807
  ${document.body.clientWidth > 768 ? '' : html ` <div class="mt-1 mb-3">${getBadgeList()}</div>`}
1772
- <div class="d-none justify-content-end">${funBTN().splitOrder()}</div>
1808
+ <div class="d-flex justify-content-end">${funBTN().splitOrder()}</div>
1773
1809
  ${BgWidget.container1x2({
1774
1810
  html: [
1775
1811
  !is_shipment ? '' : shipment_card,
@@ -1791,16 +1827,23 @@ export class ShoppingOrderManager {
1791
1827
  var _a;
1792
1828
  return dd.value == ((_a = orderData.orderData.orderStatus) !== null && _a !== void 0 ? _a : '0');
1793
1829
  })) === null || _a === void 0 ? void 0 : _a.title
1794
- : EditorElem.select({
1830
+ : BgWidget.select({
1795
1831
  title: '',
1796
1832
  gvc: gvc,
1797
- def: (_b = orderData.orderData.orderStatus) !== null && _b !== void 0 ? _b : '0',
1798
- array: [
1833
+ default: (_b = orderData.orderData.orderStatus) !== null && _b !== void 0 ? _b : '0',
1834
+ options: [
1799
1835
  {
1800
1836
  title: '變更訂單狀態',
1801
1837
  value: '',
1802
1838
  },
1803
- ].concat(ApiShop.getOrderStatusArray()),
1839
+ ]
1840
+ .concat(ApiShop.getOrderStatusArray())
1841
+ .map(item => {
1842
+ return {
1843
+ key: item.value,
1844
+ value: item.title,
1845
+ };
1846
+ }),
1804
1847
  callback: text => {
1805
1848
  orderData.orderData.orderStatus = orderData.orderData.orderStatus || '0';
1806
1849
  if (text && text !== orderData.orderData.orderStatus) {
@@ -1880,10 +1923,8 @@ export class ShoppingOrderManager {
1880
1923
  <div>$${dd.sale_price.toLocaleString()} × ${dd.count}</div>
1881
1924
  </div>
1882
1925
  <div
1883
- class="tx_normal d-sm-none d-flex flex-column"
1884
- style="display: flex;justify-content: end;${document.body.clientWidth > 800
1885
- ? 'width: 110px'
1886
- : 'width: 140px'}"
1926
+ class="tx_normal d-sm-none d-flex flex-column align-items-end justify-content-end"
1927
+ style="min-width: 110px"
1887
1928
  >
1888
1929
  ${dd.origin_price && dd.origin_price > dd.sale_price
1889
1930
  ? html ` <div style="margin-right: 6px; text-decoration: line-through;">
@@ -1892,7 +1933,6 @@ export class ShoppingOrderManager {
1892
1933
  : ''}
1893
1934
  <div>$${dd.sale_price.toLocaleString()} × ${dd.count}</div>
1894
1935
  </div>
1895
-
1896
1936
  <div
1897
1937
  class="tx_normal d-none d-sm-flex"
1898
1938
  style="display: flex;justify-content: end;${document.body.clientWidth > 800
@@ -2149,16 +2189,23 @@ export class ShoppingOrderManager {
2149
2189
  .find(dd => {
2150
2190
  return dd.value === `${orderData.status}`;
2151
2191
  })) === null || _d === void 0 ? void 0 : _d.title
2152
- : EditorElem.select({
2192
+ : BgWidget.select({
2153
2193
  title: '',
2154
2194
  gvc: gvc,
2155
- def: `${orderData.status}`,
2156
- array: [
2195
+ default: `${orderData.status}`,
2196
+ options: [
2157
2197
  {
2158
2198
  title: '變更付款狀態',
2159
2199
  value: '',
2160
2200
  },
2161
- ].concat(ApiShop.getStatusArray(orderData.orderData.proof_purchase)),
2201
+ ]
2202
+ .concat(ApiShop.getStatusArray(orderData.orderData.proof_purchase))
2203
+ .map(item => {
2204
+ return {
2205
+ key: item.value,
2206
+ value: item.title,
2207
+ };
2208
+ }),
2162
2209
  callback: text => {
2163
2210
  dialog.checkYesOrNot({
2164
2211
  text: '是否確認變更付款狀態?',
@@ -2317,6 +2364,41 @@ export class ShoppingOrderManager {
2317
2364
  .filter(Boolean)
2318
2365
  .join(BgWidget.mbContainer(18))),
2319
2366
  is_shipment ? '' : shipment_card,
2367
+ BgWidget.mainCard(gvc.bindView((() => {
2368
+ const id = gvc.glitter.getUUID();
2369
+ return {
2370
+ bind: id,
2371
+ view: () => {
2372
+ var _a;
2373
+ return html `
2374
+ <div class="d-flex align-items-center justify-content-between">
2375
+ <div>
2376
+ <div style="color: #393939; font-weight: 700;">訂單標籤</div>
2377
+ ${BgWidget.grayNote('操作後台人員登記與分類用,不會顯示於前台')}
2378
+ ${BgWidget.mbContainer(4)}
2379
+ </div>
2380
+ ${BgWidget.blueNote('使用現有標籤', gvc.event(() => {
2381
+ var _a;
2382
+ OrderModule.useOrderTags({
2383
+ gvc,
2384
+ config_key: 'order_manager_tags',
2385
+ def: (_a = orderData.orderData.tags) !== null && _a !== void 0 ? _a : [],
2386
+ callback: tags => {
2387
+ orderData.orderData.tags = tags;
2388
+ gvc.notifyDataChange(id);
2389
+ },
2390
+ });
2391
+ }))}
2392
+ </div>
2393
+ ${BgWidget.multipleInput(gvc, (_a = orderData.orderData.tags) !== null && _a !== void 0 ? _a : [], {
2394
+ save: def => {
2395
+ orderData.orderData.tags = [...new Set(def)];
2396
+ },
2397
+ }, true)}
2398
+ `;
2399
+ },
2400
+ };
2401
+ })())),
2320
2402
  BgWidget.mainCard(gvc.bindView(() => {
2321
2403
  const vm = {
2322
2404
  edit_mode: false,
@@ -2652,7 +2734,7 @@ export class ShoppingOrderManager {
2652
2734
  return viewModel
2653
2735
  .map(item => {
2654
2736
  return html `
2655
- <div>
2737
+ <div style="word-break: break-all;">
2656
2738
  ${item[0]} :
2657
2739
  ${orderData.orderData.user_info[item[1]] || '未填寫'}
2658
2740
  </div>
@@ -2684,6 +2766,7 @@ export class ShoppingOrderManager {
2684
2766
  case 'OKMARTC2C':
2685
2767
  case 'UNIMARTC2C':
2686
2768
  case 'UNIMARTFREEZE':
2769
+ case 'FAMIC2CFREEZE':
2687
2770
  return [
2688
2771
  html ` <div class="d-flex flex-wrap w-100">
2689
2772
  <span class="me-2 fw-normal fs-6">門市名稱:</span>
@@ -3331,6 +3414,7 @@ export class ShoppingOrderManager {
3331
3414
  count: (_b = variant.qty) !== null && _b !== void 0 ? _b : '1',
3332
3415
  sale_price: variant.sale_price,
3333
3416
  sku: variant.sku,
3417
+ deduction_log: {},
3334
3418
  });
3335
3419
  orderDetail.subtotal +=
3336
3420
  Number(orderDetail.lineItems[index].count) * orderDetail.lineItems[index].sale_price;