ts-glitter 22.5.6 → 22.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +13 -13
- package/lowcode/backend-manager/bg-product.ts +13 -13
- package/lowcode/backend-manager/bg-shopping.js +8 -13
- package/lowcode/backend-manager/bg-shopping.ts +8 -15
- package/lowcode/backend-manager/bg-widget.js +62 -49
- package/lowcode/backend-manager/bg-widget.ts +129 -93
- package/lowcode/cms-plugin/POS-setting.js +30 -9
- package/lowcode/cms-plugin/POS-setting.ts +49 -16
- package/lowcode/cms-plugin/cms-router.js +27 -21
- package/lowcode/cms-plugin/cms-router.ts +116 -101
- package/lowcode/cms-plugin/filter-options.js +25 -17
- package/lowcode/cms-plugin/filter-options.ts +27 -17
- package/lowcode/cms-plugin/module/product-excel.js +2 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/module/product-setting.js +13 -12
- package/lowcode/cms-plugin/module/product-setting.ts +26 -23
- package/lowcode/cms-plugin/order/order-module.js +91 -68
- package/lowcode/cms-plugin/order/order-module.ts +105 -73
- package/lowcode/cms-plugin/pos-checkout-setting.js +46 -39
- package/lowcode/cms-plugin/pos-checkout-setting.ts +237 -227
- package/lowcode/cms-plugin/pos-config-setting.js +25 -23
- package/lowcode/cms-plugin/pos-config-setting.ts +35 -32
- package/lowcode/cms-plugin/pos-pages/payment-function.js +253 -139
- package/lowcode/cms-plugin/pos-pages/payment-function.ts +405 -279
- package/lowcode/cms-plugin/pos-pages/payment-page.js +348 -267
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +378 -296
- package/lowcode/cms-plugin/pos-pages/pos-function.js +76 -19
- package/lowcode/cms-plugin/pos-pages/pos-function.ts +84 -19
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-finance-setting.js +1590 -1701
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1967 -2011
- package/lowcode/cms-plugin/shopping-order-manager.js +74 -62
- package/lowcode/cms-plugin/shopping-order-manager.ts +119 -85
- package/lowcode/cms-plugin/shopping-product-text.js +874 -531
- package/lowcode/cms-plugin/shopping-product-text.ts +1656 -1305
- package/lowcode/cms-plugin/shopping-setting-basic.js +152 -124
- package/lowcode/cms-plugin/shopping-setting-basic.ts +315 -247
- package/lowcode/css/editor.css +3 -2
- package/lowcode/glitter-base/global/language.js +5 -3
- package/lowcode/glitter-base/global/language.ts +8 -6
- package/lowcode/glitter-base/global/payment-config.js +6 -0
- package/lowcode/glitter-base/global/payment-config.ts +6 -3
- package/lowcode/public-components/product/pd-class.js +1 -3
- package/lowcode/public-components/product/pd-class.ts +1 -3
- package/lowcode/public-components/user-manager/um-order.js +2 -1
- package/lowcode/public-components/user-manager/um-order.ts +2 -1
- package/package.json +1 -1
- package/src/api-public/controllers/index.js +14 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +16 -1
- package/src/api-public/controllers/shop.js +14 -7
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -8
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/financial-serviceV2.js +7 -17
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/updated-table-checked.js +20 -0
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +21 -0
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/index.js +3 -3
- package/src/index.js.map +13 -1
- package/src/modules/database.js +5 -1
- package/src/modules/database.js.map +1 -1
- package/src/modules/database.ts +5 -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
|
@@ -8,295 +8,421 @@ import { OrderDetail } from './models.js';
|
|
|
8
8
|
const html = String.raw;
|
|
9
9
|
|
|
10
10
|
export class PaymentFunction {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
public static cashFinish(gvc: GVC, total: number, callback: (result: boolean) => void) {
|
|
12
|
+
gvc.addStyle(`
|
|
13
|
+
.dialog-box {
|
|
14
|
+
width: 100vw;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
20
|
+
z-index: 10000;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
.dialog-absolute {
|
|
24
|
+
width: 100%;
|
|
25
|
+
border-top: 1px solid #e2e5f1;
|
|
26
|
+
position: absolute;
|
|
27
|
+
left: 0px;
|
|
28
|
+
bottom: 0px;
|
|
29
|
+
height: 40px;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
.hover-cancel {
|
|
37
|
+
background-color: #fff;
|
|
38
|
+
border-radius: 0 0 0 0.5rem;
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
.hover-cancel:hover {
|
|
42
|
+
background-color: #e6e6e6;
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
.hover-save {
|
|
46
|
+
background-color: #393939;
|
|
47
|
+
border-radius: 0 0 0.5rem;
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
50
|
+
.hover-save:hover {
|
|
51
|
+
background-color: #646464;
|
|
52
|
+
}
|
|
53
|
+
`);
|
|
54
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
55
|
+
gvc.glitter.innerDialog(
|
|
56
|
+
(gvc: GVC) => {
|
|
57
|
+
return html`
|
|
58
|
+
<div class="dialog-box">
|
|
59
|
+
<div class="dialog-content position-relative pb-5" style="width: 452px;max-width: calc(100% - 20px);">
|
|
60
|
+
<div
|
|
61
|
+
class="my-3 fs-6 fw-500 text-center"
|
|
62
|
+
style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
63
|
+
>
|
|
64
|
+
請先收取現金後進行結帳
|
|
65
|
+
</div>
|
|
66
|
+
<div
|
|
67
|
+
style="font-size: 18px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;"
|
|
68
|
+
>
|
|
69
|
+
本次結帳金額為
|
|
70
|
+
<span style="font-size: 28px;font-style: normal;font-weight: 700;line-height: 160%;"
|
|
71
|
+
>$${total.toLocaleString()}</span
|
|
72
|
+
>
|
|
73
|
+
</div>
|
|
74
|
+
<div
|
|
75
|
+
class="d-flex align-items-center justify-content-center"
|
|
76
|
+
style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;"
|
|
77
|
+
>
|
|
78
|
+
<div
|
|
79
|
+
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
|
|
80
|
+
onclick="${gvc.event(() => {
|
|
81
|
+
gvc.glitter.closeDiaLog();
|
|
82
|
+
})}"
|
|
83
|
+
>
|
|
84
|
+
取消
|
|
85
|
+
</div>
|
|
86
|
+
<div
|
|
87
|
+
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:120px;text-align:center;"
|
|
88
|
+
onclick="${gvc.event(() => {
|
|
89
|
+
gvc.closeDialog();
|
|
90
|
+
callback(true);
|
|
91
|
+
})}"
|
|
92
|
+
>
|
|
93
|
+
確認
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
},
|
|
100
|
+
'orderFinish',
|
|
101
|
+
{
|
|
102
|
+
dismiss: () => {
|
|
103
|
+
// vm.type = "list";
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public static creditFinish(gvc: GVC, total: number, orderDetail: any, callback: (result: boolean) => void) {
|
|
110
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
111
|
+
|
|
112
|
+
const pwd = orderDetail.payment_setting.find((dd: any) => {
|
|
113
|
+
return dd.key === 'ut_credit_card';
|
|
114
|
+
}).pwd;
|
|
115
|
+
gvc.glitter.innerDialog(
|
|
116
|
+
(gvc: GVC) => {
|
|
117
|
+
if (PayConfig.deviceType === 'pos') {
|
|
118
|
+
gvc.glitter.runJsInterFace(
|
|
119
|
+
'credit_card',
|
|
93
120
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
121
|
+
amount: `${total}`,
|
|
122
|
+
memo: `訂單ID:${orderDetail.orderID}`,
|
|
123
|
+
orderID: orderDetail.orderID,
|
|
124
|
+
pwd: pwd,
|
|
125
|
+
},
|
|
126
|
+
(res: any) => {
|
|
127
|
+
const response = JSON.parse(res.result.data);
|
|
128
|
+
if (response.code === '250') {
|
|
129
|
+
gvc.closeDialog();
|
|
130
|
+
callback(true);
|
|
131
|
+
} else {
|
|
132
|
+
gvc.closeDialog();
|
|
133
|
+
// callback(false);
|
|
134
|
+
dialog.errorMessage({ text: `交易失敗,失敗原因:${response.msg ?? ''}` });
|
|
135
|
+
}
|
|
97
136
|
}
|
|
98
|
-
|
|
99
|
-
|
|
137
|
+
);
|
|
138
|
+
} else if (ConnectionMode.on_connected_device) {
|
|
139
|
+
gvc.glitter.share.credit_card_callback = (res: any) => {
|
|
140
|
+
const response = JSON.parse(res.result.data);
|
|
141
|
+
if (response.code === '250') {
|
|
142
|
+
gvc.closeDialog();
|
|
143
|
+
callback(true);
|
|
144
|
+
} else {
|
|
145
|
+
gvc.closeDialog();
|
|
146
|
+
dialog.errorMessage({ text: `交易失敗,失敗原因:${response.msg ?? ''}` });
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
ConnectionMode.sendCommand({
|
|
150
|
+
cmd: 'credit_card',
|
|
151
|
+
amount: `${total}`,
|
|
152
|
+
memo: `訂單ID:${orderDetail.orderID}`,
|
|
153
|
+
orderID: orderDetail.orderID,
|
|
154
|
+
pwd: pwd,
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
gvc.closeDialog();
|
|
159
|
+
dialog.errorMessage({ text: '尚未連線至刷卡機' });
|
|
160
|
+
}, 100);
|
|
161
|
+
}
|
|
100
162
|
|
|
101
|
-
|
|
102
|
-
|
|
163
|
+
return html`
|
|
164
|
+
<div class="dialog-box">
|
|
165
|
+
<div class="dialog-content position-relative " style="width: 370px;max-width: calc(100% - 20px);">
|
|
166
|
+
<div
|
|
167
|
+
class="my-3 fw-500 text-center"
|
|
168
|
+
style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
169
|
+
>
|
|
170
|
+
請感應或插入信用卡進行付款
|
|
171
|
+
</div>
|
|
172
|
+
<div
|
|
173
|
+
style="font-size: 16px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;"
|
|
174
|
+
>
|
|
175
|
+
若逾時將重新選擇付款方式
|
|
176
|
+
</div>
|
|
177
|
+
<img
|
|
178
|
+
class="mt-3"
|
|
179
|
+
style="max-width:70%;"
|
|
180
|
+
src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scsds7s8sbsfs3s8_b00f1f368f2a9b9fb067a844f940ca2a.gif"
|
|
181
|
+
/>
|
|
182
|
+
<div
|
|
183
|
+
class="fw-500 w-100 mt-3"
|
|
184
|
+
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
|
|
185
|
+
onclick="${gvc.event(() => {
|
|
186
|
+
// clearTimeout(timer)
|
|
187
|
+
gvc.glitter.closeDiaLog();
|
|
188
|
+
})}"
|
|
189
|
+
>
|
|
190
|
+
取消付款
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
`;
|
|
195
|
+
},
|
|
196
|
+
'orderFinish',
|
|
197
|
+
{
|
|
198
|
+
dismiss: () => {
|
|
199
|
+
// vm.type = "list";
|
|
200
|
+
},
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
103
204
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
205
|
+
public static lineFinish(
|
|
206
|
+
gvc: GVC,
|
|
207
|
+
total: number,
|
|
208
|
+
prefix: number,
|
|
209
|
+
orderDetail: OrderDetail,
|
|
210
|
+
callback: (result: boolean) => void
|
|
211
|
+
) {
|
|
212
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
213
|
+
gvc.glitter.innerDialog(
|
|
214
|
+
(gvc: GVC) => {
|
|
215
|
+
let block = false;
|
|
216
|
+
PayConfig.onPayment = scanText => {
|
|
217
|
+
if (block) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
dialog.dataLoading({ visible: true });
|
|
221
|
+
ApiShop.toPOSLinePay({
|
|
222
|
+
amount: total,
|
|
223
|
+
currency: 'TWD',
|
|
224
|
+
orderId: `${orderDetail.orderID}-${orderDetail.line_prefix || 0}`,
|
|
225
|
+
productName: orderDetail.lineItems
|
|
226
|
+
.map((data: any) => {
|
|
227
|
+
return `${data.title} * ${data.count}`;
|
|
228
|
+
})
|
|
229
|
+
.join(','),
|
|
230
|
+
oneTimeKey: scanText,
|
|
231
|
+
}).then(res => {
|
|
232
|
+
dialog.dataLoading({ visible: false });
|
|
233
|
+
if (!res.result || !res.response.result) {
|
|
234
|
+
dialog.errorMessage({ text: '交易失敗' });
|
|
235
|
+
callback(false);
|
|
236
|
+
} else {
|
|
237
|
+
gvc.closeDialog();
|
|
238
|
+
PayConfig.onPayment = undefined;
|
|
239
|
+
callback(true);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
let m_text = '';
|
|
244
|
+
return html`
|
|
245
|
+
<div class="dialog-box">
|
|
246
|
+
<div class="dialog-content position-relative " style="width: 370px;max-width: calc(100% - 20px);">
|
|
247
|
+
<div
|
|
248
|
+
class="my-3 fw-500 text-center"
|
|
249
|
+
style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
250
|
+
>
|
|
251
|
+
請掃描LINE Pay付款條碼
|
|
252
|
+
</div>
|
|
253
|
+
<img
|
|
254
|
+
class="mt-3"
|
|
255
|
+
style="max-width:70%;"
|
|
256
|
+
src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_s6sfs4scs5s3s0sa_Screenshot2024-09-06at12.28.00 PM.jpg"
|
|
257
|
+
/>
|
|
258
|
+
<div class="d-flex w-100 align-items-center mt-3" style="border:1px solid grey;height: 50px;">
|
|
259
|
+
<input
|
|
260
|
+
class="form-control h-100"
|
|
261
|
+
style="border: none;"
|
|
262
|
+
placeholder="請輸入或掃描付款代碼"
|
|
263
|
+
onchange="${gvc.event((e, event) => {
|
|
264
|
+
m_text = e.value;
|
|
265
|
+
})}"
|
|
266
|
+
value="${m_text || ''}"
|
|
267
|
+
onfocus="${gvc.event(() => {
|
|
268
|
+
block = true;
|
|
269
|
+
})}"
|
|
270
|
+
onblur="${gvc.event(() => {
|
|
271
|
+
block = false;
|
|
272
|
+
})}"
|
|
273
|
+
/>
|
|
274
|
+
<div class="flex-fill"></div>
|
|
275
|
+
<div
|
|
276
|
+
style="background: grey;width: 50px;"
|
|
277
|
+
class="d-flex align-items-center justify-content-center text-white h-100"
|
|
278
|
+
onclick="${gvc.event(() => {
|
|
279
|
+
gvc.glitter.runJsInterFace('start_scan', {}, res => {
|
|
280
|
+
PayConfig.onPayment!(res.text);
|
|
147
281
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
282
|
+
})}"
|
|
283
|
+
>
|
|
284
|
+
<i class="fa-regular fa-barcode-read"></i>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
<div
|
|
288
|
+
class="d-flex align-items-center justify-content-center w-100"
|
|
289
|
+
style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;"
|
|
290
|
+
>
|
|
291
|
+
<div
|
|
292
|
+
class="flex-fill"
|
|
293
|
+
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;text-align:center;"
|
|
294
|
+
onclick="${gvc.event(() => {
|
|
295
|
+
PayConfig.onPayment = undefined;
|
|
296
|
+
gvc.glitter.closeDiaLog();
|
|
297
|
+
})}"
|
|
298
|
+
>
|
|
299
|
+
取消
|
|
300
|
+
</div>
|
|
301
|
+
<div class="mx-2"></div>
|
|
302
|
+
<div
|
|
303
|
+
class="flex-fill"
|
|
304
|
+
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
|
|
305
|
+
onclick="${gvc.event(async () => {
|
|
306
|
+
if (!m_text) {
|
|
307
|
+
dialog.errorMessage({ text: '請輸入交易條碼' });
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
block = false;
|
|
311
|
+
PayConfig.onPayment!(m_text);
|
|
312
|
+
})}"
|
|
313
|
+
>
|
|
314
|
+
確定
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
`;
|
|
320
|
+
},
|
|
321
|
+
'orderFinish',
|
|
322
|
+
{
|
|
323
|
+
dismiss: () => {
|
|
324
|
+
// vm.type = "list";
|
|
325
|
+
gvc.glitter.share.scan_back = () => {};
|
|
326
|
+
},
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
}
|
|
154
330
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<img class="mt-3" style="max-width:70%;"
|
|
167
|
-
src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scsds7s8sbsfs3s8_b00f1f368f2a9b9fb067a844f940ca2a.gif"></img>
|
|
168
|
-
<div class="fw-500 w-100 mt-3"
|
|
169
|
-
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
|
|
170
|
-
onclick="${gvc.event(() => {
|
|
171
|
-
// clearTimeout(timer)
|
|
172
|
-
gvc.glitter.closeDiaLog();
|
|
173
|
-
})}">取消付款
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
`;
|
|
178
|
-
},
|
|
179
|
-
'orderFinish',
|
|
180
|
-
{
|
|
181
|
-
dismiss: () => {
|
|
182
|
-
// vm.type = "list";
|
|
183
|
-
},
|
|
184
|
-
}
|
|
185
|
-
);
|
|
186
|
-
}
|
|
331
|
+
public static customFinish(gvc: GVC, total: number, callback: (result: boolean) => void) {
|
|
332
|
+
gvc.addStyle(`
|
|
333
|
+
.dialog-box {
|
|
334
|
+
width: 100vw;
|
|
335
|
+
height: 100vh;
|
|
336
|
+
display: flex;
|
|
337
|
+
align-items: center;
|
|
338
|
+
justify-content: center;
|
|
339
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
340
|
+
z-index: 10000;
|
|
341
|
+
}
|
|
187
342
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
<div class="mx-2"></div>
|
|
274
|
-
<div
|
|
275
|
-
class="flex-fill"
|
|
276
|
-
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
|
|
277
|
-
onclick="${gvc.event(async () => {
|
|
278
|
-
if (!m_text) {
|
|
279
|
-
dialog.errorMessage({ text: '請輸入交易條碼' });
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
block = false;
|
|
283
|
-
PayConfig.onPayment!(m_text);
|
|
284
|
-
})}"
|
|
285
|
-
>
|
|
286
|
-
確定
|
|
287
|
-
</div>
|
|
288
|
-
</div>
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
`;
|
|
292
|
-
},
|
|
293
|
-
'orderFinish',
|
|
294
|
-
{
|
|
295
|
-
dismiss: () => {
|
|
296
|
-
// vm.type = "list";
|
|
297
|
-
gvc.glitter.share.scan_back = () => {};
|
|
298
|
-
},
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
}
|
|
343
|
+
.dialog-absolute {
|
|
344
|
+
width: 100%;
|
|
345
|
+
border-top: 1px solid #e2e5f1;
|
|
346
|
+
position: absolute;
|
|
347
|
+
left: 0px;
|
|
348
|
+
bottom: 0px;
|
|
349
|
+
height: 40px;
|
|
350
|
+
display: flex;
|
|
351
|
+
align-items: center;
|
|
352
|
+
justify-content: center;
|
|
353
|
+
cursor: pointer;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.hover-cancel {
|
|
357
|
+
background-color: #fff;
|
|
358
|
+
border-radius: 0 0 0 0.5rem;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.hover-cancel:hover {
|
|
362
|
+
background-color: #e6e6e6;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.hover-save {
|
|
366
|
+
background-color: #393939;
|
|
367
|
+
border-radius: 0 0 0.5rem;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.hover-save:hover {
|
|
371
|
+
background-color: #646464;
|
|
372
|
+
}
|
|
373
|
+
`);
|
|
374
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
375
|
+
gvc.glitter.innerDialog(
|
|
376
|
+
(gvc: GVC) => {
|
|
377
|
+
return html`
|
|
378
|
+
<div class="dialog-box">
|
|
379
|
+
<div class="dialog-content position-relative pb-5" style="width: 452px;max-width: calc(100% - 20px);">
|
|
380
|
+
<div
|
|
381
|
+
class="my-3 fs-6 fw-500 text-center"
|
|
382
|
+
style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
383
|
+
>
|
|
384
|
+
請先收取款項後進行結帳
|
|
385
|
+
</div>
|
|
386
|
+
<div
|
|
387
|
+
style="font-size: 18px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;"
|
|
388
|
+
>
|
|
389
|
+
本次結帳金額為
|
|
390
|
+
<span style="font-size: 28px;font-style: normal;font-weight: 700;line-height: 160%;"
|
|
391
|
+
>$${total.toLocaleString()}</span
|
|
392
|
+
>
|
|
393
|
+
</div>
|
|
394
|
+
<div
|
|
395
|
+
class="d-flex align-items-center justify-content-center"
|
|
396
|
+
style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;"
|
|
397
|
+
>
|
|
398
|
+
<div
|
|
399
|
+
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
|
|
400
|
+
onclick="${gvc.event(() => {
|
|
401
|
+
gvc.glitter.closeDiaLog();
|
|
402
|
+
})}"
|
|
403
|
+
>
|
|
404
|
+
取消
|
|
405
|
+
</div>
|
|
406
|
+
<div
|
|
407
|
+
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:120px;text-align:center;"
|
|
408
|
+
onclick="${gvc.event(() => {
|
|
409
|
+
gvc.closeDialog();
|
|
410
|
+
callback(true);
|
|
411
|
+
})}"
|
|
412
|
+
>
|
|
413
|
+
確認
|
|
414
|
+
</div>
|
|
415
|
+
</div>
|
|
416
|
+
</div>
|
|
417
|
+
</div>
|
|
418
|
+
`;
|
|
419
|
+
},
|
|
420
|
+
'orderFinish',
|
|
421
|
+
{
|
|
422
|
+
dismiss: () => {
|
|
423
|
+
// vm.type = "list";
|
|
424
|
+
},
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
}
|
|
302
428
|
}
|