ts-glitter 21.8.4 → 21.8.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.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/POS-setting.js +18 -6
- package/lowcode/cms-plugin/POS-setting.ts +22 -10
- package/lowcode/cms-plugin/pos-pages/payment-page.js +9 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +11 -3
- package/lowcode/cms-plugin/stock-stores.js +55 -0
- package/lowcode/cms-plugin/stock-stores.ts +59 -0
- package/lowcode/jspage/function-page/setting_editor.js +1 -1
- package/lowcode/jspage/function-page/setting_editor.ts +1 -1
- package/lowcode/public-components/layout-plugin/social-links-01.js +55 -34
- package/lowcode/public-components/layout-plugin/social-links-01.ts +68 -43
- package/package.json +1 -1
- package/src/api-public/services/checkout-event.js +77 -40
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +82 -31
- package/src/services/saas-table-check.js +1 -1
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/saas-table-check.ts +1 -1
|
@@ -33,17 +33,33 @@ export class SocialLinks01 {
|
|
|
33
33
|
};
|
|
34
34
|
const gotoTopImg = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/arrow-up-to-line-light.svg';
|
|
35
35
|
gvc.addStyle(css`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
@media (max-width: 768px) {
|
|
37
|
+
.floating-action-panel {
|
|
38
|
+
position: fixed;
|
|
39
|
+
bottom: 20px;
|
|
40
|
+
right: 10px;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column; /* 垂直排列 */
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: 10px; /* 按鈕間距 */
|
|
45
|
+
z-index: 1000;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media (min-width: 769px) {
|
|
50
|
+
.floating-action-panel {
|
|
51
|
+
position: fixed;
|
|
52
|
+
bottom: 30px;
|
|
53
|
+
right: 30px;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column; /* 垂直排列 */
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 10px; /* 按鈕間距 */
|
|
58
|
+
z-index: 1000;
|
|
59
|
+
}
|
|
45
60
|
}
|
|
46
61
|
|
|
62
|
+
|
|
47
63
|
.social-links {
|
|
48
64
|
display: flex;
|
|
49
65
|
flex-direction: column;
|
|
@@ -69,56 +85,64 @@ export class SocialLinks01 {
|
|
|
69
85
|
border: none;
|
|
70
86
|
padding: 2px;
|
|
71
87
|
cursor: pointer;
|
|
88
|
+
width: 40px;
|
|
89
|
+
height: 40px;
|
|
72
90
|
border-radius: 50%;
|
|
73
91
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
74
92
|
}
|
|
75
93
|
|
|
76
|
-
.component-img {
|
|
77
|
-
width: 40px;
|
|
78
|
-
height: 40px;
|
|
79
|
-
object-fit: contain;
|
|
80
|
-
}
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
|
|
96
|
+
.component-circle:hover {
|
|
83
97
|
opacity: 0.8;
|
|
84
98
|
}
|
|
85
99
|
|
|
86
100
|
.up-to-top.hidden {
|
|
87
|
-
display: none;
|
|
101
|
+
display: none !important;
|
|
88
102
|
}
|
|
89
103
|
`);
|
|
104
|
+
|
|
90
105
|
return gvc.bindView({
|
|
91
106
|
bind:vm.id,
|
|
92
107
|
view:()=>{
|
|
93
108
|
return html`
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
<div class="floating-action-panel">
|
|
110
|
+
<div class="social-links">
|
|
111
|
+
${socialList
|
|
112
|
+
.map(socialLink => {
|
|
113
|
+
if(socialLink.icon==='https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'){
|
|
114
|
+
(socialLink.icon as any) = undefined;
|
|
115
|
+
}
|
|
116
|
+
const imgSrc = supportSocial.includes(socialLink.social_type)
|
|
117
|
+
? socialIMG[socialLink.social_type]
|
|
118
|
+
: socialIMG.other;
|
|
119
|
+
return html`
|
|
120
|
+
<div onclick="${
|
|
121
|
+
gvc.event(()=>{
|
|
122
|
+
gvc.glitter.href = socialLink.link;
|
|
123
|
+
})
|
|
124
|
+
}" class="component-circle" style="overflow: hidden;
|
|
125
|
+
background-image: url('${socialLink.icon??imgSrc}');background-size: cover;background-position: center;"
|
|
126
|
+
>
|
|
127
|
+
</div>
|
|
128
|
+
`;
|
|
129
|
+
})
|
|
130
|
+
.join('')}
|
|
131
|
+
</div>
|
|
132
|
+
<button
|
|
133
|
+
class="component-circle up-to-top hidden rounded-circle align-items-center justify-content-center"
|
|
134
|
+
style="overflow: hidden; background-color: white;display: flex; "
|
|
135
|
+
onclick="${gvc.event(() => {
|
|
136
|
+
scrollToTop();
|
|
137
|
+
})}"
|
|
138
|
+
>
|
|
139
|
+
<i class="fa-solid fa-angle-up fs-3"></i>
|
|
140
|
+
</button>
|
|
141
|
+
</div>
|
|
142
|
+
`;
|
|
119
143
|
},divCreate:{}
|
|
120
144
|
,onInitial:()=>{
|
|
121
|
-
|
|
145
|
+
window.addEventListener('scroll', function() {
|
|
122
146
|
const scrollPosition = window.scrollY;
|
|
123
147
|
|
|
124
148
|
const threshold = window.innerHeight / 2;
|
|
@@ -130,7 +154,8 @@ export class SocialLinks01 {
|
|
|
130
154
|
} else {
|
|
131
155
|
panel!.classList.add('hidden');
|
|
132
156
|
}
|
|
133
|
-
};
|
|
157
|
+
});
|
|
158
|
+
|
|
134
159
|
}
|
|
135
160
|
})
|
|
136
161
|
|
package/package.json
CHANGED
|
@@ -58,7 +58,7 @@ class CheckoutEvent {
|
|
|
58
58
|
return JSON.parse(JSON.stringify((0, glitter_finance_js_1.onlinePayArray)()));
|
|
59
59
|
}
|
|
60
60
|
async toCheckout(data, type = 'add', replace_order_id) {
|
|
61
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17;
|
|
62
62
|
try {
|
|
63
63
|
const utTimer = new ut_timer_js_1.UtTimer('TO-CHECKOUT');
|
|
64
64
|
const checkPoint = utTimer.checkPoint;
|
|
@@ -313,8 +313,9 @@ class CheckoutEvent {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
const store_info = await userClass.getConfigV2({ key: 'store-information', user_id: 'manager' });
|
|
316
|
+
const store_manager = (_z = (await userClass.getConfigV2({ key: 'store_manager', user_id: 'manager' })).list) !== null && _z !== void 0 ? _z : [];
|
|
316
317
|
data.line_items = await Promise.all(data.line_items.map(async (item) => {
|
|
317
|
-
var _a, _b, _c
|
|
318
|
+
var _a, _b, _c;
|
|
318
319
|
const getProductData = (await this.shopping.getProduct({
|
|
319
320
|
page: 0,
|
|
320
321
|
limit: 1,
|
|
@@ -336,7 +337,20 @@ class CheckoutEvent {
|
|
|
336
337
|
const isUnderstockingVisible = variant.show_understocking !== 'false';
|
|
337
338
|
const isManualType = type === 'manual' || type === 'manual-preview';
|
|
338
339
|
if (isPOS && isUnderstockingVisible && !data.isExhibition) {
|
|
339
|
-
variant.stock =
|
|
340
|
+
variant.stock =
|
|
341
|
+
store_manager
|
|
342
|
+
.filter((dd) => {
|
|
343
|
+
var _a;
|
|
344
|
+
return (dd.id === data.pos_store ||
|
|
345
|
+
((_a = store_manager.find((dd) => {
|
|
346
|
+
return dd.id === data.pos_store;
|
|
347
|
+
}).support_store) !== null && _a !== void 0 ? _a : []).includes(dd.id));
|
|
348
|
+
})
|
|
349
|
+
.map((d1) => {
|
|
350
|
+
var _a, _b;
|
|
351
|
+
return (_b = (_a = variant.stockList) === null || _a === void 0 ? void 0 : _a[d1.id]) === null || _b === void 0 ? void 0 : _b.count;
|
|
352
|
+
})
|
|
353
|
+
.reduce((acc, val) => acc + val, 0) || 0;
|
|
340
354
|
}
|
|
341
355
|
if (variant.stock < item.count && isUnderstockingVisible && !isManualType) {
|
|
342
356
|
if (isPOS || isPreOrderStore) {
|
|
@@ -378,7 +392,7 @@ class CheckoutEvent {
|
|
|
378
392
|
show_understocking: variant.show_understocking,
|
|
379
393
|
stockList: variant.stockList,
|
|
380
394
|
weight: parseInt(variant.weight || '0', 10),
|
|
381
|
-
designated_logistics: (
|
|
395
|
+
designated_logistics: (_a = content.designated_logistics) !== null && _a !== void 0 ? _a : { type: 'all', list: [] },
|
|
382
396
|
product_customize_tag: content.product_customize_tag || [],
|
|
383
397
|
});
|
|
384
398
|
const shipmentValue = (() => {
|
|
@@ -403,8 +417,8 @@ class CheckoutEvent {
|
|
|
403
417
|
if (!scheduledData) {
|
|
404
418
|
const sql = `WHERE JSON_CONTAINS(content->'$.pending_order', '"${data.temp_cart_id}"'`;
|
|
405
419
|
const scheduledDataQuery = `
|
|
406
|
-
|
|
407
|
-
|
|
420
|
+
SELECT *
|
|
421
|
+
FROM \`${this.app}\`.\`t_live_purchase_interactions\` ${sql});
|
|
408
422
|
`;
|
|
409
423
|
scheduledData = (await database_js_1.default.query(scheduledDataQuery, []))[0];
|
|
410
424
|
if (scheduledData) {
|
|
@@ -439,15 +453,37 @@ class CheckoutEvent {
|
|
|
439
453
|
}
|
|
440
454
|
}
|
|
441
455
|
else {
|
|
442
|
-
|
|
443
|
-
|
|
456
|
+
const refer = JSON.parse(JSON.stringify(variant.stockList));
|
|
457
|
+
console.log(`refer.stockList===>`, variant.stockList);
|
|
458
|
+
Object.keys(refer).forEach(key => {
|
|
459
|
+
var _a;
|
|
460
|
+
if ((key !== data.pos_store) &&
|
|
461
|
+
(!((_a = store_manager.find((dd) => {
|
|
462
|
+
return dd.id === data.pos_store;
|
|
463
|
+
}).support_store) !== null && _a !== void 0 ? _a : []).includes(key))) {
|
|
464
|
+
delete refer[key];
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
console.log(`refer===>`, refer);
|
|
468
|
+
const returnData = new stock_js_1.Stock(this.app, this.token).allocateStock(refer, item.count);
|
|
469
|
+
variant.stockList = Object.assign(Object.assign({}, variant.stockList), refer);
|
|
470
|
+
variant.deduction_log = Object.assign(Object.assign({}, variant.deduction_log), returnData.deductionLog);
|
|
444
471
|
item.deduction_log = variant.deduction_log;
|
|
472
|
+
console.log(`item.deduction_log===>`, item.deduction_log);
|
|
473
|
+
console.log(`variant.stockList===>`, variant.stockList);
|
|
474
|
+
console.log(`variant.deduction_log===>`, variant.deduction_log);
|
|
475
|
+
content.variants.forEach((d1, index) => {
|
|
476
|
+
console.log(`update-content-pos->`, d1.stockList);
|
|
477
|
+
});
|
|
445
478
|
}
|
|
446
479
|
}
|
|
447
480
|
else {
|
|
448
481
|
const returnData = new stock_js_1.Stock(this.app, this.token).allocateStock(variant.stockList, item.count);
|
|
449
482
|
variant.deduction_log = returnData.deductionLog;
|
|
450
483
|
item.deduction_log = returnData.deductionLog;
|
|
484
|
+
content.variants.forEach((d1, index) => {
|
|
485
|
+
console.log(`update-content-web->`, d1.stockList);
|
|
486
|
+
});
|
|
451
487
|
}
|
|
452
488
|
saveStockArray.push(() => new Promise(async (resolve, reject) => {
|
|
453
489
|
var _a;
|
|
@@ -456,8 +492,8 @@ class CheckoutEvent {
|
|
|
456
492
|
if (!scheduledData) {
|
|
457
493
|
const sql = `WHERE JSON_CONTAINS(content->'$.pending_order', '"${data.temp_cart_id}"'`;
|
|
458
494
|
const scheduledDataQuery = `
|
|
459
|
-
|
|
460
|
-
|
|
495
|
+
SELECT *
|
|
496
|
+
FROM \`${this.app}\`.\`t_live_purchase_interactions\` ${sql});
|
|
461
497
|
`;
|
|
462
498
|
scheduledData = (await database_js_1.default.query(scheduledDataQuery, []))[0];
|
|
463
499
|
}
|
|
@@ -492,11 +528,12 @@ class CheckoutEvent {
|
|
|
492
528
|
item.deduction_log = { [store_config.list[0].id]: item.count };
|
|
493
529
|
}
|
|
494
530
|
else {
|
|
495
|
-
|
|
531
|
+
content.variants.forEach((d1, index) => {
|
|
532
|
+
console.log(`update-content->`, d1.stockList);
|
|
533
|
+
});
|
|
534
|
+
await this.shopping.postVariantsAndPriceValue(content);
|
|
496
535
|
}
|
|
497
|
-
|
|
498
|
-
SET ?
|
|
499
|
-
WHERE id = ${getProductData.id}`, [{ content: JSON.stringify(content) }]);
|
|
536
|
+
console.log(`post-variants===>`, content);
|
|
500
537
|
}
|
|
501
538
|
resolve(true);
|
|
502
539
|
}
|
|
@@ -511,8 +548,8 @@ class CheckoutEvent {
|
|
|
511
548
|
is_hidden: content.visible === 'false',
|
|
512
549
|
is_gift: content.productType.giveaway,
|
|
513
550
|
sale_price: content.productType.giveaway ? 0 : item.sale_price,
|
|
514
|
-
min_qty: (
|
|
515
|
-
max_qty: (
|
|
551
|
+
min_qty: (_b = content.min_qty) !== null && _b !== void 0 ? _b : item.min_qty,
|
|
552
|
+
max_qty: (_c = content.max_qty) !== null && _c !== void 0 ? _c : item.max_qty,
|
|
516
553
|
});
|
|
517
554
|
item.is_add_on_items && add_on_items.push(item);
|
|
518
555
|
item.is_gift && gift_product.push(item);
|
|
@@ -530,24 +567,24 @@ class CheckoutEvent {
|
|
|
530
567
|
}
|
|
531
568
|
if (hasMaxProduct && data.email !== 'no-email') {
|
|
532
569
|
const cartTokenSQL = `
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
570
|
+
SELECT cart_token
|
|
571
|
+
FROM \`${this.app}\`.t_checkout
|
|
572
|
+
WHERE email IN (${[-99, (_0 = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _0 === void 0 ? void 0 : _0.email, (_1 = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _1 === void 0 ? void 0 : _1.phone]
|
|
536
573
|
.filter(Boolean)
|
|
537
574
|
.map(item => database_js_1.default.escape(item))
|
|
538
575
|
.join(',')})
|
|
539
|
-
|
|
576
|
+
AND order_status <> '-1'
|
|
540
577
|
`;
|
|
541
578
|
const soldHistory = await database_js_1.default.query(`
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
579
|
+
SELECT *
|
|
580
|
+
FROM \`${this.app}\`.t_products_sold_history
|
|
581
|
+
WHERE product_id IN (${[...maxProductMap.keys()].join(',')})
|
|
582
|
+
AND order_id IN (${cartTokenSQL})
|
|
546
583
|
`, []);
|
|
547
584
|
const purchaseHistory = new Map();
|
|
548
585
|
for (const history of soldHistory) {
|
|
549
586
|
const pid = Number(history.product_id);
|
|
550
|
-
purchaseHistory.set(pid, ((
|
|
587
|
+
purchaseHistory.set(pid, ((_2 = purchaseHistory.get(pid)) !== null && _2 !== void 0 ? _2 : 0) + history.count);
|
|
551
588
|
}
|
|
552
589
|
for (const item of data.line_items) {
|
|
553
590
|
if (maxProductMap.has(item.id)) {
|
|
@@ -556,13 +593,13 @@ class CheckoutEvent {
|
|
|
556
593
|
}
|
|
557
594
|
}
|
|
558
595
|
checkPoint('set max product');
|
|
559
|
-
carData.select_shipment_setting = ((
|
|
596
|
+
carData.select_shipment_setting = ((_3 = data === null || data === void 0 ? void 0 : data.user_info) === null || _3 === void 0 ? void 0 : _3.shipment)
|
|
560
597
|
? await userClass.getConfigV2({
|
|
561
598
|
key: 'shipment_config_' + data.user_info.shipment,
|
|
562
599
|
user_id: 'manager',
|
|
563
600
|
})
|
|
564
601
|
: {};
|
|
565
|
-
const freeShipmnetNum = (
|
|
602
|
+
const freeShipmnetNum = (_6 = (_5 = (_4 = carData.select_shipment_setting) === null || _4 === void 0 ? void 0 : _4.cartSetting) === null || _5 === void 0 ? void 0 : _5.freeShipmnetTarget) !== null && _6 !== void 0 ? _6 : 0;
|
|
566
603
|
const isFreeShipment = freeShipmnetNum > 0 && carData.total >= freeShipmnetNum;
|
|
567
604
|
carData.shipment_fee = isFreeShipment
|
|
568
605
|
? 0
|
|
@@ -620,7 +657,7 @@ class CheckoutEvent {
|
|
|
620
657
|
await this.shopping.checkVoucher(carData);
|
|
621
658
|
checkPoint('check voucher');
|
|
622
659
|
let can_add_gift = [];
|
|
623
|
-
(
|
|
660
|
+
(_7 = carData.voucherList) === null || _7 === void 0 ? void 0 : _7.filter(dd => dd.reBackType === 'giveaway').forEach(dd => can_add_gift.push(dd.add_on_products));
|
|
624
661
|
gift_product.forEach(dd => {
|
|
625
662
|
const max_count = can_add_gift.filter(d1 => d1.includes(dd.id)).length;
|
|
626
663
|
if (max_count) {
|
|
@@ -632,7 +669,7 @@ class CheckoutEvent {
|
|
|
632
669
|
}
|
|
633
670
|
});
|
|
634
671
|
for (const giveawayData of carData.voucherList.filter(dd => dd.reBackType === 'giveaway')) {
|
|
635
|
-
if (!((
|
|
672
|
+
if (!((_8 = giveawayData.add_on_products) === null || _8 === void 0 ? void 0 : _8.length))
|
|
636
673
|
continue;
|
|
637
674
|
const productPromises = giveawayData.add_on_products
|
|
638
675
|
.map(async (id) => {
|
|
@@ -660,7 +697,7 @@ class CheckoutEvent {
|
|
|
660
697
|
appName: this.app,
|
|
661
698
|
key: 'glitter_finance',
|
|
662
699
|
});
|
|
663
|
-
const keyData = (
|
|
700
|
+
const keyData = (_9 = configData[0]) === null || _9 === void 0 ? void 0 : _9.value;
|
|
664
701
|
if (keyData) {
|
|
665
702
|
carData.payment_info_custom = keyData.payment_info_custom;
|
|
666
703
|
}
|
|
@@ -690,10 +727,10 @@ class CheckoutEvent {
|
|
|
690
727
|
}
|
|
691
728
|
});
|
|
692
729
|
checkPoint('set payment');
|
|
693
|
-
keyData.cash_on_delivery = (
|
|
730
|
+
keyData.cash_on_delivery = (_10 = keyData.cash_on_delivery) !== null && _10 !== void 0 ? _10 : { shipmentSupport: [] };
|
|
694
731
|
carData.payment_info_line_pay = keyData.payment_info_line_pay;
|
|
695
732
|
carData.payment_info_atm = keyData.payment_info_atm;
|
|
696
|
-
keyData.cash_on_delivery.shipmentSupport = (
|
|
733
|
+
keyData.cash_on_delivery.shipmentSupport = (_11 = keyData.cash_on_delivery.shipmentSupport) !== null && _11 !== void 0 ? _11 : [];
|
|
697
734
|
await this.setPaymentSetting({ carData: carData, checkoutPayment: checkoutPayment, keyData: keyData });
|
|
698
735
|
let subtotal = 0;
|
|
699
736
|
carData.lineItems.map(item => {
|
|
@@ -715,7 +752,7 @@ class CheckoutEvent {
|
|
|
715
752
|
const excludedValuesByTotal = new Set(['UNIMARTC2C', 'FAMIC2C', 'HILIFEC2C', 'OKMARTC2C']);
|
|
716
753
|
const excludedValuesByWeight = new Set(['normal', 'black_cat']);
|
|
717
754
|
const logisticsGroupResult = await userClass.getConfig({ key: 'logistics_group', user_id: 'manager' });
|
|
718
|
-
const logisticsGroup = (
|
|
755
|
+
const logisticsGroup = (_13 = (_12 = logisticsGroupResult[0]) === null || _12 === void 0 ? void 0 : _12.value) !== null && _13 !== void 0 ? _13 : [];
|
|
719
756
|
const isExcludedByTotal = (dd) => {
|
|
720
757
|
return carData.total > 20000 && excludedValuesByTotal.has(dd.value);
|
|
721
758
|
};
|
|
@@ -822,7 +859,7 @@ class CheckoutEvent {
|
|
|
822
859
|
carData.discount = data.discount;
|
|
823
860
|
carData.voucherList = [tempVoucher];
|
|
824
861
|
carData.customer_info = data.customer_info;
|
|
825
|
-
carData.total = (
|
|
862
|
+
carData.total = (_14 = data.total) !== null && _14 !== void 0 ? _14 : 0;
|
|
826
863
|
carData.rebate = tempVoucher.rebate_total;
|
|
827
864
|
if (tempVoucher.reBackType == 'shipment_free' || type == 'split') {
|
|
828
865
|
carData.shipment_fee = 0;
|
|
@@ -867,7 +904,7 @@ class CheckoutEvent {
|
|
|
867
904
|
if (checkOutType === 'POS' && Array.isArray(data.voucherList)) {
|
|
868
905
|
const manualVoucher = data.voucherList.find((item) => item.id === 0);
|
|
869
906
|
if (manualVoucher) {
|
|
870
|
-
manualVoucher.discount = (
|
|
907
|
+
manualVoucher.discount = (_15 = manualVoucher.discount_total) !== null && _15 !== void 0 ? _15 : 0;
|
|
871
908
|
carData.total -= manualVoucher.discount;
|
|
872
909
|
carData.discount += manualVoucher.discount;
|
|
873
910
|
carData.voucherList.push(manualVoucher);
|
|
@@ -899,15 +936,15 @@ class CheckoutEvent {
|
|
|
899
936
|
console.error(e);
|
|
900
937
|
}
|
|
901
938
|
}
|
|
939
|
+
await trans.commit();
|
|
940
|
+
await trans.release();
|
|
941
|
+
await Promise.all(saveStockArray.map(dd => dd()));
|
|
902
942
|
await order_event_js_1.OrderEvent.insertOrder({
|
|
903
943
|
cartData: carData,
|
|
904
944
|
status: data.pay_status,
|
|
905
945
|
app: this.app,
|
|
906
946
|
});
|
|
907
|
-
await
|
|
908
|
-
await trans.release();
|
|
909
|
-
await Promise.all(saveStockArray.map(dd => dd()));
|
|
910
|
-
await this.shopping.releaseCheckout((_15 = data.pay_status) !== null && _15 !== void 0 ? _15 : 0, carData.orderID);
|
|
947
|
+
await this.shopping.releaseCheckout((_16 = data.pay_status) !== null && _16 !== void 0 ? _16 : 0, carData.orderID);
|
|
911
948
|
checkPoint('release pos checkout');
|
|
912
949
|
for (const email of new Set([carData.customer_info, carData.user_info].map(dd => {
|
|
913
950
|
return dd && dd.email;
|
|
@@ -961,7 +998,7 @@ class CheckoutEvent {
|
|
|
961
998
|
appName: this.app,
|
|
962
999
|
key: 'glitter_finance',
|
|
963
1000
|
}))[0].value;
|
|
964
|
-
let kd = (
|
|
1001
|
+
let kd = (_17 = keyData[carData.customer_info.payment_select]) !== null && _17 !== void 0 ? _17 : {
|
|
965
1002
|
ReturnURL: '',
|
|
966
1003
|
NotifyURL: '',
|
|
967
1004
|
};
|