ts-glitter 13.8.66 → 13.8.72
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 +107 -7
- package/lowcode/Entry.ts +146 -43
- package/lowcode/api/pageConfig.js +10 -0
- package/lowcode/api/pageConfig.ts +11 -0
- package/lowcode/cms-plugin/POS-setting.js +11 -10
- package/lowcode/cms-plugin/POS-setting.ts +18 -17
- package/lowcode/cms-plugin/module/form-check.js +1 -0
- package/lowcode/cms-plugin/module/form-check.ts +1 -1
- package/lowcode/cms-plugin/pos-pages/payment-page.js +2 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +2 -2
- package/lowcode/config.js +3 -1
- package/lowcode/config.ts +3 -1
- package/lowcode/glitterBundle/GVController.js +3 -1
- package/lowcode/glitterBundle/GVController.ts +3 -1
- package/lowcode/glitterBundle/module/PageManager.js +4 -0
- package/lowcode/glitterBundle/module/PageManager.ts +7 -0
- package/lowcode/glitterBundle/module/html-generate.js +10 -0
- package/lowcode/glitterBundle/module/html-generate.ts +13 -0
- package/lowcode/jspage/main.js +0 -18
- package/lowcode/jspage/main.ts +1 -28
- package/lowcode/official_event/page/change-page.ts +0 -1
- package/lowcode/public-components/product/pd-card-01.js +22 -18
- package/lowcode/public-components/product/pd-card-01.ts +33 -29
- package/lowcode/public-components/product/pd-card-02.js +31 -22
- package/lowcode/public-components/product/pd-card-02.ts +40 -31
- package/lowcode/public-components/product/pd-card-03.js +25 -20
- package/lowcode/public-components/product/pd-card-03.ts +36 -31
- package/lowcode/public-components/product/product-detail.js +16 -3
- package/lowcode/public-components/product/product-detail.ts +20 -7
- package/lowcode/public-components/user-manager/um-class.js +493 -0
- package/lowcode/public-components/user-manager/um-class.ts +489 -0
- package/lowcode/public-components/user-manager/um-info.js +476 -0
- package/lowcode/public-components/user-manager/um-info.ts +572 -0
- package/lowcode/public-components/user-manager/um-orderlist.js +170 -0
- package/lowcode/public-components/user-manager/um-orderlist.ts +297 -0
- package/lowcode/public-components/user-manager/um-rebate.js +225 -0
- package/lowcode/public-components/user-manager/um-rebate.ts +251 -0
- package/lowcode/public-components/user-manager/um-wishlist.js +170 -0
- package/lowcode/public-components/user-manager/um-wishlist.ts +260 -0
- package/lowcode/view-model/saas-view-model.js +378 -204
- package/lowcode/view-model/saas-view-model.ts +837 -655
- package/package.json +1 -1
- package/src/api-public/controllers/ai-chat.js +10 -5
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +10 -5
- package/src/api-public/services/ai-robot.d.ts +0 -1
- package/src/api-public/services/ai-robot.js +2 -2
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/ai-robot.ts +2 -2
- package/src/api-public/services/chat.js.map +1 -1
- package/src/api-public/services/fb-message.js.map +1 -1
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/user.js +31 -19
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +32 -21
- package/src/controllers/ai.js.map +1 -1
- package/src/controllers/app.js +24 -7
- package/src/controllers/app.js.map +1 -1
- package/src/controllers/app.ts +58 -41
- package/src/controllers/index.js +1 -0
- package/src/controllers/index.js.map +1 -1
- package/src/controllers/index.ts +1 -0
- package/src/index.js +3 -3
- package/src/index.js.map +1 -1
- package/src/index.ts +2 -0
- package/src/services/app.d.ts +1 -0
- package/src/services/app.js +21 -0
- package/src/services/app.js.map +1 -1
- package/src/services/app.ts +26 -0
package/lowcode/Entry.js
CHANGED
|
@@ -17,6 +17,11 @@ import { ShareDialog } from './glitterBundle/dialog/ShareDialog.js';
|
|
|
17
17
|
export class Entry {
|
|
18
18
|
static onCreate(glitter) {
|
|
19
19
|
var _a;
|
|
20
|
+
glitter.share.reload = (page, app_name) => {
|
|
21
|
+
window.appName = app_name || window.appName;
|
|
22
|
+
window.glitter_page = page;
|
|
23
|
+
location.reload();
|
|
24
|
+
};
|
|
20
25
|
glitter.share.top_inset = 0;
|
|
21
26
|
glitter.share.bottom_inset = 0;
|
|
22
27
|
glitter.share.reload_code_hash = function () {
|
|
@@ -60,11 +65,10 @@ export class Entry {
|
|
|
60
65
|
`);
|
|
61
66
|
if (glitter.getUrlParameter('appName')) {
|
|
62
67
|
window.appName = glitter.getUrlParameter('appName');
|
|
63
|
-
config.appName = glitter.getUrlParameter('appName');
|
|
64
68
|
}
|
|
65
69
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
66
70
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
67
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
71
|
+
glitter.share.editerVersion = 'V_13.8.72';
|
|
68
72
|
glitter.share.start = new Date();
|
|
69
73
|
const vm = {
|
|
70
74
|
appConfig: [],
|
|
@@ -163,13 +167,58 @@ export class Entry {
|
|
|
163
167
|
if (glitter.getUrlParameter('type') === 'editor') {
|
|
164
168
|
const dialog = new ShareDialog(glitter);
|
|
165
169
|
dialog.dataLoading({ visible: true, text: '後台載入中' });
|
|
166
|
-
Entry.toBackendEditor(glitter, () => {
|
|
170
|
+
Entry.toBackendEditor(glitter, () => {
|
|
171
|
+
});
|
|
167
172
|
}
|
|
168
173
|
else if (glitter.getUrlParameter('type') === 'htmlEditor') {
|
|
169
174
|
Entry.toHtmlEditor(glitter, vm, () => {
|
|
170
175
|
Entry.checkIframe(glitter);
|
|
171
176
|
});
|
|
172
177
|
}
|
|
178
|
+
else if (glitter.getUrlParameter('page') === 'backend_manager') {
|
|
179
|
+
if (!GlobalUser.token) {
|
|
180
|
+
glitter.setUrlParameter('page', 'login');
|
|
181
|
+
location.reload();
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
try {
|
|
185
|
+
const appList = (yield ApiPageConfig.getAppList(undefined, GlobalUser.token)).response.result;
|
|
186
|
+
localStorage.setItem('select_item', '0');
|
|
187
|
+
if (appList.length === 0) {
|
|
188
|
+
glitter.getModule(new URL('./view-model/saas-view-model.js', location.href).href, (SaasViewModel) => {
|
|
189
|
+
glitter.innerDialog((gvc) => {
|
|
190
|
+
return gvc.bindView(() => {
|
|
191
|
+
const id = gvc.glitter.getUUID();
|
|
192
|
+
return {
|
|
193
|
+
bind: id,
|
|
194
|
+
view: () => {
|
|
195
|
+
return SaasViewModel.createShop(gvc, true);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
}, 'change_app');
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
let appName = appList[0].appName;
|
|
204
|
+
if (appList.find((dd) => {
|
|
205
|
+
return dd.appName === localStorage.getItem('select_app_name');
|
|
206
|
+
})) {
|
|
207
|
+
appName = localStorage.getItem('select_app_name');
|
|
208
|
+
}
|
|
209
|
+
glitter.setUrlParameter('page', 'index');
|
|
210
|
+
glitter.setUrlParameter('type', 'editor');
|
|
211
|
+
glitter.setUrlParameter('appName', appName);
|
|
212
|
+
glitter.setUrlParameter('function', 'backend-manger');
|
|
213
|
+
location.reload();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
glitter.setUrlParameter('page', 'login');
|
|
218
|
+
location.reload();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
173
222
|
else {
|
|
174
223
|
Entry.toNormalRender(glitter, vm, () => {
|
|
175
224
|
Entry.checkIframe(glitter);
|
|
@@ -202,7 +251,8 @@ export class Entry {
|
|
|
202
251
|
}
|
|
203
252
|
}
|
|
204
253
|
static toBackendEditor(glitter, callback) {
|
|
205
|
-
if (localStorage.getItem('on-pos') === 'true') {
|
|
254
|
+
if ((localStorage.getItem('on-pos') === 'true') && glitter.getUrlParameter('page') !== 'pos') {
|
|
255
|
+
localStorage.removeItem('on-pos');
|
|
206
256
|
location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
|
|
207
257
|
}
|
|
208
258
|
glitter.addStyle(`
|
|
@@ -296,7 +346,9 @@ export class Entry {
|
|
|
296
346
|
{
|
|
297
347
|
src: 'https://kit.fontawesome.com/cccedec0f8.js',
|
|
298
348
|
},
|
|
299
|
-
], () => {
|
|
349
|
+
], () => {
|
|
350
|
+
}, () => {
|
|
351
|
+
});
|
|
300
352
|
glitter.addStyle(`
|
|
301
353
|
@media (prefers-reduced-motion: no-preference) {
|
|
302
354
|
:root {
|
|
@@ -330,7 +382,9 @@ export class Entry {
|
|
|
330
382
|
src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
|
|
331
383
|
type: 'module',
|
|
332
384
|
};
|
|
333
|
-
}), () => {
|
|
385
|
+
}), () => {
|
|
386
|
+
}, () => {
|
|
387
|
+
}, [{ key: 'async', value: 'true' }]);
|
|
334
388
|
glitter.htmlGenerate.loadScript(glitter, window.parent.editerData.setting
|
|
335
389
|
.filter((dd) => {
|
|
336
390
|
return ['widget', 'container', 'code'].indexOf(dd.type) === -1;
|
|
@@ -394,7 +448,8 @@ export class Entry {
|
|
|
394
448
|
.map((dd) => {
|
|
395
449
|
return {
|
|
396
450
|
src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
|
|
397
|
-
callback: () => {
|
|
451
|
+
callback: () => {
|
|
452
|
+
},
|
|
398
453
|
};
|
|
399
454
|
}));
|
|
400
455
|
function authPass() {
|
|
@@ -425,6 +480,20 @@ export class Entry {
|
|
|
425
480
|
});
|
|
426
481
|
}
|
|
427
482
|
static resourceInitial(glitter, vm, callback) {
|
|
483
|
+
glitter.runJsInterFace('getTopInset', {}, (response) => {
|
|
484
|
+
glitter.share.top_inset = (response.data);
|
|
485
|
+
}, {
|
|
486
|
+
webFunction: () => {
|
|
487
|
+
return { data: 0 };
|
|
488
|
+
},
|
|
489
|
+
});
|
|
490
|
+
glitter.runJsInterFace('getBottomInset', {}, (response) => {
|
|
491
|
+
glitter.share.bottom_inset = (response.data);
|
|
492
|
+
}, {
|
|
493
|
+
webFunction: () => {
|
|
494
|
+
return { data: 0 };
|
|
495
|
+
},
|
|
496
|
+
});
|
|
428
497
|
window.glitterInitialHelper.getPlugin((dd) => {
|
|
429
498
|
var _a, _b, _c, _d, _e;
|
|
430
499
|
console.log(`getPlugin-time:`, window.renderClock.stop());
|
|
@@ -503,6 +572,37 @@ export class Entry {
|
|
|
503
572
|
static globalStyle(glitter, dd) {
|
|
504
573
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
505
574
|
var _a, _b;
|
|
575
|
+
function loopVersion() {
|
|
576
|
+
ApiPageConfig.getGlitterVersion().then((res) => {
|
|
577
|
+
console.log('glitterVersion:', res.response.result);
|
|
578
|
+
if (!glitter.share.editerVersion.includes(res.response.result)) {
|
|
579
|
+
const dialog = new ShareDialog(glitter);
|
|
580
|
+
dialog.checkYesOrNot({
|
|
581
|
+
text: '新版本已發佈,是否進行更新?',
|
|
582
|
+
callback: (response) => {
|
|
583
|
+
if (response) {
|
|
584
|
+
location.reload();
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
setTimeout(() => {
|
|
588
|
+
loopVersion();
|
|
589
|
+
}, 1000 * 300);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
setTimeout(() => {
|
|
596
|
+
loopVersion();
|
|
597
|
+
}, 1000 * 300);
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
if (glitter.getUrlParameter('type') === 'editor' || glitter.getUrlParameter('page') === 'pos') {
|
|
602
|
+
setTimeout(() => {
|
|
603
|
+
loopVersion();
|
|
604
|
+
}, 1000 * 300);
|
|
605
|
+
}
|
|
506
606
|
let countI = dd.response.data.initialList.length;
|
|
507
607
|
const vm = {
|
|
508
608
|
get count() {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import {Glitter} from './glitterBundle/Glitter.js';
|
|
3
|
+
import {config} from './config.js';
|
|
4
|
+
import {ApiPageConfig} from './api/pageConfig.js';
|
|
5
|
+
import {BaseApi} from './glitterBundle/api/base.js';
|
|
6
|
+
import {GlobalUser} from './glitter-base/global/global-user.js';
|
|
7
|
+
import {EditorConfig} from './editor-config.js';
|
|
8
|
+
import {ShareDialog} from './glitterBundle/dialog/ShareDialog.js';
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
export class Entry {
|
|
11
12
|
public static onCreate(glitter: Glitter) {
|
|
13
|
+
glitter.share.reload = (page: string, app_name: string) => {
|
|
14
|
+
(window as any).appName = app_name || (window as any).appName;
|
|
15
|
+
(window as any).glitter_page = page;
|
|
16
|
+
location.reload();
|
|
17
|
+
}
|
|
12
18
|
glitter.share.top_inset = 0;
|
|
13
19
|
glitter.share.bottom_inset = 0;
|
|
14
20
|
glitter.share.reload_code_hash = function () {
|
|
@@ -60,11 +66,10 @@ export class Entry {
|
|
|
60
66
|
`);
|
|
61
67
|
if (glitter.getUrlParameter('appName')) {
|
|
62
68
|
(window as any).appName = glitter.getUrlParameter('appName');
|
|
63
|
-
config.appName = glitter.getUrlParameter('appName');
|
|
64
69
|
}
|
|
65
70
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
66
71
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
67
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
72
|
+
glitter.share.editerVersion = 'V_13.8.72';
|
|
68
73
|
glitter.share.start = new Date();
|
|
69
74
|
const vm: {
|
|
70
75
|
appConfig: any;
|
|
@@ -83,14 +88,14 @@ export class Entry {
|
|
|
83
88
|
Entry.resourceInitial(glitter, vm, async (dd) => {
|
|
84
89
|
glitter.addStyle(`
|
|
85
90
|
${
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
parseInt((window.parent as any).glitter.share.bottom_inset, 10)
|
|
92
|
+
? `
|
|
88
93
|
.update-bar-container {
|
|
89
94
|
padding-bottom: ${(window.parent as any).glitter.share.bottom_inset}px !important;
|
|
90
95
|
}
|
|
91
96
|
`
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
: ``
|
|
98
|
+
}
|
|
94
99
|
|
|
95
100
|
.editorParent .editorChild {
|
|
96
101
|
display: none;
|
|
@@ -171,14 +176,59 @@ export class Entry {
|
|
|
171
176
|
await Entry.globalStyle(glitter, dd);
|
|
172
177
|
if (glitter.getUrlParameter('type') === 'editor') {
|
|
173
178
|
const dialog = new ShareDialog(glitter);
|
|
174
|
-
dialog.dataLoading({
|
|
179
|
+
dialog.dataLoading({visible: true, text: '後台載入中'});
|
|
175
180
|
// 頁面編輯器
|
|
176
|
-
Entry.toBackendEditor(glitter, () => {
|
|
181
|
+
Entry.toBackendEditor(glitter, () => {
|
|
182
|
+
});
|
|
177
183
|
} else if (glitter.getUrlParameter('type') === 'htmlEditor') {
|
|
178
184
|
// Iframe預覽區塊
|
|
179
185
|
Entry.toHtmlEditor(glitter, vm, () => {
|
|
180
186
|
Entry.checkIframe(glitter);
|
|
181
187
|
});
|
|
188
|
+
} else if (glitter.getUrlParameter('page') === 'backend_manager') {
|
|
189
|
+
if (!GlobalUser.token) {
|
|
190
|
+
glitter.setUrlParameter('page', 'login');
|
|
191
|
+
location.reload()
|
|
192
|
+
} else {
|
|
193
|
+
try {
|
|
194
|
+
const appList = (await ApiPageConfig.getAppList(
|
|
195
|
+
undefined,
|
|
196
|
+
GlobalUser.token
|
|
197
|
+
)).response.result;
|
|
198
|
+
localStorage.setItem('select_item', '0')
|
|
199
|
+
if (appList.length === 0) {
|
|
200
|
+
glitter.getModule(new URL('./view-model/saas-view-model.js', location.href).href, (SaasViewModel) => {
|
|
201
|
+
glitter.innerDialog((gvc) => {
|
|
202
|
+
return gvc.bindView(() => {
|
|
203
|
+
const id = gvc.glitter.getUUID();
|
|
204
|
+
return {
|
|
205
|
+
bind: id,
|
|
206
|
+
view: () => {
|
|
207
|
+
return SaasViewModel.createShop(gvc, true)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
}, 'change_app')
|
|
213
|
+
})
|
|
214
|
+
} else {
|
|
215
|
+
let appName = appList[0].appName;
|
|
216
|
+
if (appList.find((dd: any) => {
|
|
217
|
+
return dd.appName === localStorage.getItem('select_app_name')
|
|
218
|
+
})) {
|
|
219
|
+
appName = localStorage.getItem('select_app_name')
|
|
220
|
+
}
|
|
221
|
+
glitter.setUrlParameter('page', 'index')
|
|
222
|
+
glitter.setUrlParameter('type', 'editor')
|
|
223
|
+
glitter.setUrlParameter('appName', appName)
|
|
224
|
+
glitter.setUrlParameter('function', 'backend-manger')
|
|
225
|
+
location.reload()
|
|
226
|
+
}
|
|
227
|
+
} catch (e) {
|
|
228
|
+
glitter.setUrlParameter('page', 'login');
|
|
229
|
+
location.reload()
|
|
230
|
+
}
|
|
231
|
+
}
|
|
182
232
|
} else {
|
|
183
233
|
// 一般頁面
|
|
184
234
|
Entry.toNormalRender(glitter, vm, () => {
|
|
@@ -215,8 +265,9 @@ export class Entry {
|
|
|
215
265
|
|
|
216
266
|
// 跳轉至頁面編輯器
|
|
217
267
|
public static toBackendEditor(glitter: Glitter, callback: () => void) {
|
|
218
|
-
if(localStorage.getItem('on-pos')==='true'){
|
|
219
|
-
|
|
268
|
+
if ((localStorage.getItem('on-pos') === 'true') && glitter.getUrlParameter('page') !== 'pos') {
|
|
269
|
+
localStorage.removeItem('on-pos')
|
|
270
|
+
location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
|
|
220
271
|
}
|
|
221
272
|
glitter.addStyle(`
|
|
222
273
|
@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');
|
|
@@ -324,8 +375,10 @@ export class Entry {
|
|
|
324
375
|
src: 'https://kit.fontawesome.com/cccedec0f8.js',
|
|
325
376
|
},
|
|
326
377
|
],
|
|
327
|
-
() => {
|
|
328
|
-
|
|
378
|
+
() => {
|
|
379
|
+
},
|
|
380
|
+
() => {
|
|
381
|
+
}
|
|
329
382
|
);
|
|
330
383
|
glitter.addStyle(`
|
|
331
384
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -366,9 +419,11 @@ export class Entry {
|
|
|
366
419
|
type: 'module',
|
|
367
420
|
};
|
|
368
421
|
}),
|
|
369
|
-
() => {
|
|
370
|
-
|
|
371
|
-
|
|
422
|
+
() => {
|
|
423
|
+
},
|
|
424
|
+
() => {
|
|
425
|
+
},
|
|
426
|
+
[{key: 'async', value: 'true'}]
|
|
372
427
|
);
|
|
373
428
|
|
|
374
429
|
// Preload page script
|
|
@@ -389,7 +444,7 @@ export class Entry {
|
|
|
389
444
|
return eval(evals);
|
|
390
445
|
};
|
|
391
446
|
setTimeout(() => {
|
|
392
|
-
(window.parent as any).glitter.share.loading_dialog.dataLoading({
|
|
447
|
+
(window.parent as any).glitter.share.loading_dialog.dataLoading({text: '', visible: false});
|
|
393
448
|
}, 2000);
|
|
394
449
|
glitter.htmlGenerate.setHome({
|
|
395
450
|
app_config: vm.appConfig,
|
|
@@ -444,7 +499,8 @@ export class Entry {
|
|
|
444
499
|
.map((dd: any) => {
|
|
445
500
|
return {
|
|
446
501
|
src: `${glitter.htmlGenerate.configureCDN(glitter.htmlGenerate.resourceHook(dd.js))}`,
|
|
447
|
-
callback: () => {
|
|
502
|
+
callback: () => {
|
|
503
|
+
},
|
|
448
504
|
};
|
|
449
505
|
})
|
|
450
506
|
);
|
|
@@ -484,6 +540,32 @@ export class Entry {
|
|
|
484
540
|
|
|
485
541
|
// 資源初始化
|
|
486
542
|
public static resourceInitial(glitter: Glitter, vm: any, callback: (data: any) => void) {
|
|
543
|
+
//取得APP的上間隔距離
|
|
544
|
+
glitter.runJsInterFace(
|
|
545
|
+
'getTopInset',
|
|
546
|
+
{},
|
|
547
|
+
(response: any) => {
|
|
548
|
+
glitter.share.top_inset = (response.data);
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
webFunction: () => {
|
|
552
|
+
return {data: 0};
|
|
553
|
+
},
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
//取得APP的底部間隔距離
|
|
557
|
+
glitter.runJsInterFace(
|
|
558
|
+
'getBottomInset',
|
|
559
|
+
{},
|
|
560
|
+
(response: any) => {
|
|
561
|
+
glitter.share.bottom_inset = (response.data);
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
webFunction: () => {
|
|
565
|
+
return {data: 0};
|
|
566
|
+
},
|
|
567
|
+
}
|
|
568
|
+
);
|
|
487
569
|
(window as any).glitterInitialHelper.getPlugin((dd: any) => {
|
|
488
570
|
console.log(`getPlugin-time:`, (window as any).renderClock.stop());
|
|
489
571
|
(window as any).saasConfig.appConfig = dd.response.data;
|
|
@@ -511,11 +593,11 @@ export class Entry {
|
|
|
511
593
|
glitter.addStyle(`
|
|
512
594
|
@charset "UTF-8";
|
|
513
595
|
${glitter.share.font_theme
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
596
|
+
.map((dd: any) => {
|
|
597
|
+
glitter.share.initial_fonts.push(dd.value);
|
|
598
|
+
return `@import url('https://fonts.googleapis.com/css2?family=${dd.value}&display=swap');`;
|
|
599
|
+
})
|
|
600
|
+
.join('\n')}
|
|
519
601
|
body {
|
|
520
602
|
font-family: '${glitter.share.font_theme[0].value}' !important;
|
|
521
603
|
font-optical-sizing: auto;
|
|
@@ -563,20 +645,39 @@ export class Entry {
|
|
|
563
645
|
// 載入全域資源
|
|
564
646
|
public static globalStyle(glitter: Glitter, dd: any) {
|
|
565
647
|
return new Promise(async (resolve, reject) => {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
648
|
+
//定期確認版本號碼
|
|
649
|
+
function loopVersion() {
|
|
650
|
+
ApiPageConfig.getGlitterVersion().then((res) => {
|
|
651
|
+
console.log('glitterVersion:', res.response.result);
|
|
652
|
+
if (!glitter.share.editerVersion.includes(res.response.result)) {
|
|
653
|
+
const dialog = new ShareDialog(glitter)
|
|
654
|
+
dialog.checkYesOrNot({
|
|
655
|
+
text: '新版本已發佈,是否進行更新?',
|
|
656
|
+
callback: (response) => {
|
|
657
|
+
if (response) {
|
|
658
|
+
location.reload()
|
|
659
|
+
} else {
|
|
660
|
+
setTimeout(() => {
|
|
661
|
+
loopVersion()
|
|
662
|
+
}, 1000 * 300)
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
})
|
|
666
|
+
} else {
|
|
667
|
+
setTimeout(() => {
|
|
668
|
+
loopVersion()
|
|
669
|
+
}, 1000 * 300)
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
})
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
if (glitter.getUrlParameter('type') === 'editor' || glitter.getUrlParameter('page') === 'pos') {
|
|
676
|
+
setTimeout(() => {
|
|
677
|
+
loopVersion()
|
|
678
|
+
}, 1000 * 300)
|
|
679
|
+
}
|
|
680
|
+
|
|
580
681
|
let countI = dd.response.data.initialList.length;
|
|
581
682
|
const vm = {
|
|
582
683
|
// @ts-ignore
|
|
@@ -635,6 +736,8 @@ export class Entry {
|
|
|
635
736
|
glitter.setUrlParameter('page', 'login');
|
|
636
737
|
}
|
|
637
738
|
}
|
|
739
|
+
|
|
740
|
+
|
|
638
741
|
}
|
|
639
742
|
|
|
640
743
|
let clockF = () => {
|
|
@@ -28,6 +28,16 @@ export class ApiPageConfig {
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
+
static getGlitterVersion() {
|
|
32
|
+
return BaseApi.create({
|
|
33
|
+
"url": config.url + `/api/v1/app/version?library=ts-glitter`,
|
|
34
|
+
"type": "GET",
|
|
35
|
+
"timeout": 0,
|
|
36
|
+
"headers": {
|
|
37
|
+
"Content-Type": "application/json"
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
31
41
|
static getTemplateList() {
|
|
32
42
|
return BaseApi.create({
|
|
33
43
|
"url": config.url + `/api/v1/app/template?template_from=all`,
|
|
@@ -25,6 +25,17 @@ export class ApiPageConfig {
|
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
public static getGlitterVersion() {
|
|
29
|
+
return BaseApi.create({
|
|
30
|
+
"url": config.url + `/api/v1/app/version?library=ts-glitter`,
|
|
31
|
+
"type": "GET",
|
|
32
|
+
"timeout": 0,
|
|
33
|
+
"headers": {
|
|
34
|
+
"Content-Type": "application/json"
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
public static getTemplateList() {
|
|
29
40
|
return BaseApi.create({
|
|
30
41
|
"url": config.url + `/api/v1/app/template?template_from=all`,
|
|
@@ -156,7 +156,6 @@ height: 51px;
|
|
|
156
156
|
}
|
|
157
157
|
static main(gvc) {
|
|
158
158
|
const glitter = gvc.glitter;
|
|
159
|
-
localStorage.setItem('on-pos', 'true');
|
|
160
159
|
gvc.glitter.runJsInterFace("pos-device", {}, (res) => {
|
|
161
160
|
PayConfig.deviceType = res.deviceType === 'neostra' ? 'pos' : 'web';
|
|
162
161
|
if (PayConfig.deviceType === 'pos') {
|
|
@@ -223,7 +222,6 @@ height: 51px;
|
|
|
223
222
|
`);
|
|
224
223
|
POSSetting.initialStyle(gvc);
|
|
225
224
|
gvc.glitter.share.NormalPageEditor = NormalPageEditor;
|
|
226
|
-
getConfig().config.appName = gvc.glitter.getUrlParameter('app-id');
|
|
227
225
|
window.glitterBase = 'shopnex';
|
|
228
226
|
window.appName = gvc.glitter.getUrlParameter('app-id');
|
|
229
227
|
window.saasConfig.config.token = GlobalUser.saas_token;
|
|
@@ -315,18 +313,18 @@ height: 51px;
|
|
|
315
313
|
return html `
|
|
316
314
|
<div
|
|
317
315
|
class="d-flex nav-top"
|
|
318
|
-
style="z-index:20;
|
|
316
|
+
style="z-index:20;padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
|
|
317
|
+
>
|
|
318
|
+
<div
|
|
319
|
+
class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ``} mx-2 w-100"
|
|
320
|
+
style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}height: ${(() => {
|
|
319
321
|
if (document.body.offsetWidth > 800) {
|
|
320
322
|
return `86px`;
|
|
321
323
|
}
|
|
322
324
|
else {
|
|
323
325
|
return `66px`;
|
|
324
326
|
}
|
|
325
|
-
})()};
|
|
326
|
-
>
|
|
327
|
-
<div
|
|
328
|
-
class="POS-logo h-100 d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ``} mx-2 w-100"
|
|
329
|
-
style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}"
|
|
327
|
+
})()};"
|
|
330
328
|
>
|
|
331
329
|
${document.body.offsetWidth < 800 && vm.type === 'menu'
|
|
332
330
|
? ` `
|
|
@@ -558,8 +556,11 @@ cursor: pointer;
|
|
|
558
556
|
})().join('<div class="dropdown-divider"></div>')}
|
|
559
557
|
${(POSSetting.config.who === 'manager') ? `<div class="dropdown-divider"></div>
|
|
560
558
|
<a class="dropdown-item cursor_pointer d-flex flex-column" onclick="${gvc.event(() => {
|
|
559
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
560
|
+
dialog.dataLoading({ visible: true });
|
|
561
561
|
localStorage.removeItem('on-pos');
|
|
562
|
-
|
|
562
|
+
(window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
|
|
563
|
+
glitter.share.reload('cms', 'shopnex');
|
|
563
564
|
})}">返回全通路後臺</a>
|
|
564
565
|
` : ``}
|
|
565
566
|
</div>
|
|
@@ -610,7 +611,7 @@ cursor: pointer;
|
|
|
610
611
|
}),
|
|
611
612
|
divCreate: {
|
|
612
613
|
class: `h-100 ${document.body.clientWidth < 768 ? `` : `d-flex`}`,
|
|
613
|
-
style: `background: #F7F7F7;`,
|
|
614
|
+
style: `background: #F7F7F7;padding-top:${glitter.share.top_inset}px;`,
|
|
614
615
|
},
|
|
615
616
|
})}
|
|
616
617
|
${gvc.bindView({
|
|
@@ -184,7 +184,6 @@ height: 51px;
|
|
|
184
184
|
|
|
185
185
|
public static main(gvc: GVC) {
|
|
186
186
|
const glitter = gvc.glitter
|
|
187
|
-
localStorage.setItem('on-pos','true')
|
|
188
187
|
// https://unpkg.com/html5-qrcode/minified/html5-qrcode.min.js
|
|
189
188
|
//設定裝置類型
|
|
190
189
|
gvc.glitter.runJsInterFace("pos-device", {}, (res) => {
|
|
@@ -258,7 +257,6 @@ height: 51px;
|
|
|
258
257
|
POSSetting.initialStyle(gvc);
|
|
259
258
|
//提供給編輯器使用
|
|
260
259
|
gvc.glitter.share.NormalPageEditor = NormalPageEditor;
|
|
261
|
-
getConfig().config.appName = gvc.glitter.getUrlParameter('app-id');
|
|
262
260
|
(window as any).glitterBase = 'shopnex';
|
|
263
261
|
(window as any).appName = gvc.glitter.getUrlParameter('app-id');
|
|
264
262
|
(window as any).saasConfig.config.token = GlobalUser.saas_token;
|
|
@@ -356,17 +354,17 @@ height: 51px;
|
|
|
356
354
|
return html`
|
|
357
355
|
<div
|
|
358
356
|
class="d-flex nav-top"
|
|
359
|
-
style="z-index:20;
|
|
360
|
-
if (document.body.offsetWidth > 800) {
|
|
361
|
-
return `86px`
|
|
362
|
-
} else {
|
|
363
|
-
return `66px`
|
|
364
|
-
}
|
|
365
|
-
})()};width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
|
|
357
|
+
style="z-index:20;padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
|
|
366
358
|
>
|
|
367
359
|
<div
|
|
368
|
-
class="POS-logo
|
|
369
|
-
style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}
|
|
360
|
+
class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ``} mx-2 w-100"
|
|
361
|
+
style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}height: ${(() => {
|
|
362
|
+
if (document.body.offsetWidth > 800) {
|
|
363
|
+
return `86px`
|
|
364
|
+
} else {
|
|
365
|
+
return `66px`
|
|
366
|
+
}
|
|
367
|
+
})()};"
|
|
370
368
|
>
|
|
371
369
|
${document.body.offsetWidth < 800 && vm.type === 'menu'
|
|
372
370
|
? ` `
|
|
@@ -602,12 +600,15 @@ cursor: pointer;
|
|
|
602
600
|
}
|
|
603
601
|
return view
|
|
604
602
|
})().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
|
-
|
|
608
|
-
|
|
603
|
+
${(POSSetting.config.who === 'manager') ? `<div class="dropdown-divider"></div>
|
|
604
|
+
<a class="dropdown-item cursor_pointer d-flex flex-column" onclick="${gvc.event(() => {
|
|
605
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
606
|
+
dialog.dataLoading({visible: true});
|
|
607
|
+
localStorage.removeItem('on-pos');
|
|
608
|
+
(window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
|
|
609
|
+
glitter.share.reload('cms','shopnex');
|
|
609
610
|
})}">返回全通路後臺</a>
|
|
610
|
-
|
|
611
|
+
` : ``}
|
|
611
612
|
</div>
|
|
612
613
|
</div>`)
|
|
613
614
|
})
|
|
@@ -653,7 +654,7 @@ cursor: pointer;
|
|
|
653
654
|
},
|
|
654
655
|
divCreate: {
|
|
655
656
|
class: `h-100 ${document.body.clientWidth < 768 ? `` : `d-flex`}`,
|
|
656
|
-
style: `background: #F7F7F7;`,
|
|
657
|
+
style: `background: #F7F7F7;padding-top:${glitter.share.top_inset}px;`,
|
|
657
658
|
},
|
|
658
659
|
})}
|
|
659
660
|
${gvc.bindView({
|