ts-glitter 21.8.9 → 21.9.1

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.
@@ -4,7 +4,7 @@ import { ApiUser } from '../../glitter-base/route/user.js';
4
4
  import { ApiShop } from '../../glitter-base/route/shopping.js';
5
5
  import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
6
6
  import { Tool } from '../../modules/tool.js';
7
- import { CartData, LineItem, OrderData, OrderDetail } from './data.js';
7
+ import { OrderDetail } from './data.js';
8
8
  import { EditorElem } from '../../glitterBundle/plugins/editor-elem.js';
9
9
  import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
10
10
  import { PaymentConfig } from '../../glitter-base/global/payment-config.js';
@@ -83,6 +83,7 @@ export class OrderSetting {
83
83
  { title: '部分付款', value: '3' },
84
84
  { title: '待核款 / 貨到付款 / 未付款', value: '0' },
85
85
  { title: '已退款', value: '-2' },
86
+ { title: '付款失敗', value: '-1' },
86
87
  ].map(item => {
87
88
  return {
88
89
  key: item.value,
@@ -1300,6 +1301,51 @@ export class OrderSetting {
1300
1301
  }, 'combineOrders');
1301
1302
  }
1302
1303
 
1304
+ static allEditDialog(data: { gvc: GVC; title: string; options: OptionsItem[]; callback: (value: any) => void }) {
1305
+ const gvc = data.gvc;
1306
+ const dialog = new ShareDialog(gvc.glitter);
1307
+ const defaultValue = '';
1308
+ let temp = '';
1309
+
1310
+ BgWidget.settingDialog({
1311
+ gvc: gvc,
1312
+ title: data.title,
1313
+ innerHTML: (innerGVC: GVC) => {
1314
+ return html` <div>
1315
+ <div class="tx_700 mb-2">更改為</div>
1316
+ ${BgWidget.select({
1317
+ gvc: innerGVC,
1318
+ callback: (value: any) => {
1319
+ temp = value;
1320
+ },
1321
+ default: defaultValue,
1322
+ options: [{ key: '', value: '請選擇狀態' }, ...data.options],
1323
+ })}
1324
+ </div>`;
1325
+ },
1326
+ footer_html: (footerGVC: GVC) => {
1327
+ return [
1328
+ BgWidget.cancel(
1329
+ footerGVC.event(() => footerGVC.closeDialog()),
1330
+ '取消'
1331
+ ),
1332
+ BgWidget.save(
1333
+ footerGVC.event(() => {
1334
+ if (temp === defaultValue) {
1335
+ dialog.infoMessage({ text: '請選擇欲更改的選項' });
1336
+ return;
1337
+ }
1338
+ footerGVC.closeDialog();
1339
+ data.callback(temp);
1340
+ }),
1341
+ '儲存'
1342
+ ),
1343
+ ].join('');
1344
+ },
1345
+ width: 350,
1346
+ });
1347
+ }
1348
+
1303
1349
  // 大量編輯
1304
1350
  static batchEditOrders(obj: { gvc: GVC; orders: any; callback: (orders: any) => void }) {
1305
1351
  const wp = window.parent as any;
@@ -1417,8 +1463,23 @@ export class OrderSetting {
1417
1463
  dd.status = value;
1418
1464
  },
1419
1465
  default: `${dd.status || 0}`,
1420
- options: OrderSetting.getPaymentStatusOpt(),
1421
- style: 'min-width: 220px;',
1466
+ options: (() => {
1467
+ const paymentOptions = OrderSetting.getPaymentStatusOpt();
1468
+ const unpayOption = paymentOptions.find(item => item.key === '0');
1469
+
1470
+ if (unpayOption) {
1471
+ if (dd.orderData.proof_purchase) {
1472
+ unpayOption.value = '待核款';
1473
+ } else if (dd.orderData.customer_info.payment_select == 'cash_on_delivery') {
1474
+ unpayOption.value = '貨到付款';
1475
+ } else {
1476
+ unpayOption.value = '未付款';
1477
+ }
1478
+ }
1479
+
1480
+ return paymentOptions;
1481
+ })(),
1482
+ style: 'min-width: 150px;',
1422
1483
  }),
1423
1484
  },
1424
1485
  {
@@ -1499,7 +1560,7 @@ export class OrderSetting {
1499
1560
  return html` <div class="d-flex align-items-center gap-2">${htmlArray.join('')}</div>`;
1500
1561
  },
1501
1562
  divCreate: {
1502
- style: 'min-width: 580px;',
1563
+ style: 'min-width: 620px;',
1503
1564
  },
1504
1565
  };
1505
1566
  })()
@@ -1509,50 +1570,6 @@ export class OrderSetting {
1509
1570
  });
1510
1571
  }
1511
1572
 
1512
- function allEditDialog(data: { title: string; options: OptionsItem[]; callback: (value: any) => void }) {
1513
- const defaultValue = '';
1514
- let temp = '';
1515
-
1516
- BgWidget.settingDialog({
1517
- gvc: gvc,
1518
- title: data.title,
1519
- innerHTML: (innerGVC: GVC) => {
1520
- return html` <div>
1521
- <div class="tx_700 mb-2">更改為</div>
1522
- ${BgWidget.select({
1523
- gvc: innerGVC,
1524
- callback: (value: any) => {
1525
- temp = value;
1526
- },
1527
- default: defaultValue,
1528
- options: [{ key: '', value: '請選擇狀態' }, ...data.options],
1529
- })}
1530
- </div>`;
1531
- },
1532
- footer_html: (footerGVC: GVC) => {
1533
- return [
1534
- BgWidget.cancel(
1535
- footerGVC.event(() => footerGVC.closeDialog()),
1536
- '取消'
1537
- ),
1538
- BgWidget.save(
1539
- footerGVC.event(() => {
1540
- if (temp === defaultValue) {
1541
- dialog.infoMessage({ text: '請選擇欲更改的選項' });
1542
- return;
1543
- }
1544
- footerGVC.closeDialog();
1545
- data.callback(temp);
1546
- gvc.notifyDataChange(vm.id);
1547
- }),
1548
- '儲存'
1549
- ),
1550
- ].join('');
1551
- },
1552
- width: 350,
1553
- });
1554
- }
1555
-
1556
1573
  function editOrderView() {
1557
1574
  return BgWidget.tableV3({
1558
1575
  gvc,
@@ -1560,13 +1577,15 @@ export class OrderSetting {
1560
1577
  {
1561
1578
  name: '更改付款狀態',
1562
1579
  event: (checkArray: any) => {
1563
- allEditDialog({
1580
+ OrderSetting.allEditDialog({
1581
+ gvc,
1564
1582
  title: '批量更改付款狀態',
1565
1583
  options: OrderSetting.getPaymentStatusOpt(),
1566
1584
  callback: (value: any) => {
1567
1585
  checkArray.forEach((order: any) => {
1568
1586
  order.status = Number(value);
1569
1587
  });
1588
+ gvc.notifyDataChange(vm.id);
1570
1589
  },
1571
1590
  });
1572
1591
  },
@@ -1574,7 +1593,8 @@ export class OrderSetting {
1574
1593
  {
1575
1594
  name: '更改出貨狀態',
1576
1595
  event: (checkArray: any) => {
1577
- allEditDialog({
1596
+ OrderSetting.allEditDialog({
1597
+ gvc,
1578
1598
  title: '批量更改出貨狀態',
1579
1599
  options: OrderSetting.getShippmentOpt(),
1580
1600
  callback: (value: any) => {
@@ -1584,6 +1604,7 @@ export class OrderSetting {
1584
1604
  order.orderData.user_info.shipment_number = '';
1585
1605
  }
1586
1606
  });
1607
+ gvc.notifyDataChange(vm.id);
1587
1608
  },
1588
1609
  });
1589
1610
  },
@@ -1591,13 +1612,15 @@ export class OrderSetting {
1591
1612
  {
1592
1613
  name: '更改訂單狀態',
1593
1614
  event: (checkArray: any) => {
1594
- allEditDialog({
1615
+ OrderSetting.allEditDialog({
1616
+ gvc,
1595
1617
  title: '批量更改訂單狀態',
1596
1618
  options: OrderSetting.getOrderStatusOpt(),
1597
1619
  callback: (value: any) => {
1598
1620
  checkArray.forEach((order: any) => {
1599
1621
  order.orderData.orderStatus = value;
1600
1622
  });
1623
+ gvc.notifyDataChange(vm.id);
1601
1624
  },
1602
1625
  });
1603
1626
  },
@@ -1660,33 +1683,13 @@ export class OrderSetting {
1660
1683
  ${BgWidget.cancel(gvc.event(() => closeEvent()))}
1661
1684
  ${BgWidget.save(
1662
1685
  gvc.event(() => {
1663
- // 與原訂單的資料做驗證
1664
- for (let i = 0; i < vm.orders.length; i++) {
1665
- const order = vm.orders[i];
1666
- const cloneOrder = cloneOrders[i];
1667
-
1668
- if (
1669
- ['wait', 'returns', undefined].includes(cloneOrder.orderData.progress) &&
1670
- ['arrived', 'finish', 'shipping', 'in_stock'].includes(order.orderData.progress) &&
1671
- !order.orderData.user_info.shipment_number
1672
- ) {
1673
- dialog.errorMessage({
1674
- text: `訂單編號 #${order.cart_token} 未輸入出貨單號碼`,
1675
- });
1676
- return;
1677
- }
1678
- }
1679
-
1680
- // 「備貨中」重新賦值
1681
- vm.orders.forEach((order: any) => {
1682
- if (order.orderData.progress === 'in_stock') {
1683
- order.orderData.progress = 'wait';
1684
- }
1685
- });
1686
+ const verify = this.batchUpdateOrderVerify(gvc, cloneOrders, vm.orders);
1686
1687
 
1687
- // 觸發更新事件
1688
- obj.callback(vm.orders);
1689
- topGVC.glitter.closeDiaLog();
1688
+ if (verify) {
1689
+ // 觸發更新事件
1690
+ obj.callback(vm.orders);
1691
+ topGVC.glitter.closeDiaLog();
1692
+ }
1690
1693
  })
1691
1694
  )}
1692
1695
  </div>
@@ -1697,6 +1700,36 @@ export class OrderSetting {
1697
1700
  }, 'batchEditOrders');
1698
1701
  }
1699
1702
 
1703
+ // 與原訂單的資料做驗證
1704
+ static batchUpdateOrderVerify(gvc: GVC, cloneOrders: Order[], updateOrders: Order[]): Boolean {
1705
+ const dialog = new ShareDialog(gvc.glitter);
1706
+
1707
+ for (let i = 0; i < updateOrders.length; i++) {
1708
+ const order = updateOrders[i];
1709
+ const cloneOrder = cloneOrders[i];
1710
+
1711
+ if (
1712
+ ['wait', 'returns', undefined].includes(cloneOrder.orderData.progress) &&
1713
+ ['arrived', 'finish', 'shipping', 'in_stock'].includes(order.orderData.progress) &&
1714
+ !order.orderData.user_info.shipment_number
1715
+ ) {
1716
+ dialog.errorMessage({
1717
+ text: `訂單編號 #${order.cart_token} 未輸入出貨單號碼`,
1718
+ });
1719
+ return false;
1720
+ }
1721
+ }
1722
+
1723
+ // 「備貨中」重新賦值
1724
+ updateOrders.forEach((order: any) => {
1725
+ if (order.orderData.progress === 'in_stock') {
1726
+ order.orderData.progress = 'wait';
1727
+ }
1728
+ });
1729
+
1730
+ return true;
1731
+ }
1732
+
1700
1733
  // 拆分訂單
1701
1734
  static splitOrder(topGVC: GVC, origOrderData: any, callback: () => void) {
1702
1735
  //把原本的預設資訊扔進拆分表單內,並且把商品的數量設定為0
@@ -588,6 +588,60 @@ export class ShoppingOrderManager {
588
588
  return OrderSetting.combineOrders(gvc, checkArray, () => gvc.notifyDataChange(vm.id));
589
589
  },
590
590
  },
591
+ {
592
+ name: '更改付款狀態',
593
+ option: true,
594
+ event: (checkArray) => {
595
+ OrderSetting.allEditDialog({
596
+ gvc,
597
+ title: '批量更改付款狀態',
598
+ options: OrderSetting.getPaymentStatusOpt(),
599
+ callback: (value) => {
600
+ checkArray.forEach((order) => {
601
+ order.status = Number(value);
602
+ });
603
+ updateOrders(checkArray);
604
+ },
605
+ });
606
+ },
607
+ },
608
+ {
609
+ name: '更改出貨狀態',
610
+ option: true,
611
+ event: (checkArray) => {
612
+ OrderSetting.allEditDialog({
613
+ gvc,
614
+ title: '批量更改出貨狀態',
615
+ options: OrderSetting.getShippmentOpt(),
616
+ callback: (value) => {
617
+ checkArray.forEach((order) => {
618
+ order.orderData.progress = value;
619
+ if (['wait', 'returns', undefined].includes(value)) {
620
+ order.orderData.user_info.shipment_number = '';
621
+ }
622
+ });
623
+ updateOrders(checkArray);
624
+ },
625
+ });
626
+ },
627
+ },
628
+ {
629
+ name: '更改訂單狀態',
630
+ option: true,
631
+ event: (checkArray) => {
632
+ OrderSetting.allEditDialog({
633
+ gvc,
634
+ title: '批量更改訂單狀態',
635
+ options: OrderSetting.getOrderStatusOpt(),
636
+ callback: (value) => {
637
+ checkArray.forEach((order) => {
638
+ order.orderData.orderStatus = value;
639
+ });
640
+ updateOrders(checkArray);
641
+ },
642
+ });
643
+ },
644
+ },
591
645
  {
592
646
  name: '批改訂單各項狀態',
593
647
  option: true,
@@ -872,6 +926,51 @@ export class ShoppingOrderManager {
872
926
  },
873
927
  ];
874
928
  const defaultArray = [
929
+ {
930
+ name: '列印出貨明細 / 地址貼條',
931
+ event: (checkArray) => {
932
+ let type = '';
933
+ BgWidget.settingDialog({
934
+ gvc: gvc,
935
+ title: '列印模式',
936
+ innerHTML: (gvc) => BgWidget.select({
937
+ gvc,
938
+ callback: (value) => {
939
+ type = value;
940
+ },
941
+ default: '',
942
+ options: [
943
+ { title: '選擇列印模式', value: '' },
944
+ { title: '出貨明細', value: 'shipment' },
945
+ { title: '地址貼條', value: 'address' },
946
+ { title: '出貨明細 + 地址貼條', value: 'shipAddr' },
947
+ ].map(item => {
948
+ return {
949
+ key: item.value,
950
+ value: item.title,
951
+ };
952
+ }),
953
+ }),
954
+ footer_html: (gvc) => {
955
+ return [
956
+ BgWidget.cancel(gvc.event(() => {
957
+ gvc.closeDialog();
958
+ }), '取消'),
959
+ BgWidget.save(gvc.event(() => {
960
+ if (['shipment', 'address', 'shipAddr'].includes(type)) {
961
+ gvc.closeDialog();
962
+ DeliveryHTML.print(gvc, checkArray, type);
963
+ }
964
+ else {
965
+ dialog.infoMessage({ text: '請選擇列印模式' });
966
+ }
967
+ }), '列印'),
968
+ ].join('');
969
+ },
970
+ width: 350,
971
+ });
972
+ },
973
+ },
875
974
  {
876
975
  name: query.isArchived ? '解除封存' : '批量封存',
877
976
  event: (checkArray) => {
@@ -915,27 +1014,6 @@ export class ShoppingOrderManager {
915
1014
  DeliveryHTML.print(gvc, checkArray, 'pick');
916
1015
  },
917
1016
  },
918
- {
919
- name: '列印出貨明細',
920
- option: true,
921
- event: (checkArray) => {
922
- DeliveryHTML.print(gvc, checkArray, 'shipment');
923
- },
924
- },
925
- {
926
- name: '列印地址貼條',
927
- option: true,
928
- event: (checkArray) => {
929
- DeliveryHTML.print(gvc, checkArray, 'address');
930
- },
931
- },
932
- {
933
- name: '列印出貨明細 + 地址貼條',
934
- option: true,
935
- event: (checkArray) => {
936
- DeliveryHTML.print(gvc, checkArray, 'shipAddr');
937
- },
938
- },
939
1017
  ];
940
1018
  return [...defaultArray, ...(query.isShipment ? shipmentArray : normalArray)];
941
1019
  })(),
@@ -1999,7 +2077,7 @@ export class ShoppingOrderManager {
1999
2077
  const status = dd.discount_total > 0;
2000
2078
  const isMinus = status ? '-' : '';
2001
2079
  const isNegative = status ? 1 : -1;
2002
- return `${isMinus} $${(dd.discount_total * isNegative).toLocaleString()}`;
2080
+ return `${isMinus} $${(Math.floor(dd.discount_total) * isNegative).toLocaleString()}`;
2003
2081
  })(),
2004
2082
  },
2005
2083
  };
@@ -2057,7 +2135,7 @@ export class ShoppingOrderManager {
2057
2135
  <div>分倉出貨</div>
2058
2136
  <div
2059
2137
  class="${is_shipment ? 'd-none' : ''}"
2060
- style="display: flex;padding: 6px 18px;justify-content: center;align-items: center;gap: 8px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;cursor: pointer;"
2138
+ style="display: flex;padding: 4px 18px;justify-content: center;align-items: center;gap: 8px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;cursor: pointer;"
2061
2139
  onclick="${gvc.event(() => {
2062
2140
  OrderSetting.showEditShip({
2063
2141
  gvc: gvc,
@@ -2171,19 +2249,22 @@ export class ShoppingOrderManager {
2171
2249
  title: '',
2172
2250
  gvc: gvc,
2173
2251
  default: `${orderData.status}`,
2174
- options: [
2175
- {
2176
- title: '變更付款狀態',
2177
- value: '',
2178
- },
2179
- ]
2180
- .concat(ApiShop.getStatusArray(orderData.orderData.proof_purchase))
2181
- .map(item => {
2182
- return {
2183
- key: item.value,
2184
- value: item.title,
2185
- };
2186
- }),
2252
+ options: (() => {
2253
+ const paymentOptions = OrderSetting.getPaymentStatusOpt();
2254
+ const unpayOption = paymentOptions.find(item => item.key === '0');
2255
+ if (unpayOption) {
2256
+ if (orderData.orderData.proof_purchase) {
2257
+ unpayOption.value = '待核款';
2258
+ }
2259
+ else if (orderData.orderData.customer_info.payment_select == 'cash_on_delivery') {
2260
+ unpayOption.value = '貨到付款';
2261
+ }
2262
+ else {
2263
+ unpayOption.value = '未付款';
2264
+ }
2265
+ }
2266
+ return paymentOptions;
2267
+ })(),
2187
2268
  callback: text => {
2188
2269
  dialog.checkYesOrNot({
2189
2270
  text: '是否確認變更付款狀態?',
@@ -2389,28 +2470,28 @@ export class ShoppingOrderManager {
2389
2470
  <div class="w-100 d-flex tx_700 align-items-center justify-content-between">
2390
2471
  <div>顧客備註</div>
2391
2472
  <div
2392
- style="display: flex;padding: 6px 18px;justify-content: center;align-items: center;gap: 8px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;cursor: pointer;"
2473
+ style="display: flex;padding: 4px 18px;justify-content: center;align-items: center;gap: 8px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;cursor: pointer;"
2393
2474
  onclick="${gvc.event(() => {
2394
2475
  vm.edit_mode = !vm.edit_mode;
2395
2476
  gvc.notifyDataChange(vm.id);
2396
2477
  })}"
2397
2478
  >
2398
- ${vm.edit_mode ? `取消編輯` : `編輯`}
2479
+ ${vm.edit_mode ? '取消編輯' : '編輯'}
2399
2480
  </div>
2400
2481
  </div>
2401
2482
  ${BgWidget.mbContainer(18)}
2402
- <div style="position: relative;">
2483
+ <div style="position: relative; color: #8d8d8d;">
2403
2484
  ${vm.edit_mode
2404
2485
  ? EditorElem.editeText({
2405
2486
  gvc: gvc,
2406
2487
  title: '',
2407
2488
  default: orderData.orderData.user_info.note || '',
2408
- placeHolder: '',
2489
+ placeHolder: '請輸入備註',
2409
2490
  callback: text => {
2410
2491
  orderData.orderData.user_info.note = text;
2411
2492
  },
2412
2493
  })
2413
- : orderData.orderData.user_info.note || '尚未填寫顧客備註'}
2494
+ : orderData.orderData.user_info.note || '顧客尚未填寫備註'}
2414
2495
  </div>
2415
2496
  `;
2416
2497
  },
@@ -2426,30 +2507,19 @@ export class ShoppingOrderManager {
2426
2507
  view: () => {
2427
2508
  return html `
2428
2509
  <div class="w-100 d-flex tx_700 align-items-center justify-content-between">
2429
- <div>商家備註</div>
2430
- <div
2431
- style="display: flex;padding: 6px 18px;justify-content: center;align-items: center;gap: 8px;border-radius: 10px;border: 1px solid #DDD;background: #FFF;cursor: pointer;"
2432
- onclick="${gvc.event(() => {
2433
- vm.edit_mode = !vm.edit_mode;
2434
- gvc.notifyDataChange(vm.id);
2435
- })}"
2436
- >
2437
- ${vm.edit_mode ? `取消編輯` : `編輯`}
2438
- </div>
2510
+ 訂單備註
2439
2511
  </div>
2440
2512
  ${BgWidget.mbContainer(18)}
2441
2513
  <div style="position: relative;">
2442
- ${vm.edit_mode
2443
- ? EditorElem.editeText({
2444
- gvc: gvc,
2445
- title: '',
2446
- default: orderData.orderData.order_note || '',
2447
- placeHolder: '',
2448
- callback: text => {
2449
- orderData.orderData.order_note = text;
2450
- },
2451
- })
2452
- : orderData.orderData.order_note || '尚未填寫商家備註'}
2514
+ ${EditorElem.editeText({
2515
+ gvc: gvc,
2516
+ title: '',
2517
+ default: orderData.orderData.order_note || '',
2518
+ placeHolder: '請輸入備註',
2519
+ callback: text => {
2520
+ orderData.orderData.order_note = text;
2521
+ },
2522
+ })}
2453
2523
  </div>
2454
2524
  `;
2455
2525
  },
@@ -2650,7 +2720,7 @@ export class ShoppingOrderManager {
2650
2720
  <div class="tx_700">訂購人資料</div>
2651
2721
  <div class="flex-fill"></div>
2652
2722
  </div>
2653
- <div class="w-100 d-flex flex-column mt-2" style="gap:12px;">
2723
+ <div class="w-100 d-flex flex-column mt-2" style="gap:6px;">
2654
2724
  ${[
2655
2725
  html ` <div class="d-flex flex-column" style="gap:8px;">
2656
2726
  <div
@@ -2711,7 +2781,7 @@ export class ShoppingOrderManager {
2711
2781
  ${(_l = (_k = (_j = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _j === void 0 ? void 0 : _j.email) !== null && _k !== void 0 ? _k : orderData.orderData.user_info.email) !== null && _l !== void 0 ? _l : ''}
2712
2782
  </div>
2713
2783
  </div>`,
2714
- BgWidget.horizontalLine(),
2784
+ BgWidget.horizontalLine({ margin: 0.5 }),
2715
2785
  gvc.bindView({
2716
2786
  bind: `user_info`,
2717
2787
  view: () => {
@@ -2748,10 +2818,11 @@ export class ShoppingOrderManager {
2748
2818
  </div>
2749
2819
  `;
2750
2820
  })
2751
- .join(BgWidget.mbContainer(4));
2821
+ .join('');
2752
2822
  }),
2753
2823
  divCreate: {
2754
- class: `tx_normal`,
2824
+ class: 'd-flex flex-column tx_normal',
2825
+ style: 'gap: 8px;',
2755
2826
  },
2756
2827
  };
2757
2828
  }),
@@ -2775,33 +2846,28 @@ export class ShoppingOrderManager {
2775
2846
  case 'UNIMARTC2C':
2776
2847
  case 'UNIMARTFREEZE':
2777
2848
  case 'FAMIC2CFREEZE':
2778
- return [
2779
- html ` <div class="d-flex flex-wrap w-100">
2780
- <span class="me-2 fw-normal fs-6">門市名稱:</span>
2849
+ return html ` <div class="tx_700">配送資訊</div>
2850
+ <div class="d-flex flex-wrap w-100">
2781
2851
  <div
2782
2852
  class="fw-normal fs-6"
2783
2853
  style="white-space: normal;word-break: break-all;"
2784
2854
  >
2785
- ${decodeURI(orderData.orderData.user_info.CVSStoreName)}
2855
+ ${decodeURI(orderData.orderData.user_info.CVSStoreName)}(${orderData.orderData.user_info.CVSStoreID})
2786
2856
  </div>
2787
- </div>`,
2788
- html ` <div class="fw-normal fs-6">
2789
- 代號: ${orderData.orderData.user_info.CVSStoreID}
2790
- </div>`,
2791
- html ` <div
2857
+ </div>
2858
+ <div
2792
2859
  class="fw-normal fs-6 w-100"
2793
2860
  style="white-space: normal;word-break: break-all;"
2794
2861
  >
2795
- 地址: ${orderData.orderData.user_info.CVSAddress}
2796
- </div>`,
2797
- ].join('');
2862
+ ${orderData.orderData.user_info.CVSAddress}
2863
+ </div>`;
2798
2864
  case 'global_express':
2799
2865
  case 'black_cat_freezing':
2800
2866
  case 'normal':
2801
2867
  default:
2802
2868
  const mapView = [];
2803
2869
  if (orderData.orderData.user_info.address) {
2804
- mapView.push(html ` <div class="tx_700">配送地址</div>
2870
+ mapView.push(html `<div class="tx_700">配送資訊</div>
2805
2871
  <div class="fw-normal fs-6" style="white-space: normal;">
2806
2872
  ${[
2807
2873
  orderData.orderData.user_info.city,
@@ -2865,7 +2931,7 @@ export class ShoppingOrderManager {
2865
2931
  `
2866
2932
  : ''}
2867
2933
  `);
2868
- return view.join(`<div class="my-2"></div>`);
2934
+ return view.join(BgWidget.horizontalLine({ margin: 0.5 }));
2869
2935
  },
2870
2936
  divCreate: {
2871
2937
  class: 'd-flex flex-column',
@@ -3421,6 +3487,11 @@ export class ShoppingOrderManager {
3421
3487
  sale_price: variant.sale_price,
3422
3488
  sku: variant.sku,
3423
3489
  deduction_log: {},
3490
+ rebate: 0,
3491
+ weight: 0,
3492
+ is_gift: false,
3493
+ origin_price: variant.cost || variant.sale_price,
3494
+ discount_price: 0,
3424
3495
  });
3425
3496
  orderDetail.subtotal +=
3426
3497
  Number(orderDetail.lineItems[index].count) * orderDetail.lineItems[index].sale_price;
@@ -3982,7 +4053,7 @@ export class ShoppingOrderManager {
3982
4053
  style: 'width: 100%; display: flex; align-items: center; margin: 24px 0;',
3983
4054
  },
3984
4055
  })}
3985
- ${BgWidget.horizontalLine()} ${showOrderDetail()}
4056
+ ${BgWidget.horizontalLine({ margin: 0.5 })} ${showOrderDetail()}
3986
4057
  </div>
3987
4058
  <!-- 選擇顧客 --- 顧客資料填寫 -->
3988
4059
  <div style="margin-top: 24px"></div>