ts-glitter 20.4.9 → 20.5.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.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/module/data.ts +1 -1
- package/lowcode/cms-plugin/module/order-setting.js +19 -8
- package/lowcode/cms-plugin/module/order-setting.ts +22 -16
- package/lowcode/cms-plugin/shopping-collections.js +2 -2
- package/lowcode/cms-plugin/shopping-collections.ts +3 -2
- package/lowcode/cms-plugin/shopping-order-manager.js +252 -223
- package/lowcode/cms-plugin/shopping-order-manager.ts +64 -37
- package/lowcode/cms-plugin/stock-history.js +13 -9
- package/lowcode/cms-plugin/stock-history.ts +22 -17
- package/lowcode/glitter-base/route/shopping.ts +1 -1
- package/lowcode/modules/checkInput.js +1 -1
- package/lowcode/modules/checkInput.ts +2 -1
- package/lowcode/public-components/checkout/index.js +7 -12
- package/lowcode/public-components/checkout/index.ts +7 -12
- package/lowcode/public-components/user-manager/um-class.js +1 -0
- package/lowcode/public-components/user-manager/um-class.ts +1 -0
- package/lowcode/public-components/user-manager/um-order.js +46 -2
- package/lowcode/public-components/user-manager/um-order.ts +51 -5
- package/lowcode/public-models/order-info.js +2 -3
- package/lowcode/public-models/order-info.ts +2 -2
- package/lowcode/src/glitterBundle/Glitter.js +1 -1
- package/lowcode/src/glitterBundle/Glitter.ts +1 -1
- package/lowcode/src/glitterBundle/GlitterInitial.js +1 -1
- package/lowcode/src/glitterBundle/GlitterInitial.ts +1 -1
- package/lowcode/src/glitterBundle/module/Animation.js +13 -7
- package/lowcode/src/glitterBundle/module/Enum.js +6 -2
- package/lowcode/src/glitterBundle/module/Html_generate.js +42 -50
- package/lowcode/src/glitterBundle/module/PageManager.js +30 -23
- package/lowcode/src/glitterBundle/plugins/click-event.js +19 -25
- package/lowcode/src/glitterBundle/plugins/dialog-style-editor.js +16 -13
- package/lowcode/src/glitterBundle/plugins/editor-elem.js +6 -1
- package/lowcode/src/glitterBundle/plugins/editor.js +5 -1
- package/lowcode/src/glitterBundle/plugins/html-render.js +5 -2
- package/lowcode/src/glitterBundle/plugins/plugin-creater.js +22 -28
- package/lowcode/src/glitterBundle/plugins/seo-manager.js +5 -1
- package/lowcode/src/glitterBundle/plugins/style-attr.js +5 -1
- package/lowcode/src/glitterBundle/plugins/style-editor.js +3 -1
- package/package.json +1 -1
- package/src/Language.js.map +1 -1
- package/src/api-public/controllers/ai-points.js.map +1 -1
- package/src/api-public/controllers/chat.js.map +1 -1
- package/src/api-public/controllers/customer-sessions.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/fb-service.js.map +1 -1
- package/src/api-public/controllers/invoice.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/oauth.js.map +1 -1
- package/src/api-public/controllers/recommend.js.map +1 -1
- package/src/api-public/controllers/reconciliation.js.map +1 -1
- package/src/api-public/controllers/shop.js +1 -3
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +12 -6
- package/src/api-public/controllers/shopee.js.map +1 -1
- package/src/api-public/controllers/sms-points.js.map +1 -1
- package/src/api-public/controllers/sms.js.map +1 -1
- package/src/api-public/controllers/smtp.js.map +1 -1
- package/src/api-public/controllers/stock.js.map +1 -1
- package/src/api-public/controllers/track.js.map +1 -1
- package/src/api-public/controllers/voucher.js.map +1 -1
- package/src/api-public/controllers/wallet.js.map +1 -1
- package/src/api-public/services/EcInvoice.js.map +1 -1
- package/src/api-public/services/article.js.map +1 -1
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/ezpay/tool.js.map +1 -1
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +2 -3
- package/src/api-public/services/form-check.js.map +1 -1
- package/src/api-public/services/graph-api.js.map +1 -1
- package/src/api-public/services/mail.js.map +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.d.ts +9 -0
- package/src/api-public/services/model/handlePaymentTransaction.js +54 -0
- package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -0
- package/src/api-public/services/model/handlePaymentTransaction.ts +120 -0
- package/src/api-public/services/product-initial.js.map +1 -1
- package/src/api-public/services/rebate.js +6 -6
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/rebate.ts +6 -6
- package/src/api-public/services/reconciliation.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +6 -4
- package/src/api-public/services/shopping.js +179 -26
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +271 -50
- package/src/api-public/services/terms-check.js.map +1 -1
- package/src/api-public/services/updated-table-checked.js +22 -0
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +28 -0
- package/src/api-public/services/user-service.d.ts +9 -0
- package/src/api-public/services/user-service.js +9 -0
- package/src/api-public/services/user-service.js.map +1 -0
- package/src/api-public/services/user-service.ts +11 -0
- package/src/api-public/services/user-update.js +10 -6
- package/src/api-public/services/user-update.js.map +1 -1
- package/src/api-public/services/user-update.ts +9 -2
- package/src/api-public/services/user.js +9 -8
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +9 -10
- package/src/api-public/utils/ut-database.js.map +1 -1
- package/src/app-project/serverless/src/controllers/index.js.map +1 -1
- package/src/app-project/serverless/src/controllers/sample.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -2
- package/src/app-project/serverless/src/modules/database.js.map +1 -1
- package/src/app-project/serverless/src/modules/exception.js.map +1 -1
- package/src/app-project/serverless/src/modules/hooks.js.map +1 -1
- package/src/app-project/serverless/src/modules/logger.js.map +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.js.map +1 -1
- package/src/app-project/serverless/src/modules/response.js.map +1 -1
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/controllers/ai.js.map +1 -1
- package/src/controllers/global-event.js.map +1 -1
- package/src/controllers/page.js.map +1 -1
- package/src/controllers/private_config.js.map +1 -1
- package/src/export/export-test.js.map +1 -1
- package/src/firebase/message.js +1 -2
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +1 -2
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/helper/glitter-util.js.map +1 -1
- package/src/lambda/interface.d.ts +1 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/caught-error.js.map +1 -1
- package/src/modules/exception.js.map +1 -1
- package/src/modules/hooks.js.map +1 -1
- package/src/modules/response.js.map +1 -1
- package/src/modules/ssh.js.map +1 -1
- package/src/services/ses.js +1 -2
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/src/update-script.js.map +1 -1
|
@@ -95,7 +95,6 @@ class OrderDetail {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
99
98
|
export class ShoppingOrderManager {
|
|
100
99
|
static vm = {
|
|
101
100
|
page: 1,
|
|
@@ -380,8 +379,9 @@ export class ShoppingOrderManager {
|
|
|
380
379
|
vm.apiJSON.is_pos = vm.filter_type === 'pos';
|
|
381
380
|
}
|
|
382
381
|
|
|
383
|
-
ApiShop.getOrder(vm.apiJSON).then(data => {
|
|
384
|
-
function getDatalist() {
|
|
382
|
+
ApiShop.getOrder(vm.apiJSON).then(async data => {
|
|
383
|
+
async function getDatalist() {
|
|
384
|
+
const payment_support = await PaymentConfig.getSupportPayment();
|
|
385
385
|
return data.response.data.map((dd: any) => {
|
|
386
386
|
dd.orderData.total = dd.orderData.total || 0;
|
|
387
387
|
dd.orderData.customer_info = dd.orderData.customer_info ?? {};
|
|
@@ -461,6 +461,8 @@ export class ShoppingOrderManager {
|
|
|
461
461
|
return '';
|
|
462
462
|
}
|
|
463
463
|
return BgWidget.primaryInsignia('POS', { type: 'border' });
|
|
464
|
+
case 'split':
|
|
465
|
+
return BgWidget.warningInsignia('拆分', { type: 'border' });
|
|
464
466
|
default:
|
|
465
467
|
return '';
|
|
466
468
|
}
|
|
@@ -469,7 +471,7 @@ export class ShoppingOrderManager {
|
|
|
469
471
|
},
|
|
470
472
|
{
|
|
471
473
|
key: '訂單日期',
|
|
472
|
-
value: html
|
|
474
|
+
value: html` <div style="width: 120px;">
|
|
473
475
|
${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}
|
|
474
476
|
</div>`,
|
|
475
477
|
},
|
|
@@ -542,17 +544,17 @@ export class ShoppingOrderManager {
|
|
|
542
544
|
},
|
|
543
545
|
{
|
|
544
546
|
key: '運送方式',
|
|
545
|
-
value: html
|
|
547
|
+
value: html` <div style="width: 120px;">
|
|
546
548
|
${OrderInfo.shipmetSelector(dd, OrderModule.supportShipmentMethod())}
|
|
547
549
|
</div>`,
|
|
548
550
|
},
|
|
549
551
|
{
|
|
550
552
|
key: '付款方式',
|
|
551
|
-
value: OrderInfo.paymentSelector(gvc, dd),
|
|
553
|
+
value: OrderInfo.paymentSelector(gvc, dd, payment_support),
|
|
552
554
|
},
|
|
553
555
|
{
|
|
554
556
|
key: '付款時間',
|
|
555
|
-
value: html
|
|
557
|
+
value: html` <div style="width: 160px;">
|
|
556
558
|
${(() => {
|
|
557
559
|
if (!dd.orderData.editRecord) {
|
|
558
560
|
return '-';
|
|
@@ -587,7 +589,7 @@ export class ShoppingOrderManager {
|
|
|
587
589
|
vm.dataList = data.response.data;
|
|
588
590
|
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
589
591
|
vmi.originalData = vm.dataList;
|
|
590
|
-
vmi.tableData = getDatalist();
|
|
592
|
+
vmi.tableData = await getDatalist();
|
|
591
593
|
vmi.loading = false;
|
|
592
594
|
if (vmi.pageSize != 0 && vmi.page > vmi.pageSize) {
|
|
593
595
|
ShoppingOrderManager.vm.page = 1;
|
|
@@ -1128,10 +1130,11 @@ export class ShoppingOrderManager {
|
|
|
1128
1130
|
limit: 1,
|
|
1129
1131
|
search: cart_token,
|
|
1130
1132
|
data_from: 'manager',
|
|
1131
|
-
searchType: '
|
|
1133
|
+
searchType: 'cart_token_exact',
|
|
1132
1134
|
});
|
|
1133
1135
|
orderData = structuredClone(orderDataNew.response.data[0]);
|
|
1134
1136
|
originData = structuredClone(orderData);
|
|
1137
|
+
console.log('orderDataNew.response.data -- ', orderDataNew.response.data);
|
|
1135
1138
|
}
|
|
1136
1139
|
|
|
1137
1140
|
orderData.orderData.progress = orderData.orderData.progress ?? 'wait';
|
|
@@ -1198,6 +1201,28 @@ export class ShoppingOrderManager {
|
|
|
1198
1201
|
});
|
|
1199
1202
|
}
|
|
1200
1203
|
|
|
1204
|
+
const funBTN = () => {
|
|
1205
|
+
gvc.addStyle(html`
|
|
1206
|
+
.funInsignia{ border-radius: 10px; background: #EAEAEA; display: flex; padding: 6px 18px; justify-content:
|
|
1207
|
+
center; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; cursor: pointer; }
|
|
1208
|
+
`);
|
|
1209
|
+
return {
|
|
1210
|
+
splitOrder: () => {
|
|
1211
|
+
return html` <div
|
|
1212
|
+
class="funInsignia"
|
|
1213
|
+
style=""
|
|
1214
|
+
onclick="${gvc.event(() => {
|
|
1215
|
+
console.log('orderData -- ', orderData);
|
|
1216
|
+
|
|
1217
|
+
OrderSetting.splitOrder(gvc, orderData.orderData, () => gvc.notifyDataChange(vm.id));
|
|
1218
|
+
})}"
|
|
1219
|
+
>
|
|
1220
|
+
拆分訂單
|
|
1221
|
+
</div>`;
|
|
1222
|
+
},
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1201
1226
|
function getBadgeList() {
|
|
1202
1227
|
const vt = OrderSetting.getAllStatusBadge(orderData as any);
|
|
1203
1228
|
return html` <div style="display: flex; gap: 10px; justify-content: flex-end;">
|
|
@@ -1428,7 +1453,7 @@ export class ShoppingOrderManager {
|
|
|
1428
1453
|
BgWidget.editeInput({
|
|
1429
1454
|
gvc: gvc,
|
|
1430
1455
|
title: '出貨單號碼',
|
|
1431
|
-
default:
|
|
1456
|
+
default: `${shipnumber ?? ''}`,
|
|
1432
1457
|
callback: text => {
|
|
1433
1458
|
shipnumber = text;
|
|
1434
1459
|
},
|
|
@@ -1830,7 +1855,7 @@ export class ShoppingOrderManager {
|
|
|
1830
1855
|
let map = [];
|
|
1831
1856
|
|
|
1832
1857
|
if ((orderData.orderData.user_info as any).invoice_method) {
|
|
1833
|
-
map.push(html
|
|
1858
|
+
map.push(html` <div class="tx_700">發票開立資訊</div>`);
|
|
1834
1859
|
map.push(
|
|
1835
1860
|
`開立時機: ${(() => {
|
|
1836
1861
|
switch ((orderData.orderData.user_info as any).invoice_method) {
|
|
@@ -1873,13 +1898,13 @@ export class ShoppingOrderManager {
|
|
|
1873
1898
|
`發票寄送信箱: ${(orderData.orderData.user_info as any).email || '未填寫'}`,
|
|
1874
1899
|
]
|
|
1875
1900
|
.map(dd => {
|
|
1876
|
-
return html
|
|
1901
|
+
return html` <div>${dd}</div>`;
|
|
1877
1902
|
})
|
|
1878
1903
|
.join(BgWidget.mbContainer(8));
|
|
1879
1904
|
default:
|
|
1880
1905
|
return [`發票寄送信箱: ${(orderData.orderData.user_info as any).email || '未填寫'}`]
|
|
1881
1906
|
.map(dd => {
|
|
1882
|
-
return html
|
|
1907
|
+
return html` <div>${dd}</div>`;
|
|
1883
1908
|
})
|
|
1884
1909
|
.join(BgWidget.mbContainer(8));
|
|
1885
1910
|
}
|
|
@@ -1889,7 +1914,7 @@ export class ShoppingOrderManager {
|
|
|
1889
1914
|
|
|
1890
1915
|
return map
|
|
1891
1916
|
.map(dd => {
|
|
1892
|
-
return html
|
|
1917
|
+
return html` <div>${dd}</div>`;
|
|
1893
1918
|
})
|
|
1894
1919
|
.join(BgWidget.mbContainer(8));
|
|
1895
1920
|
})(),
|
|
@@ -1938,6 +1963,7 @@ export class ShoppingOrderManager {
|
|
|
1938
1963
|
${document.body.clientWidth > 768 ? getBadgeList() : ''}
|
|
1939
1964
|
</div>
|
|
1940
1965
|
${document.body.clientWidth > 768 ? '' : html` <div class="mt-1 mb-3">${getBadgeList()}</div>`}
|
|
1966
|
+
<div class="d-none justify-content-end">${funBTN().splitOrder()}</div>
|
|
1941
1967
|
${BgWidget.container1x2(
|
|
1942
1968
|
{
|
|
1943
1969
|
html: [
|
|
@@ -2023,15 +2049,15 @@ export class ShoppingOrderManager {
|
|
|
2023
2049
|
</div>
|
|
2024
2050
|
<div class="d-flex flex-column">
|
|
2025
2051
|
${dd.is_hidden
|
|
2026
|
-
? html
|
|
2052
|
+
? html` <div style="width:auto;">
|
|
2027
2053
|
${BgWidget.secondaryInsignia('隱形商品')}
|
|
2028
2054
|
</div>`
|
|
2029
2055
|
: ''}
|
|
2030
2056
|
<div class="tx_700 d-flex align-items-center" style="gap:4px;">
|
|
2031
2057
|
<div>${dd.title}</div>
|
|
2032
|
-
${dd.is_gift ? html
|
|
2033
|
-
${dd.is_add_on_items ? html
|
|
2034
|
-
${dd.pre_order ? html
|
|
2058
|
+
${dd.is_gift ? html` <div>${showTag('#FFE9B2', '贈品')}</div>` : ''}
|
|
2059
|
+
${dd.is_add_on_items ? html` <div>${showTag('#D8E7EC', '加購品')}</div>` : ''}
|
|
2060
|
+
${dd.pre_order ? html` <div>${showTag('#D8E7EC', '預購')}</div>` : ''}
|
|
2035
2061
|
</div>
|
|
2036
2062
|
${dd.spec.length > 0 ? BgWidget.grayNote(dd.spec.join(', ')) : ''}
|
|
2037
2063
|
${BgWidget.grayNote(
|
|
@@ -2183,7 +2209,7 @@ export class ShoppingOrderManager {
|
|
|
2183
2209
|
})
|
|
2184
2210
|
.join(BgWidget.mbContainer(18))}
|
|
2185
2211
|
${`${orderData.orderData.orderStatus ?? 0}` === '0'
|
|
2186
|
-
? html
|
|
2212
|
+
? html` <div class="d-flex justify-content-end mt-3">
|
|
2187
2213
|
${BgWidget.blueNote(
|
|
2188
2214
|
'手動調整訂單價格',
|
|
2189
2215
|
gvc.event(() => {
|
|
@@ -2373,7 +2399,7 @@ export class ShoppingOrderManager {
|
|
|
2373
2399
|
<div>
|
|
2374
2400
|
${(cash_flow.TradeStatus === '1'
|
|
2375
2401
|
? [
|
|
2376
|
-
html
|
|
2402
|
+
html` <div class="d-flex align-items-center">
|
|
2377
2403
|
金流交易結果:
|
|
2378
2404
|
${(cash_flow.credit_receipt && cash_flow.credit_receipt.status) ||
|
|
2379
2405
|
'已付款'}
|
|
@@ -2599,7 +2625,7 @@ export class ShoppingOrderManager {
|
|
|
2599
2625
|
</div>
|
|
2600
2626
|
${invoiceDataList
|
|
2601
2627
|
.map((invoiceData: any) => {
|
|
2602
|
-
return html
|
|
2628
|
+
return html` <div class="d-flex" style="height:55px;">
|
|
2603
2629
|
<div class="col-3 d-flex align-items-center ">
|
|
2604
2630
|
${invoiceData.create_date.split('T')[0]}
|
|
2605
2631
|
</div>
|
|
@@ -2673,7 +2699,7 @@ export class ShoppingOrderManager {
|
|
|
2673
2699
|
(() => {
|
|
2674
2700
|
const renderReconciliationInfo = (orderData: any) => {
|
|
2675
2701
|
if (!orderData.reconciliation_date) {
|
|
2676
|
-
return html
|
|
2702
|
+
return html` <div>尚未入帳</div>`;
|
|
2677
2703
|
}
|
|
2678
2704
|
|
|
2679
2705
|
return html`
|
|
@@ -2738,8 +2764,8 @@ export class ShoppingOrderManager {
|
|
|
2738
2764
|
.slice() // 避免改變原始資料
|
|
2739
2765
|
.reverse()
|
|
2740
2766
|
.map(renderOffsetRecord)
|
|
2741
|
-
.map(dd => html
|
|
2742
|
-
.join(html
|
|
2767
|
+
.map(dd => html` <div class="w-100">${dd}</div>`)
|
|
2768
|
+
.join(html` <div class="w-100 border-top my-2"></div>`);
|
|
2743
2769
|
|
|
2744
2770
|
BgWidget.mainCard(html`
|
|
2745
2771
|
<div class="tx_700">對帳記錄</div>
|
|
@@ -2765,6 +2791,7 @@ export class ShoppingOrderManager {
|
|
|
2765
2791
|
const source: Record<string, string> = {
|
|
2766
2792
|
pos: 'POS',
|
|
2767
2793
|
combine: '合併訂單',
|
|
2794
|
+
split: '拆分',
|
|
2768
2795
|
};
|
|
2769
2796
|
return source[orderData.orderData.orderSource] ?? '線上';
|
|
2770
2797
|
})()}
|
|
@@ -2831,7 +2858,7 @@ export class ShoppingOrderManager {
|
|
|
2831
2858
|
if (orderData.orderData.user_info.shipment !== 'now') {
|
|
2832
2859
|
view.push(
|
|
2833
2860
|
[
|
|
2834
|
-
html
|
|
2861
|
+
html` <div style="font-size: 16px;font-weight: 700;color:#393939">
|
|
2835
2862
|
收件人資料
|
|
2836
2863
|
</div>`,
|
|
2837
2864
|
gvc.bindView(() => {
|
|
@@ -2949,7 +2976,7 @@ export class ShoppingOrderManager {
|
|
|
2949
2976
|
mapView.push(
|
|
2950
2977
|
formData.form
|
|
2951
2978
|
.map((dd: any) => {
|
|
2952
|
-
return html
|
|
2979
|
+
return html` <div class="d-flex flex-wrap w-100">
|
|
2953
2980
|
<span class="me-2 fw-normal fs-6"
|
|
2954
2981
|
>${Language.getLanguageCustomText(dd.title)}:</span
|
|
2955
2982
|
>
|
|
@@ -3610,11 +3637,12 @@ export class ShoppingOrderManager {
|
|
|
3610
3637
|
title: '',
|
|
3611
3638
|
id: data.id,
|
|
3612
3639
|
spec: variant.spec,
|
|
3613
|
-
count: variant.qty ??
|
|
3640
|
+
count: variant.qty ?? '1',
|
|
3614
3641
|
sale_price: variant.sale_price,
|
|
3615
|
-
sku: variant.sku
|
|
3642
|
+
sku: variant.sku,
|
|
3616
3643
|
});
|
|
3617
|
-
orderDetail.subtotal +=
|
|
3644
|
+
orderDetail.subtotal +=
|
|
3645
|
+
Number(orderDetail.lineItems[index].count) * orderDetail.lineItems[index].sale_price;
|
|
3618
3646
|
});
|
|
3619
3647
|
// 取得這些商品運費
|
|
3620
3648
|
if (orderDetailRefresh) {
|
|
@@ -4051,7 +4079,7 @@ export class ShoppingOrderManager {
|
|
|
4051
4079
|
.join('')}
|
|
4052
4080
|
</select>
|
|
4053
4081
|
`
|
|
4054
|
-
: html
|
|
4082
|
+
: html` <div
|
|
4055
4083
|
class="d-flex align-items-center"
|
|
4056
4084
|
style="height: 34px;color: #8D8D8D;font-size: 14px;font-weight: 400;"
|
|
4057
4085
|
>
|
|
@@ -4710,7 +4738,7 @@ export class ShoppingOrderManager {
|
|
|
4710
4738
|
}),
|
|
4711
4739
|
]
|
|
4712
4740
|
.map(dd => {
|
|
4713
|
-
return html
|
|
4741
|
+
return html` <div class="col-12 col-lg-6">${dd}</div>`;
|
|
4714
4742
|
})
|
|
4715
4743
|
.join('')}
|
|
4716
4744
|
</div>
|
|
@@ -4796,7 +4824,7 @@ export class ShoppingOrderManager {
|
|
|
4796
4824
|
returnHTML = html`
|
|
4797
4825
|
<div class="d-flex flex-column">
|
|
4798
4826
|
${[
|
|
4799
|
-
html
|
|
4827
|
+
html` <div class="d-flex align-items-center pt-2">
|
|
4800
4828
|
<img
|
|
4801
4829
|
style="width: 23px;height: 23px;margin-right: 8px;"
|
|
4802
4830
|
src="${ShipmentConfig.list.find(dd => {
|
|
@@ -4813,10 +4841,10 @@ export class ShoppingOrderManager {
|
|
|
4813
4841
|
點擊更換門市
|
|
4814
4842
|
</div>
|
|
4815
4843
|
</div>`,
|
|
4816
|
-
html
|
|
4817
|
-
html
|
|
4818
|
-
html
|
|
4819
|
-
].join(html
|
|
4844
|
+
html` <div class="d-flex">門市名稱: ${orderDetail.user_info.CVSStoreName}</div>`,
|
|
4845
|
+
html` <div class="d-flex">門市店號: ${orderDetail.user_info.CVSStoreID}</div>`,
|
|
4846
|
+
html` <div class="d-flex">門市地址: ${orderDetail.user_info.CVSAddress}</div>`,
|
|
4847
|
+
].join(html` <div class="my-2 w-100 border-top"></div>`)}
|
|
4820
4848
|
</div>
|
|
4821
4849
|
`;
|
|
4822
4850
|
return html`
|
|
@@ -4887,7 +4915,6 @@ export class ShoppingOrderManager {
|
|
|
4887
4915
|
passData.orderStatus = 1;
|
|
4888
4916
|
delete passData.tag;
|
|
4889
4917
|
passData.line_items = passData.lineItems;
|
|
4890
|
-
|
|
4891
4918
|
dialog.dataLoading({ visible: true });
|
|
4892
4919
|
if (checkOrderEmpty(passData)) {
|
|
4893
4920
|
ApiShop.toManualCheckout(passData).then(() => {
|
|
@@ -239,8 +239,13 @@ export class StockHistory {
|
|
|
239
239
|
{
|
|
240
240
|
key: '總金額',
|
|
241
241
|
value: `<span class="fs-7">$ ${dd.content.product_list.reduce((sum, item) => {
|
|
242
|
-
var _a;
|
|
243
|
-
|
|
242
|
+
var _a, _b;
|
|
243
|
+
if (dd.type === 'restocking') {
|
|
244
|
+
return sum + item.cost * ((_a = item.transfer_count) !== null && _a !== void 0 ? _a : 0);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
return sum + item.cost * ((_b = item.recent_count) !== null && _b !== void 0 ? _b : 0);
|
|
248
|
+
}
|
|
244
249
|
}, 0).toLocaleString()}</span>`,
|
|
245
250
|
},
|
|
246
251
|
{
|
|
@@ -1038,15 +1043,14 @@ export class StockHistory {
|
|
|
1038
1043
|
class="w-100 d-flex align-items-center justify-content-center cursor_pointer"
|
|
1039
1044
|
style="color: #36B; font-size: 16px; font-weight: 400;"
|
|
1040
1045
|
onclick="${gvc.event(() => {
|
|
1041
|
-
|
|
1042
|
-
gvc,
|
|
1043
|
-
title: '搜尋商品',
|
|
1046
|
+
BgProduct.productsDialog({
|
|
1047
|
+
gvc: gvc,
|
|
1044
1048
|
default: dvm.variantIds,
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
dvm.variantIds =
|
|
1049
|
+
with_variants: true,
|
|
1050
|
+
callback: (value) => __awaiter(this, void 0, void 0, function* () {
|
|
1051
|
+
dvm.variantIds = value;
|
|
1048
1052
|
gvc.notifyDataChange(dvm.tableId);
|
|
1049
|
-
},
|
|
1053
|
+
}),
|
|
1050
1054
|
});
|
|
1051
1055
|
})}"
|
|
1052
1056
|
>
|
|
@@ -271,7 +271,11 @@ export class StockHistory {
|
|
|
271
271
|
{
|
|
272
272
|
key: '總金額',
|
|
273
273
|
value: `<span class="fs-7">$ ${ dd.content.product_list.reduce((sum, item) => {
|
|
274
|
-
|
|
274
|
+
if(dd.type==='restocking'){
|
|
275
|
+
return sum + item.cost * (item.transfer_count ?? 0);
|
|
276
|
+
}else{
|
|
277
|
+
return sum + item.cost * (item.recent_count ?? 0);
|
|
278
|
+
}
|
|
275
279
|
}, 0).toLocaleString()}</span>`,
|
|
276
280
|
},
|
|
277
281
|
{
|
|
@@ -1126,24 +1130,25 @@ export class StockHistory {
|
|
|
1126
1130
|
class="w-100 d-flex align-items-center justify-content-center cursor_pointer"
|
|
1127
1131
|
style="color: #36B; font-size: 16px; font-weight: 400;"
|
|
1128
1132
|
onclick="${gvc.event(() => {
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
// },
|
|
1136
|
-
// })
|
|
1137
|
-
BgWidget.variantDialog({
|
|
1138
|
-
gvc,
|
|
1139
|
-
title: '搜尋商品',
|
|
1140
|
-
default: dvm.variantIds,
|
|
1141
|
-
callback: resultData => {
|
|
1142
|
-
alert(JSON.stringify(resultData));
|
|
1143
|
-
dvm.variantIds = resultData;
|
|
1133
|
+
BgProduct.productsDialog({
|
|
1134
|
+
gvc: gvc,
|
|
1135
|
+
default: dvm.variantIds,
|
|
1136
|
+
with_variants:true,
|
|
1137
|
+
callback: async value => {
|
|
1138
|
+
dvm.variantIds=value
|
|
1144
1139
|
gvc.notifyDataChange(dvm.tableId);
|
|
1140
|
+
// alert(JSON.stringify(value))
|
|
1145
1141
|
},
|
|
1146
|
-
})
|
|
1142
|
+
})
|
|
1143
|
+
// BgWidget.variantDialog({
|
|
1144
|
+
// gvc,
|
|
1145
|
+
// title: '搜尋商品',
|
|
1146
|
+
// default: dvm.variantIds,
|
|
1147
|
+
// callback: resultData => {
|
|
1148
|
+
// dvm.variantIds = resultData;
|
|
1149
|
+
// gvc.notifyDataChange(dvm.tableId);
|
|
1150
|
+
// },
|
|
1151
|
+
// });
|
|
1147
1152
|
})}"
|
|
1148
1153
|
>
|
|
1149
1154
|
<div>新增${typeData.name}商品</div>
|
|
@@ -28,7 +28,7 @@ export class CheckInput {
|
|
|
28
28
|
return regex.test(input);
|
|
29
29
|
}
|
|
30
30
|
static isChineseEnglishNumberHyphen(input) {
|
|
31
|
-
const regex = /^[
|
|
31
|
+
const regex = /^[A-Za-z0-9\u4e00-\u9fa5\- ]*$/;
|
|
32
32
|
return regex.test(input);
|
|
33
33
|
}
|
|
34
34
|
static isBirthString(input) {
|
|
@@ -34,8 +34,9 @@ export class CheckInput {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
static isChineseEnglishNumberHyphen(input: string): boolean {
|
|
37
|
-
const regex = /^[
|
|
37
|
+
const regex = /^[A-Za-z0-9\u4e00-\u9fa5\- ]*$/;
|
|
38
38
|
return regex.test(input);
|
|
39
|
+
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
static isBirthString(input: string): boolean {
|
|
@@ -3303,12 +3303,18 @@ export class CheckoutIndex {
|
|
|
3303
3303
|
});
|
|
3304
3304
|
return false;
|
|
3305
3305
|
}
|
|
3306
|
-
else if (!subData['area'] || subData['area'] === '') {
|
|
3306
|
+
else if ((!subData['area'] || subData['area'] === '') && (subData['shipment'] !== 'global_express')) {
|
|
3307
3307
|
dialog.errorMessage({
|
|
3308
3308
|
text: `${Language.text('please_enter')}「${Language.text('area')}」`,
|
|
3309
3309
|
});
|
|
3310
3310
|
return false;
|
|
3311
3311
|
}
|
|
3312
|
+
else if ((!subData['state'] || subData['state'] === '') && (subData['shipment'] === 'global_express')) {
|
|
3313
|
+
dialog.errorMessage({
|
|
3314
|
+
text: `${Language.text('please_enter')}「${Language.text('state')}」`,
|
|
3315
|
+
});
|
|
3316
|
+
return false;
|
|
3317
|
+
}
|
|
3312
3318
|
}
|
|
3313
3319
|
else {
|
|
3314
3320
|
delete subData['city'];
|
|
@@ -3414,17 +3420,6 @@ export class CheckoutIndex {
|
|
|
3414
3420
|
};
|
|
3415
3421
|
}),
|
|
3416
3422
|
});
|
|
3417
|
-
Ad.fbqEvent('Purchase', {
|
|
3418
|
-
value: cartData.total,
|
|
3419
|
-
currency: 'TWD',
|
|
3420
|
-
contents: cartData.lineItems.map((item) => {
|
|
3421
|
-
return {
|
|
3422
|
-
id: item.sku || item.id,
|
|
3423
|
-
quantity: item.count,
|
|
3424
|
-
};
|
|
3425
|
-
}),
|
|
3426
|
-
content_type: 'product',
|
|
3427
|
-
});
|
|
3428
3423
|
return true;
|
|
3429
3424
|
}
|
|
3430
3425
|
static viewDialog(obj) {
|
|
@@ -3594,11 +3594,16 @@ export class CheckoutIndex {
|
|
|
3594
3594
|
text: `${Language.text('please_enter')}「${Language.text('city')}」`,
|
|
3595
3595
|
});
|
|
3596
3596
|
return false;
|
|
3597
|
-
} else if (!subData['area'] || subData['area'] === '') {
|
|
3597
|
+
} else if ((!subData['area'] || subData['area'] === '') && (subData['shipment']!=='global_express')) {
|
|
3598
3598
|
dialog.errorMessage({
|
|
3599
3599
|
text: `${Language.text('please_enter')}「${Language.text('area')}」`,
|
|
3600
3600
|
});
|
|
3601
3601
|
return false;
|
|
3602
|
+
}else if ((!subData['state'] || subData['state'] === '') && (subData['shipment']==='global_express')) {
|
|
3603
|
+
dialog.errorMessage({
|
|
3604
|
+
text: `${Language.text('please_enter')}「${Language.text('state')}」`,
|
|
3605
|
+
});
|
|
3606
|
+
return false;
|
|
3602
3607
|
}
|
|
3603
3608
|
} else {
|
|
3604
3609
|
delete subData['city'];
|
|
@@ -3726,17 +3731,7 @@ export class CheckoutIndex {
|
|
|
3726
3731
|
};
|
|
3727
3732
|
}),
|
|
3728
3733
|
});
|
|
3729
|
-
|
|
3730
|
-
value: cartData.total,
|
|
3731
|
-
currency: 'TWD',
|
|
3732
|
-
contents: cartData.lineItems.map((item: any) => {
|
|
3733
|
-
return {
|
|
3734
|
-
id: item.sku || item.id,
|
|
3735
|
-
quantity: item.count,
|
|
3736
|
-
};
|
|
3737
|
-
}),
|
|
3738
|
-
content_type: 'product',
|
|
3739
|
-
});
|
|
3734
|
+
|
|
3740
3735
|
return true;
|
|
3741
3736
|
}
|
|
3742
3737
|
|
|
@@ -382,6 +382,7 @@ export class UmClass {
|
|
|
382
382
|
const solidButtonBgr = (_e = globalValue['theme_color.0.solid-button-bg']) !== null && _e !== void 0 ? _e : '#292218';
|
|
383
383
|
const solidButtonText = (_f = globalValue['theme_color.0.solid-button-text']) !== null && _f !== void 0 ? _f : '#000000';
|
|
384
384
|
gvc.addStyle(`
|
|
385
|
+
|
|
385
386
|
.um-nav-title {
|
|
386
387
|
font-weight: 700;
|
|
387
388
|
font-size: 36px;
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { UmClass } from './um-class.js';
|
|
11
11
|
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
12
12
|
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
13
|
-
import { ApiCart } from '../../glitter-base/route/api-cart.js';
|
|
14
13
|
import { Ad } from '../public/ad.js';
|
|
15
14
|
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
16
15
|
import { FormWidget } from '../../official_view_component/official/form.js';
|
|
@@ -172,12 +171,33 @@ export class UMOrder {
|
|
|
172
171
|
cursor: pointer;
|
|
173
172
|
}
|
|
174
173
|
.customer-btn-text {
|
|
174
|
+
line-height:normal;
|
|
175
175
|
text-align: center;
|
|
176
176
|
color: white;
|
|
177
177
|
font-size: 14px;
|
|
178
178
|
font-weight: 400;
|
|
179
179
|
letter-spacing: 0.56px;
|
|
180
180
|
}
|
|
181
|
+
|
|
182
|
+
.payment-section {
|
|
183
|
+
border: 1px solid #ccc;
|
|
184
|
+
padding: 10px;
|
|
185
|
+
margin-bottom: 20px;
|
|
186
|
+
}
|
|
187
|
+
#repay-button {
|
|
188
|
+
height:32px;
|
|
189
|
+
|
|
190
|
+
background-color: #4caf50;
|
|
191
|
+
color: white;
|
|
192
|
+
border-radius:10px;
|
|
193
|
+
padding: 6px 14px;
|
|
194
|
+
border: none;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
#repay-button:hover {
|
|
199
|
+
background-color: #45a049;
|
|
200
|
+
}
|
|
181
201
|
`);
|
|
182
202
|
}
|
|
183
203
|
static repay(gvc, id) {
|
|
@@ -191,7 +211,6 @@ export class UMOrder {
|
|
|
191
211
|
const id = gvc.glitter.getUUID();
|
|
192
212
|
$('body').append(`<div id="${id}" style="display: none;">${res.response.form}</div>`);
|
|
193
213
|
document.querySelector(`#${id} #submit`).click();
|
|
194
|
-
new ApiCart().clearCart();
|
|
195
214
|
});
|
|
196
215
|
});
|
|
197
216
|
}
|
|
@@ -229,6 +248,7 @@ export class UMOrder {
|
|
|
229
248
|
type: '',
|
|
230
249
|
formList: [],
|
|
231
250
|
};
|
|
251
|
+
const repayArray = ['ecPay', 'newWebPay', 'paypal', 'jkopay', 'paynow', 'line_pay'];
|
|
232
252
|
return html ` <div class="container py-4">
|
|
233
253
|
${gvc.bindView({
|
|
234
254
|
bind: ids.view,
|
|
@@ -619,6 +639,17 @@ export class UMOrder {
|
|
|
619
639
|
text: `您已完成訂單,請於「付款資訊」了解付款說明後,儘速上傳結帳證明,以完成付款程序`,
|
|
620
640
|
});
|
|
621
641
|
}
|
|
642
|
+
Ad.fbqEvent('Purchase', {
|
|
643
|
+
value: orderData.total,
|
|
644
|
+
currency: 'TWD',
|
|
645
|
+
contents: orderData.lineItems.map((item) => {
|
|
646
|
+
return {
|
|
647
|
+
id: item.sku || item.id,
|
|
648
|
+
quantity: item.count,
|
|
649
|
+
};
|
|
650
|
+
}),
|
|
651
|
+
content_type: 'product',
|
|
652
|
+
});
|
|
622
653
|
Ad.gtagEvent('purchase', {
|
|
623
654
|
transaction_id: vm.data.cart_token,
|
|
624
655
|
value: orderData.total,
|
|
@@ -724,11 +755,24 @@ export class UMOrder {
|
|
|
724
755
|
{
|
|
725
756
|
title: Language.text('payment_status'),
|
|
726
757
|
value: (() => {
|
|
758
|
+
var _a, _b;
|
|
727
759
|
if (orderData.customer_info.payment_select === 'cash_on_delivery') {
|
|
728
760
|
return Language.text('cash_on_delivery');
|
|
729
761
|
}
|
|
730
762
|
switch (vm.data.status) {
|
|
731
763
|
case 0:
|
|
764
|
+
if (repayArray.includes((_b = (_a = vm.data) === null || _a === void 0 ? void 0 : _a.payment_method) !== null && _b !== void 0 ? _b : '')) {
|
|
765
|
+
const repayBtn = () => {
|
|
766
|
+
return html `
|
|
767
|
+
<span class="payment-actions">
|
|
768
|
+
<button class="d-none customer-btn-text ms-3" id="repay-button" onclick="${gvc.event(() => {
|
|
769
|
+
UMOrder.repay(gvc, vm.data.cart_token).then(r => {
|
|
770
|
+
});
|
|
771
|
+
})}">重新付款</button>
|
|
772
|
+
</span>`;
|
|
773
|
+
};
|
|
774
|
+
return Language.text('awaiting_verification') + repayBtn();
|
|
775
|
+
}
|
|
732
776
|
return orderData.proof_purchase
|
|
733
777
|
? Language.text('awaiting_verification')
|
|
734
778
|
: `${Language.text('unpaid')}${gotoCheckout()}`;
|