ts-glitter 13.8.62 → 13.8.63
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 +5 -2
- package/lowcode/Entry.ts +5 -11
- package/lowcode/cms-plugin/POS-setting.js +28 -19
- package/lowcode/cms-plugin/POS-setting.ts +33 -22
- package/lowcode/cms-plugin/pos-pages/payment-page.js +126 -107
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +149 -124
- package/lowcode/cms-plugin/shopping-order-manager.js +1 -1
- package/lowcode/cms-plugin/shopping-order-manager.ts +1 -1
- package/lowcode/jslib/qrcode.min.js +1 -0
- package/lowcode/public-components/footer/footer-01.js +179 -0
- package/lowcode/public-components/footer/footer-01.ts +183 -0
- package/lowcode/public-components/footer/footer-02.js +178 -0
- package/lowcode/public-components/footer/footer-02.ts +181 -0
- package/lowcode/public-components/footer/footer-03.js +180 -0
- package/lowcode/public-components/footer/footer-03.ts +183 -0
- package/lowcode/public-components/footer/ft-class.js +13 -0
- package/lowcode/public-components/footer/ft-class.ts +15 -0
- package/lowcode/public-components/product/pd-card-01.js +3 -3
- package/lowcode/public-components/product/pd-card-01.ts +2 -2
- package/lowcode/public-components/product/pd-card-02.js +3 -3
- package/lowcode/public-components/product/pd-card-02.ts +2 -2
- package/lowcode/public-components/product/pd-card-03.js +3 -3
- package/lowcode/public-components/product/pd-card-03.ts +2 -2
- package/package.json +1 -1
- package/src/api-public/controllers/ai-chat.js.map +1 -5
- package/src/api-public/controllers/app-release.js.map +1 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/post.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/EcInvoice.js.map +1 -1
- package/src/api-public/services/ai-robot.d.ts +1 -0
- package/src/api-public/services/ai-robot.js.map +1 -5
- package/src/api-public/services/chat.js.map +1 -1
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/shopping.js.map +3 -3
- package/src/api-public/services/user.js.map +1 -1
- package/src/index.js +3 -3
- package/src/index.js.map +1 -5
package/lowcode/Entry.js
CHANGED
|
@@ -64,7 +64,7 @@ export class Entry {
|
|
|
64
64
|
}
|
|
65
65
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
66
66
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
67
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
67
|
+
glitter.share.editerVersion = 'V_13.8.63';
|
|
68
68
|
glitter.share.start = new Date();
|
|
69
69
|
const vm = {
|
|
70
70
|
appConfig: [],
|
|
@@ -202,6 +202,9 @@ export class Entry {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
static toBackendEditor(glitter, callback) {
|
|
205
|
+
if (localStorage.getItem('on-pos') === 'true') {
|
|
206
|
+
location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
|
|
207
|
+
}
|
|
205
208
|
glitter.addStyle(`
|
|
206
209
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');
|
|
207
210
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -234,7 +237,7 @@ export class Entry {
|
|
|
234
237
|
'assets/vendor/swiper/swiper-bundle.min.js',
|
|
235
238
|
'assets/js/theme.min.js',
|
|
236
239
|
'https://kit.fontawesome.com/cccedec0f8.js',
|
|
237
|
-
'https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js'
|
|
240
|
+
'https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js',
|
|
238
241
|
], () => {
|
|
239
242
|
resolve(true);
|
|
240
243
|
}, () => {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -9,7 +9,6 @@ import { ShareDialog } from './glitterBundle/dialog/ShareDialog.js';
|
|
|
9
9
|
|
|
10
10
|
export class Entry {
|
|
11
11
|
public static onCreate(glitter: Glitter) {
|
|
12
|
-
|
|
13
12
|
glitter.share.top_inset = 0;
|
|
14
13
|
glitter.share.bottom_inset = 0;
|
|
15
14
|
glitter.share.reload_code_hash = function () {
|
|
@@ -65,7 +64,7 @@ export class Entry {
|
|
|
65
64
|
}
|
|
66
65
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
67
66
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
68
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
67
|
+
glitter.share.editerVersion = 'V_13.8.63';
|
|
69
68
|
glitter.share.start = new Date();
|
|
70
69
|
const vm: {
|
|
71
70
|
appConfig: any;
|
|
@@ -216,6 +215,9 @@ export class Entry {
|
|
|
216
215
|
|
|
217
216
|
// 跳轉至頁面編輯器
|
|
218
217
|
public static toBackendEditor(glitter: Glitter, callback: () => void) {
|
|
218
|
+
if(localStorage.getItem('on-pos')==='true'){
|
|
219
|
+
location.href=glitter.root_path+'pos?app-id=t_1725992531001'
|
|
220
|
+
}
|
|
219
221
|
glitter.addStyle(`
|
|
220
222
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');
|
|
221
223
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -240,15 +242,7 @@ export class Entry {
|
|
|
240
242
|
'https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/monolith.min.css',
|
|
241
243
|
'https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/nano.min.css',
|
|
242
244
|
]);
|
|
243
|
-
// <script src="https://cdnjs.cloudflare.com/ajax/libs/mui/3.7.1/js/mui.min.js"
|
|
244
|
-
// integrity="sha512-5LSZkoyayM01bXhnlp2T6+RLFc+dE4SIZofQMxy/ydOs3D35mgQYf6THIQrwIMmgoyjI+bqjuuj4fQcGLyJFYg=="
|
|
245
|
-
// crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
246
|
-
// <script type="text/javascript" src="https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js"></script>
|
|
247
|
-
// <script src="//oss-sg.imin.sg/web/iMinPartner2/js/jquery.min.js"></script>
|
|
248
|
-
// <script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.9.1/vconsole.min.js"></script>
|
|
249
245
|
await new Promise((resolve, reject) => {
|
|
250
|
-
|
|
251
|
-
|
|
252
246
|
glitter.addMtScript(
|
|
253
247
|
[
|
|
254
248
|
'jslib/pickr.min.js',
|
|
@@ -257,7 +251,7 @@ export class Entry {
|
|
|
257
251
|
'assets/vendor/swiper/swiper-bundle.min.js',
|
|
258
252
|
'assets/js/theme.min.js',
|
|
259
253
|
'https://kit.fontawesome.com/cccedec0f8.js',
|
|
260
|
-
'https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js'
|
|
254
|
+
'https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js',
|
|
261
255
|
],
|
|
262
256
|
() => {
|
|
263
257
|
resolve(true);
|
|
@@ -156,26 +156,28 @@ height: 51px;
|
|
|
156
156
|
}
|
|
157
157
|
static main(gvc) {
|
|
158
158
|
const glitter = gvc.glitter;
|
|
159
|
-
|
|
160
|
-
const script = document.createElement('script');
|
|
161
|
-
script.type = 'text/javascript';
|
|
162
|
-
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mui/3.7.1/js/mui.min.js';
|
|
163
|
-
script.integrity = 'sha512-5LSZkoyayM01bXhnlp2T6+RLFc+dE4SIZofQMxy/ydOs3D35mgQYf6THIQrwIMmgoyjI+bqjuuj4fQcGLyJFYg==';
|
|
164
|
-
script.referrerPolicy = 'no-referrer';
|
|
165
|
-
script.crossOrigin = 'anonymous';
|
|
166
|
-
document.head.appendChild(script);
|
|
167
|
-
}
|
|
168
|
-
glitter.addMtScript([
|
|
169
|
-
'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js'
|
|
170
|
-
], () => {
|
|
171
|
-
}, () => {
|
|
172
|
-
});
|
|
173
|
-
setTimeout(() => {
|
|
174
|
-
window.IminPrintInstance = new IminPrinter();
|
|
175
|
-
window.IminPrintInstance.connect();
|
|
176
|
-
}, 3000);
|
|
159
|
+
localStorage.setItem('on-pos', 'true');
|
|
177
160
|
gvc.glitter.runJsInterFace("pos-device", {}, (res) => {
|
|
178
|
-
PayConfig.deviceType = res.deviceType
|
|
161
|
+
PayConfig.deviceType = res.deviceType === 'neostra' ? 'pos' : 'web';
|
|
162
|
+
if (PayConfig.deviceType === 'pos') {
|
|
163
|
+
const script = document.createElement('script');
|
|
164
|
+
script.type = 'text/javascript';
|
|
165
|
+
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mui/3.7.1/js/mui.min.js';
|
|
166
|
+
script.integrity = 'sha512-5LSZkoyayM01bXhnlp2T6+RLFc+dE4SIZofQMxy/ydOs3D35mgQYf6THIQrwIMmgoyjI+bqjuuj4fQcGLyJFYg==';
|
|
167
|
+
script.referrerPolicy = 'no-referrer';
|
|
168
|
+
script.crossOrigin = 'anonymous';
|
|
169
|
+
document.head.appendChild(script);
|
|
170
|
+
glitter.addMtScript([
|
|
171
|
+
'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
|
|
172
|
+
'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js'
|
|
173
|
+
], () => {
|
|
174
|
+
}, () => {
|
|
175
|
+
});
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
window.IminPrintInstance = new IminPrinter();
|
|
178
|
+
window.IminPrintInstance.connect();
|
|
179
|
+
}, 3000);
|
|
180
|
+
}
|
|
179
181
|
});
|
|
180
182
|
gvc.addStyle(`
|
|
181
183
|
.dialog-box {
|
|
@@ -437,6 +439,7 @@ cursor: pointer;
|
|
|
437
439
|
const select_member = (_a = member_auth.find((dd) => {
|
|
438
440
|
return dd.config.member_id === POSSetting.config.who;
|
|
439
441
|
})) !== null && _a !== void 0 ? _a : { config: { title: '管理員', name: 'manager' } };
|
|
442
|
+
glitter.share.staff_title = select_member.config.name === 'manager' ? `BOSS` : POSSetting.config.who;
|
|
440
443
|
resolve(`<div class="h-100 group dropdown border-start ps-1 d-flex align-items-center" style="" >
|
|
441
444
|
<div class=" btn btn-outline-secondary border-0 p-1 position-relative" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
442
445
|
<div class="d-flex align-items-center px-2" style="gap:5px;">
|
|
@@ -553,6 +556,12 @@ cursor: pointer;
|
|
|
553
556
|
}
|
|
554
557
|
return view;
|
|
555
558
|
})().join('<div class="dropdown-divider"></div>')}
|
|
559
|
+
${(POSSetting.config.who === 'manager') ? `<div class="dropdown-divider"></div>
|
|
560
|
+
<a class="dropdown-item cursor_pointer d-flex flex-column" onclick="${gvc.event(() => {
|
|
561
|
+
localStorage.removeItem('on-pos');
|
|
562
|
+
location.href = `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`;
|
|
563
|
+
})}">返回全通路後臺</a>
|
|
564
|
+
` : ``}
|
|
556
565
|
</div>
|
|
557
566
|
</div>`);
|
|
558
567
|
}));
|
|
@@ -184,30 +184,34 @@ height: 51px;
|
|
|
184
184
|
|
|
185
185
|
public static main(gvc: GVC) {
|
|
186
186
|
const glitter = gvc.glitter
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
script.type = 'text/javascript';
|
|
190
|
-
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mui/3.7.1/js/mui.min.js';
|
|
191
|
-
script.integrity = 'sha512-5LSZkoyayM01bXhnlp2T6+RLFc+dE4SIZofQMxy/ydOs3D35mgQYf6THIQrwIMmgoyjI+bqjuuj4fQcGLyJFYg=='
|
|
192
|
-
script.referrerPolicy = 'no-referrer'
|
|
193
|
-
script.crossOrigin = 'anonymous'
|
|
194
|
-
// 当脚本加载完成后执行回调函数
|
|
195
|
-
document.head.appendChild(script);
|
|
196
|
-
}
|
|
197
|
-
glitter.addMtScript([
|
|
198
|
-
'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js'
|
|
199
|
-
], () => {
|
|
200
|
-
}, () => {
|
|
201
|
-
})
|
|
202
|
-
setTimeout(()=>{
|
|
203
|
-
//@ts-ignore
|
|
204
|
-
window.IminPrintInstance = new IminPrinter();
|
|
205
|
-
//@ts-ignore
|
|
206
|
-
window.IminPrintInstance.connect()
|
|
207
|
-
},3000)
|
|
187
|
+
localStorage.setItem('on-pos','true')
|
|
188
|
+
// https://unpkg.com/html5-qrcode/minified/html5-qrcode.min.js
|
|
208
189
|
//設定裝置類型
|
|
209
190
|
gvc.glitter.runJsInterFace("pos-device", {}, (res) => {
|
|
210
|
-
PayConfig.deviceType = res.deviceType
|
|
191
|
+
PayConfig.deviceType = res.deviceType === 'neostra' ? 'pos' : 'web';
|
|
192
|
+
//POS機台啟用列印功能
|
|
193
|
+
if (PayConfig.deviceType === 'pos') {
|
|
194
|
+
const script = document.createElement('script');
|
|
195
|
+
script.type = 'text/javascript';
|
|
196
|
+
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mui/3.7.1/js/mui.min.js';
|
|
197
|
+
script.integrity = 'sha512-5LSZkoyayM01bXhnlp2T6+RLFc+dE4SIZofQMxy/ydOs3D35mgQYf6THIQrwIMmgoyjI+bqjuuj4fQcGLyJFYg=='
|
|
198
|
+
script.referrerPolicy = 'no-referrer'
|
|
199
|
+
script.crossOrigin = 'anonymous'
|
|
200
|
+
// 当脚本加载完成后执行回调函数
|
|
201
|
+
document.head.appendChild(script);
|
|
202
|
+
glitter.addMtScript([
|
|
203
|
+
'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
|
|
204
|
+
'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js'
|
|
205
|
+
], () => {
|
|
206
|
+
}, () => {
|
|
207
|
+
})
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
//@ts-ignore
|
|
210
|
+
window.IminPrintInstance = new IminPrinter();
|
|
211
|
+
//@ts-ignore
|
|
212
|
+
window.IminPrintInstance.connect()
|
|
213
|
+
}, 3000)
|
|
214
|
+
}
|
|
211
215
|
})
|
|
212
216
|
gvc.addStyle(`
|
|
213
217
|
.dialog-box {
|
|
@@ -478,6 +482,7 @@ cursor: pointer;
|
|
|
478
482
|
const select_member = member_auth.find((dd: any) => {
|
|
479
483
|
return dd.config.member_id === POSSetting.config.who
|
|
480
484
|
}) ?? {config: {title: '管理員', name: 'manager'}}
|
|
485
|
+
glitter.share.staff_title = select_member.config.name === 'manager' ? `BOSS` : POSSetting.config.who
|
|
481
486
|
// POSSetting.login(gvc);
|
|
482
487
|
resolve(`<div class="h-100 group dropdown border-start ps-1 d-flex align-items-center" style="" >
|
|
483
488
|
<div class=" btn btn-outline-secondary border-0 p-1 position-relative" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
@@ -597,6 +602,12 @@ cursor: pointer;
|
|
|
597
602
|
}
|
|
598
603
|
return view
|
|
599
604
|
})().join('<div class="dropdown-divider"></div>')}
|
|
605
|
+
${(POSSetting.config.who==='manager') ? `<div class="dropdown-divider"></div>
|
|
606
|
+
<a class="dropdown-item cursor_pointer d-flex flex-column" onclick="${gvc.event(()=>{
|
|
607
|
+
localStorage.removeItem('on-pos')
|
|
608
|
+
location.href=`${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`
|
|
609
|
+
})}">返回全通路後臺</a>
|
|
610
|
+
`:``}
|
|
600
611
|
</div>
|
|
601
612
|
</div>`)
|
|
602
613
|
})
|
|
@@ -1271,11 +1271,6 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
});
|
|
1273
1273
|
}
|
|
1274
|
-
gvc.glitter.share.scan_back = (text) => {
|
|
1275
|
-
c_vm.value = text;
|
|
1276
|
-
gvc.recreateView();
|
|
1277
|
-
next();
|
|
1278
|
-
};
|
|
1279
1274
|
return html `
|
|
1280
1275
|
<div class="dialog-box">
|
|
1281
1276
|
<div class="dialog-content position-relative "
|
|
@@ -1307,7 +1302,10 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1307
1302
|
style="background: grey;width: 50px;"
|
|
1308
1303
|
class="d-flex align-items-center justify-content-center text-white h-100"
|
|
1309
1304
|
onclick="${gvc.event(() => {
|
|
1310
|
-
gvc.glitter.runJsInterFace('start_scan', {}, () => {
|
|
1305
|
+
gvc.glitter.runJsInterFace('start_scan', {}, (res) => {
|
|
1306
|
+
c_vm.value = res.text;
|
|
1307
|
+
gvc.recreateView();
|
|
1308
|
+
next();
|
|
1311
1309
|
});
|
|
1312
1310
|
})}"
|
|
1313
1311
|
>
|
|
@@ -1365,11 +1363,6 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1365
1363
|
}
|
|
1366
1364
|
});
|
|
1367
1365
|
}
|
|
1368
|
-
gvc.glitter.share.scan_back = (text) => {
|
|
1369
|
-
c_vm.value = text;
|
|
1370
|
-
gvc.recreateView();
|
|
1371
|
-
next();
|
|
1372
|
-
};
|
|
1373
1366
|
return html `
|
|
1374
1367
|
<div class="dialog-box">
|
|
1375
1368
|
<div class="dialog-content position-relative "
|
|
@@ -1401,7 +1394,10 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1401
1394
|
style="background: grey;width: 50px;"
|
|
1402
1395
|
class="d-flex align-items-center justify-content-center text-white h-100"
|
|
1403
1396
|
onclick="${gvc.event(() => {
|
|
1404
|
-
gvc.glitter.runJsInterFace('start_scan', {}, () => {
|
|
1397
|
+
gvc.glitter.runJsInterFace('start_scan', {}, (res) => {
|
|
1398
|
+
c_vm.value = res.text;
|
|
1399
|
+
gvc.recreateView();
|
|
1400
|
+
next();
|
|
1405
1401
|
});
|
|
1406
1402
|
})}"
|
|
1407
1403
|
>
|
|
@@ -1588,43 +1584,118 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1588
1584
|
command_line.push({ cmd, data, callback });
|
|
1589
1585
|
}
|
|
1590
1586
|
if (type === 'client') {
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1587
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
1588
|
+
const IminPrintInstance = window.IminPrintInstance;
|
|
1589
|
+
function generateBarcodeBase64(barcodeString) {
|
|
1590
|
+
const canvas = document.createElement("canvas");
|
|
1591
|
+
JsBarcode(canvas, barcodeString, {
|
|
1592
|
+
format: "CODE128",
|
|
1593
|
+
lineColor: "#000000",
|
|
1594
|
+
width: 2,
|
|
1595
|
+
height: 50,
|
|
1596
|
+
displayValue: false
|
|
1597
|
+
});
|
|
1598
|
+
const base64String = canvas.toDataURL("image/png");
|
|
1599
|
+
console.log("Base64 Barcode:", base64String);
|
|
1600
|
+
return base64String;
|
|
1601
|
+
}
|
|
1602
|
+
yield IminPrintInstance.setAlignment(1);
|
|
1603
|
+
yield IminPrintInstance.setTextSize(50);
|
|
1604
|
+
yield IminPrintInstance.setTextStyle(1);
|
|
1605
|
+
yield IminPrintInstance.printText(PayConfig.pos_config.shop_name);
|
|
1606
|
+
yield IminPrintInstance.printAndFeedPaper(20);
|
|
1607
|
+
yield IminPrintInstance.setAlignment(1);
|
|
1608
|
+
yield IminPrintInstance.setTextSize(40);
|
|
1609
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1610
|
+
yield IminPrintInstance.printText('電子發票證明聯');
|
|
1611
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1612
|
+
yield IminPrintInstance.setAlignment(1);
|
|
1613
|
+
yield IminPrintInstance.setTextSize(50);
|
|
1614
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1615
|
+
yield IminPrintInstance.printText(invoice.date);
|
|
1616
|
+
yield IminPrintInstance.setAlignment(1);
|
|
1617
|
+
yield IminPrintInstance.setTextSize(50);
|
|
1618
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1619
|
+
yield IminPrintInstance.printText(invoice.invoice_code);
|
|
1620
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1621
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1622
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1623
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1624
|
+
yield IminPrintInstance.printText(invoice.create_date);
|
|
1625
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1626
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1627
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1628
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1629
|
+
yield IminPrintInstance.printText(`${invoice.random_code} ${invoice.total}`);
|
|
1630
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1631
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1632
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1633
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1634
|
+
yield IminPrintInstance.printText(`${invoice.sale_gui} ${invoice.buy_gui}`);
|
|
1635
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1636
|
+
IminPrintInstance.printSingleBitmap(generateBarcodeBase64(invoice.bar_code));
|
|
1637
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
1638
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1639
|
+
yield IminPrintInstance.setQrCodeSize(2);
|
|
1640
|
+
yield IminPrintInstance.setDoubleQRSize(3);
|
|
1641
|
+
yield IminPrintInstance.setDoubleQR1MarginLeft(10);
|
|
1642
|
+
yield IminPrintInstance.setDoubleQR2MarginLeft(520);
|
|
1643
|
+
const ba = (new Blob([invoice.qrcode_0]).size - (new Blob([invoice.qrcode_1]).size)) * 1.1;
|
|
1644
|
+
for (let a = 0; a <= ba; a++) {
|
|
1645
|
+
invoice.qrcode_1 += '*';
|
|
1646
|
+
}
|
|
1647
|
+
yield IminPrintInstance.printDoubleQR([invoice.qrcode_0, invoice.qrcode_1]);
|
|
1648
|
+
yield IminPrintInstance.printAndFeedPaper(100);
|
|
1649
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1650
|
+
yield IminPrintInstance.setAlignment(1);
|
|
1651
|
+
yield IminPrintInstance.setTextSize(40);
|
|
1652
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1653
|
+
yield IminPrintInstance.printText('交易明細');
|
|
1654
|
+
yield IminPrintInstance.printAndFeedPaper(10);
|
|
1655
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1656
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1657
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1658
|
+
yield IminPrintInstance.printText('時間:' + invoice.create_date);
|
|
1659
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1660
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1661
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1662
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1663
|
+
yield IminPrintInstance.printText('營業人統編:' + invoice.sale_gui.replace('賣方 ', ''));
|
|
1664
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1665
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1666
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1667
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1668
|
+
yield IminPrintInstance.printText('訂單編號:' + res.response.data.orderID);
|
|
1669
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1670
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1671
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1672
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1673
|
+
yield IminPrintInstance.printText('發票號碼:' + invoice.invoice_code);
|
|
1674
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1675
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1676
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1677
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1678
|
+
yield IminPrintInstance.printText('員工:' + glitter.share.staff_title);
|
|
1679
|
+
yield IminPrintInstance.printAndFeedPaper(30);
|
|
1680
|
+
yield IminPrintInstance.printText('品名 單價*數量 金額 ');
|
|
1681
|
+
const pay_what = PaymentPage.stripHtmlTags(invoice.pay_detail);
|
|
1682
|
+
for (let a = 0; a < pay_what.length; a++) {
|
|
1683
|
+
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1684
|
+
yield IminPrintInstance.setAlignment(a % 3);
|
|
1685
|
+
yield IminPrintInstance.setTextSize(24);
|
|
1686
|
+
yield IminPrintInstance.setTextStyle(0);
|
|
1687
|
+
yield IminPrintInstance.printText(pay_what[a]);
|
|
1688
|
+
}
|
|
1689
|
+
yield IminPrintInstance.setAlignment(0);
|
|
1690
|
+
let tempDiv = document.createElement("div");
|
|
1691
|
+
tempDiv.innerHTML = invoice.pay_detail_footer;
|
|
1692
|
+
const text = `${tempDiv.querySelector('.invoice-detail-sum').children[0].textContent}
|
|
1693
|
+
${tempDiv.querySelector('.invoice-detail-sum').children[1].textContent}
|
|
1694
|
+
${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/ /g, '')}`;
|
|
1695
|
+
yield IminPrintInstance.printText(text);
|
|
1696
|
+
yield IminPrintInstance.printAndFeedPaper(100);
|
|
1697
|
+
}), 1000);
|
|
1698
|
+
}))();
|
|
1628
1699
|
}
|
|
1629
1700
|
else {
|
|
1630
1701
|
addCommandLine("print_text", { size: 2, align: 1, text: "收執聯" }, () => {
|
|
@@ -1654,58 +1725,6 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1654
1725
|
addCommandLine("print_text", { size: 2, align: 0, text: "\n\n\n\n" }, () => {
|
|
1655
1726
|
});
|
|
1656
1727
|
}
|
|
1657
|
-
addCommandLine("print_text", { size: 2, align: 1, text: "交易明細" }, () => {
|
|
1658
|
-
});
|
|
1659
|
-
addCommandLine("print_text", { size: 2, align: 0, text: "\n" }, () => {
|
|
1660
|
-
});
|
|
1661
|
-
addCommandLine("print_text", { size: 1, align: 0, text: "2024-09-14 01:27:39" }, () => {
|
|
1662
|
-
});
|
|
1663
|
-
addCommandLine("print_text", { size: 2, align: 0, text: "\n" }, () => {
|
|
1664
|
-
});
|
|
1665
|
-
addCommandLine("print_text", {
|
|
1666
|
-
size: 1,
|
|
1667
|
-
align: 0,
|
|
1668
|
-
text: "品名 單價*數量 金額"
|
|
1669
|
-
}, () => {
|
|
1670
|
-
});
|
|
1671
|
-
addCommandLine("print_text", { size: 2, align: 0, text: "\n" }, () => {
|
|
1672
|
-
});
|
|
1673
|
-
PaymentPage.stripHtmlTags(invoice.pay_detail).map((dd, index) => {
|
|
1674
|
-
addCommandLine("print_text", { size: 1, align: index % 3, text: dd }, () => {
|
|
1675
|
-
});
|
|
1676
|
-
});
|
|
1677
|
-
addCommandLine("print_text", { size: 2, align: 0, text: "\n" }, () => {
|
|
1678
|
-
});
|
|
1679
|
-
addCommandLine("print_text", { size: 1, align: 1, text: "------------------------" }, () => {
|
|
1680
|
-
});
|
|
1681
|
-
(() => {
|
|
1682
|
-
let tempDiv = document.createElement("div");
|
|
1683
|
-
tempDiv.innerHTML = invoice.pay_detail_footer;
|
|
1684
|
-
addCommandLine("print_text", {
|
|
1685
|
-
size: 1,
|
|
1686
|
-
align: 0,
|
|
1687
|
-
text: `${tempDiv.querySelector('.invoice-detail-sum').children[0].textContent}
|
|
1688
|
-
${tempDiv.querySelector('.invoice-detail-sum').children[1].textContent}
|
|
1689
|
-
${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/ /g, '')}`
|
|
1690
|
-
}, () => {
|
|
1691
|
-
});
|
|
1692
|
-
})();
|
|
1693
|
-
addCommandLine("print_text", { size: 2, align: 0, text: "\n" }, () => {
|
|
1694
|
-
});
|
|
1695
|
-
addCommandLine("print_text", { size: 2, align: 0, text: "\n" }, () => {
|
|
1696
|
-
});
|
|
1697
|
-
addCommandLine("print_text", { size: 2, align: 0, text: "\n" }, () => {
|
|
1698
|
-
});
|
|
1699
|
-
new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
1700
|
-
for (const b of command_line) {
|
|
1701
|
-
yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
1702
|
-
glitter.runJsInterFace(b.cmd, b.data, () => {
|
|
1703
|
-
resolve(true);
|
|
1704
|
-
});
|
|
1705
|
-
}));
|
|
1706
|
-
}
|
|
1707
|
-
resolve(true);
|
|
1708
|
-
}));
|
|
1709
1728
|
}
|
|
1710
1729
|
if (PayConfig.pos_config.execution_slip) {
|
|
1711
1730
|
print('save');
|
|
@@ -1865,17 +1884,15 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
|
|
|
1865
1884
|
</div>
|
|
1866
1885
|
${(() => {
|
|
1867
1886
|
if (c_vm.invoice_select === 'carry') {
|
|
1868
|
-
gvc.glitter.share.scan_back = (text) => {
|
|
1869
|
-
c_vm.value = text;
|
|
1870
|
-
gvc.recreateView();
|
|
1871
|
-
};
|
|
1872
1887
|
return `<div class="d-flex w-100 align-items-center mt-3" style="border:1px solid grey;height: 50px;">
|
|
1873
1888
|
<input class="form-control h-100" style="border: none;" placeholder="請輸入或掃描載具" oninput="${gvc.event((e, event) => {
|
|
1874
1889
|
c_vm.value = e.value;
|
|
1875
1890
|
})}" value="${c_vm.value}">
|
|
1876
1891
|
<div class="flex-fill"></div>
|
|
1877
1892
|
<div style="background: grey;width: 50px;" class="d-flex align-items-center justify-content-center text-white h-100" onclick="${gvc.event(() => {
|
|
1878
|
-
gvc.glitter.runJsInterFace('start_scan', {}, () => {
|
|
1893
|
+
gvc.glitter.runJsInterFace('start_scan', {}, (res) => {
|
|
1894
|
+
c_vm.value = res.text;
|
|
1895
|
+
gvc.recreateView();
|
|
1879
1896
|
});
|
|
1880
1897
|
})}">
|
|
1881
1898
|
<i class="fa-regular fa-barcode-read"></i>
|
|
@@ -1889,7 +1906,9 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
|
|
|
1889
1906
|
})}">
|
|
1890
1907
|
<div class="flex-fill"></div>
|
|
1891
1908
|
<div style="background: grey;width: 50px;" class="d-flex align-items-center justify-content-center text-white h-100" onclick="${gvc.event(() => {
|
|
1892
|
-
gvc.glitter.runJsInterFace('start_scan', {}, () => {
|
|
1909
|
+
gvc.glitter.runJsInterFace('start_scan', {}, (res) => {
|
|
1910
|
+
c_vm.value = res.text;
|
|
1911
|
+
gvc.recreateView();
|
|
1893
1912
|
});
|
|
1894
1913
|
})}">
|
|
1895
1914
|
<i class="fa-regular fa-barcode-read"></i>
|