ts-glitter 13.8.750 → 13.8.751
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 +105 -24
- package/lowcode/cms-plugin/POS-setting.ts +237 -149
- package/lowcode/cms-plugin/pos-pages/connection-mode.js +232 -0
- package/lowcode/cms-plugin/pos-pages/connection-mode.ts +264 -0
- package/lowcode/cms-plugin/pos-pages/imin-module.js +127 -0
- package/lowcode/cms-plugin/pos-pages/imin-module.ts +141 -0
- package/lowcode/cms-plugin/pos-pages/lottie/connected.json +1 -0
- package/lowcode/cms-plugin/pos-pages/lottie/disconect.json +1 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +195 -349
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +218 -392
- package/lowcode/cms-plugin/shopping-discount-setting.js +1 -1
- package/lowcode/cms-plugin/shopping-discount-setting.ts +1 -1
- package/package.json +1 -1
- package/src/api-public/controllers/chat.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +2 -2
- package/src/api-public/services/shopping.js +5 -5
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +7 -6
- package/src/api-public/services/user.js +0 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/utils/ut-permission.d.ts +1 -0
- package/src/api-public/utils/ut-permission.js +19 -0
- package/src/api-public/utils/ut-permission.js.map +1 -1
- package/src/api-public/utils/ut-permission.ts +22 -0
- package/src/services/ai.js.map +1 -1
- package/src/services/ai.ts +0 -2
- package/src/services/web-socket.d.ts +21 -0
- package/src/services/web-socket.js +160 -3
- package/src/services/web-socket.js.map +1 -1
- package/src/services/web-socket.ts +214 -9
- package/bq35s7n6px.json +0 -1
- package/usk99virc5.csv +0 -178
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.751';
|
|
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.751';
|
|
72
72
|
glitter.share.start = new Date();
|
|
73
73
|
const vm: {
|
|
74
74
|
appConfig: any;
|
|
@@ -21,6 +21,7 @@ import { ApiPageConfig } from "../api/pageConfig.js";
|
|
|
21
21
|
import { PosHomePage } from "./pos-pages/pos-home-page.js";
|
|
22
22
|
import { ApiShop } from "../glitter-base/route/shopping.js";
|
|
23
23
|
import { Swal } from "../modules/sweetAlert.js";
|
|
24
|
+
import { ConnectionMode } from "./pos-pages/connection-mode.js";
|
|
24
25
|
function getConfig() {
|
|
25
26
|
const saasConfig = window.parent.saasConfig;
|
|
26
27
|
return saasConfig;
|
|
@@ -222,6 +223,7 @@ height: 51px;
|
|
|
222
223
|
background-color: #646464;
|
|
223
224
|
}
|
|
224
225
|
`);
|
|
226
|
+
ConnectionMode.initial(gvc);
|
|
225
227
|
POSSetting.initialStyle(gvc);
|
|
226
228
|
gvc.glitter.share.NormalPageEditor = NormalPageEditor;
|
|
227
229
|
window.glitterBase = 'shopnex';
|
|
@@ -235,7 +237,7 @@ height: 51px;
|
|
|
235
237
|
last_string: ''
|
|
236
238
|
};
|
|
237
239
|
let scannerObserver = function (event) {
|
|
238
|
-
if (event.key.toLowerCase() !== 'enter') {
|
|
240
|
+
if (event.key.toLowerCase() !== 'enter' && event.key.toLowerCase() !== 'shift') {
|
|
239
241
|
clearInterval(timer_vm.timer);
|
|
240
242
|
timer_vm.last_string += event.key;
|
|
241
243
|
timer_vm.timer = setTimeout(() => {
|
|
@@ -335,6 +337,36 @@ height: 51px;
|
|
|
335
337
|
gvc.notifyDataChange(['checkout-page']);
|
|
336
338
|
}
|
|
337
339
|
}
|
|
340
|
+
if (text.indexOf(`voucher-`) === 0) {
|
|
341
|
+
text = text.replace(`voucher-`, '');
|
|
342
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
343
|
+
OrderDetail.singleInstance.code_array = OrderDetail.singleInstance.code_array || [];
|
|
344
|
+
OrderDetail.singleInstance.code_array = OrderDetail.singleInstance.code_array.filter((dd) => {
|
|
345
|
+
return dd !== text;
|
|
346
|
+
});
|
|
347
|
+
OrderDetail.singleInstance.code_array.push(text);
|
|
348
|
+
dialog.dataLoading({ visible: true });
|
|
349
|
+
const od = (yield ApiShop.getCheckout({
|
|
350
|
+
line_items: OrderDetail.singleInstance.lineItems,
|
|
351
|
+
checkOutType: 'POS',
|
|
352
|
+
user_info: OrderDetail.singleInstance.user_info,
|
|
353
|
+
code_array: OrderDetail.singleInstance.code_array,
|
|
354
|
+
})).response.data;
|
|
355
|
+
dialog.dataLoading({ visible: false });
|
|
356
|
+
if (!od ||
|
|
357
|
+
!od.voucherList.find((dd) => {
|
|
358
|
+
return dd.code === text;
|
|
359
|
+
})) {
|
|
360
|
+
OrderDetail.singleInstance.code_array = OrderDetail.singleInstance.code_array.filter((dd) => {
|
|
361
|
+
return dd !== text;
|
|
362
|
+
});
|
|
363
|
+
dialog.errorMessage({ text: '請輸入正確的優惠代碼' });
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
dialog.successMessage({ text: '成功新增優惠券' });
|
|
367
|
+
gvc.notifyDataChange(['checkout-page']);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
338
370
|
});
|
|
339
371
|
}
|
|
340
372
|
static posView(gvc) {
|
|
@@ -506,7 +538,7 @@ cursor: pointer;
|
|
|
506
538
|
</div>
|
|
507
539
|
${(vm.type !== 'menu' || (document.body.clientWidth > 800)) ? `<div class="flex-fill"></div>` : ``}
|
|
508
540
|
${gvc.bindView(() => {
|
|
509
|
-
const id =
|
|
541
|
+
const id = 'right_top_info';
|
|
510
542
|
function refreshUserBar() {
|
|
511
543
|
gvc.notifyDataChange([id, 'nav-slide']);
|
|
512
544
|
}
|
|
@@ -523,19 +555,29 @@ cursor: pointer;
|
|
|
523
555
|
return dd.config.member_id === POSSetting.config.who;
|
|
524
556
|
})) !== null && _a !== void 0 ? _a : { config: { title: '管理員', name: 'manager' } };
|
|
525
557
|
glitter.share.staff_title = select_member.config.name === 'manager' ? `BOSS` : POSSetting.config.who;
|
|
526
|
-
resolve(
|
|
527
|
-
<div class="
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
558
|
+
resolve(html `
|
|
559
|
+
<div class="h-100 group dropdown border-start ps-1 d-flex align-items-center"
|
|
560
|
+
style="">
|
|
561
|
+
<div class=" btn btn-outline-secondary border-0 p-1 position-relative"
|
|
562
|
+
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
563
|
+
aria-expanded="false">
|
|
564
|
+
<div class="d-flex align-items-center px-2"
|
|
565
|
+
style="gap:5px;">
|
|
566
|
+
<i class="fa-solid fa-repeat fs-5"></i>
|
|
567
|
+
<div class="ps-2 text-start">
|
|
568
|
+
<div class="fs-xs lh-1 opacity-60 fw-500">
|
|
569
|
+
${select_member.config.title}
|
|
570
|
+
</div>
|
|
571
|
+
<div class="fs-sm fw-500">
|
|
572
|
+
${select_member.config.name}
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
|
|
576
|
+
</div>
|
|
577
|
+
</div>
|
|
578
|
+
<div class="dropdown-menu position-absolute"
|
|
579
|
+
style="top:50px; right: 0;">
|
|
580
|
+
${(() => {
|
|
539
581
|
const view = member_auth.filter((dd) => {
|
|
540
582
|
return dd.config.member_id !== POSSetting.config.who;
|
|
541
583
|
}).map((dd) => {
|
|
@@ -626,7 +668,9 @@ cursor: pointer;
|
|
|
626
668
|
`;
|
|
627
669
|
});
|
|
628
670
|
if (POSSetting.config.who !== 'manager') {
|
|
629
|
-
view.push(
|
|
671
|
+
view.push(html `<a
|
|
672
|
+
class="dropdown-item cursor_pointer d-flex flex-column ${POSSetting.config.who === 'manager' ? `d-none` : ``}"
|
|
673
|
+
onclick="${gvc.event(() => {
|
|
630
674
|
gvc.glitter.innerDialog((gvc) => {
|
|
631
675
|
return POSSetting.loginManager(gvc, 'switch', () => {
|
|
632
676
|
refreshUserBar();
|
|
@@ -634,22 +678,59 @@ cursor: pointer;
|
|
|
634
678
|
});
|
|
635
679
|
}, '');
|
|
636
680
|
})}">
|
|
637
|
-
|
|
638
|
-
</a>`);
|
|
681
|
+
切換至管理員
|
|
682
|
+
</a>`);
|
|
639
683
|
}
|
|
640
684
|
return view;
|
|
641
685
|
})().join('<div class="dropdown-divider"></div>')}
|
|
642
|
-
|
|
643
|
-
|
|
686
|
+
<div class="dropdown-divider"></div>
|
|
687
|
+
${[
|
|
688
|
+
html `
|
|
689
|
+
<a class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
690
|
+
style="gap:10px;"
|
|
691
|
+
onclick="${gvc.event(() => {
|
|
692
|
+
ConnectionMode.main(gvc);
|
|
693
|
+
})}"><i class="fa-solid fa-plug d-flex align-items-center justify-content-center" style="width:20px;" ></i>連線模式</a>`,
|
|
694
|
+
...((ConnectionMode.on_connected_device) ? [
|
|
695
|
+
`<a class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
696
|
+
style="gap:10px;"
|
|
697
|
+
onclick="${gvc.event(() => {
|
|
698
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
699
|
+
dialog.checkYesOrNot({
|
|
700
|
+
text: '是否斷開與 IMIN 裝置的連線?',
|
|
701
|
+
callback: (response) => {
|
|
702
|
+
if (response) {
|
|
703
|
+
dialog.infoMessage({ text: '已斷開連線' });
|
|
704
|
+
ConnectionMode.last_connect_id = '';
|
|
705
|
+
ConnectionMode.on_connected_device = '';
|
|
706
|
+
ConnectionMode.socket.close();
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
})}"><i class="fa-solid fa-power-off d-flex align-items-center justify-content-center" style="width:20px;"></i>斷開裝置連線</a>`
|
|
711
|
+
] : [])
|
|
712
|
+
].concat(ConnectionMode.device_list.map((dd) => {
|
|
713
|
+
return html `<a
|
|
714
|
+
class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
715
|
+
style="gap:10px;"
|
|
716
|
+
onclick="${gvc.event(() => {
|
|
717
|
+
ConnectionMode.connect(dd);
|
|
718
|
+
})}"><i
|
|
719
|
+
class="fa-solid fa-plug d-flex align-items-center justify-content-center" style="width:20px;"></i>連線至『 ${dd} 』</a>`;
|
|
720
|
+
})).join(' <div class="dropdown-divider"></div>')}
|
|
721
|
+
${(POSSetting.config.who === 'manager') ? html `
|
|
722
|
+
<div class="dropdown-divider"></div>
|
|
723
|
+
<a class="dropdown-item cursor_pointer d-flex align-items-center"
|
|
724
|
+
style="gap:10px;" onclick="${gvc.event(() => {
|
|
644
725
|
const dialog = new ShareDialog(gvc.glitter);
|
|
645
726
|
dialog.dataLoading({ visible: true });
|
|
646
727
|
localStorage.removeItem('on-pos');
|
|
647
728
|
(window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
|
|
648
729
|
glitter.share.reload('cms', 'shopnex');
|
|
649
|
-
})}">返回全通路後臺</a>
|
|
650
|
-
` : ``}
|
|
651
|
-
|
|
652
|
-
|
|
730
|
+
})}"><i class="fa-solid fa-angle-left d-flex align-items-center justify-content-center" style="width:20px;"></i>返回全通路後臺</a>
|
|
731
|
+
` : ``}
|
|
732
|
+
</div>
|
|
733
|
+
</div>`);
|
|
653
734
|
}));
|
|
654
735
|
},
|
|
655
736
|
divCreate: {
|