ts-glitter 22.5.7 → 22.5.8
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.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +13 -13
- package/lowcode/backend-manager/bg-product.ts +13 -13
- package/lowcode/backend-manager/bg-shopping.js +8 -13
- package/lowcode/backend-manager/bg-shopping.ts +8 -15
- package/lowcode/backend-manager/bg-widget.js +62 -49
- package/lowcode/backend-manager/bg-widget.ts +129 -93
- package/lowcode/cms-plugin/POS-setting.js +30 -9
- package/lowcode/cms-plugin/POS-setting.ts +49 -16
- package/lowcode/cms-plugin/cms-router.js +27 -21
- package/lowcode/cms-plugin/cms-router.ts +116 -101
- package/lowcode/cms-plugin/filter-options.js +25 -17
- package/lowcode/cms-plugin/filter-options.ts +27 -17
- package/lowcode/cms-plugin/module/product-excel.js +2 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/module/product-setting.js +13 -12
- package/lowcode/cms-plugin/module/product-setting.ts +26 -23
- package/lowcode/cms-plugin/order/order-module.js +91 -68
- package/lowcode/cms-plugin/order/order-module.ts +105 -73
- package/lowcode/cms-plugin/pos-checkout-setting.js +46 -39
- package/lowcode/cms-plugin/pos-checkout-setting.ts +237 -227
- package/lowcode/cms-plugin/pos-config-setting.js +25 -23
- package/lowcode/cms-plugin/pos-config-setting.ts +35 -32
- package/lowcode/cms-plugin/pos-pages/payment-function.js +253 -139
- package/lowcode/cms-plugin/pos-pages/payment-function.ts +405 -279
- package/lowcode/cms-plugin/pos-pages/payment-page.js +348 -267
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +378 -296
- package/lowcode/cms-plugin/pos-pages/pos-function.js +76 -19
- package/lowcode/cms-plugin/pos-pages/pos-function.ts +84 -19
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-finance-setting.js +1590 -1701
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1967 -2011
- package/lowcode/cms-plugin/shopping-order-manager.js +74 -62
- package/lowcode/cms-plugin/shopping-order-manager.ts +119 -85
- package/lowcode/cms-plugin/shopping-product-text.js +874 -531
- package/lowcode/cms-plugin/shopping-product-text.ts +1656 -1305
- package/lowcode/cms-plugin/shopping-setting-basic.js +152 -124
- package/lowcode/cms-plugin/shopping-setting-basic.ts +315 -247
- package/lowcode/css/editor.css +3 -2
- package/lowcode/glitter-base/global/language.js +5 -3
- package/lowcode/glitter-base/global/language.ts +8 -6
- package/lowcode/glitter-base/global/payment-config.js +6 -0
- package/lowcode/glitter-base/global/payment-config.ts +6 -3
- package/lowcode/public-components/product/pd-class.js +1 -3
- package/lowcode/public-components/product/pd-class.ts +1 -3
- package/lowcode/public-components/user-manager/um-order.js +2 -1
- package/lowcode/public-components/user-manager/um-order.ts +2 -1
- package/package.json +1 -1
- package/src/api-public/controllers/index.js +14 -3
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +16 -3
- package/src/api-public/controllers/shop.js +14 -7
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -8
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/financial-serviceV2.js +7 -17
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/updated-table-checked.js +20 -0
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +21 -0
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/index.js +3 -3
- package/src/index.js.map +13 -1
- package/src/modules/tool.d.ts +2 -0
- package/src/modules/tool.js +7 -0
- package/src/modules/tool.js.map +1 -1
- package/src/modules/tool.ts +7 -0
- package/src/seo-config.js +3 -3
- package/src/seo-config.js.map +9 -1
- package/src/services/private_config.js +11 -0
- package/src/services/private_config.js.map +1 -1
- package/src/services/private_config.ts +11 -0
- package/src/services/saas-table-check.js +12 -0
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/saas-table-check.ts +12 -0
- package/src/services/ses.js +3 -4
- package/src/services/ses.js.map +1 -1
|
@@ -1310,7 +1310,7 @@ export class ShoppingOrderManager {
|
|
|
1310
1310
|
</div>`,
|
|
1311
1311
|
html `
|
|
1312
1312
|
<div class="tx_700 d-flex align-items-center" style="gap:5px;">出貨單號碼</div>
|
|
1313
|
-
${is_shipment ? '' : BgWidget.grayNote('
|
|
1313
|
+
${is_shipment ? '' : BgWidget.grayNote('取號後將自動生成出貨單,於出貨單列表單中')}
|
|
1314
1314
|
${BgWidget.mbContainer(12)}
|
|
1315
1315
|
<div class="d-flex align-items-center" style="gap:10px;">
|
|
1316
1316
|
${orderData.orderData.user_info.shipment_number || '尚未取號'}
|
|
@@ -1544,65 +1544,74 @@ export class ShoppingOrderManager {
|
|
|
1544
1544
|
</div>
|
|
1545
1545
|
${BgWidget.mbContainer(12)}`
|
|
1546
1546
|
: ''}
|
|
1547
|
-
<div class="d-flex flex-column tx_normal"
|
|
1547
|
+
<div class="d-flex flex-column tx_normal">
|
|
1548
1548
|
${(() => {
|
|
1549
|
-
var _a
|
|
1549
|
+
var _a;
|
|
1550
1550
|
if (['normal', 'black_cat', 'global_express', 'black_cat_freezing'].includes(orderData.orderData.user_info.shipment)) {
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1551
|
+
const userInfo = orderData.orderData.user_info;
|
|
1552
|
+
const addressMap = [];
|
|
1553
|
+
const countryName = (_a = CountryTw.find(item => item.countryCode === userInfo.country)) === null || _a === void 0 ? void 0 : _a.countryName;
|
|
1554
|
+
if (countryName) {
|
|
1555
|
+
addressMap.push(['國家', countryName]);
|
|
1556
|
+
}
|
|
1557
|
+
if (userInfo.postal_code) {
|
|
1558
|
+
addressMap.push(['郵遞區號', userInfo.postal_code]);
|
|
1559
|
+
}
|
|
1560
|
+
if (userInfo.city) {
|
|
1561
|
+
addressMap.push(['城市', userInfo.city]);
|
|
1558
1562
|
}
|
|
1559
|
-
if (
|
|
1560
|
-
|
|
1563
|
+
if (userInfo.state) {
|
|
1564
|
+
addressMap.push(['州/省', userInfo.state]);
|
|
1561
1565
|
}
|
|
1562
|
-
if (
|
|
1563
|
-
|
|
1566
|
+
if (userInfo.area) {
|
|
1567
|
+
addressMap.push(['鄉/鎮', userInfo.area]);
|
|
1564
1568
|
}
|
|
1565
|
-
if (
|
|
1566
|
-
|
|
1569
|
+
if (userInfo.address) {
|
|
1570
|
+
addressMap.push(['地址', userInfo.address]);
|
|
1567
1571
|
}
|
|
1568
|
-
if (orderData.orderData.user_info.
|
|
1569
|
-
map.
|
|
1572
|
+
if (orderData.orderData.user_info.shipment === 'global_express') {
|
|
1573
|
+
return addressMap.map(item => item.join(' : ')).join(BgWidget.mbContainer(4));
|
|
1574
|
+
}
|
|
1575
|
+
else {
|
|
1576
|
+
return addressMap.map(item => item[1]).join('');
|
|
1570
1577
|
}
|
|
1571
|
-
return map.join('<div class="w-100 border-top my-1"></div>');
|
|
1572
1578
|
}
|
|
1573
|
-
const formData = (orderData.orderData.shipment_selector || OrderModule.supportShipmentMethod()).find(
|
|
1574
|
-
|
|
1575
|
-
});
|
|
1576
|
-
if ([
|
|
1579
|
+
const formData = (orderData.orderData.shipment_selector || OrderModule.supportShipmentMethod()).find(item => item.value === orderData.orderData.user_info.shipment);
|
|
1580
|
+
const cvsShipmentMethods = [
|
|
1577
1581
|
'UNIMARTC2C',
|
|
1578
1582
|
'FAMIC2C',
|
|
1579
1583
|
'OKMARTC2C',
|
|
1580
1584
|
'HILIFEC2C',
|
|
1581
1585
|
'UNIMARTFREEZE',
|
|
1582
1586
|
'FAMIC2CFREEZE',
|
|
1583
|
-
]
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
+
];
|
|
1588
|
+
if (cvsShipmentMethods.includes(orderData.orderData.user_info.shipment)) {
|
|
1589
|
+
return [
|
|
1590
|
+
html `<div class="d-flex flex-wrap">
|
|
1591
|
+
<span class="me-2">門市名稱 :</span>
|
|
1587
1592
|
<div style="white-space: normal;word-break: break-all;">
|
|
1588
1593
|
${orderData.orderData.user_info.CVSStoreName}
|
|
1589
1594
|
</div>
|
|
1590
|
-
</div
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1595
|
+
</div>`,
|
|
1596
|
+
html `<div class="d-flex">
|
|
1597
|
+
門市店號 : ${orderData.orderData.user_info.CVSStoreID}
|
|
1598
|
+
</div>`,
|
|
1599
|
+
html `<div class="d-flex" style="white-space: normal;word-break: break-all;">
|
|
1600
|
+
地址 : ${orderData.orderData.user_info.CVSAddress}
|
|
1601
|
+
</div>`,
|
|
1602
|
+
].join(BgWidget.mbContainer(4));
|
|
1596
1603
|
}
|
|
1597
1604
|
else if (formData.form) {
|
|
1598
1605
|
return formData.form
|
|
1599
|
-
.map((
|
|
1600
|
-
return html `
|
|
1601
|
-
<
|
|
1602
|
-
|
|
1603
|
-
|
|
1606
|
+
.map((formItem) => {
|
|
1607
|
+
return html `
|
|
1608
|
+
<div class="d-flex flex-wrap">
|
|
1609
|
+
<span class="me-2">${Language.getLanguageCustomText(formItem.title)} :</span>
|
|
1610
|
+
<div style="white-space: normal; word-break: break-all;">
|
|
1611
|
+
${Language.getLanguageCustomText(orderData.orderData.user_info.custom_form_delivery[formItem.key])}
|
|
1612
|
+
</div>
|
|
1604
1613
|
</div>
|
|
1605
|
-
|
|
1614
|
+
`;
|
|
1606
1615
|
})
|
|
1607
1616
|
.join('');
|
|
1608
1617
|
}
|
|
@@ -1665,7 +1674,7 @@ export class ShoppingOrderManager {
|
|
|
1665
1674
|
return !noNeedAddress || !['city', 'area', 'address'].includes(item[1]);
|
|
1666
1675
|
});
|
|
1667
1676
|
const receipt = (yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')).response.value;
|
|
1668
|
-
receipt.list.map((d1) => {
|
|
1677
|
+
(receipt.list || []).map((d1) => {
|
|
1669
1678
|
if (!viewModel.find(dd => dd[1] === d1.key)) {
|
|
1670
1679
|
viewModel.push([d1.title, d1.key]);
|
|
1671
1680
|
}
|
|
@@ -1756,7 +1765,7 @@ export class ShoppingOrderManager {
|
|
|
1756
1765
|
let map = [];
|
|
1757
1766
|
if (orderData.orderData.user_info.invoice_method) {
|
|
1758
1767
|
map.push(html ` <div class="tx_700">發票開立資訊</div>`);
|
|
1759
|
-
map.push(
|
|
1768
|
+
map.push(`開立時機 : ${(() => {
|
|
1760
1769
|
switch (orderData.orderData.user_info.invoice_method) {
|
|
1761
1770
|
case 'nouse':
|
|
1762
1771
|
return '不開立發票';
|
|
@@ -1769,7 +1778,7 @@ export class ShoppingOrderManager {
|
|
|
1769
1778
|
}
|
|
1770
1779
|
if (orderData.orderData.user_info.invoice_method &&
|
|
1771
1780
|
orderData.orderData.user_info.invoice_method !== 'nouse') {
|
|
1772
|
-
map.push(
|
|
1781
|
+
map.push(`開立對象 : ${(() => {
|
|
1773
1782
|
switch (orderData.orderData.user_info.invoice_type) {
|
|
1774
1783
|
case 'donate':
|
|
1775
1784
|
return '捐贈';
|
|
@@ -1782,19 +1791,21 @@ export class ShoppingOrderManager {
|
|
|
1782
1791
|
map.push(`${(() => {
|
|
1783
1792
|
switch (orderData.orderData.user_info.invoice_type) {
|
|
1784
1793
|
case 'donate':
|
|
1785
|
-
return '
|
|
1794
|
+
return '發票捐贈單位 : ' + orderData.orderData.user_info.love_code;
|
|
1786
1795
|
case 'company':
|
|
1787
1796
|
return [
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1797
|
+
`公司抬頭 : ${orderData.orderData.user_info.company}`,
|
|
1798
|
+
`統編號碼 : ${orderData.orderData.user_info.gui_number}`,
|
|
1799
|
+
`發票寄送信箱 : ${orderData.orderData.user_info.email || '未填寫'}`,
|
|
1791
1800
|
]
|
|
1792
1801
|
.map(dd => {
|
|
1793
1802
|
return html ` <div>${dd}</div>`;
|
|
1794
1803
|
})
|
|
1795
1804
|
.join(BgWidget.mbContainer(8));
|
|
1796
1805
|
default:
|
|
1797
|
-
return [
|
|
1806
|
+
return [
|
|
1807
|
+
`發票寄送信箱 : ${orderData.orderData.user_info.email || '未填寫'}`,
|
|
1808
|
+
]
|
|
1798
1809
|
.map(dd => {
|
|
1799
1810
|
return html ` <div>${dd}</div>`;
|
|
1800
1811
|
})
|
|
@@ -1804,7 +1815,7 @@ export class ShoppingOrderManager {
|
|
|
1804
1815
|
}
|
|
1805
1816
|
return map
|
|
1806
1817
|
.map(dd => {
|
|
1807
|
-
return html ` <div>${dd}</div>`;
|
|
1818
|
+
return html ` <div class="tx_normal">${dd}</div>`;
|
|
1808
1819
|
})
|
|
1809
1820
|
.join(BgWidget.mbContainer(8));
|
|
1810
1821
|
})(),
|
|
@@ -2789,9 +2800,11 @@ export class ShoppingOrderManager {
|
|
|
2789
2800
|
let view = [];
|
|
2790
2801
|
if (orderData.orderData.user_info.shipment !== 'now') {
|
|
2791
2802
|
view.push([
|
|
2792
|
-
html `
|
|
2793
|
-
|
|
2794
|
-
|
|
2803
|
+
html `
|
|
2804
|
+
<div style="font-size: 16px; font-weight: 700; color: #393939">
|
|
2805
|
+
收件人資料
|
|
2806
|
+
</div>
|
|
2807
|
+
`,
|
|
2795
2808
|
gvc.bindView(() => {
|
|
2796
2809
|
return {
|
|
2797
2810
|
bind: gvc.glitter.getUUID(),
|
|
@@ -2801,21 +2814,20 @@ export class ShoppingOrderManager {
|
|
|
2801
2814
|
['電話', 'phone'],
|
|
2802
2815
|
['信箱', 'email'],
|
|
2803
2816
|
];
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
viewModel.push([
|
|
2817
|
+
const receiptConfig = yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager');
|
|
2818
|
+
const receiptList = receiptConfig.response.value.list || [];
|
|
2819
|
+
receiptList.forEach((customField) => {
|
|
2820
|
+
const fieldExists = viewModel.some(field => field[1] === customField.key);
|
|
2821
|
+
if (!fieldExists) {
|
|
2822
|
+
viewModel.push([customField.title, customField.key]);
|
|
2810
2823
|
}
|
|
2811
2824
|
});
|
|
2812
2825
|
return viewModel
|
|
2813
2826
|
.map(item => {
|
|
2827
|
+
const [label, key] = item;
|
|
2828
|
+
const value = orderData.orderData.user_info[key] || '未填寫';
|
|
2814
2829
|
return html `
|
|
2815
|
-
<div style="word-break: break-all;">
|
|
2816
|
-
${item[0]} :
|
|
2817
|
-
${orderData.orderData.user_info[item[1]] || '未填寫'}
|
|
2818
|
-
</div>
|
|
2830
|
+
<div style="word-break: break-all;">${label} : ${value}</div>
|
|
2819
2831
|
`;
|
|
2820
2832
|
})
|
|
2821
2833
|
.join('');
|
|
@@ -3692,7 +3704,7 @@ export class ShoppingOrderManager {
|
|
|
3692
3704
|
onchange="${gvc.event(e => {
|
|
3693
3705
|
if (e.value < 1) {
|
|
3694
3706
|
dialog.warningMessage({
|
|
3695
|
-
text: '更改數量為 0
|
|
3707
|
+
text: '更改數量為 0 將會刪除該商品,<br />確定要刪除此商品嗎?',
|
|
3696
3708
|
callback: response => {
|
|
3697
3709
|
if (response) {
|
|
3698
3710
|
newOrder.productCheck.splice(index, 1);
|
|
@@ -1476,7 +1476,7 @@ export class ShoppingOrderManager {
|
|
|
1476
1476
|
</div>`,
|
|
1477
1477
|
html`
|
|
1478
1478
|
<div class="tx_700 d-flex align-items-center" style="gap:5px;">出貨單號碼</div>
|
|
1479
|
-
${is_shipment ? '' : BgWidget.grayNote('
|
|
1479
|
+
${is_shipment ? '' : BgWidget.grayNote('取號後將自動生成出貨單,於出貨單列表單中')}
|
|
1480
1480
|
${BgWidget.mbContainer(12)}
|
|
1481
1481
|
<div class="d-flex align-items-center" style="gap:10px;">
|
|
1482
1482
|
${orderData.orderData.user_info.shipment_number || '尚未取號'}
|
|
@@ -1737,82 +1737,106 @@ export class ShoppingOrderManager {
|
|
|
1737
1737
|
</div>
|
|
1738
1738
|
${BgWidget.mbContainer(12)}`
|
|
1739
1739
|
: ''}
|
|
1740
|
-
<div class="d-flex flex-column tx_normal"
|
|
1740
|
+
<div class="d-flex flex-column tx_normal">
|
|
1741
1741
|
${(() => {
|
|
1742
|
+
// 處理一般和黑貓等配送方式
|
|
1742
1743
|
if (
|
|
1743
1744
|
['normal', 'black_cat', 'global_express', 'black_cat_freezing'].includes(
|
|
1744
1745
|
orderData.orderData.user_info.shipment
|
|
1745
1746
|
)
|
|
1746
1747
|
) {
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
return dd.countryCode === (orderData.orderData.user_info as any).country;
|
|
1757
|
-
})?.countryName
|
|
1758
|
-
}`
|
|
1759
|
-
);
|
|
1748
|
+
const userInfo = orderData.orderData.user_info as any;
|
|
1749
|
+
const addressMap: string[][] = [];
|
|
1750
|
+
|
|
1751
|
+
// 查找並添加國家資訊
|
|
1752
|
+
const countryName = CountryTw.find(
|
|
1753
|
+
item => item.countryCode === userInfo.country
|
|
1754
|
+
)?.countryName;
|
|
1755
|
+
if (countryName) {
|
|
1756
|
+
addressMap.push(['國家', countryName]);
|
|
1760
1757
|
}
|
|
1761
|
-
|
|
1762
|
-
|
|
1758
|
+
|
|
1759
|
+
// 添加郵遞區號資訊
|
|
1760
|
+
if (userInfo.postal_code) {
|
|
1761
|
+
addressMap.push(['郵遞區號', userInfo.postal_code]);
|
|
1763
1762
|
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1763
|
+
|
|
1764
|
+
// 添加城市資訊
|
|
1765
|
+
if (userInfo.city) {
|
|
1766
|
+
addressMap.push(['城市', userInfo.city]);
|
|
1766
1767
|
}
|
|
1767
|
-
|
|
1768
|
-
|
|
1768
|
+
|
|
1769
|
+
// 添加州/省資訊
|
|
1770
|
+
if (userInfo.state) {
|
|
1771
|
+
addressMap.push(['州/省', userInfo.state]);
|
|
1769
1772
|
}
|
|
1770
|
-
|
|
1771
|
-
|
|
1773
|
+
|
|
1774
|
+
// 添加鄉/鎮資訊
|
|
1775
|
+
if (userInfo.area) {
|
|
1776
|
+
addressMap.push(['鄉/鎮', userInfo.area]);
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
// 添加地址資訊
|
|
1780
|
+
if (userInfo.address) {
|
|
1781
|
+
addressMap.push(['地址', userInfo.address]);
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
if (orderData.orderData.user_info.shipment === 'global_express') {
|
|
1785
|
+
return addressMap.map(item => item.join(' : ')).join(BgWidget.mbContainer(4));
|
|
1786
|
+
} else {
|
|
1787
|
+
return addressMap.map(item => item[1]).join('');
|
|
1772
1788
|
}
|
|
1773
|
-
return map.join('<div class="w-100 border-top my-1"></div>');
|
|
1774
1789
|
}
|
|
1790
|
+
|
|
1791
|
+
// 查找配送方式相關資訊
|
|
1775
1792
|
const formData: any = (
|
|
1776
1793
|
orderData.orderData.shipment_selector || OrderModule.supportShipmentMethod()
|
|
1777
|
-
).find(
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
) {
|
|
1790
|
-
return
|
|
1791
|
-
|
|
1792
|
-
<span class="me-2"
|
|
1794
|
+
).find(item => item.value === orderData.orderData.user_info.shipment);
|
|
1795
|
+
|
|
1796
|
+
// 處理超商取貨相關配送方式
|
|
1797
|
+
const cvsShipmentMethods = [
|
|
1798
|
+
'UNIMARTC2C',
|
|
1799
|
+
'FAMIC2C',
|
|
1800
|
+
'OKMARTC2C',
|
|
1801
|
+
'HILIFEC2C',
|
|
1802
|
+
'UNIMARTFREEZE',
|
|
1803
|
+
'FAMIC2CFREEZE',
|
|
1804
|
+
];
|
|
1805
|
+
|
|
1806
|
+
if (cvsShipmentMethods.includes(orderData.orderData.user_info.shipment)) {
|
|
1807
|
+
return [
|
|
1808
|
+
html`<div class="d-flex flex-wrap">
|
|
1809
|
+
<span class="me-2">門市名稱 :</span>
|
|
1793
1810
|
<div style="white-space: normal;word-break: break-all;">
|
|
1794
1811
|
${orderData.orderData.user_info.CVSStoreName}
|
|
1795
1812
|
</div>
|
|
1796
|
-
</div
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1813
|
+
</div>`,
|
|
1814
|
+
html`<div class="d-flex">
|
|
1815
|
+
門市店號 : ${orderData.orderData.user_info.CVSStoreID}
|
|
1816
|
+
</div>`,
|
|
1817
|
+
html`<div class="d-flex" style="white-space: normal;word-break: break-all;">
|
|
1818
|
+
地址 : ${orderData.orderData.user_info.CVSAddress}
|
|
1819
|
+
</div>`,
|
|
1820
|
+
].join(BgWidget.mbContainer(4));
|
|
1821
|
+
}
|
|
1822
|
+
// 處理自定義表單配送方式
|
|
1823
|
+
else if (formData.form) {
|
|
1803
1824
|
return formData.form
|
|
1804
|
-
.map((
|
|
1805
|
-
return html`
|
|
1806
|
-
<
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1825
|
+
.map((formItem: any) => {
|
|
1826
|
+
return html`
|
|
1827
|
+
<div class="d-flex flex-wrap">
|
|
1828
|
+
<span class="me-2">${Language.getLanguageCustomText(formItem.title)} :</span>
|
|
1829
|
+
<div style="white-space: normal; word-break: break-all;">
|
|
1830
|
+
${Language.getLanguageCustomText(
|
|
1831
|
+
orderData.orderData.user_info.custom_form_delivery[formItem.key]
|
|
1832
|
+
)}
|
|
1833
|
+
</div>
|
|
1811
1834
|
</div>
|
|
1812
|
-
|
|
1835
|
+
`;
|
|
1813
1836
|
})
|
|
1814
1837
|
.join('');
|
|
1815
1838
|
}
|
|
1839
|
+
|
|
1816
1840
|
return '';
|
|
1817
1841
|
})()}
|
|
1818
1842
|
</div>`,
|
|
@@ -1877,7 +1901,7 @@ export class ShoppingOrderManager {
|
|
|
1877
1901
|
await ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')
|
|
1878
1902
|
).response.value;
|
|
1879
1903
|
|
|
1880
|
-
receipt.list.map((d1: any) => {
|
|
1904
|
+
(receipt.list || []).map((d1: any) => {
|
|
1881
1905
|
if (!viewModel.find(dd => dd[1] === d1.key)) {
|
|
1882
1906
|
viewModel.push([d1.title, d1.key]);
|
|
1883
1907
|
}
|
|
@@ -1973,7 +1997,7 @@ export class ShoppingOrderManager {
|
|
|
1973
1997
|
if ((orderData.orderData.user_info as any).invoice_method) {
|
|
1974
1998
|
map.push(html` <div class="tx_700">發票開立資訊</div>`);
|
|
1975
1999
|
map.push(
|
|
1976
|
-
|
|
2000
|
+
`開立時機 : ${(() => {
|
|
1977
2001
|
switch ((orderData.orderData.user_info as any).invoice_method) {
|
|
1978
2002
|
case 'nouse':
|
|
1979
2003
|
return '不開立發票';
|
|
@@ -1991,7 +2015,7 @@ export class ShoppingOrderManager {
|
|
|
1991
2015
|
(orderData.orderData.user_info as any).invoice_method !== 'nouse'
|
|
1992
2016
|
) {
|
|
1993
2017
|
map.push(
|
|
1994
|
-
|
|
2018
|
+
`開立對象 : ${(() => {
|
|
1995
2019
|
switch ((orderData.orderData.user_info as any).invoice_type) {
|
|
1996
2020
|
case 'donate':
|
|
1997
2021
|
return '捐贈';
|
|
@@ -2006,19 +2030,21 @@ export class ShoppingOrderManager {
|
|
|
2006
2030
|
`${(() => {
|
|
2007
2031
|
switch ((orderData.orderData.user_info as any).invoice_type) {
|
|
2008
2032
|
case 'donate':
|
|
2009
|
-
return '
|
|
2033
|
+
return '發票捐贈單位 : ' + (orderData.orderData.user_info as any).love_code;
|
|
2010
2034
|
case 'company':
|
|
2011
2035
|
return [
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2036
|
+
`公司抬頭 : ${(orderData.orderData.user_info as any).company}`,
|
|
2037
|
+
`統編號碼 : ${(orderData.orderData.user_info as any).gui_number}`,
|
|
2038
|
+
`發票寄送信箱 : ${(orderData.orderData.user_info as any).email || '未填寫'}`,
|
|
2015
2039
|
]
|
|
2016
2040
|
.map(dd => {
|
|
2017
2041
|
return html` <div>${dd}</div>`;
|
|
2018
2042
|
})
|
|
2019
2043
|
.join(BgWidget.mbContainer(8));
|
|
2020
2044
|
default:
|
|
2021
|
-
return [
|
|
2045
|
+
return [
|
|
2046
|
+
`發票寄送信箱 : ${(orderData.orderData.user_info as any).email || '未填寫'}`,
|
|
2047
|
+
]
|
|
2022
2048
|
.map(dd => {
|
|
2023
2049
|
return html` <div>${dd}</div>`;
|
|
2024
2050
|
})
|
|
@@ -2030,7 +2056,7 @@ export class ShoppingOrderManager {
|
|
|
2030
2056
|
|
|
2031
2057
|
return map
|
|
2032
2058
|
.map(dd => {
|
|
2033
|
-
return html` <div>${dd}</div>`;
|
|
2059
|
+
return html` <div class="tx_normal">${dd}</div>`;
|
|
2034
2060
|
})
|
|
2035
2061
|
.join(BgWidget.mbContainer(8));
|
|
2036
2062
|
})(),
|
|
@@ -3072,40 +3098,48 @@ export class ShoppingOrderManager {
|
|
|
3072
3098
|
if (orderData.orderData.user_info.shipment !== 'now') {
|
|
3073
3099
|
view.push(
|
|
3074
3100
|
[
|
|
3075
|
-
html`
|
|
3076
|
-
|
|
3077
|
-
|
|
3101
|
+
html`
|
|
3102
|
+
<div style="font-size: 16px; font-weight: 700; color: #393939">
|
|
3103
|
+
收件人資料
|
|
3104
|
+
</div>
|
|
3105
|
+
`,
|
|
3078
3106
|
gvc.bindView(() => {
|
|
3079
3107
|
return {
|
|
3080
3108
|
bind: gvc.glitter.getUUID(),
|
|
3081
3109
|
view: async () => {
|
|
3110
|
+
// 基本收件人欄位
|
|
3082
3111
|
let viewModel = [
|
|
3083
3112
|
['姓名', 'name'],
|
|
3084
3113
|
['電話', 'phone'],
|
|
3085
3114
|
['信箱', 'email'],
|
|
3086
3115
|
];
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
)
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3116
|
+
|
|
3117
|
+
// 獲取自定義表單配置
|
|
3118
|
+
const receiptConfig = await ApiUser.getPublicConfig(
|
|
3119
|
+
'custom_form_checkout_recipient',
|
|
3120
|
+
'manager'
|
|
3121
|
+
);
|
|
3122
|
+
const receiptList = receiptConfig.response.value.list || [];
|
|
3123
|
+
|
|
3124
|
+
// 合併自定義欄位到顯示列表
|
|
3125
|
+
receiptList.forEach((customField: any) => {
|
|
3126
|
+
const fieldExists = viewModel.some(
|
|
3127
|
+
field => field[1] === customField.key
|
|
3128
|
+
);
|
|
3129
|
+
if (!fieldExists) {
|
|
3130
|
+
viewModel.push([customField.title, customField.key]);
|
|
3100
3131
|
}
|
|
3101
3132
|
});
|
|
3133
|
+
|
|
3134
|
+
// 渲染所有欄位
|
|
3102
3135
|
return viewModel
|
|
3103
3136
|
.map(item => {
|
|
3137
|
+
const [label, key] = item;
|
|
3138
|
+
const value =
|
|
3139
|
+
(orderData.orderData.user_info as any)[key] || '未填寫';
|
|
3140
|
+
|
|
3104
3141
|
return html`
|
|
3105
|
-
<div style="word-break: break-all;">
|
|
3106
|
-
${item[0]} :
|
|
3107
|
-
${(orderData.orderData.user_info as any)[item[1]] || '未填寫'}
|
|
3108
|
-
</div>
|
|
3142
|
+
<div style="word-break: break-all;">${label} : ${value}</div>
|
|
3109
3143
|
`;
|
|
3110
3144
|
})
|
|
3111
3145
|
.join('');
|
|
@@ -4065,7 +4099,7 @@ export class ShoppingOrderManager {
|
|
|
4065
4099
|
onchange="${gvc.event(e => {
|
|
4066
4100
|
if (e.value < 1) {
|
|
4067
4101
|
dialog.warningMessage({
|
|
4068
|
-
text: '更改數量為 0
|
|
4102
|
+
text: '更改數量為 0 將會刪除該商品,<br />確定要刪除此商品嗎?',
|
|
4069
4103
|
callback: response => {
|
|
4070
4104
|
if (response) {
|
|
4071
4105
|
newOrder.productCheck.splice(index, 1);
|