ts-glitter 16.5.6 → 16.5.7
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-pages/payment-page.js +23 -14
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +30 -21
- package/lowcode/cms-plugin/pos-pages/products-page.js +45 -4
- package/lowcode/cms-plugin/pos-pages/products-page.ts +35 -6
- package/lowcode/cms-plugin/shopping-order-manager.js +36 -29
- package/lowcode/cms-plugin/shopping-order-manager.ts +33 -29
- package/lowcode/cms-plugin/shopping-product-stock.js +1 -4
- package/lowcode/cms-plugin/shopping-product-stock.ts +1 -4
- package/lowcode/glitter-base/route/shopping.ts +3 -0
- package/lowcode/public-components/product/pd-class.js +4 -1
- package/lowcode/public-components/product/pd-class.ts +4 -1
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +3 -0
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +3 -0
- package/src/api-public/services/shopping.d.ts +3 -1
- package/src/api-public/services/shopping.js +89 -32
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +210 -143
- package/src/index.ts +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -79,7 +79,7 @@ export class Entry {
|
|
|
79
79
|
}
|
|
80
80
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
81
81
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
82
|
-
glitter.share.editerVersion = 'V_16.5.
|
|
82
|
+
glitter.share.editerVersion = 'V_16.5.7';
|
|
83
83
|
glitter.share.start = new Date();
|
|
84
84
|
const vm = {
|
|
85
85
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -78,7 +78,7 @@ export class Entry {
|
|
|
78
78
|
}
|
|
79
79
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
80
80
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
81
|
-
glitter.share.editerVersion = 'V_16.5.
|
|
81
|
+
glitter.share.editerVersion = 'V_16.5.7';
|
|
82
82
|
glitter.share.start = new Date();
|
|
83
83
|
const vm: {
|
|
84
84
|
appConfig: any;
|
|
@@ -85,6 +85,7 @@ export class PaymentPage {
|
|
|
85
85
|
const orderDetail = (yield ApiShop.getCheckout({
|
|
86
86
|
line_items: obj.ogOrderData.lineItems,
|
|
87
87
|
checkOutType: 'POS',
|
|
88
|
+
pos_store: POSSetting.config.where_store,
|
|
88
89
|
user_info: obj.ogOrderData.user_info,
|
|
89
90
|
code_array: obj.ogOrderData.code_array || [],
|
|
90
91
|
})).response.data;
|
|
@@ -1668,6 +1669,8 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1668
1669
|
text: `訂單成立中`,
|
|
1669
1670
|
});
|
|
1670
1671
|
passData.user_info.email = orderDetail.user_info.email || 'no-email';
|
|
1672
|
+
passData.pos_store = POSSetting.config.where_store;
|
|
1673
|
+
passData.invoice_select = c_vm.invoice_select;
|
|
1671
1674
|
ApiShop.toPOSCheckout(passData).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
1672
1675
|
if (!res.result) {
|
|
1673
1676
|
dialog.dataLoading({ visible: false });
|
|
@@ -1678,7 +1681,7 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1678
1681
|
dialog.errorMessage({ text: '請確認載具是否輸入正確' });
|
|
1679
1682
|
}
|
|
1680
1683
|
else {
|
|
1681
|
-
dialog.errorMessage({ text: '
|
|
1684
|
+
dialog.errorMessage({ text: '開立異常,請確認發票配號是否足夠' });
|
|
1682
1685
|
}
|
|
1683
1686
|
}
|
|
1684
1687
|
else {
|
|
@@ -1702,7 +1705,6 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1702
1705
|
}
|
|
1703
1706
|
}
|
|
1704
1707
|
}
|
|
1705
|
-
print('client');
|
|
1706
1708
|
}
|
|
1707
1709
|
dialog.dataLoading({ visible: false });
|
|
1708
1710
|
orderDetail.lineItems = [];
|
|
@@ -1778,12 +1780,12 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1778
1780
|
<div class="dialog-content position-relative"
|
|
1779
1781
|
style="width: 452px;max-width: calc(100% - 20px);">
|
|
1780
1782
|
<div
|
|
1781
|
-
class="mb-3 fs-
|
|
1783
|
+
class="mb-3 fs-5 fw-500 text-center"
|
|
1782
1784
|
style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
1783
1785
|
>
|
|
1784
1786
|
選擇發票開立方式
|
|
1785
1787
|
</div>
|
|
1786
|
-
<div class="
|
|
1788
|
+
<div class="row p-0">
|
|
1787
1789
|
${(() => {
|
|
1788
1790
|
let btnArray = [
|
|
1789
1791
|
{
|
|
@@ -1801,30 +1803,37 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1801
1803
|
value: 'company',
|
|
1802
1804
|
icon: `<i class="fa-regular fa-building"></i>`,
|
|
1803
1805
|
},
|
|
1806
|
+
{
|
|
1807
|
+
title: `不開立`,
|
|
1808
|
+
value: 'nouse',
|
|
1809
|
+
icon: `<i class="fa-solid fa-ban"></i>`,
|
|
1810
|
+
}
|
|
1804
1811
|
];
|
|
1805
1812
|
return btnArray
|
|
1806
1813
|
.map((btn) => {
|
|
1807
1814
|
return html `
|
|
1808
|
-
<div
|
|
1809
|
-
|
|
1810
|
-
|
|
1815
|
+
<div class="col-6 mb-4">
|
|
1816
|
+
<div
|
|
1817
|
+
class="w-100 d-flex align-items-center flex-column justify-content-center"
|
|
1818
|
+
style="padding: 20px;border-radius: 10px;background: #F6F6F6;${c_vm.invoice_select ==
|
|
1811
1819
|
btn.value
|
|
1812
1820
|
? `color:#393939;border-radius: 10px;border: 3px solid #393939;box-shadow: 2px 2px 15px 0px rgba(0, 0, 0, 0.20);`
|
|
1813
|
-
: 'color:#8D8D8D;'}"
|
|
1814
|
-
|
|
1821
|
+
: 'color:#8D8D8D;'} "
|
|
1822
|
+
onclick="${gvc.event(() => {
|
|
1815
1823
|
c_vm.invoice_select = btn.value;
|
|
1816
1824
|
c_vm.value = '';
|
|
1817
1825
|
gvc.recreateView();
|
|
1818
1826
|
})}"
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1827
|
+
>
|
|
1828
|
+
<div style="" class="fs-2">${btn.icon}</div>
|
|
1829
|
+
<div style="font-size: 16px;font-weight: 500;letter-spacing: 0.64px;">
|
|
1830
|
+
${btn.title}
|
|
1831
|
+
</div>
|
|
1823
1832
|
</div>
|
|
1824
1833
|
</div>
|
|
1825
1834
|
`;
|
|
1826
1835
|
})
|
|
1827
|
-
.join('
|
|
1836
|
+
.join('');
|
|
1828
1837
|
})()}
|
|
1829
1838
|
</div>
|
|
1830
1839
|
${(() => {
|
|
@@ -89,6 +89,7 @@ export class PaymentPage {
|
|
|
89
89
|
await ApiShop.getCheckout({
|
|
90
90
|
line_items: obj.ogOrderData.lineItems,
|
|
91
91
|
checkOutType: 'POS',
|
|
92
|
+
pos_store:POSSetting.config.where_store,
|
|
92
93
|
user_info: obj.ogOrderData.user_info,
|
|
93
94
|
code_array: obj.ogOrderData.code_array || [],
|
|
94
95
|
})
|
|
@@ -1748,7 +1749,8 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1748
1749
|
text: `訂單成立中`,
|
|
1749
1750
|
});
|
|
1750
1751
|
passData.user_info.email = orderDetail.user_info.email || 'no-email';
|
|
1751
|
-
|
|
1752
|
+
passData.pos_store=POSSetting.config.where_store;
|
|
1753
|
+
passData.invoice_select=c_vm.invoice_select;
|
|
1752
1754
|
ApiShop.toPOSCheckout(passData).then(async (res) => {
|
|
1753
1755
|
if (!res.result) {
|
|
1754
1756
|
dialog.dataLoading({visible: false});
|
|
@@ -1757,7 +1759,7 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1757
1759
|
} else if (c_vm.invoice_select === 'carry') {
|
|
1758
1760
|
dialog.errorMessage({text: '請確認載具是否輸入正確'});
|
|
1759
1761
|
} else {
|
|
1760
|
-
dialog.errorMessage({text: '
|
|
1762
|
+
dialog.errorMessage({text: '開立異常,請確認發票配號是否足夠'});
|
|
1761
1763
|
}
|
|
1762
1764
|
} else {
|
|
1763
1765
|
PaymentPage.clearHistory();
|
|
@@ -1782,7 +1784,7 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1782
1784
|
}
|
|
1783
1785
|
}
|
|
1784
1786
|
|
|
1785
|
-
|
|
1787
|
+
|
|
1786
1788
|
}
|
|
1787
1789
|
dialog.dataLoading({visible: false});
|
|
1788
1790
|
orderDetail.lineItems = [];
|
|
@@ -1869,12 +1871,12 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1869
1871
|
<div class="dialog-content position-relative"
|
|
1870
1872
|
style="width: 452px;max-width: calc(100% - 20px);">
|
|
1871
1873
|
<div
|
|
1872
|
-
class="mb-3 fs-
|
|
1874
|
+
class="mb-3 fs-5 fw-500 text-center"
|
|
1873
1875
|
style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
1874
1876
|
>
|
|
1875
1877
|
選擇發票開立方式
|
|
1876
1878
|
</div>
|
|
1877
|
-
<div class="
|
|
1879
|
+
<div class="row p-0">
|
|
1878
1880
|
${(() => {
|
|
1879
1881
|
|
|
1880
1882
|
let btnArray = [
|
|
@@ -1893,30 +1895,37 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1893
1895
|
value: 'company',
|
|
1894
1896
|
icon: `<i class="fa-regular fa-building"></i>`,
|
|
1895
1897
|
},
|
|
1898
|
+
{
|
|
1899
|
+
title: `不開立`,
|
|
1900
|
+
value: 'nouse',
|
|
1901
|
+
icon: `<i class="fa-solid fa-ban"></i>`,
|
|
1902
|
+
}
|
|
1896
1903
|
];
|
|
1897
1904
|
return btnArray
|
|
1898
1905
|
.map((btn) => {
|
|
1899
1906
|
return html`
|
|
1900
|
-
<div
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1907
|
+
<div class="col-6 mb-4">
|
|
1908
|
+
<div
|
|
1909
|
+
class="w-100 d-flex align-items-center flex-column justify-content-center"
|
|
1910
|
+
style="padding: 20px;border-radius: 10px;background: #F6F6F6;${c_vm.invoice_select ==
|
|
1911
|
+
btn.value
|
|
1912
|
+
? `color:#393939;border-radius: 10px;border: 3px solid #393939;box-shadow: 2px 2px 15px 0px rgba(0, 0, 0, 0.20);`
|
|
1913
|
+
: 'color:#8D8D8D;'} "
|
|
1914
|
+
onclick="${gvc.event(() => {
|
|
1915
|
+
c_vm.invoice_select = btn.value as any;
|
|
1916
|
+
c_vm.value = '';
|
|
1917
|
+
gvc.recreateView();
|
|
1918
|
+
})}"
|
|
1919
|
+
>
|
|
1920
|
+
<div style="" class="fs-2">${btn.icon}</div>
|
|
1921
|
+
<div style="font-size: 16px;font-weight: 500;letter-spacing: 0.64px;">
|
|
1922
|
+
${btn.title}
|
|
1923
|
+
</div>
|
|
1915
1924
|
</div>
|
|
1916
1925
|
</div>
|
|
1917
1926
|
`;
|
|
1918
1927
|
})
|
|
1919
|
-
.join('
|
|
1928
|
+
.join('');
|
|
1920
1929
|
})()}
|
|
1921
1930
|
</div>
|
|
1922
1931
|
${(() => {
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { ApiShop } from "../../glitter-base/route/shopping.js";
|
|
2
11
|
import { ShareDialog } from "../../glitterBundle/dialog/ShareDialog.js";
|
|
3
12
|
import { POSSetting } from "../POS-setting.js";
|
|
4
13
|
import { Swal } from "../../modules/sweetAlert.js";
|
|
14
|
+
import { PaymentPage } from "./payment-page.js";
|
|
5
15
|
const html = String.raw;
|
|
6
16
|
export class ProductsPage {
|
|
7
17
|
static main(obj) {
|
|
@@ -326,6 +336,7 @@ export class ProductsPage {
|
|
|
326
336
|
if (document.querySelector('.js-cart-count')) {
|
|
327
337
|
document.querySelector('.js-cart-count').recreateView();
|
|
328
338
|
}
|
|
339
|
+
gvc.glitter.share.checkStock();
|
|
329
340
|
gvc.glitter.closeDiaLog();
|
|
330
341
|
})
|
|
331
342
|
}
|
|
@@ -390,15 +401,42 @@ export class ProductsPage {
|
|
|
390
401
|
${(() => {
|
|
391
402
|
const checkId = gvc.glitter.getUUID();
|
|
392
403
|
let checking = true;
|
|
404
|
+
let interVal = 0;
|
|
393
405
|
function checkStock() {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
406
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
407
|
+
checking = true;
|
|
408
|
+
gvc.notifyDataChange(checkId);
|
|
409
|
+
const res_ = yield ApiShop.getCheckout({
|
|
410
|
+
line_items: orderDetail.lineItems,
|
|
411
|
+
checkOutType: 'POS',
|
|
412
|
+
pos_store: POSSetting.config.where_store
|
|
413
|
+
});
|
|
414
|
+
let remove = false;
|
|
415
|
+
orderDetail.lineItems.map((data) => {
|
|
416
|
+
const find = res_.response.data.lineItems.find((dd) => {
|
|
417
|
+
return `${dd.id}-${dd.spec.join('')}` === `${data.id}-${data.spec.join('')}`;
|
|
418
|
+
});
|
|
419
|
+
if (!find || (find.count !== data.count)) {
|
|
420
|
+
dialog.errorMessage({ text: `『 ${data.title} 』庫存數量不足${data.count}個,系統已自動移除。` });
|
|
421
|
+
data.count = (find && find.count) || 0;
|
|
422
|
+
remove = true;
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
orderDetail.lineItems = orderDetail.lineItems.filter((dd) => { return dd.count; });
|
|
426
|
+
if (remove) {
|
|
427
|
+
gvc.notifyDataChange('order');
|
|
428
|
+
}
|
|
397
429
|
checking = false;
|
|
430
|
+
PaymentPage.storeHistory(orderDetail);
|
|
398
431
|
gvc.notifyDataChange(checkId);
|
|
399
|
-
}
|
|
432
|
+
});
|
|
400
433
|
}
|
|
434
|
+
gvc.glitter.share.checkStock = checkStock;
|
|
401
435
|
checkStock();
|
|
436
|
+
function checkStockInterVal() {
|
|
437
|
+
clearInterval(interVal);
|
|
438
|
+
interVal = setTimeout(() => { checkStock(); }, 300);
|
|
439
|
+
}
|
|
402
440
|
const view = html `
|
|
403
441
|
<div class=""
|
|
404
442
|
style="height: 100%;width: 352px;max-width:100%;overflow: auto;${(document.body.clientWidth > 800) ? `padding: 36px 24px;` : `padding: 10px 12px;`};background: #FFF;box-shadow: 1px 0 10px 0 rgba(0, 0, 0, 0.10);">
|
|
@@ -460,6 +498,7 @@ export class ProductsPage {
|
|
|
460
498
|
<div style="display: flex;width: 30px;height: 30px;padding: 8px;justify-content: center;align-items: center;border-radius: 10px;background: #393939;"
|
|
461
499
|
onclick="${gvc.event(() => {
|
|
462
500
|
item.count = (item.count < 2) ? item.count : item.count - 1;
|
|
501
|
+
checkStockInterVal();
|
|
463
502
|
gvc.notifyDataChange('order');
|
|
464
503
|
})}">
|
|
465
504
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
@@ -475,11 +514,13 @@ export class ProductsPage {
|
|
|
475
514
|
value="${item.count}"
|
|
476
515
|
onchange="${gvc.event((e, event) => {
|
|
477
516
|
item.count = e.value;
|
|
517
|
+
checkStockInterVal();
|
|
478
518
|
gvc.notifyDataChange('order');
|
|
479
519
|
})}">
|
|
480
520
|
<div style="display: flex;width: 30px;height: 30px;padding: 8px;justify-content: center;align-items: center;border-radius: 10px;background: #393939;"
|
|
481
521
|
onclick="${gvc.event(() => {
|
|
482
522
|
item.count++;
|
|
523
|
+
checkStockInterVal();
|
|
483
524
|
gvc.notifyDataChange('order');
|
|
484
525
|
})}">
|
|
485
526
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
@@ -4,6 +4,7 @@ import {ApiShop} from "../../glitter-base/route/shopping.js";
|
|
|
4
4
|
import {ShareDialog} from "../../glitterBundle/dialog/ShareDialog.js";
|
|
5
5
|
import {POSSetting} from "../POS-setting.js";
|
|
6
6
|
import {Swal} from "../../modules/sweetAlert.js";
|
|
7
|
+
import {PaymentPage} from "./payment-page.js";
|
|
7
8
|
|
|
8
9
|
const html = String.raw
|
|
9
10
|
|
|
@@ -342,6 +343,7 @@ export class ProductsPage {
|
|
|
342
343
|
if (document.querySelector('.js-cart-count')) {
|
|
343
344
|
(document.querySelector('.js-cart-count') as any).recreateView()
|
|
344
345
|
}
|
|
346
|
+
gvc.glitter.share.checkStock()
|
|
345
347
|
gvc.glitter.closeDiaLog()
|
|
346
348
|
})
|
|
347
349
|
}
|
|
@@ -404,16 +406,40 @@ export class ProductsPage {
|
|
|
404
406
|
${(() => {
|
|
405
407
|
const checkId=gvc.glitter.getUUID()
|
|
406
408
|
let checking=true
|
|
407
|
-
|
|
409
|
+
let interVal:any=0
|
|
410
|
+
async function checkStock() {
|
|
408
411
|
checking=true
|
|
409
412
|
gvc.notifyDataChange(checkId)
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
413
|
+
const res_=await ApiShop.getCheckout({
|
|
414
|
+
line_items: orderDetail.lineItems,
|
|
415
|
+
checkOutType:'POS',
|
|
416
|
+
pos_store:POSSetting.config.where_store
|
|
417
|
+
});
|
|
418
|
+
let remove=false
|
|
419
|
+
orderDetail.lineItems.map((data:any)=>{
|
|
420
|
+
const find=res_.response.data.lineItems.find((dd:any)=>{
|
|
421
|
+
return `${dd.id}-${dd.spec.join('')}`===`${data.id}-${data.spec.join('')}`
|
|
422
|
+
});
|
|
423
|
+
if(!find || (find.count !== data.count)){
|
|
424
|
+
dialog.errorMessage({text:`『 ${data.title} 』庫存數量不足${data.count}個,系統已自動移除。`})
|
|
425
|
+
data.count=(find && find.count) || 0
|
|
426
|
+
remove=true
|
|
427
|
+
}
|
|
428
|
+
})
|
|
429
|
+
orderDetail.lineItems=orderDetail.lineItems.filter((dd)=>{return dd.count})
|
|
430
|
+
if(remove){
|
|
431
|
+
gvc.notifyDataChange('order')
|
|
432
|
+
}
|
|
433
|
+
checking=false
|
|
434
|
+
PaymentPage.storeHistory(orderDetail)
|
|
435
|
+
gvc.notifyDataChange(checkId)
|
|
415
436
|
}
|
|
437
|
+
gvc.glitter.share.checkStock=checkStock
|
|
416
438
|
checkStock()
|
|
439
|
+
function checkStockInterVal() {
|
|
440
|
+
clearInterval(interVal)
|
|
441
|
+
interVal=setTimeout(()=>{checkStock()},300)
|
|
442
|
+
}
|
|
417
443
|
const view = html`
|
|
418
444
|
<div class=""
|
|
419
445
|
style="height: 100%;width: 352px;max-width:100%;overflow: auto;${(document.body.clientWidth > 800) ? `padding: 36px 24px;` : `padding: 10px 12px;`};background: #FFF;box-shadow: 1px 0 10px 0 rgba(0, 0, 0, 0.10);">
|
|
@@ -475,6 +501,7 @@ export class ProductsPage {
|
|
|
475
501
|
<div style="display: flex;width: 30px;height: 30px;padding: 8px;justify-content: center;align-items: center;border-radius: 10px;background: #393939;"
|
|
476
502
|
onclick="${gvc.event(() => {
|
|
477
503
|
item.count = (item.count < 2) ? item.count : item.count - 1;
|
|
504
|
+
checkStockInterVal()
|
|
478
505
|
gvc.notifyDataChange('order')
|
|
479
506
|
})}">
|
|
480
507
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
@@ -490,11 +517,13 @@ export class ProductsPage {
|
|
|
490
517
|
value="${item.count}"
|
|
491
518
|
onchange="${gvc.event((e, event)=>{
|
|
492
519
|
item.count=e.value;
|
|
520
|
+
checkStockInterVal()
|
|
493
521
|
gvc.notifyDataChange('order')
|
|
494
522
|
})}">
|
|
495
523
|
<div style="display: flex;width: 30px;height: 30px;padding: 8px;justify-content: center;align-items: center;border-radius: 10px;background: #393939;"
|
|
496
524
|
onclick="${gvc.event(() => {
|
|
497
525
|
item.count++
|
|
526
|
+
checkStockInterVal()
|
|
498
527
|
gvc.notifyDataChange('order')
|
|
499
528
|
})}">
|
|
500
529
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1041,27 +1041,29 @@ export class ShoppingOrderManager {
|
|
|
1041
1041
|
${gvc.bindView({
|
|
1042
1042
|
bind: "storehouseList",
|
|
1043
1043
|
view: () => {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
else {
|
|
1057
|
-
if (storeList.length == 0) {
|
|
1058
|
-
return html `倉儲資訊錯誤`;
|
|
1044
|
+
try {
|
|
1045
|
+
if (storeLoading) {
|
|
1046
|
+
ApiUser.getPublicConfig('store_manager', 'manager').then((dd) => {
|
|
1047
|
+
if (dd.result && dd.response.value) {
|
|
1048
|
+
storeList = dd.response.value.list;
|
|
1049
|
+
storeLoading = false;
|
|
1050
|
+
gvc.notifyDataChange('storehouseList');
|
|
1051
|
+
}
|
|
1052
|
+
else {
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
return html `讀取中...`;
|
|
1059
1056
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1057
|
+
else {
|
|
1058
|
+
if (storeList.length == 0) {
|
|
1059
|
+
return html `倉儲資訊錯誤`;
|
|
1060
|
+
}
|
|
1061
|
+
return storeList.map((store) => {
|
|
1062
|
+
let returnHtml = ``;
|
|
1063
|
+
orderData.orderData.lineItems.map((item) => {
|
|
1064
|
+
console.log(`item.deduction_log=>`, item.deduction_log);
|
|
1065
|
+
if (item.deduction_log[store.id]) {
|
|
1066
|
+
returnHtml += html `
|
|
1065
1067
|
<div class="d-flex justify-content-between"
|
|
1066
1068
|
style="font-size: 16px;font-weight: 400;">
|
|
1067
1069
|
<div>${item.title} -
|
|
@@ -1071,10 +1073,10 @@ export class ShoppingOrderManager {
|
|
|
1071
1073
|
</div>
|
|
1072
1074
|
</div>
|
|
1073
1075
|
`;
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
if (returnHtml) {
|
|
1079
|
+
return html `
|
|
1078
1080
|
<div class="d-flex flex-column w-100"
|
|
1079
1081
|
style="gap:8px;padding: 18px;border-radius: 10px;border: 1px solid #DDD;">
|
|
1080
1082
|
<div class="d-flex w-100 align-items-center"
|
|
@@ -1091,11 +1093,16 @@ export class ShoppingOrderManager {
|
|
|
1091
1093
|
</div>
|
|
1092
1094
|
</div>
|
|
1093
1095
|
`;
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1096
|
+
}
|
|
1097
|
+
else {
|
|
1098
|
+
return ``;
|
|
1099
|
+
}
|
|
1100
|
+
}).join('');
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
catch (e) {
|
|
1104
|
+
console.log(e);
|
|
1105
|
+
return `error-${e}`;
|
|
1099
1106
|
}
|
|
1100
1107
|
},
|
|
1101
1108
|
divCreate: {
|
|
@@ -1279,26 +1279,28 @@ export class ShoppingOrderManager {
|
|
|
1279
1279
|
${gvc.bindView({
|
|
1280
1280
|
bind: "storehouseList",
|
|
1281
1281
|
view: () => {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1282
|
+
try {
|
|
1283
|
+
if (storeLoading) {
|
|
1284
|
+
ApiUser.getPublicConfig('store_manager', 'manager').then((dd: any) => {
|
|
1285
|
+
if (dd.result && dd.response.value) {
|
|
1286
|
+
storeList = dd.response.value.list;
|
|
1287
|
+
storeLoading = false
|
|
1288
|
+
gvc.notifyDataChange('storehouseList');
|
|
1289
|
+
} else {
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
return html`讀取中...`
|
|
1293
|
+
} else {
|
|
1294
|
+
if (storeList.length == 0) {
|
|
1295
|
+
return html`倉儲資訊錯誤`
|
|
1289
1296
|
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
return storeList.map((store: any) => {
|
|
1298
|
-
let returnHtml = ``;
|
|
1299
|
-
orderData.orderData.lineItems.map((item: any) => {
|
|
1300
|
-
if (item.deduction_log[store.id]) {
|
|
1301
|
-
returnHtml += html`
|
|
1297
|
+
// console.log(orderData.orderData.lineItems)
|
|
1298
|
+
return storeList.map((store: any) => {
|
|
1299
|
+
let returnHtml = ``;
|
|
1300
|
+
orderData.orderData.lineItems.map((item: any) => {
|
|
1301
|
+
console.log(`item.deduction_log=>`,item.deduction_log)
|
|
1302
|
+
if (item.deduction_log[store.id]) {
|
|
1303
|
+
returnHtml += html`
|
|
1302
1304
|
<div class="d-flex justify-content-between"
|
|
1303
1305
|
style="font-size: 16px;font-weight: 400;">
|
|
1304
1306
|
<div>${item.title} -
|
|
@@ -1308,10 +1310,10 @@ export class ShoppingOrderManager {
|
|
|
1308
1310
|
</div>
|
|
1309
1311
|
</div>
|
|
1310
1312
|
`
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1313
|
+
}
|
|
1314
|
+
})
|
|
1315
|
+
if (returnHtml) {
|
|
1316
|
+
return html`
|
|
1315
1317
|
<div class="d-flex flex-column w-100"
|
|
1316
1318
|
style="gap:8px;padding: 18px;border-radius: 10px;border: 1px solid #DDD;">
|
|
1317
1319
|
<div class="d-flex w-100 align-items-center"
|
|
@@ -1328,14 +1330,16 @@ export class ShoppingOrderManager {
|
|
|
1328
1330
|
</div>
|
|
1329
1331
|
</div>
|
|
1330
1332
|
`
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1333
|
+
} else {
|
|
1334
|
+
return ``
|
|
1335
|
+
}
|
|
1334
1336
|
|
|
1335
|
-
|
|
1337
|
+
}).join('');
|
|
1338
|
+
}
|
|
1339
|
+
}catch (e) {
|
|
1340
|
+
console.log(e)
|
|
1341
|
+
return `error-${e}`
|
|
1336
1342
|
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
1343
|
},
|
|
1340
1344
|
divCreate: {
|
|
1341
1345
|
class: `w-100 d-flex flex-column`,
|
|
@@ -79,10 +79,7 @@ export class StockList {
|
|
|
79
79
|
<div class="d-flex align-items-center gap-3" style="min-width: 250px;">
|
|
80
80
|
${BgWidget.validImageBox({
|
|
81
81
|
gvc,
|
|
82
|
-
image:
|
|
83
|
-
&&
|
|
84
|
-
dd.product_content.language_data[(window.parent.store_info.language_setting.def)].preview_image[0])
|
|
85
|
-
|| dd.product_content.preview_image[0],
|
|
82
|
+
image: dd.variant_content.preview_image,
|
|
86
83
|
width: 40,
|
|
87
84
|
class: 'rounded border ms-1',
|
|
88
85
|
})}
|
|
@@ -125,10 +125,7 @@ export class StockList {
|
|
|
125
125
|
<div class="d-flex align-items-center gap-3" style="min-width: 250px;">
|
|
126
126
|
${BgWidget.validImageBox({
|
|
127
127
|
gvc,
|
|
128
|
-
image:
|
|
129
|
-
&&
|
|
130
|
-
dd.product_content.language_data[((window.parent as any).store_info.language_setting.def)].preview_image[0])
|
|
131
|
-
|| dd.product_content.preview_image[0],
|
|
128
|
+
image: dd.variant_content.preview_image,
|
|
132
129
|
width: 40,
|
|
133
130
|
class: 'rounded border ms-1',
|
|
134
131
|
})}
|