ts-glitter 13.8.752 → 13.8.756
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 +6 -4
- package/lowcode/cms-plugin/POS-setting.ts +6 -5
- package/lowcode/cms-plugin/pos-pages/connection-mode.js +37 -6
- package/lowcode/cms-plugin/pos-pages/connection-mode.ts +47 -10
- package/lowcode/cms-plugin/pos-pages/lottie/connected.jpg +0 -0
- package/lowcode/cms-plugin/pos-pages/lottie/disconect.jpg +0 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +127 -104
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +245 -231
- package/lowcode/cms-plugin/pos-pages/products-page.js +1 -1
- package/lowcode/cms-plugin/pos-pages/products-page.ts +1 -1
- package/lowcode/glitterBundle/dialog/ShareDialog.js +1 -1
- package/lowcode/glitterBundle/dialog/ShareDialog.ts +3 -3
- package/package.json +1 -1
- package/src/services/web-socket.d.ts +1 -0
- package/src/services/web-socket.js +22 -0
- package/src/services/web-socket.js.map +1 -1
- package/src/services/web-socket.ts +31 -0
package/lowcode/Entry.js
CHANGED
|
@@ -68,7 +68,7 @@ export class Entry {
|
|
|
68
68
|
}
|
|
69
69
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
70
70
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
71
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
71
|
+
glitter.share.editerVersion = 'V_13.8.756';
|
|
72
72
|
glitter.share.start = new Date();
|
|
73
73
|
const vm = {
|
|
74
74
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -68,7 +68,7 @@ export class Entry {
|
|
|
68
68
|
}
|
|
69
69
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
70
70
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
71
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
71
|
+
glitter.share.editerVersion = 'V_13.8.756';
|
|
72
72
|
glitter.share.start = new Date();
|
|
73
73
|
const vm: {
|
|
74
74
|
appConfig: any;
|
|
@@ -685,12 +685,14 @@ cursor: pointer;
|
|
|
685
685
|
})().join('<div class="dropdown-divider"></div>')}
|
|
686
686
|
<div class="dropdown-divider"></div>
|
|
687
687
|
${[
|
|
688
|
-
|
|
688
|
+
...((PayConfig.deviceType === 'pos') ? [
|
|
689
|
+
html `
|
|
689
690
|
<a class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
690
691
|
style="gap:10px;"
|
|
691
692
|
onclick="${gvc.event(() => {
|
|
692
|
-
|
|
693
|
-
|
|
693
|
+
ConnectionMode.main(gvc);
|
|
694
|
+
})}"><i class="fa-solid fa-plug d-flex align-items-center justify-content-center" style="width:20px;" ></i>連線模式</a>`,
|
|
695
|
+
] : []),
|
|
694
696
|
...((ConnectionMode.on_connected_device) ? [
|
|
695
697
|
`<a class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
696
698
|
style="gap:10px;"
|
|
@@ -709,7 +711,7 @@ cursor: pointer;
|
|
|
709
711
|
});
|
|
710
712
|
})}"><i class="fa-solid fa-power-off d-flex align-items-center justify-content-center" style="width:20px;"></i>斷開裝置連線</a>`
|
|
711
713
|
] : [])
|
|
712
|
-
].concat(ConnectionMode.device_list.map((dd) => {
|
|
714
|
+
].concat(PayConfig.deviceType === 'pos' ? [] : ConnectionMode.device_list.map((dd) => {
|
|
713
715
|
return html `<a
|
|
714
716
|
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
715
717
|
style="gap:10px;"
|
|
@@ -744,13 +744,14 @@ cursor: pointer;
|
|
|
744
744
|
})().join('<div class="dropdown-divider"></div>')}
|
|
745
745
|
<div class="dropdown-divider"></div>
|
|
746
746
|
${[
|
|
747
|
-
|
|
747
|
+
...((PayConfig.deviceType==='pos') ? [
|
|
748
|
+
html`
|
|
748
749
|
<a class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
749
750
|
style="gap:10px;"
|
|
750
751
|
onclick="${gvc.event(() => {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
ConnectionMode.main(gvc)
|
|
753
|
+
})}"><i class="fa-solid fa-plug d-flex align-items-center justify-content-center" style="width:20px;" ></i>連線模式</a>`,
|
|
754
|
+
]:[]),
|
|
754
755
|
...((ConnectionMode.on_connected_device) ? [
|
|
755
756
|
`<a class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
756
757
|
style="gap:10px;"
|
|
@@ -770,7 +771,7 @@ cursor: pointer;
|
|
|
770
771
|
|
|
771
772
|
})}"><i class="fa-solid fa-power-off d-flex align-items-center justify-content-center" style="width:20px;"></i>斷開裝置連線</a>`
|
|
772
773
|
]:[])
|
|
773
|
-
].concat(ConnectionMode.device_list.map((dd) => {
|
|
774
|
+
].concat(PayConfig.deviceType==='pos' ? []:ConnectionMode.device_list.map((dd) => {
|
|
774
775
|
return html`<a
|
|
775
776
|
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
776
777
|
style="gap:10px;"
|
|
@@ -59,6 +59,8 @@ export class ConnectionMode {
|
|
|
59
59
|
switch (data.type) {
|
|
60
60
|
case 'on_connected':
|
|
61
61
|
vm.connected = true;
|
|
62
|
+
ConnectionMode.on_pare_device = data.connect_id;
|
|
63
|
+
console.log(`ConnectionMode.on_pare_device`, ConnectionMode.on_pare_device);
|
|
62
64
|
gvc.notifyDataChange(vm.id);
|
|
63
65
|
break;
|
|
64
66
|
case 'disconnect':
|
|
@@ -71,6 +73,15 @@ export class ConnectionMode {
|
|
|
71
73
|
case 'print_invoice':
|
|
72
74
|
IminModule.printInvoice(data.function.invoice, data.function.orderID, data.function.staff_title);
|
|
73
75
|
break;
|
|
76
|
+
case 'credit_card':
|
|
77
|
+
gvc.glitter.runJsInterFace('credit_card', {
|
|
78
|
+
amount: data.function.amount,
|
|
79
|
+
memo: data.function.memo
|
|
80
|
+
}, (res) => {
|
|
81
|
+
res.cmd = 'credit_card';
|
|
82
|
+
ConnectionMode.sendCommandToPaired(res);
|
|
83
|
+
});
|
|
84
|
+
break;
|
|
74
85
|
}
|
|
75
86
|
break;
|
|
76
87
|
}
|
|
@@ -90,15 +101,14 @@ export class ConnectionMode {
|
|
|
90
101
|
bind: vm.id,
|
|
91
102
|
view: () => {
|
|
92
103
|
return `<div class="dialog-content position-relative "
|
|
93
|
-
style="width: 370px;max-width: calc(100% - 20px);">
|
|
104
|
+
style="width: 370px;max-width: calc(100% - 20px);background: #f4f6f8;">
|
|
94
105
|
<div class="my-3 fw-500 text-center d-flex flex-column align-items-center justify-content-center"
|
|
95
106
|
style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;gap:10px;">
|
|
96
107
|
${vm.connected ? `裝置已成功配對` : `等待配對中`} \n
|
|
97
108
|
<span class="fs-6" style="color:gray;">配對ID : ${ConnectionMode.device_id}</span>
|
|
98
109
|
</div>
|
|
99
|
-
<
|
|
100
|
-
style="max-width:70%;"
|
|
101
|
-
autoplay></lottie-player>
|
|
110
|
+
<img src="${gvc.glitter.root_path}cms-plugin/pos-pages/lottie/${(vm.connected) ? `connected` : `disconect`}.jpg" class="mx-auto " speed="1"
|
|
111
|
+
style="max-width:70%;" ></img>
|
|
102
112
|
<div class="fw-500 w-100 mt-3"
|
|
103
113
|
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;cursor: pointer;"
|
|
104
114
|
onclick="${gvc.event(() => {
|
|
@@ -132,6 +142,7 @@ export class ConnectionMode {
|
|
|
132
142
|
});
|
|
133
143
|
}
|
|
134
144
|
static sendCommand(data) {
|
|
145
|
+
console.log(`send_to_pos`, data);
|
|
135
146
|
ConnectionMode.socket.send(JSON.stringify({
|
|
136
147
|
type: 'send_to_pos',
|
|
137
148
|
token: window.saasConfig.config.token,
|
|
@@ -141,6 +152,16 @@ export class ConnectionMode {
|
|
|
141
152
|
data: data
|
|
142
153
|
}));
|
|
143
154
|
}
|
|
155
|
+
static sendCommandToPaired(data) {
|
|
156
|
+
ConnectionMode.socket.send(JSON.stringify({
|
|
157
|
+
type: 'send_to_paired',
|
|
158
|
+
token: window.saasConfig.config.token,
|
|
159
|
+
app_name: window.appName,
|
|
160
|
+
device_id: ConnectionMode.device_id,
|
|
161
|
+
connect: ConnectionMode.on_pare_device,
|
|
162
|
+
data: data
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
144
165
|
static connect(id) {
|
|
145
166
|
ConnectionMode.last_connect_id = id;
|
|
146
167
|
const dialog = new ShareDialog(this.gvc.glitter);
|
|
@@ -189,16 +210,25 @@ export class ConnectionMode {
|
|
|
189
210
|
dialog.dataLoading({ visible: false });
|
|
190
211
|
ConnectionMode.on_connected_device = data.connect_id;
|
|
191
212
|
ConnectionMode.last_connect_id = data.connect_id;
|
|
192
|
-
|
|
213
|
+
gvc.glitter.closeDiaLog('disconnected');
|
|
214
|
+
dialog.successMessage({ text: '裝置配對成功' });
|
|
193
215
|
break;
|
|
194
216
|
case 'connected_false':
|
|
195
217
|
dialog.dataLoading({ visible: false });
|
|
196
218
|
dialog.errorMessage({ text: '配對失敗' });
|
|
197
219
|
break;
|
|
198
220
|
case 'disconnect':
|
|
199
|
-
dialog.errorMessage({ text: '裝置已斷線' });
|
|
221
|
+
dialog.errorMessage({ text: '裝置已斷線', tag: 'disconnected' });
|
|
200
222
|
ConnectionMode.on_connected_device = '';
|
|
201
223
|
break;
|
|
224
|
+
case 'function':
|
|
225
|
+
console.log(`收到命令:`, data.function);
|
|
226
|
+
switch (data.function.cmd) {
|
|
227
|
+
case 'credit_card':
|
|
228
|
+
gvc.glitter.share.credit_card_callback(data.function);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
202
232
|
}
|
|
203
233
|
});
|
|
204
234
|
});
|
|
@@ -223,6 +253,7 @@ export class ConnectionMode {
|
|
|
223
253
|
}
|
|
224
254
|
ConnectionMode.device_list = [];
|
|
225
255
|
ConnectionMode.on_connected_device = '';
|
|
256
|
+
ConnectionMode.on_pare_device = '';
|
|
226
257
|
function randomString(max) {
|
|
227
258
|
let possible = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
228
259
|
let text = possible.charAt(Math.floor(Math.random() * (possible.length - 10)));
|
|
@@ -41,7 +41,8 @@ export class ConnectionMode {
|
|
|
41
41
|
public static socket: any;
|
|
42
42
|
//已連線的裝置ID
|
|
43
43
|
public static on_connected_device = ''
|
|
44
|
-
|
|
44
|
+
//已配對的裝置UD
|
|
45
|
+
public static on_pare_device = ''
|
|
45
46
|
public static main(gvc: GVC) {
|
|
46
47
|
const html = String.raw
|
|
47
48
|
const url = new URL((window as any).glitterBackend)
|
|
@@ -72,7 +73,9 @@ export class ConnectionMode {
|
|
|
72
73
|
console.log(`getMessage:`, data)
|
|
73
74
|
switch (data.type) {
|
|
74
75
|
case 'on_connected':
|
|
75
|
-
vm.connected = true
|
|
76
|
+
vm.connected = true;
|
|
77
|
+
ConnectionMode.on_pare_device=data.connect_id;
|
|
78
|
+
console.log(`ConnectionMode.on_pare_device`,ConnectionMode.on_pare_device)
|
|
76
79
|
gvc.notifyDataChange(vm.id)
|
|
77
80
|
break
|
|
78
81
|
case 'disconnect':
|
|
@@ -80,10 +83,24 @@ export class ConnectionMode {
|
|
|
80
83
|
gvc.notifyDataChange(vm.id)
|
|
81
84
|
break
|
|
82
85
|
case 'function':
|
|
83
|
-
console.log(`收到命令:`,data.function)
|
|
86
|
+
console.log(`收到命令:`, data.function)
|
|
84
87
|
switch (data.function.cmd) {
|
|
85
88
|
case 'print_invoice':
|
|
86
|
-
IminModule.printInvoice(data.function.invoice,data.function.orderID,data.function.staff_title)
|
|
89
|
+
IminModule.printInvoice(data.function.invoice, data.function.orderID, data.function.staff_title)
|
|
90
|
+
break
|
|
91
|
+
case 'credit_card':
|
|
92
|
+
|
|
93
|
+
gvc.glitter.runJsInterFace(
|
|
94
|
+
'credit_card',
|
|
95
|
+
{
|
|
96
|
+
amount: data.function.amount,
|
|
97
|
+
memo: data.function.memo
|
|
98
|
+
},
|
|
99
|
+
(res: any) => {
|
|
100
|
+
res.cmd='credit_card'
|
|
101
|
+
ConnectionMode.sendCommandToPaired(res)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
87
104
|
break
|
|
88
105
|
}
|
|
89
106
|
break
|
|
@@ -104,15 +121,14 @@ export class ConnectionMode {
|
|
|
104
121
|
bind: vm.id,
|
|
105
122
|
view: () => {
|
|
106
123
|
return `<div class="dialog-content position-relative "
|
|
107
|
-
style="width: 370px;max-width: calc(100% - 20px);">
|
|
124
|
+
style="width: 370px;max-width: calc(100% - 20px);background: #f4f6f8;">
|
|
108
125
|
<div class="my-3 fw-500 text-center d-flex flex-column align-items-center justify-content-center"
|
|
109
126
|
style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;gap:10px;">
|
|
110
127
|
${vm.connected ? `裝置已成功配對` : `等待配對中`} \n
|
|
111
128
|
<span class="fs-6" style="color:gray;">配對ID : ${ConnectionMode.device_id}</span>
|
|
112
129
|
</div>
|
|
113
|
-
<
|
|
114
|
-
style="max-width:70%;"
|
|
115
|
-
autoplay></lottie-player>
|
|
130
|
+
<img src="${gvc.glitter.root_path}cms-plugin/pos-pages/lottie/${(vm.connected) ? `connected` : `disconect`}.jpg" class="mx-auto " speed="1"
|
|
131
|
+
style="max-width:70%;" ></img>
|
|
116
132
|
<div class="fw-500 w-100 mt-3"
|
|
117
133
|
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;cursor: pointer;"
|
|
118
134
|
onclick="${gvc.event(() => {
|
|
@@ -153,6 +169,7 @@ export class ConnectionMode {
|
|
|
153
169
|
}
|
|
154
170
|
|
|
155
171
|
public static sendCommand(data: any) {
|
|
172
|
+
console.log(`send_to_pos`,data)
|
|
156
173
|
ConnectionMode.socket.send(JSON.stringify({
|
|
157
174
|
type: 'send_to_pos',
|
|
158
175
|
token: (window as any).saasConfig.config.token,
|
|
@@ -163,6 +180,17 @@ export class ConnectionMode {
|
|
|
163
180
|
}))
|
|
164
181
|
}
|
|
165
182
|
|
|
183
|
+
public static sendCommandToPaired(data: any) {
|
|
184
|
+
ConnectionMode.socket.send(JSON.stringify({
|
|
185
|
+
type: 'send_to_paired',
|
|
186
|
+
token: (window as any).saasConfig.config.token,
|
|
187
|
+
app_name: (window as any).appName,
|
|
188
|
+
device_id: ConnectionMode.device_id,
|
|
189
|
+
connect: ConnectionMode.on_pare_device,
|
|
190
|
+
data: data
|
|
191
|
+
}))
|
|
192
|
+
}
|
|
193
|
+
|
|
166
194
|
public static connect(id: string) {
|
|
167
195
|
ConnectionMode.last_connect_id = id
|
|
168
196
|
const dialog = new ShareDialog(this.gvc.glitter)
|
|
@@ -212,16 +240,25 @@ export class ConnectionMode {
|
|
|
212
240
|
dialog.dataLoading({visible: false})
|
|
213
241
|
ConnectionMode.on_connected_device = data.connect_id
|
|
214
242
|
ConnectionMode.last_connect_id = data.connect_id
|
|
215
|
-
|
|
243
|
+
gvc.glitter.closeDiaLog('disconnected')
|
|
244
|
+
dialog.successMessage({text: '裝置配對成功'})
|
|
216
245
|
break
|
|
217
246
|
case 'connected_false':
|
|
218
247
|
dialog.dataLoading({visible: false})
|
|
219
248
|
dialog.errorMessage({text: '配對失敗'})
|
|
220
249
|
break
|
|
221
250
|
case 'disconnect':
|
|
222
|
-
dialog.errorMessage({text: '裝置已斷線'})
|
|
251
|
+
dialog.errorMessage({text: '裝置已斷線',tag:'disconnected'})
|
|
223
252
|
ConnectionMode.on_connected_device = ''
|
|
224
253
|
break
|
|
254
|
+
case 'function':
|
|
255
|
+
console.log(`收到命令:`, data.function)
|
|
256
|
+
switch (data.function.cmd){
|
|
257
|
+
case 'credit_card':
|
|
258
|
+
gvc.glitter.share.credit_card_callback(data.function)
|
|
259
|
+
break
|
|
260
|
+
}
|
|
261
|
+
break
|
|
225
262
|
}
|
|
226
263
|
|
|
227
264
|
});
|
|
Binary file
|
|
Binary file
|
|
@@ -1204,20 +1204,46 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1204
1204
|
function next() {
|
|
1205
1205
|
PaymentPage.selectInvoice(gvc, orderDetail, vm, passData);
|
|
1206
1206
|
}
|
|
1207
|
+
console.log(`orderDetail=>`, orderDetail);
|
|
1207
1208
|
gvc.glitter.innerDialog((gvc) => {
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1209
|
+
if (PayConfig.deviceType === 'pos') {
|
|
1210
|
+
gvc.glitter.runJsInterFace('credit_card', {
|
|
1211
|
+
amount: `${orderDetail.total}`,
|
|
1212
|
+
memo: `訂單ID:${orderDetail.orderID}`,
|
|
1213
|
+
}, (res) => {
|
|
1214
|
+
if (res.result) {
|
|
1215
|
+
gvc.closeDialog();
|
|
1216
|
+
next();
|
|
1217
|
+
}
|
|
1218
|
+
else {
|
|
1219
|
+
gvc.closeDialog();
|
|
1220
|
+
dialog.errorMessage({ text: '交易失敗' });
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
else if (ConnectionMode.on_connected_device) {
|
|
1225
|
+
gvc.glitter.share.credit_card_callback = (res) => {
|
|
1226
|
+
if (res.result) {
|
|
1227
|
+
gvc.closeDialog();
|
|
1228
|
+
next();
|
|
1229
|
+
}
|
|
1230
|
+
else {
|
|
1231
|
+
gvc.closeDialog();
|
|
1232
|
+
dialog.errorMessage({ text: '交易失敗' });
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
ConnectionMode.sendCommand({
|
|
1236
|
+
cmd: 'credit_card',
|
|
1237
|
+
amount: `${orderDetail.total}`,
|
|
1238
|
+
memo: `訂單ID:${orderDetail.orderID}`,
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
else {
|
|
1242
|
+
setTimeout(() => {
|
|
1217
1243
|
gvc.closeDialog();
|
|
1218
|
-
dialog.errorMessage({ text: '
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1244
|
+
dialog.errorMessage({ text: '尚未連線Imin裝置' });
|
|
1245
|
+
}, 100);
|
|
1246
|
+
}
|
|
1221
1247
|
return html `
|
|
1222
1248
|
<div class="dialog-box">
|
|
1223
1249
|
<div class="dialog-content position-relative "
|
|
@@ -1608,50 +1634,50 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1608
1634
|
vm.type = 'menu';
|
|
1609
1635
|
gvc.glitter.innerDialog((gvc) => {
|
|
1610
1636
|
return html `
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1637
|
+
<div
|
|
1638
|
+
class="w-100 h-100 d-flex align-items-center justify-content-center"
|
|
1639
|
+
onclick="${gvc.event(() => {
|
|
1614
1640
|
gvc.closeDialog();
|
|
1615
1641
|
})}"
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1642
|
+
>
|
|
1643
|
+
<div
|
|
1644
|
+
style="position: relative;max-width:calc(100% - 20px);width: 492px;height: 223px;border-radius: 10px;background: #FFF;display: flex;flex-direction: column;align-items: center;justify-content: center;"
|
|
1645
|
+
>
|
|
1646
|
+
<svg
|
|
1647
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1648
|
+
width="14"
|
|
1649
|
+
height="14"
|
|
1650
|
+
viewBox="0 0 14 14"
|
|
1651
|
+
fill="none"
|
|
1652
|
+
style="position: absolute;top: 12px;right: 12px;cursor: pointer;"
|
|
1653
|
+
onclick="${gvc.event(() => {
|
|
1628
1654
|
gvc.glitter.closeDiaLog();
|
|
1629
1655
|
})}"
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1656
|
+
>
|
|
1657
|
+
<path d="M1 1L13 13" stroke="#393939" stroke-linecap="round"/>
|
|
1658
|
+
<path d="M13 1L1 13" stroke="#393939" stroke-linecap="round"/>
|
|
1659
|
+
</svg>
|
|
1634
1660
|
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1661
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="75" height="75"
|
|
1662
|
+
viewBox="0 0 75 75" fill="none">
|
|
1663
|
+
<g clip-path="url(#clip0_9850_171427)">
|
|
1664
|
+
<path
|
|
1665
|
+
d="M37.5 7.03125C45.5808 7.03125 53.3307 10.2413 59.0447 15.9553C64.7587 21.6693 67.9688 29.4192 67.9688 37.5C67.9688 45.5808 64.7587 53.3307 59.0447 59.0447C53.3307 64.7587 45.5808 67.9688 37.5 67.9688C29.4192 67.9688 21.6693 64.7587 15.9553 59.0447C10.2413 53.3307 7.03125 45.5808 7.03125 37.5C7.03125 29.4192 10.2413 21.6693 15.9553 15.9553C21.6693 10.2413 29.4192 7.03125 37.5 7.03125ZM37.5 75C47.4456 75 56.9839 71.0491 64.0165 64.0165C71.0491 56.9839 75 47.4456 75 37.5C75 27.5544 71.0491 18.0161 64.0165 10.9835C56.9839 3.95088 47.4456 0 37.5 0C27.5544 0 18.0161 3.95088 10.9835 10.9835C3.95088 18.0161 0 27.5544 0 37.5C0 47.4456 3.95088 56.9839 10.9835 64.0165C18.0161 71.0491 27.5544 75 37.5 75ZM54.0527 30.6152C55.4297 29.2383 55.4297 27.0117 54.0527 25.6494C52.6758 24.2871 50.4492 24.2725 49.0869 25.6494L32.8271 41.9092L25.9424 35.0244C24.5654 33.6475 22.3389 33.6475 20.9766 35.0244C19.6143 36.4014 19.5996 38.6279 20.9766 39.9902L30.3516 49.3652C31.7285 50.7422 33.9551 50.7422 35.3174 49.3652L54.0527 30.6152Z"
|
|
1666
|
+
fill="#393939"
|
|
1667
|
+
/>
|
|
1668
|
+
</g>
|
|
1669
|
+
<defs>
|
|
1670
|
+
<clipPath id="clip0_9850_171427">
|
|
1671
|
+
<rect width="75" height="75" fill="white"/>
|
|
1672
|
+
</clipPath>
|
|
1673
|
+
</defs>
|
|
1674
|
+
</svg>
|
|
1675
|
+
<div style="text-align: center;color: #393939;font-size: 16px;font-weight: 400;line-height: 160%;margin-top: 24px;">
|
|
1676
|
+
訂單新增成功!
|
|
1677
|
+
</div>
|
|
1678
|
+
</div>
|
|
1651
1679
|
</div>
|
|
1652
|
-
|
|
1653
|
-
</div>
|
|
1654
|
-
`;
|
|
1680
|
+
`;
|
|
1655
1681
|
}, 'orderFinish', {
|
|
1656
1682
|
dismiss: () => {
|
|
1657
1683
|
},
|
|
@@ -1659,36 +1685,33 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1659
1685
|
}
|
|
1660
1686
|
}));
|
|
1661
1687
|
}
|
|
1662
|
-
if ((yield ApiShop
|
|
1663
|
-
.
|
|
1664
|
-
getInvoiceType()).
|
|
1665
|
-
response
|
|
1666
|
-
.
|
|
1667
|
-
method
|
|
1668
|
-
===
|
|
1669
|
-
'nouse') {
|
|
1688
|
+
if ((yield ApiShop.getInvoiceType()).response.method === 'nouse') {
|
|
1670
1689
|
c_vm
|
|
1671
|
-
.
|
|
1672
|
-
invoice_select = 'nouse';
|
|
1690
|
+
.invoice_select = 'nouse';
|
|
1673
1691
|
next();
|
|
1674
1692
|
}
|
|
1675
1693
|
else {
|
|
1694
|
+
if ((PayConfig.deviceType !== 'pos' && !ConnectionMode.on_connected_device) && (orderDetail.user_info.email === 'no-email')) {
|
|
1695
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
1696
|
+
dialog.errorMessage({ text: '請選擇會員' });
|
|
1697
|
+
return;
|
|
1698
|
+
}
|
|
1676
1699
|
gvc.glitter.innerDialog((gvc) => {
|
|
1677
1700
|
return html `
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1701
|
+
<div class="dialog-box">
|
|
1702
|
+
<div class="dialog-content position-relative"
|
|
1703
|
+
style="width: 452px;max-width: calc(100% - 20px);">
|
|
1704
|
+
<div
|
|
1705
|
+
class="mb-3 fs-6 fw-500 text-center"
|
|
1706
|
+
style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
|
|
1707
|
+
>
|
|
1708
|
+
選擇發票開立方式
|
|
1709
|
+
</div>
|
|
1710
|
+
<div class="d-flex align-items-center w-100">
|
|
1711
|
+
${(() => {
|
|
1689
1712
|
let btnArray = [
|
|
1690
1713
|
{
|
|
1691
|
-
title: PayConfig.deviceType === 'pos' ? `列印` : `寄送`,
|
|
1714
|
+
title: (PayConfig.deviceType === 'pos' || ConnectionMode.on_connected_device) ? `列印` : `寄送`,
|
|
1692
1715
|
value: 'print',
|
|
1693
1716
|
icon: `<i class="fa-regular fa-print"></i>`,
|
|
1694
1717
|
},
|
|
@@ -1706,29 +1729,29 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1706
1729
|
return btnArray
|
|
1707
1730
|
.map((btn) => {
|
|
1708
1731
|
return html `
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1732
|
+
<div
|
|
1733
|
+
class="flex-fill"
|
|
1734
|
+
style="display: flex;flex-direction: column;justify-content: center;align-items: center;padding: 20px;border-radius: 10px;background: #F6F6F6;${c_vm.invoice_select ==
|
|
1712
1735
|
btn.value
|
|
1713
1736
|
? `color:#393939;border-radius: 10px;border: 3px solid #393939;box-shadow: 2px 2px 15px 0px rgba(0, 0, 0, 0.20);`
|
|
1714
1737
|
: 'color:#8D8D8D;'}"
|
|
1715
|
-
|
|
1738
|
+
onclick="${gvc.event(() => {
|
|
1716
1739
|
c_vm.invoice_select = btn.value;
|
|
1717
1740
|
c_vm.value = '';
|
|
1718
1741
|
gvc.recreateView();
|
|
1719
1742
|
})}"
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1743
|
+
>
|
|
1744
|
+
<div style="" class="fs-2">${btn.icon}</div>
|
|
1745
|
+
<div style="font-size: 16px;font-weight: 500;letter-spacing: 0.64px;">
|
|
1746
|
+
${btn.title}
|
|
1747
|
+
</div>
|
|
1748
|
+
</div>
|
|
1749
|
+
`;
|
|
1727
1750
|
})
|
|
1728
1751
|
.join('<div class="mx-2"></div>');
|
|
1729
1752
|
})()}
|
|
1730
|
-
|
|
1731
|
-
|
|
1753
|
+
</div>
|
|
1754
|
+
${(() => {
|
|
1732
1755
|
if (c_vm.invoice_select === 'carry') {
|
|
1733
1756
|
return `<div class="d-flex w-100 align-items-center mt-3" style="border:1px solid grey;height: 50px;">
|
|
1734
1757
|
<input class="form-control h-100" style="border: none;" placeholder="請輸入或掃描載具" oninput="${gvc.event((e, event) => {
|
|
@@ -1765,31 +1788,31 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1765
1788
|
return ``;
|
|
1766
1789
|
}
|
|
1767
1790
|
})()}
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1791
|
+
<div class="d-flex align-items-center justify-content-center w-100"
|
|
1792
|
+
style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
|
|
1793
|
+
<div
|
|
1794
|
+
class="flex-fill"
|
|
1795
|
+
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;text-align:center;"
|
|
1796
|
+
onclick="${gvc.event(() => {
|
|
1774
1797
|
gvc.glitter.closeDiaLog();
|
|
1775
1798
|
})}"
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1799
|
+
>
|
|
1800
|
+
取消
|
|
1801
|
+
</div>
|
|
1802
|
+
<div class="mx-2"></div>
|
|
1803
|
+
<div
|
|
1804
|
+
class="flex-fill"
|
|
1805
|
+
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
|
|
1806
|
+
onclick="${gvc.event(() => {
|
|
1784
1807
|
next();
|
|
1785
1808
|
})}"
|
|
1786
|
-
|
|
1787
|
-
|
|
1809
|
+
>
|
|
1810
|
+
確定
|
|
1811
|
+
</div>
|
|
1812
|
+
</div>
|
|
1788
1813
|
</div>
|
|
1789
1814
|
</div>
|
|
1790
|
-
|
|
1791
|
-
</div>
|
|
1792
|
-
`;
|
|
1815
|
+
`;
|
|
1793
1816
|
}, 'selectInvoice', {
|
|
1794
1817
|
dismiss: () => {
|
|
1795
1818
|
gvc.glitter.share.scan_back = () => {
|