ts-glitter 22.5.7 → 22.5.9
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-advance.js +1 -1
- package/lowcode/cms-plugin/shopping-setting-advance.ts +2 -1
- 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/schedule.js +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +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/api-public/services/user.js +22 -12
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +31 -22
- 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
|
@@ -20,77 +20,102 @@ import { PosFunction } from '../pos-pages/pos-function.js';
|
|
|
20
20
|
const html = String.raw;
|
|
21
21
|
export class OrderModule {
|
|
22
22
|
static getPaymentMethodText(gvc, orderData) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return `${(() => {
|
|
45
|
-
switch (dd.method) {
|
|
46
|
-
case 'creditCard':
|
|
47
|
-
return '信用卡';
|
|
48
|
-
case 'line':
|
|
49
|
-
return 'Line Pay';
|
|
50
|
-
case 'cash':
|
|
51
|
-
return '現金';
|
|
23
|
+
return gvc.bindView({
|
|
24
|
+
bind: gvc.glitter.getUUID(),
|
|
25
|
+
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
var _a;
|
|
27
|
+
if (orderData.orderSource === 'POS') {
|
|
28
|
+
const saasConfig = window.parent.saasConfig;
|
|
29
|
+
const custom_pos_payment = yield saasConfig.api
|
|
30
|
+
.getPrivateConfig(saasConfig.config.appName, 'glitter_finance')
|
|
31
|
+
.then((d) => {
|
|
32
|
+
return (() => {
|
|
33
|
+
try {
|
|
34
|
+
const val = d.response.result[0].value;
|
|
35
|
+
return val.payment_info_custom
|
|
36
|
+
.filter((item) => item.type === 'pos')
|
|
37
|
+
.map((item) => {
|
|
38
|
+
return {
|
|
39
|
+
title: item.name,
|
|
40
|
+
value: item.id,
|
|
41
|
+
key: item.id,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
52
44
|
}
|
|
53
|
-
|
|
45
|
+
catch (error) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
})();
|
|
54
49
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
gvc.glitter.share.reloadPosPage();
|
|
74
|
-
}),
|
|
75
|
-
})}
|
|
76
|
-
</div>`);
|
|
77
|
-
}
|
|
78
|
-
return map_.join('<div class="w-100"></div>');
|
|
50
|
+
return this.formatPosPaymentInfo(gvc, orderData, custom_pos_payment);
|
|
51
|
+
}
|
|
52
|
+
return (((_a = (yield PaymentConfig.getSupportPayment()).find(dd => {
|
|
53
|
+
return dd.key === orderData.customer_info.payment_select;
|
|
54
|
+
})) === null || _a === void 0 ? void 0 : _a.name) || '線下付款');
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static formatPosPaymentInfo(gvc, orderData, custom_pos_payment) {
|
|
59
|
+
if (typeof orderData.pos_info.payment === 'string') {
|
|
60
|
+
return `門市『 ${(() => {
|
|
61
|
+
switch (orderData.pos_info.payment) {
|
|
62
|
+
case 'creditCard':
|
|
63
|
+
return '信用卡';
|
|
64
|
+
case 'line':
|
|
65
|
+
return 'Line Pay';
|
|
66
|
+
case 'cash':
|
|
67
|
+
return '現金';
|
|
79
68
|
}
|
|
80
|
-
})()}
|
|
81
|
-
`;
|
|
69
|
+
})()} 』付款`;
|
|
82
70
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
71
|
+
const pay_total = orderData.pos_info.payment
|
|
72
|
+
.map((dd) => dd.total)
|
|
73
|
+
.reduce((acc, val) => acc + val, 0);
|
|
74
|
+
const getPaymentMethodLabel = (method) => {
|
|
75
|
+
if (method === 'cash') {
|
|
76
|
+
return '現金';
|
|
77
|
+
}
|
|
78
|
+
if (method === 'creditCard') {
|
|
79
|
+
return '刷卡';
|
|
80
|
+
}
|
|
81
|
+
if (method === 'line') {
|
|
82
|
+
return 'LINE PAY';
|
|
83
|
+
}
|
|
84
|
+
const payment = (custom_pos_payment || []).find((item) => item.key === method);
|
|
85
|
+
if (!payment) {
|
|
86
|
+
return '';
|
|
87
|
+
}
|
|
88
|
+
return payment.title;
|
|
89
|
+
};
|
|
90
|
+
let map_ = orderData.pos_info.payment.map((dd) => {
|
|
91
|
+
return html `${getPaymentMethodLabel(dd.method)}付款<span class="fw-500" style="color: #E85757;">
|
|
92
|
+
$${dd.total.toLocaleString()}</span
|
|
93
|
+
>`;
|
|
93
94
|
});
|
|
95
|
+
if (pay_total < orderData.total) {
|
|
96
|
+
map_.push(html ` <div class="d-flex align-items-center">
|
|
97
|
+
<span class="fw-500 text-danger">付款金額不足</span>
|
|
98
|
+
<div class="mx-1"></div>
|
|
99
|
+
<span class="fw-500"> $${(orderData.total - pay_total).toLocaleString()}</span>
|
|
100
|
+
<div class="mx-1"></div>
|
|
101
|
+
${BgWidget.customButton({
|
|
102
|
+
button: {
|
|
103
|
+
color: 'gray',
|
|
104
|
+
size: 'sm',
|
|
105
|
+
},
|
|
106
|
+
text: {
|
|
107
|
+
name: '前往結帳',
|
|
108
|
+
},
|
|
109
|
+
event: gvc.event(() => {
|
|
110
|
+
PaymentPage.storeHistory(orderData);
|
|
111
|
+
gvc.closeDialog();
|
|
112
|
+
localStorage.setItem('show_pos_page', 'payment');
|
|
113
|
+
gvc.glitter.share.reloadPosPage();
|
|
114
|
+
}),
|
|
115
|
+
})}
|
|
116
|
+
</div>`);
|
|
117
|
+
}
|
|
118
|
+
return map_.join('<div class="w-100"></div>');
|
|
94
119
|
}
|
|
95
120
|
static getProofPurchaseString(gvc, orderData) {
|
|
96
121
|
if (orderData.method !== 'off_line' || orderData.customer_info.payment_select === 'cash_on_delivery') {
|
|
@@ -284,10 +309,8 @@ export class OrderModule {
|
|
|
284
309
|
}
|
|
285
310
|
static formatRecord(gvc, vm, orderID, record) {
|
|
286
311
|
const orderNumbers = record.match(/{{order=(\d+[a-zA-Z]?)}}/g) || [];
|
|
287
|
-
console.log('orderNumbers - ', orderNumbers);
|
|
288
312
|
orderNumbers.map((order) => {
|
|
289
313
|
const pureOrder = order.replace(/{{order=|}}/g, '');
|
|
290
|
-
console.log('pureOrder -- ', pureOrder);
|
|
291
314
|
record = record.replace(order, BgWidget.blueNote(`#${pureOrder}`, gvc.event(() => {
|
|
292
315
|
vm.data.cart_token = pureOrder;
|
|
293
316
|
vm.type = 'replace';
|
|
@@ -14,79 +14,114 @@ const html = String.raw;
|
|
|
14
14
|
|
|
15
15
|
export class OrderModule {
|
|
16
16
|
static getPaymentMethodText(gvc: GVC, orderData: any) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
})()}付款<span class="fw-500" style="color:#E85757;"> $${dd.total.toLocaleString()}</span>`;
|
|
47
|
-
});
|
|
48
|
-
if (pay_total < orderData.total) {
|
|
49
|
-
map_.push(
|
|
50
|
-
html` <div class="d-flex align-items-center">
|
|
51
|
-
<span class="fw-500 text-danger">付款金額不足</span>
|
|
52
|
-
<div class="mx-1"></div>
|
|
53
|
-
<span class="fw-500"> $${(orderData.total - pay_total).toLocaleString()}</span>
|
|
54
|
-
<div class="mx-1"></div>
|
|
55
|
-
${BgWidget.customButton({
|
|
56
|
-
button: {
|
|
57
|
-
color: 'gray',
|
|
58
|
-
size: 'sm',
|
|
59
|
-
},
|
|
60
|
-
text: {
|
|
61
|
-
name: '前往結帳',
|
|
62
|
-
},
|
|
63
|
-
event: gvc.event(() => {
|
|
64
|
-
PaymentPage.storeHistory(orderData);
|
|
65
|
-
gvc.closeDialog();
|
|
66
|
-
localStorage.setItem('show_pos_page', 'payment');
|
|
67
|
-
gvc.glitter.share.reloadPosPage();
|
|
68
|
-
}),
|
|
69
|
-
})}
|
|
70
|
-
</div>`
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return map_.join('<div class="w-100"></div>');
|
|
17
|
+
return gvc.bindView({
|
|
18
|
+
bind: gvc.glitter.getUUID(),
|
|
19
|
+
view: async () => {
|
|
20
|
+
if (orderData.orderSource === 'POS') {
|
|
21
|
+
const saasConfig: { config: any; api: any } = (window.parent as any).saasConfig;
|
|
22
|
+
|
|
23
|
+
const custom_pos_payment = await saasConfig.api
|
|
24
|
+
.getPrivateConfig(saasConfig.config.appName, 'glitter_finance')
|
|
25
|
+
.then((d: any) => {
|
|
26
|
+
return (() => {
|
|
27
|
+
try {
|
|
28
|
+
const val = d.response.result[0].value;
|
|
29
|
+
|
|
30
|
+
return val.payment_info_custom
|
|
31
|
+
.filter((item: any) => item.type === 'pos')
|
|
32
|
+
.map((item: any) => {
|
|
33
|
+
return {
|
|
34
|
+
title: item.name,
|
|
35
|
+
value: item.id,
|
|
36
|
+
key: item.id,
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
})();
|
|
43
|
+
});
|
|
44
|
+
return this.formatPosPaymentInfo(gvc, orderData, custom_pos_payment);
|
|
74
45
|
}
|
|
75
|
-
|
|
76
|
-
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
(await PaymentConfig.getSupportPayment()).find(dd => {
|
|
49
|
+
return dd.key === orderData.customer_info.payment_select;
|
|
50
|
+
})?.name || '線下付款'
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static formatPosPaymentInfo(gvc: GVC, orderData: any, custom_pos_payment: any) {
|
|
57
|
+
if (typeof orderData.pos_info.payment === 'string') {
|
|
58
|
+
return `門市『 ${(() => {
|
|
59
|
+
switch (orderData.pos_info.payment) {
|
|
60
|
+
case 'creditCard':
|
|
61
|
+
return '信用卡';
|
|
62
|
+
case 'line':
|
|
63
|
+
return 'Line Pay';
|
|
64
|
+
case 'cash':
|
|
65
|
+
return '現金';
|
|
66
|
+
}
|
|
67
|
+
})()} 』付款`;
|
|
77
68
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
69
|
+
|
|
70
|
+
const pay_total = orderData.pos_info.payment
|
|
71
|
+
.map((dd: any) => dd.total)
|
|
72
|
+
.reduce((acc: any, val: any) => acc + val, 0);
|
|
73
|
+
|
|
74
|
+
const getPaymentMethodLabel = (method: string) => {
|
|
75
|
+
if (method === 'cash') {
|
|
76
|
+
return '現金';
|
|
77
|
+
}
|
|
78
|
+
if (method === 'creditCard') {
|
|
79
|
+
return '刷卡';
|
|
80
|
+
}
|
|
81
|
+
if (method === 'line') {
|
|
82
|
+
return 'LINE PAY';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const payment = (custom_pos_payment || []).find((item: any) => item.key === method);
|
|
86
|
+
if (!payment) {
|
|
87
|
+
return '';
|
|
88
|
+
}
|
|
89
|
+
return payment.title;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
let map_ = orderData.pos_info.payment.map((dd: any) => {
|
|
93
|
+
return html`${getPaymentMethodLabel(dd.method)}付款<span class="fw-500" style="color: #E85757;">
|
|
94
|
+
$${dd.total.toLocaleString()}</span
|
|
95
|
+
>`;
|
|
89
96
|
});
|
|
97
|
+
|
|
98
|
+
if (pay_total < orderData.total) {
|
|
99
|
+
map_.push(
|
|
100
|
+
html` <div class="d-flex align-items-center">
|
|
101
|
+
<span class="fw-500 text-danger">付款金額不足</span>
|
|
102
|
+
<div class="mx-1"></div>
|
|
103
|
+
<span class="fw-500"> $${(orderData.total - pay_total).toLocaleString()}</span>
|
|
104
|
+
<div class="mx-1"></div>
|
|
105
|
+
${BgWidget.customButton({
|
|
106
|
+
button: {
|
|
107
|
+
color: 'gray',
|
|
108
|
+
size: 'sm',
|
|
109
|
+
},
|
|
110
|
+
text: {
|
|
111
|
+
name: '前往結帳',
|
|
112
|
+
},
|
|
113
|
+
event: gvc.event(() => {
|
|
114
|
+
PaymentPage.storeHistory(orderData);
|
|
115
|
+
gvc.closeDialog();
|
|
116
|
+
localStorage.setItem('show_pos_page', 'payment');
|
|
117
|
+
gvc.glitter.share.reloadPosPage();
|
|
118
|
+
}),
|
|
119
|
+
})}
|
|
120
|
+
</div>`
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return map_.join('<div class="w-100"></div>');
|
|
90
125
|
}
|
|
91
126
|
|
|
92
127
|
static getProofPurchaseString(gvc: GVC, orderData: any) {
|
|
@@ -304,12 +339,9 @@ export class OrderModule {
|
|
|
304
339
|
|
|
305
340
|
static formatRecord(gvc: GVC, vm: any, orderID: string, record: string): string {
|
|
306
341
|
// 處理訂單連結
|
|
307
|
-
|
|
308
342
|
const orderNumbers = record.match(/{{order=(\d+[a-zA-Z]?)}}/g) || [];
|
|
309
|
-
console.log('orderNumbers - ', orderNumbers);
|
|
310
343
|
orderNumbers.map((order: string) => {
|
|
311
344
|
const pureOrder = order.replace(/{{order=|}}/g, '');
|
|
312
|
-
console.log('pureOrder -- ', pureOrder);
|
|
313
345
|
record = record.replace(
|
|
314
346
|
order,
|
|
315
347
|
BgWidget.blueNote(
|
|
@@ -26,7 +26,9 @@ export class PosCheckoutSetting {
|
|
|
26
26
|
const dialog = new ShareDialog(gvc.glitter);
|
|
27
27
|
function save(next) {
|
|
28
28
|
dialog.dataLoading({ visible: true, text: '請稍候...' });
|
|
29
|
-
saasConfig.api
|
|
29
|
+
saasConfig.api
|
|
30
|
+
.setPrivateConfig(saasConfig.config.appName, `invoice_setting`, vm.data)
|
|
31
|
+
.then((r) => {
|
|
30
32
|
setTimeout(() => {
|
|
31
33
|
dialog.dataLoading({ visible: false, text: '請稍候...' });
|
|
32
34
|
if (r.response) {
|
|
@@ -42,11 +44,11 @@ export class PosCheckoutSetting {
|
|
|
42
44
|
bind: vm.id,
|
|
43
45
|
view: () => {
|
|
44
46
|
return BgWidget.container(html `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
<div class="title-container">
|
|
48
|
+
${BgWidget.title(`發票設定`)}
|
|
49
|
+
<div class="flex-fill"></div>
|
|
50
|
+
</div>
|
|
51
|
+
${BgWidget.container([
|
|
50
52
|
BgWidget.mainCard(gvc.bindView(() => {
|
|
51
53
|
const id = gvc.glitter.getUUID();
|
|
52
54
|
return {
|
|
@@ -71,13 +73,15 @@ export class PosCheckoutSetting {
|
|
|
71
73
|
bind: id,
|
|
72
74
|
view: () => {
|
|
73
75
|
return html `
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
<div class="d-flex flex-column" style="gap:18px;">
|
|
77
|
+
${[
|
|
76
78
|
{
|
|
77
79
|
title: html ` <div class="d-flex flex-column">
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
開立發票
|
|
81
|
+
<span style="color:#8D8D8D;font-size: 12px;"
|
|
82
|
+
>串接綠界電子發票系統進行發票開立</span
|
|
83
|
+
>
|
|
84
|
+
</div>`,
|
|
81
85
|
value: 'ecpay',
|
|
82
86
|
},
|
|
83
87
|
{
|
|
@@ -85,26 +89,29 @@ export class PosCheckoutSetting {
|
|
|
85
89
|
value: 'nouse',
|
|
86
90
|
},
|
|
87
91
|
]
|
|
88
|
-
.map(
|
|
92
|
+
.map(dd => {
|
|
89
93
|
return html ` <div>
|
|
90
|
-
|
|
94
|
+
${[
|
|
91
95
|
html ` <div
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
class="d-flex align-items-center cursor_pointer"
|
|
97
|
+
style="gap:8px;"
|
|
98
|
+
onclick="${gvc.event(() => {
|
|
95
99
|
vm.data.fincial = dd.value;
|
|
96
100
|
gvc.notifyDataChange(id);
|
|
97
101
|
})}"
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
>
|
|
103
|
+
${vm.data.fincial === dd.value
|
|
100
104
|
? `<i class="fa-sharp fa-solid fa-circle-dot color39"></i>`
|
|
101
105
|
: ` <div class="c_39_checkbox"></div>`}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
html ` <div class="d-flex position-relative mt-2"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
<div class="tx_normal fw-normal">${dd.title}</div>
|
|
107
|
+
</div>`,
|
|
108
|
+
html ` <div class="d-flex position-relative mt-2">
|
|
109
|
+
<div
|
|
110
|
+
class="ms-2 border-end position-absolute h-100"
|
|
111
|
+
style="left: 0px;"
|
|
112
|
+
></div>
|
|
113
|
+
<div class="flex-fill " style="margin-left:30px;max-width: 518px;">
|
|
114
|
+
${(() => {
|
|
108
115
|
var _a, _b, _c;
|
|
109
116
|
if (vm.data.fincial === 'nouse' ||
|
|
110
117
|
vm.data.fincial === 'off_line' ||
|
|
@@ -127,7 +134,7 @@ export class PosCheckoutSetting {
|
|
|
127
134
|
value: 'official',
|
|
128
135
|
},
|
|
129
136
|
],
|
|
130
|
-
callback:
|
|
137
|
+
callback: text => {
|
|
131
138
|
vm.data.point = text;
|
|
132
139
|
if (vm.data.point == 'beta') {
|
|
133
140
|
vm.data.hashkey = vm.data.bhashkey;
|
|
@@ -142,11 +149,11 @@ export class PosCheckoutSetting {
|
|
|
142
149
|
}),
|
|
143
150
|
BgWidget.editeInput({
|
|
144
151
|
gvc: gvc,
|
|
145
|
-
title: '
|
|
152
|
+
title: '商店代號',
|
|
146
153
|
default: (_a = vm.data.merchNO) !== null && _a !== void 0 ? _a : '',
|
|
147
154
|
type: 'text',
|
|
148
|
-
placeHolder: '
|
|
149
|
-
callback:
|
|
155
|
+
placeHolder: '請輸入商店代號',
|
|
156
|
+
callback: text => {
|
|
150
157
|
vm.data.merchNO = text;
|
|
151
158
|
},
|
|
152
159
|
}),
|
|
@@ -156,7 +163,7 @@ export class PosCheckoutSetting {
|
|
|
156
163
|
default: (_b = vm.data.hashkey) !== null && _b !== void 0 ? _b : '',
|
|
157
164
|
type: 'text',
|
|
158
165
|
placeHolder: '請輸入HashKey',
|
|
159
|
-
callback:
|
|
166
|
+
callback: text => {
|
|
160
167
|
vm.data.hashkey = text;
|
|
161
168
|
if (vm.data.point == 'beta') {
|
|
162
169
|
vm.data.bhashkey = text;
|
|
@@ -172,7 +179,7 @@ export class PosCheckoutSetting {
|
|
|
172
179
|
default: (_c = vm.data.hashiv) !== null && _c !== void 0 ? _c : '',
|
|
173
180
|
type: 'text',
|
|
174
181
|
placeHolder: '請輸入HashIV',
|
|
175
|
-
callback:
|
|
182
|
+
callback: text => {
|
|
176
183
|
vm.data.hashiv = text;
|
|
177
184
|
if (vm.data.point == 'beta') {
|
|
178
185
|
vm.data.bhashiv = text;
|
|
@@ -182,17 +189,17 @@ export class PosCheckoutSetting {
|
|
|
182
189
|
}
|
|
183
190
|
},
|
|
184
191
|
}),
|
|
185
|
-
].join(html ` <div
|
|
192
|
+
].join(html ` <div style="height: 12px;"></div>`);
|
|
186
193
|
}
|
|
187
194
|
})()}
|
|
188
|
-
|
|
189
|
-
|
|
195
|
+
</div>
|
|
196
|
+
</div>`,
|
|
190
197
|
].join('')}
|
|
191
|
-
|
|
198
|
+
</div>`;
|
|
192
199
|
})
|
|
193
200
|
.join('')}
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
</div>
|
|
202
|
+
`;
|
|
196
203
|
},
|
|
197
204
|
divCreate: {
|
|
198
205
|
style: ``,
|
|
@@ -210,14 +217,14 @@ export class PosCheckoutSetting {
|
|
|
210
217
|
})),
|
|
211
218
|
BgWidget.mbContainer(240),
|
|
212
219
|
html ` <div class="update-bar-container">
|
|
213
|
-
|
|
220
|
+
${BgWidget.save(gvc.event(() => {
|
|
214
221
|
save(() => {
|
|
215
222
|
dialog.successMessage({ text: '設定成功' });
|
|
216
223
|
});
|
|
217
224
|
}))}
|
|
218
|
-
|
|
225
|
+
</div>`,
|
|
219
226
|
].join(''))}
|
|
220
|
-
|
|
227
|
+
`);
|
|
221
228
|
},
|
|
222
229
|
});
|
|
223
230
|
}
|