ts-glitter 13.6.6 → 13.6.9
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/glitterBundle/Glitter.js +7 -1
- package/lowcode/glitterBundle/Glitter.ts +7 -1
- package/lowcode/jspage/editor.js +24 -5
- package/lowcode/jspage/editor.ts +23 -4
- package/lowcode/jspage/function-page/main_editor.js +49 -4
- package/lowcode/jspage/function-page/main_editor.ts +63 -15
- package/lowcode/jspage/function-page/tool-setting.js +62 -56
- package/lowcode/jspage/function-page/tool-setting.ts +63 -57
- package/lowcode/official_event/e-commerce/get-count.js +25 -20
- package/lowcode/official_event/e-commerce/get-count.ts +30 -24
- package/lowcode/official_view_component/official/component.js +4 -0
- package/lowcode/official_view_component/official/component.ts +2 -0
- package/lowcode/public-components/headers/sy-02.js +326 -0
- package/lowcode/public-components/headers/sy-02.ts +324 -0
- package/lowcode/public-components/headers/sy-04.js +320 -0
- package/lowcode/public-components/headers/sy-04.ts +318 -0
- package/package.json +1 -1
|
@@ -44,12 +44,12 @@ export class ToolSetting {
|
|
|
44
44
|
view: () => {
|
|
45
45
|
if (vm.function === 'edit') {
|
|
46
46
|
return html`
|
|
47
|
-
<div class="px-2 pt-
|
|
47
|
+
<div class="px-2 pt-2">${vm.edit_view}</div>`;
|
|
48
48
|
}
|
|
49
49
|
return html`
|
|
50
50
|
${(() => {
|
|
51
51
|
if (document.body.clientWidth < 800) {
|
|
52
|
-
return `<div class="w-100 d-flex align-items-center p-3 border-bottom
|
|
52
|
+
return `<div class="w-100 d-flex align-items-center p-3 border-bottom">
|
|
53
53
|
<h5 class="offcanvas-title " style="max-width: calc(100% - 50px);overflow: hidden;text-overflow: ellipsis;">統一元件設定</h5>
|
|
54
54
|
<div class="flex-fill"></div>
|
|
55
55
|
<div
|
|
@@ -289,60 +289,66 @@ export class ToolSetting {
|
|
|
289
289
|
callback: (response) => {
|
|
290
290
|
if (response) {
|
|
291
291
|
dialog.dataLoading({visible: true});
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
"
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
292
|
+
((window as any).glitterInitialHelper).getPageData({
|
|
293
|
+
tag: dd.tag,
|
|
294
|
+
appName: dd.appName
|
|
295
|
+
},(d3:any)=>{
|
|
296
|
+
widget.config[0] = {
|
|
297
|
+
id: gvc.glitter.getUUID(),
|
|
298
|
+
js: './official_view_component/official.js',
|
|
299
|
+
css: {
|
|
300
|
+
class: {},
|
|
301
|
+
style: {},
|
|
302
|
+
},
|
|
303
|
+
data: {
|
|
304
|
+
refer_app: dd.appName,
|
|
305
|
+
refer_form_data:d3.response.result[0].page_config.formData,
|
|
306
|
+
tag: dd.tag,
|
|
307
|
+
list: [],
|
|
308
|
+
carryData: {},
|
|
309
|
+
},
|
|
310
|
+
type: 'component',
|
|
311
|
+
class: 'w-100',
|
|
312
|
+
index: 0,
|
|
313
|
+
label: dd.name,
|
|
314
|
+
style: '',
|
|
315
|
+
bundle: {},
|
|
316
|
+
global: [],
|
|
317
|
+
toggle: false,
|
|
318
|
+
stylist: [],
|
|
319
|
+
dataType: 'static',
|
|
320
|
+
style_from: 'code',
|
|
321
|
+
classDataType: 'static',
|
|
322
|
+
preloadEvenet: {},
|
|
323
|
+
share: {},
|
|
324
|
+
"arrayData": {
|
|
325
|
+
"clickEvent": [{
|
|
326
|
+
"clickEvent": {
|
|
327
|
+
"src": "./official_event/event.js",
|
|
328
|
+
"route": "code"
|
|
329
|
+
},
|
|
330
|
+
"codeVersion": "v2",
|
|
331
|
+
"code": " //判斷不是APP在顯示\n if ((gvc.glitter.deviceType === glitter.deviceTypeEnum.Web) && (glitter.getUrlParameter('device') !== 'mobile')) {\n return [subData]\n } else {\n return []\n }"
|
|
332
|
+
}]
|
|
333
|
+
},
|
|
334
|
+
"gCount": "multiple"
|
|
335
|
+
};
|
|
336
|
+
ApiPageConfig.setPage({
|
|
337
|
+
id: widget.id,
|
|
338
|
+
appName: widget.appName,
|
|
339
|
+
tag: widget.tag,
|
|
340
|
+
name: widget.name,
|
|
341
|
+
config: widget.config,
|
|
342
|
+
group: widget.group,
|
|
343
|
+
page_config: widget.page_config,
|
|
344
|
+
page_type: widget.page_type,
|
|
345
|
+
preview_image: widget.preview_image,
|
|
346
|
+
favorite: widget.favorite,
|
|
347
|
+
}).then((api) => {
|
|
348
|
+
dialog.dataLoading({visible: false});
|
|
349
|
+
location.reload();
|
|
350
|
+
});
|
|
351
|
+
})
|
|
346
352
|
}
|
|
347
353
|
},
|
|
348
354
|
});
|
|
@@ -408,7 +414,7 @@ export class ToolSetting {
|
|
|
408
414
|
`
|
|
409
415
|
},
|
|
410
416
|
divCreate: {
|
|
411
|
-
class: `p-2 mx-n2`,
|
|
417
|
+
class: `p-2 mx-n2 mt-n2`,
|
|
412
418
|
},
|
|
413
419
|
};
|
|
414
420
|
})].join('');
|
|
@@ -10,6 +10,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { TriggerEvent } from '../../glitterBundle/plugins/trigger-event.js';
|
|
11
11
|
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
12
12
|
import { ApiCart } from "../../glitter-base/route/api-cart.js";
|
|
13
|
+
export function getCheckoutCount(callback) {
|
|
14
|
+
ApiShop.getCheckout(ApiCart.cart).then((res) => {
|
|
15
|
+
if (res.result) {
|
|
16
|
+
ApiCart.setCart((cartItem) => {
|
|
17
|
+
cartItem.line_items = res.response.data.lineItems.map((dd) => {
|
|
18
|
+
return {
|
|
19
|
+
spec: dd.spec,
|
|
20
|
+
id: dd.id,
|
|
21
|
+
count: dd.count
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
let total = 0;
|
|
26
|
+
res.response.data.lineItems.map((dd) => {
|
|
27
|
+
total += dd.count;
|
|
28
|
+
});
|
|
29
|
+
callback(total);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
callback(0);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
13
36
|
TriggerEvent.createSingleEvent(import.meta.url, () => {
|
|
14
37
|
return {
|
|
15
38
|
fun: (gvc, widget, object, subData) => {
|
|
@@ -19,26 +42,8 @@ TriggerEvent.createSingleEvent(import.meta.url, () => {
|
|
|
19
42
|
},
|
|
20
43
|
event: () => {
|
|
21
44
|
return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ApiCart.setCart((cartItem) => {
|
|
25
|
-
cartItem.line_items = res.response.data.lineItems.map((dd) => {
|
|
26
|
-
return {
|
|
27
|
-
spec: dd.spec,
|
|
28
|
-
id: dd.id,
|
|
29
|
-
count: dd.count
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
let total = 0;
|
|
34
|
-
res.response.data.lineItems.map((dd) => {
|
|
35
|
-
total += dd.count;
|
|
36
|
-
});
|
|
37
|
-
resolve(total);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
resolve(0);
|
|
41
|
-
}
|
|
45
|
+
getCheckoutCount((count) => {
|
|
46
|
+
resolve(count);
|
|
42
47
|
});
|
|
43
48
|
}));
|
|
44
49
|
},
|
|
@@ -1,9 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import {TriggerEvent} from '../../glitterBundle/plugins/trigger-event.js';
|
|
2
|
+
import {ApiShop} from '../../glitter-base/route/shopping.js';
|
|
3
|
+
import {EditorElem} from '../../glitterBundle/plugins/editor-elem.js';
|
|
4
|
+
import {GlobalUser} from '../../glitter-base/global/global-user.js';
|
|
5
5
|
import {ApiCart} from "../../glitter-base/route/api-cart.js";
|
|
6
6
|
|
|
7
|
+
export function getCheckoutCount(callback: (count: number) => void) {
|
|
8
|
+
ApiShop.getCheckout(ApiCart.cart).then((res) => {
|
|
9
|
+
|
|
10
|
+
if (res.result) {
|
|
11
|
+
ApiCart.setCart((cartItem) => {
|
|
12
|
+
cartItem.line_items = res.response.data.lineItems.map((dd: any) => {
|
|
13
|
+
return {
|
|
14
|
+
spec: dd.spec,
|
|
15
|
+
id: dd.id,
|
|
16
|
+
count: dd.count
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
let total = 0;
|
|
21
|
+
res.response.data.lineItems.map((dd: any) => {
|
|
22
|
+
total += dd.count;
|
|
23
|
+
});
|
|
24
|
+
callback(total);
|
|
25
|
+
} else {
|
|
26
|
+
callback(0);
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
7
31
|
TriggerEvent.createSingleEvent(import.meta.url, () => {
|
|
8
32
|
return {
|
|
9
33
|
fun: (gvc, widget, object, subData) => {
|
|
@@ -13,26 +37,8 @@ TriggerEvent.createSingleEvent(import.meta.url, () => {
|
|
|
13
37
|
},
|
|
14
38
|
event: () => {
|
|
15
39
|
return new Promise(async (resolve, reject) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (res.result) {
|
|
19
|
-
ApiCart.setCart((cartItem)=>{
|
|
20
|
-
cartItem.line_items=res.response.data.lineItems.map((dd:any)=>{
|
|
21
|
-
return {
|
|
22
|
-
spec:dd.spec,
|
|
23
|
-
id:dd.id,
|
|
24
|
-
count:dd.count
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
let total = 0;
|
|
29
|
-
res.response.data.lineItems.map((dd: any) => {
|
|
30
|
-
total += dd.count;
|
|
31
|
-
});
|
|
32
|
-
resolve(total);
|
|
33
|
-
} else {
|
|
34
|
-
resolve(0);
|
|
35
|
-
}
|
|
40
|
+
getCheckoutCount((count) => {
|
|
41
|
+
resolve(count)
|
|
36
42
|
})
|
|
37
43
|
});
|
|
38
44
|
},
|
|
@@ -601,10 +601,14 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
601
601
|
let html = '';
|
|
602
602
|
let spiltCount = 0;
|
|
603
603
|
function appendHtml(pageData, widget, initial, p_id, parent_array) {
|
|
604
|
+
var _a;
|
|
604
605
|
const oWidget = widget;
|
|
606
|
+
oWidget.data.refer_form_data = (_a = oWidget.data.refer_form_data) !== null && _a !== void 0 ? _a : {};
|
|
605
607
|
initialReferData(widget);
|
|
606
608
|
const page_config = pageData.page_config;
|
|
607
609
|
function getReferForm(widget, type) {
|
|
610
|
+
var _a;
|
|
611
|
+
widget.data.refer_form_data = (_a = widget.data.refer_form_data) !== null && _a !== void 0 ? _a : {};
|
|
608
612
|
if ((widget.data.refer_app)) {
|
|
609
613
|
widget.data.refer_form_data = widget.data.refer_form_data || (oWidget.data.refer_form_data && JSON.parse(JSON.stringify(oWidget.data.refer_form_data))) || JSON.parse(JSON.stringify(page_config.formData));
|
|
610
614
|
if (type !== 'def') {
|
|
@@ -613,10 +613,12 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
613
613
|
|
|
614
614
|
function appendHtml(pageData: any, widget: any, initial: boolean, p_id: string, parent_array: any) {
|
|
615
615
|
const oWidget = widget
|
|
616
|
+
oWidget.data.refer_form_data=oWidget.data.refer_form_data ?? {}
|
|
616
617
|
initialReferData(widget)
|
|
617
618
|
const page_config = pageData.page_config;
|
|
618
619
|
|
|
619
620
|
function getReferForm(widget: any, type: string) {
|
|
621
|
+
widget.data.refer_form_data=widget.data.refer_form_data??{}
|
|
620
622
|
if ((widget.data.refer_app)) {
|
|
621
623
|
widget.data.refer_form_data = widget.data.refer_form_data || (oWidget.data.refer_form_data && JSON.parse(JSON.stringify(oWidget.data.refer_form_data))) || JSON.parse(JSON.stringify(page_config.formData))
|
|
622
624
|
if (type !== 'def') {
|