ts-glitter 21.2.5 → 21.2.6

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 (34) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/cms-plugin/filter-options.js +1 -0
  4. package/lowcode/cms-plugin/filter-options.ts +1 -0
  5. package/lowcode/cms-plugin/pos-pages/pos-summary.js +4 -4
  6. package/lowcode/cms-plugin/pos-pages/pos-summary.ts +4 -1
  7. package/lowcode/cms-plugin/shopping-order-manager.js +10 -7
  8. package/lowcode/cms-plugin/shopping-order-manager.ts +10 -7
  9. package/lowcode/cms-plugin/shopping-product-setting.js +9 -6
  10. package/lowcode/cms-plugin/shopping-product-setting.ts +13 -6
  11. package/lowcode/cms-plugin/shopping-setting-basic.js +411 -405
  12. package/lowcode/cms-plugin/shopping-setting-basic.ts +497 -486
  13. package/package.json +1 -1
  14. package/src/api-public/controllers/shop.js +4 -4
  15. package/src/api-public/controllers/shop.js.map +1 -1
  16. package/src/api-public/controllers/shop.ts +10 -12
  17. package/src/api-public/services/checkout-event.js +17 -7
  18. package/src/api-public/services/checkout-event.js.map +1 -1
  19. package/src/api-public/services/financial-serviceV2.js +17 -7
  20. package/src/api-public/services/financial-serviceV2.js.map +1 -1
  21. package/src/api-public/services/mail.js +3 -3
  22. package/src/api-public/services/mail.js.map +1 -1
  23. package/src/api-public/services/mail.ts +144 -134
  24. package/src/api-public/services/shopping.js +5 -4
  25. package/src/api-public/services/shopping.js.map +1 -1
  26. package/src/api-public/services/shopping.ts +15 -14
  27. package/src/api-public/services/user.js +17 -7
  28. package/src/api-public/services/user.js.map +1 -1
  29. package/src/index.js +17 -7
  30. package/src/index.js.map +1 -1
  31. package/src/services/app.js +17 -7
  32. package/src/services/app.js.map +1 -1
  33. package/src/services/ses.js.map +1 -1
  34. package/src/services/ses.ts +41 -35
package/lowcode/Entry.js CHANGED
@@ -146,7 +146,7 @@ export class Entry {
146
146
  }
147
147
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
148
148
  console.log(`Entry-time:`, window.renderClock.stop());
149
- glitter.share.editerVersion = 'V_21.2.5';
149
+ glitter.share.editerVersion = 'V_21.2.6';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -150,7 +150,7 @@ export class Entry {
150
150
  }
151
151
  (window as any).renderClock = (window as any).renderClock ?? createClock();
152
152
  console.log(`Entry-time:`, (window as any).renderClock.stop());
153
- glitter.share.editerVersion = 'V_21.2.5';
153
+ glitter.share.editerVersion = 'V_21.2.6';
154
154
  glitter.share.start = new Date();
155
155
  const vm = { appConfig: [] };
156
156
  (window as any).saasConfig = {
@@ -574,6 +574,7 @@ FilterOptions.productListOrderBy = [
574
574
  { key: 'created_time_asc', value: '建立時間舊 > 新' },
575
575
  { key: 'updated_time_desc', value: '更新時間新 > 舊' },
576
576
  { key: 'updated_time_asc', value: '更新時間舊 > 新' },
577
+ { key: 'sort_weight', value: '商品顯示權重高 > 低' },
577
578
  ];
578
579
  FilterOptions.imageLibraryOrderBy = [
579
580
  { key: 'default', value: '預設' },
@@ -600,6 +600,7 @@ export class FilterOptions {
600
600
  { key: 'created_time_asc', value: '建立時間舊 > 新' },
601
601
  { key: 'updated_time_desc', value: '更新時間新 > 舊' },
602
602
  { key: 'updated_time_asc', value: '更新時間舊 > 新' },
603
+ { key: 'sort_weight', value: '商品顯示權重高 > 低' },
603
604
  // { key: 'stock_desc', value: '庫存數量多 > 少' },
604
605
  // { key: 'stock_asc', value: '庫存數量少 > 多' },
605
606
  ];
@@ -94,7 +94,7 @@ export class PosSummary {
94
94
  style="width:100px;"
95
95
  placeholder="0"
96
96
  onclick="${gvc.event((e, event) => {
97
- PosFunction.setMoney(gvc, response => {
97
+ PosFunction.setMoney(gvc, dd.real, response => {
98
98
  dd.real = response || 0;
99
99
  e.value = response || 0;
100
100
  }, '設定清點金額');
@@ -128,7 +128,7 @@ export class PosSummary {
128
128
  <input
129
129
  class="form-control mt-2"
130
130
  onclick="${gvc.event((e, event) => {
131
- PosFunction.setMoney(gvc, response => {
131
+ PosFunction.setMoney(gvc, money, response => {
132
132
  e.value = `${response}`;
133
133
  money = response || 0;
134
134
  }, '設定備用金額');
@@ -463,8 +463,8 @@ export class PosSummary {
463
463
  text: html `${PosWidget.fontBold('要從錢箱匯出的金額')}
464
464
  <input
465
465
  class="form-control mt-2"
466
- onclick="${gvc.event((e, event) => {
467
- PosFunction.setMoney(gvc, response => {
466
+ onclick="${gvc.event(e => {
467
+ PosFunction.setMoney(gvc, money, response => {
468
468
  if (response > min_) {
469
469
  dialog.errorMessage({ text: '錢箱金額不足' });
470
470
  }
@@ -91,6 +91,7 @@ export class PosSummary {
91
91
  onclick="${gvc.event((e, event) => {
92
92
  PosFunction.setMoney(
93
93
  gvc,
94
+ dd.real,
94
95
  response => {
95
96
  dd.real = response || 0;
96
97
  e.value = response || 0;
@@ -133,6 +134,7 @@ export class PosSummary {
133
134
  onclick="${gvc.event((e, event) => {
134
135
  PosFunction.setMoney(
135
136
  gvc,
137
+ money,
136
138
  response => {
137
139
  e.value = `${response}`;
138
140
  money = response || 0;
@@ -483,9 +485,10 @@ export class PosSummary {
483
485
  text: html`${PosWidget.fontBold('要從錢箱匯出的金額')}
484
486
  <input
485
487
  class="form-control mt-2"
486
- onclick="${gvc.event((e, event) => {
488
+ onclick="${gvc.event(e => {
487
489
  PosFunction.setMoney(
488
490
  gvc,
491
+ money,
489
492
  response => {
490
493
  if (response > min_) {
491
494
  dialog.errorMessage({ text: '錢箱金額不足' });
@@ -1547,12 +1547,15 @@ export class ShoppingOrderManager {
1547
1547
  return {
1548
1548
  bind: gvc.glitter.getUUID(),
1549
1549
  view: () => __awaiter(this, void 0, void 0, function* () {
1550
- const needAddress = [
1551
- 'normal',
1552
- 'black_cat',
1553
- 'black_cat_freezing',
1554
- 'black_cat_ice',
1555
- 'global_express',
1550
+ const noNeedAddress = [
1551
+ 'now',
1552
+ 'shop',
1553
+ 'UNIMARTC2C',
1554
+ 'FAMIC2C',
1555
+ 'HILIFEC2C',
1556
+ 'OKMARTC2C',
1557
+ 'UNIMARTFREEZE',
1558
+ 'FAMIC2CFREEZE',
1556
1559
  ].includes(orderData.orderData.user_info.shipment);
1557
1560
  const viewModel = [
1558
1561
  ['姓名', 'name'],
@@ -1562,7 +1565,7 @@ export class ShoppingOrderManager {
1562
1565
  ['鄉鎮', 'area'],
1563
1566
  ['地址', 'address'],
1564
1567
  ].filter(item => {
1565
- return needAddress || !['city', 'area', 'address'].includes(item[1]);
1568
+ return !noNeedAddress || !['city', 'area', 'address'].includes(item[1]);
1566
1569
  });
1567
1570
  const receipt = (yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')).response.value;
1568
1571
  receipt.list.map((d1) => {
@@ -1745,12 +1745,15 @@ export class ShoppingOrderManager {
1745
1745
  return {
1746
1746
  bind: gvc.glitter.getUUID(),
1747
1747
  view: async () => {
1748
- const needAddress = [
1749
- 'normal',
1750
- 'black_cat',
1751
- 'black_cat_freezing',
1752
- 'black_cat_ice',
1753
- 'global_express',
1748
+ const noNeedAddress = [
1749
+ 'now',
1750
+ 'shop',
1751
+ 'UNIMARTC2C',
1752
+ 'FAMIC2C',
1753
+ 'HILIFEC2C',
1754
+ 'OKMARTC2C',
1755
+ 'UNIMARTFREEZE',
1756
+ 'FAMIC2CFREEZE',
1754
1757
  ].includes(orderData.orderData.user_info.shipment);
1755
1758
 
1756
1759
  const viewModel = [
@@ -1761,7 +1764,7 @@ export class ShoppingOrderManager {
1761
1764
  ['鄉鎮', 'area'],
1762
1765
  ['地址', 'address'],
1763
1766
  ].filter(item => {
1764
- return needAddress || !['city', 'area', 'address'].includes(item[1]);
1767
+ return !noNeedAddress || !['city', 'area', 'address'].includes(item[1]);
1765
1768
  });
1766
1769
 
1767
1770
  const receipt = (
@@ -747,6 +747,9 @@ export class ShoppingProductSetting {
747
747
  const vm = {
748
748
  id: gvc.glitter.getUUID(),
749
749
  };
750
+ if (obj.vm.type === 'add') {
751
+ variant.shipment_type = 'none';
752
+ }
750
753
  return {
751
754
  bind: vm.id,
752
755
  view: () => {
@@ -918,7 +921,7 @@ export class ShoppingProductSetting {
918
921
  />
919
922
  `;
920
923
  })
921
- .join(``)}
924
+ .join('')}
922
925
  </div>
923
926
  </div>`;
924
927
  }
@@ -930,7 +933,7 @@ export class ShoppingProductSetting {
930
933
  <div class="flex-fill d-flex flex-column" style="gap: 8px">
931
934
  <div>庫存數量</div>
932
935
  <div
933
- class="w-100 ${postMD.shopee_id ? `` : `d-none`}"
936
+ class="w-100 ${postMD.shopee_id ? '' : `d-none`}"
934
937
  style="font-size: 14px;font-weight: 400;color: #8D8D8D;"
935
938
  >
936
939
  此商品來源為蝦皮電商平台,將自動同步蝦皮庫存
@@ -1086,7 +1089,7 @@ export class ShoppingProductSetting {
1086
1089
  })()}
1087
1090
  ${document.body.clientWidth > 768 && obj.single === undefined ? BgWidget.mbContainer(120) : ''}
1088
1091
  </div>
1089
- <div class="${obj.single ? `d-none` : ``}" style="min-width:300px; max-width:100%;">
1092
+ <div class="${obj.single ? `d-none` : ''}" style="min-width:300px; max-width:100%;">
1090
1093
  ${BgWidget.summaryCard(gvc.bindView({
1091
1094
  bind: 'right',
1092
1095
  view: () => {
@@ -1132,7 +1135,7 @@ export class ShoppingProductSetting {
1132
1135
  `;
1133
1136
  }
1134
1137
  else {
1135
- return ``;
1138
+ return '';
1136
1139
  }
1137
1140
  })
1138
1141
  .join('');
@@ -1148,7 +1151,7 @@ export class ShoppingProductSetting {
1148
1151
  `, {
1149
1152
  style: obj.vm.type === 'editSpec' ? '' : 'margin-top: 0 !important;',
1150
1153
  })}
1151
- <div class="update-bar-container ${obj.single ? `d-none` : ``}">
1154
+ <div class="update-bar-container ${obj.single ? `d-none` : ''}">
1152
1155
  ${BgWidget.cancel(obj.gvc.event(() => {
1153
1156
  checkStore(obj && obj.goBackEvent
1154
1157
  ? obj.goBackEvent.cancel
@@ -1271,7 +1274,7 @@ export class ShoppingProductSetting {
1271
1274
  view: () => {
1272
1275
  var _b, _c, _d, _e, _f;
1273
1276
  const languageData = postMD.language_data[vm.language] || {};
1274
- languageData.title = ((_b = languageData.title) === null || _b === void 0 ? void 0 : _b.trim()) ? languageData.title : (postMD === null || postMD === void 0 ? void 0 : postMD.title) || 'Default Title';
1277
+ languageData.title = ((_b = languageData.title) === null || _b === void 0 ? void 0 : _b.trim()) ? languageData.title : (postMD === null || postMD === void 0 ? void 0 : postMD.title) || '';
1275
1278
  languageData.content = (_c = languageData.content) !== null && _c !== void 0 ? _c : postMD.content;
1276
1279
  languageData.content_array = (_d = languageData.content_array) !== null && _d !== void 0 ? _d : postMD.content_array;
1277
1280
  languageData.content_json = (_e = languageData.content_json) !== null && _e !== void 0 ? _e : postMD.content_json;
@@ -303,6 +303,7 @@ export class ShoppingProductSetting {
303
303
  return undefined;
304
304
  })(),
305
305
  };
306
+
306
307
  ApiShop.getProduct(vm.apiJSON).then(data => {
307
308
  function getDatalist() {
308
309
  return data.response.data.map((dd: any) => {
@@ -858,12 +859,18 @@ export class ShoppingProductSetting {
858
859
  const vm = {
859
860
  id: gvc.glitter.getUUID(),
860
861
  };
862
+
863
+ if (obj.vm.type === 'add') {
864
+ variant.shipment_type = 'none';
865
+ }
866
+
861
867
  return {
862
868
  bind: vm.id,
863
869
  view: () => {
864
870
  if (postMD.product_category === 'weighing') {
865
871
  variant.shipment_type = 'none';
866
872
  }
873
+
867
874
  return html` <div style="font-weight: 700;margin-bottom: 6px;">運費計算</div>
868
875
  ${BgWidget.multiCheckboxContainer(
869
876
  gvc,
@@ -1044,7 +1051,7 @@ export class ShoppingProductSetting {
1044
1051
  />
1045
1052
  `;
1046
1053
  })
1047
- .join(``)}
1054
+ .join('')}
1048
1055
  </div>
1049
1056
  </div>`;
1050
1057
  }
@@ -1057,7 +1064,7 @@ export class ShoppingProductSetting {
1057
1064
  <div class="flex-fill d-flex flex-column" style="gap: 8px">
1058
1065
  <div>庫存數量</div>
1059
1066
  <div
1060
- class="w-100 ${(postMD as any).shopee_id ? `` : `d-none`}"
1067
+ class="w-100 ${(postMD as any).shopee_id ? '' : `d-none`}"
1061
1068
  style="font-size: 14px;font-weight: 400;color: #8D8D8D;"
1062
1069
  >
1063
1070
  此商品來源為蝦皮電商平台,將自動同步蝦皮庫存
@@ -1261,7 +1268,7 @@ export class ShoppingProductSetting {
1261
1268
  })()}
1262
1269
  ${document.body.clientWidth > 768 && obj.single === undefined ? BgWidget.mbContainer(120) : ''}
1263
1270
  </div>
1264
- <div class="${obj.single ? `d-none` : ``}" style="min-width:300px; max-width:100%;">
1271
+ <div class="${obj.single ? `d-none` : ''}" style="min-width:300px; max-width:100%;">
1265
1272
  ${BgWidget.summaryCard(
1266
1273
  gvc.bindView({
1267
1274
  bind: 'right',
@@ -1310,7 +1317,7 @@ export class ShoppingProductSetting {
1310
1317
  </div>
1311
1318
  `;
1312
1319
  } else {
1313
- return ``;
1320
+ return '';
1314
1321
  }
1315
1322
  })
1316
1323
  .join('');
@@ -1330,7 +1337,7 @@ export class ShoppingProductSetting {
1330
1337
  style: obj.vm.type === 'editSpec' ? '' : 'margin-top: 0 !important;',
1331
1338
  }
1332
1339
  )}
1333
- <div class="update-bar-container ${obj.single ? `d-none` : ``}">
1340
+ <div class="update-bar-container ${obj.single ? `d-none` : ''}">
1334
1341
  ${BgWidget.cancel(
1335
1342
  obj.gvc.event(() => {
1336
1343
  checkStore(
@@ -1522,7 +1529,7 @@ export class ShoppingProductSetting {
1522
1529
  const languageData = (postMD.language_data as any)[vm.language] || {};
1523
1530
 
1524
1531
  // 如果沒有塞入預設值,則使用預設值
1525
- languageData.title = languageData.title?.trim() ? languageData.title : postMD?.title || 'Default Title';
1532
+ languageData.title = languageData.title?.trim() ? languageData.title : postMD?.title || '';
1526
1533
  languageData.content = languageData.content ?? postMD.content;
1527
1534
  languageData.content_array = languageData.content_array ?? postMD.content_array;
1528
1535
  languageData.content_json = languageData.content_json ?? postMD.content_json;