ts-glitter 21.8.6 → 21.8.7
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/editor/basic-component.js +10 -0
- package/lowcode/editor/basic-component.ts +11 -1
- package/lowcode/glitterBundle/plugins/html-render.js +0 -2
- package/lowcode/glitterBundle/plugins/html-render.ts +0 -1
- package/lowcode/jspage/function-page/tool-setting.js +1 -5
- package/lowcode/jspage/function-page/tool-setting.ts +5 -4
- package/lowcode/jspage/main.js +1 -6
- package/lowcode/jspage/main.ts +1 -6
- package/lowcode/modules/image-library.js +0 -1
- package/lowcode/modules/image-library.ts +1 -1
- package/lowcode/official_view_component/official/component.js +1 -1
- package/lowcode/official_view_component/official/component.ts +1 -1
- package/lowcode/public-components/banner/first-banner.js +50 -85
- package/lowcode/public-components/banner/first-banner.ts +59 -96
- package/package.json +1 -1
- package/src/api-public/services/checkout-event.js +0 -2
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/shopping.d.ts +1 -0
- package/src/api-public/services/shopping.js +60 -49
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +87 -62
package/lowcode/Entry.js
CHANGED
|
@@ -146,7 +146,7 @@ export class Entry {
|
|
|
146
146
|
}
|
|
147
147
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
|
|
148
148
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
149
|
-
glitter.share.editerVersion = 'V_21.8.
|
|
149
|
+
glitter.share.editerVersion = 'V_21.8.7';
|
|
150
150
|
glitter.share.start = new Date();
|
|
151
151
|
const vm = { appConfig: [] };
|
|
152
152
|
window.saasConfig = {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -150,7 +150,7 @@ export class Entry {
|
|
|
150
150
|
}
|
|
151
151
|
(window as any).renderClock = (window as any).renderClock ?? createClock();
|
|
152
152
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
153
|
-
glitter.share.editerVersion = 'V_21.8.
|
|
153
|
+
glitter.share.editerVersion = 'V_21.8.7';
|
|
154
154
|
glitter.share.start = new Date();
|
|
155
155
|
const vm = { appConfig: [] };
|
|
156
156
|
(window as any).saasConfig = {
|
|
@@ -9452,6 +9452,16 @@ BasicComponent.componentList = [
|
|
|
9452
9452
|
"formData": {}
|
|
9453
9453
|
},
|
|
9454
9454
|
image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scs0sfs1sasbs1sf_Screenshot2024-11-14at2.03.47 AM.jpg`
|
|
9455
|
+
},
|
|
9456
|
+
{
|
|
9457
|
+
title: '社群按鈕',
|
|
9458
|
+
config: { "id": "s6s7sbs4s5s5sasd", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "tag": "social_popup", "_gap": "", "attr": [], "elem": "div", "list": [], "inner": "", "_other": {}, "_border": {}, "_margin": {}, "_radius": "", "_padding": {}, "_reverse": "false", "carryData": {}, "refer_app": "shop_template_black_style", "_max_width": "", "_background": "", "_style_refer": "global", "_hor_position": "center", "refer_form_data": { "social_list": [{ "icon": "https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg", "social_type": "fb" }, { "social_type": "ig" }, { "social_type": "line" }] }, "_background_setting": { "type": "none" } }, "list": [], "type": "component", "class": "w-100", "index": 2, "label": "社群彈窗", "style": "", "global": [], "mobile": { "id": "s6s7sbs4s5s5sasd", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "refer_app": "shop_template_black_style" }, "list": [], "type": "component", "class": "w-100", "index": 2, "label": "社群彈窗", "style": "", "global": [], "toggle": true, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "refer": "custom" }, "toggle": true, "desktop": { "data": { "refer_app": "shop_template_black_style", "refer_form_data": {} }, "refer": "custom" }, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "formData": {} },
|
|
9459
|
+
image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/Screenshot 2025-05-21 at 6.22.03 PM.jpg`
|
|
9460
|
+
},
|
|
9461
|
+
{
|
|
9462
|
+
title: '首頁廣告',
|
|
9463
|
+
config: { "id": "s4s1sfs7s9s8sds5", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "tag": "banner-first", "_gap": "", "attr": [], "elem": "div", "list": [], "inner": "", "_other": {}, "_border": {}, "_margin": {}, "_radius": "", "_padding": {}, "_reverse": "false", "carryData": {}, "refer_app": "shop_template_black_style", "_max_width": "", "_background": "", "_style_refer": "custom", "_hor_position": "center", "refer_form_data": { "map": "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3625.9857346364677!2d121.56387331536634!3d25.033964283970027!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3442abbff9f1f2cd%3A0xa5e9e25b96d47b6!2z5p2x5Y2A5rC45bq36Zmi!5e0!3m2!1szh-TW!2stw!4v1697247462832!5m2!1szh-TW!2stw", "list": [{ "img": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/s*px$_s7s4s2sas9s7s1s8_1747824490757.png", "link": "/all-product", "title": "所有商品頁面" }], "width": { "unit": "px", "value": "450px", "number": "450" }, "height": { "unit": "px", "value": "450px", "number": "450" } }, "_background_setting": { "type": "none" }, "_style_refer_global": { "index": "0" } }, "list": [], "type": "component", "class": "w-100", "index": 21, "label": "首圖廣告", "style": "", "global": [], "mobile": { "id": "s4s1sfs7s9s8sds5", "js": "./official_view_component/official.js", "css": { "class": {}, "style": {} }, "data": { "refer_app": "shop_template_black_style" }, "list": [], "type": "component", "class": "w-100", "index": 21, "label": "首圖廣告", "style": "", "global": [], "toggle": true, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "refer": "custom" }, "toggle": true, "desktop": { "data": { "refer_app": "shop_template_black_style", "refer_form_data": {} }, "refer": "custom" }, "stylist": [], "version": "v2", "visible": true, "dataType": "static", "style_from": "code", "classDataType": "static", "editor_bridge": {}, "preloadEvenet": {}, "container_fonts": 0, "mobile_editable": [], "desktop_editable": [], "refreshAllParameter": {}, "refreshComponentParameter": {}, "formData": {} },
|
|
9464
|
+
image: `https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/Screenshot 2025-05-21 at 6.50.46 PM.jpg`
|
|
9455
9465
|
}
|
|
9456
9466
|
];
|
|
9457
9467
|
BasicComponent.productList = [
|
|
@@ -9067,7 +9067,17 @@ export class BasicComponent {
|
|
|
9067
9067
|
"formData": {}
|
|
9068
9068
|
},
|
|
9069
9069
|
image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scs0sfs1sasbs1sf_Screenshot2024-11-14at2.03.47 AM.jpg`
|
|
9070
|
-
}
|
|
9070
|
+
},
|
|
9071
|
+
{
|
|
9072
|
+
title: '社群按鈕',
|
|
9073
|
+
config: {"id":"s6s7sbs4s5s5sasd","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"tag":"social_popup","_gap":"","attr":[],"elem":"div","list":[],"inner":"","_other":{},"_border":{},"_margin":{},"_radius":"","_padding":{},"_reverse":"false","carryData":{},"refer_app":"shop_template_black_style","_max_width":"","_background":"","_style_refer":"global","_hor_position":"center","refer_form_data":{"social_list":[{"icon":"https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg","social_type":"fb"},{"social_type":"ig"},{"social_type":"line"}]},"_background_setting":{"type":"none"}},"list":[],"type":"component","class":"w-100","index":2,"label":"社群彈窗","style":"","global":[],"mobile":{"id":"s6s7sbs4s5s5sasd","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"refer_app":"shop_template_black_style"},"list":[],"type":"component","class":"w-100","index":2,"label":"社群彈窗","style":"","global":[],"toggle":true,"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"refer":"custom"},"toggle":true,"desktop":{"data":{"refer_app":"shop_template_black_style","refer_form_data":{}},"refer":"custom"},"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"formData":{}},
|
|
9074
|
+
image: `https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/Screenshot 2025-05-21 at 6.22.03 PM.jpg`
|
|
9075
|
+
},
|
|
9076
|
+
{
|
|
9077
|
+
title: '首頁廣告',
|
|
9078
|
+
config: {"id":"s4s1sfs7s9s8sds5","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"tag":"banner-first","_gap":"","attr":[],"elem":"div","list":[],"inner":"","_other":{},"_border":{},"_margin":{},"_radius":"","_padding":{},"_reverse":"false","carryData":{},"refer_app":"shop_template_black_style","_max_width":"","_background":"","_style_refer":"custom","_hor_position":"center","refer_form_data":{"map":"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3625.9857346364677!2d121.56387331536634!3d25.033964283970027!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3442abbff9f1f2cd%3A0xa5e9e25b96d47b6!2z5p2x5Y2A5rC45bq36Zmi!5e0!3m2!1szh-TW!2stw!4v1697247462832!5m2!1szh-TW!2stw","list":[{"img":"https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/s*px$_s7s4s2sas9s7s1s8_1747824490757.png","link":"/all-product","title":"所有商品頁面"}],"width":{"unit":"px","value":"450px","number":"450"},"height":{"unit":"px","value":"450px","number":"450"}},"_background_setting":{"type":"none"},"_style_refer_global":{"index":"0"}},"list":[],"type":"component","class":"w-100","index":21,"label":"首圖廣告","style":"","global":[],"mobile":{"id":"s4s1sfs7s9s8sds5","js":"./official_view_component/official.js","css":{"class":{},"style":{}},"data":{"refer_app":"shop_template_black_style"},"list":[],"type":"component","class":"w-100","index":21,"label":"首圖廣告","style":"","global":[],"toggle":true,"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"refer":"custom"},"toggle":true,"desktop":{"data":{"refer_app":"shop_template_black_style","refer_form_data":{}},"refer":"custom"},"stylist":[],"version":"v2","visible":true,"dataType":"static","style_from":"code","classDataType":"static","editor_bridge":{},"preloadEvenet":{},"container_fonts":0,"mobile_editable":[],"desktop_editable":[],"refreshAllParameter":{},"refreshComponentParameter":{},"formData":{}},
|
|
9079
|
+
image: `https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/Screenshot 2025-05-21 at 6.50.46 PM.jpg`
|
|
9080
|
+
}
|
|
9071
9081
|
]
|
|
9072
9082
|
|
|
9073
9083
|
public static productList = [
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { init } from '../GVController.js';
|
|
11
11
|
import { TriggerEvent } from './trigger-event.js';
|
|
12
12
|
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
13
|
-
import { FirstBanner } from '../../public-components/banner/first-banner.js';
|
|
14
13
|
import { Language } from '../../glitter-base/global/language.js';
|
|
15
14
|
import { ApplicationConfig } from '../../application-config.js';
|
|
16
15
|
const html = String.raw;
|
|
@@ -91,7 +90,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
91
90
|
return {
|
|
92
91
|
onCreateView: () => {
|
|
93
92
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
94
|
-
FirstBanner.main({ gvc: gvc });
|
|
95
93
|
if (gBundle.page_config.seo && gBundle.page_config.seo.type === 'custom' && gBundle.page_config.seo.title) {
|
|
96
94
|
glitter.setUrlParameter('', undefined, [
|
|
97
95
|
(_a = gBundle.page_config.seo.title_prefix) !== null && _a !== void 0 ? _a : '',
|
|
@@ -76,7 +76,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
76
76
|
|
|
77
77
|
return {
|
|
78
78
|
onCreateView: () => {
|
|
79
|
-
FirstBanner.main({ gvc: gvc });
|
|
80
79
|
//定義SEO TITLE
|
|
81
80
|
if (gBundle.page_config.seo && gBundle.page_config.seo.type === 'custom' && gBundle.page_config.seo.title) {
|
|
82
81
|
glitter.setUrlParameter(
|
|
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
11
11
|
import { ApiPageConfig } from '../../api/pageConfig.js';
|
|
12
|
-
import { FirstBanner } from '../../public-components/banner/first-banner.js';
|
|
13
12
|
import { GlobalWidget } from '../../editor-components/global-widget/global-widget.js';
|
|
14
13
|
export class ToolSetting {
|
|
15
14
|
static main(gvc) {
|
|
@@ -173,10 +172,7 @@ export class ToolSetting {
|
|
|
173
172
|
const htmlGenerate = new gvc.glitter.htmlGenerate(widget_container, [], {
|
|
174
173
|
editor_updated_callback: (oWidget) => {
|
|
175
174
|
if (dd.tag === '廣告輪播') {
|
|
176
|
-
|
|
177
|
-
gvc: document.querySelector('.iframe_view').contentWindow.glitter.pageConfig[0].gvc,
|
|
178
|
-
ed_widget: oWidget,
|
|
179
|
-
});
|
|
175
|
+
console.log(`oWidget==>`, oWidget);
|
|
180
176
|
}
|
|
181
177
|
},
|
|
182
178
|
}, true);
|
|
@@ -213,10 +213,11 @@ export class ToolSetting {
|
|
|
213
213
|
{
|
|
214
214
|
editor_updated_callback: (oWidget: any) => {
|
|
215
215
|
if (dd.tag === '廣告輪播') {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
console.log(`oWidget==>`,oWidget)
|
|
217
|
+
// FirstBanner.main({
|
|
218
|
+
// gvc: (document.querySelector('.iframe_view') as any).contentWindow.glitter.pageConfig[0].gvc,
|
|
219
|
+
// // ed_widget: oWidget,
|
|
220
|
+
// });
|
|
220
221
|
}
|
|
221
222
|
},
|
|
222
223
|
},
|
package/lowcode/jspage/main.js
CHANGED
|
@@ -743,12 +743,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
743
743
|
src: `fa-sharp fa-regular fa-globe guide-user-editor-11-icon`,
|
|
744
744
|
index: 'color',
|
|
745
745
|
hint: '全站樣式',
|
|
746
|
-
}
|
|
747
|
-
{
|
|
748
|
-
src: `fa-regular fa-grid-2 design-guide-1-icon`,
|
|
749
|
-
index: 'widget',
|
|
750
|
-
hint: '設計元件',
|
|
751
|
-
},
|
|
746
|
+
}
|
|
752
747
|
]
|
|
753
748
|
.filter(dd => {
|
|
754
749
|
if (gvc.glitter.getUrlParameter('device') === 'mobile') {
|
package/lowcode/jspage/main.ts
CHANGED
|
@@ -804,12 +804,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
804
804
|
src: `fa-sharp fa-regular fa-globe guide-user-editor-11-icon`,
|
|
805
805
|
index: 'color',
|
|
806
806
|
hint: '全站樣式',
|
|
807
|
-
}
|
|
808
|
-
{
|
|
809
|
-
src: `fa-regular fa-grid-2 design-guide-1-icon`,
|
|
810
|
-
index: 'widget',
|
|
811
|
-
hint: '設計元件',
|
|
812
|
-
},
|
|
807
|
+
}
|
|
813
808
|
]
|
|
814
809
|
.filter(dd => {
|
|
815
810
|
if (gvc.glitter.getUrlParameter('device') === 'mobile') {
|
|
@@ -1178,7 +1178,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
1178
1178
|
</div>`,
|
|
1179
1179
|
` <div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
|
|
1180
1180
|
].join(`<div style="height:18px;"></div>`);
|
|
1181
|
-
if (app_editor || glitter.share.editorViewModel.selectItem.is_customer_header) {
|
|
1181
|
+
if (app_editor || ((glitter.share.editorViewModel.selectItem) && glitter.share.editorViewModel.selectItem.is_customer_header)) {
|
|
1182
1182
|
global_setting_view = ``;
|
|
1183
1183
|
}
|
|
1184
1184
|
if (vm.page === 'editor') {
|
|
@@ -1355,7 +1355,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
1355
1355
|
</div>`,
|
|
1356
1356
|
` <div class="mx-n3" style="background: #DDD;height: 1px;"></div>`,
|
|
1357
1357
|
].join(`<div style="height:18px;"></div>`);
|
|
1358
|
-
if (app_editor || glitter.share.editorViewModel.selectItem.is_customer_header) {
|
|
1358
|
+
if (app_editor || ((glitter.share.editorViewModel.selectItem) && glitter.share.editorViewModel.selectItem.is_customer_header)) {
|
|
1359
1359
|
global_setting_view = ``;
|
|
1360
1360
|
}
|
|
1361
1361
|
if (vm.page === 'editor') {
|
|
@@ -7,8 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { ApiPageConfig } from "../../api/pageConfig.js";
|
|
11
|
-
import { GlobalWidget } from "../../glitterBundle/html-component/global-widget.js";
|
|
12
10
|
const html = String.raw;
|
|
13
11
|
const css = String.raw;
|
|
14
12
|
export class FirstBanner {
|
|
@@ -39,50 +37,18 @@ export class FirstBanner {
|
|
|
39
37
|
background: #393939!important;
|
|
40
38
|
}
|
|
41
39
|
`);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, (d2) => {
|
|
51
|
-
const data = d2.response.result[0];
|
|
52
|
-
function getFormData(ref) {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
ref = window.parent.glitter.share.updated_form_data[`${widget.refer_app}_${widget.tag}`] || ref;
|
|
55
|
-
let formData = JSON.parse(JSON.stringify(ref || {}));
|
|
56
|
-
if ((widget.data.refer_app)) {
|
|
57
|
-
GlobalWidget.initialShowCaseData({
|
|
58
|
-
widget: widget,
|
|
59
|
-
gvc: gvc
|
|
60
|
-
});
|
|
61
|
-
if (gvc.glitter.document.body.clientWidth < 800 && widget.mobile.refer === 'custom') {
|
|
62
|
-
((_a = widget[`mobile_editable`]) !== null && _a !== void 0 ? _a : []).map((dd) => {
|
|
63
|
-
formData[dd] = JSON.parse(JSON.stringify((widget.mobile.data.refer_form_data || data.page_config.formData)[dd] || {}));
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
else if (gvc.glitter.document.body.clientWidth >= 800 && widget.desktop.refer === 'custom') {
|
|
67
|
-
((_b = widget[`desktop_editable`]) !== null && _b !== void 0 ? _b : []).map((dd) => {
|
|
68
|
-
formData[dd] = JSON.parse(JSON.stringify((widget.desktop.data.refer_form_data || data.page_config.formData)[dd] || {}));
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return formData;
|
|
73
|
-
}
|
|
74
|
-
const formData = getFormData((widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData);
|
|
75
|
-
if (formData.list && formData.list.length) {
|
|
76
|
-
obj.gvc.glitter.innerDialog((gvc) => {
|
|
77
|
-
return gvc.bindView(() => {
|
|
78
|
-
return {
|
|
79
|
-
bind: id,
|
|
80
|
-
view: () => {
|
|
81
|
-
return html `
|
|
40
|
+
const formData = obj.widget.formData;
|
|
41
|
+
if (formData.list && formData.list.length) {
|
|
42
|
+
obj.gvc.glitter.innerDialog((gvc) => {
|
|
43
|
+
return gvc.bindView(() => {
|
|
44
|
+
return {
|
|
45
|
+
bind: id,
|
|
46
|
+
view: () => {
|
|
47
|
+
return html `
|
|
82
48
|
<div class="swiper mySwiper_${id}" style="width:520px;max-width:100vw;height:auto !important;">
|
|
83
49
|
<div class="swiper-wrapper">
|
|
84
50
|
${formData.list.map((dd) => {
|
|
85
|
-
|
|
51
|
+
return html `
|
|
86
52
|
<div class="swiper-slide pb-4 d-flex align-items-center justify-content-center position-relative"
|
|
87
53
|
style="background: none;
|
|
88
54
|
overflow: hidden;;
|
|
@@ -90,61 +56,60 @@ overflow: hidden;;
|
|
|
90
56
|
<img src="${dd.img || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}" style="width:520px;max-width:calc(100vw - 40px);max-height: 100vh;cursor: pointer;
|
|
91
57
|
border-radius: 25px;
|
|
92
58
|
" onclick="${gvc.event(() => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
59
|
+
gvc.glitter.href = dd.link;
|
|
60
|
+
gvc.closeDialog();
|
|
61
|
+
})}" >
|
|
96
62
|
<div class="position-absolute d-flex align-items-center justify-content-center"
|
|
97
63
|
style="top:0px;right: 0px;width:50px;height: 50px;
|
|
98
64
|
background: rgba(0,0,0,0.5);border-top-right-radius: 25px;border-bottom-left-radius: 10px;cursor: pointer;" onclick="${(() => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
65
|
+
if (gvc.glitter.htmlGenerate.isEditMode()) {
|
|
66
|
+
return gvc.editorEvent(() => {
|
|
67
|
+
gvc.closeDialog();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return gvc.event(() => {
|
|
72
|
+
gvc.closeDialog();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
})()}">
|
|
110
76
|
<i class="fa-regular fa-circle-xmark text-white fs-5"
|
|
111
77
|
></i>
|
|
112
78
|
</div>
|
|
113
79
|
</div>
|
|
114
80
|
`;
|
|
115
|
-
|
|
81
|
+
}).join('')}
|
|
116
82
|
</div>
|
|
117
83
|
<div class="swiper-pagination swiper-pagination-${id}"></div>
|
|
118
84
|
</div>`;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
85
|
+
},
|
|
86
|
+
divCreate: {
|
|
87
|
+
class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
|
|
88
|
+
style: css `z-index: 999999;
|
|
123
89
|
background: rgba(0, 0, 0, 0.5);`
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
90
|
+
},
|
|
91
|
+
onCreate: () => {
|
|
92
|
+
const interval = setInterval(() => {
|
|
93
|
+
if (gvc.glitter.window.Swiper) {
|
|
94
|
+
const swiper = new gvc.glitter.window.Swiper(`.mySwiper_${id}`, {
|
|
95
|
+
loop: true,
|
|
96
|
+
pagination: {
|
|
97
|
+
el: `.swiper-pagination-${id}`,
|
|
98
|
+
clickable: true,
|
|
99
|
+
},
|
|
100
|
+
on: {
|
|
101
|
+
slideChange: function () {
|
|
133
102
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
});
|
|
145
|
-
}, 'first-banner', {});
|
|
146
|
-
}
|
|
147
|
-
});
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
clearTimeout(interval);
|
|
106
|
+
}
|
|
107
|
+
}, 100);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}, 'first-banner', {});
|
|
112
|
+
}
|
|
148
113
|
return ``;
|
|
149
114
|
});
|
|
150
115
|
}
|
|
@@ -8,9 +8,10 @@ const css = String.raw
|
|
|
8
8
|
|
|
9
9
|
export class FirstBanner {
|
|
10
10
|
|
|
11
|
-
public static async main(obj:
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
public static async main(obj:{
|
|
12
|
+
gvc: GVC,
|
|
13
|
+
widget: any,
|
|
14
|
+
subData: any
|
|
14
15
|
}) {
|
|
15
16
|
|
|
16
17
|
const gvc = obj.gvc
|
|
@@ -38,57 +39,21 @@ export class FirstBanner {
|
|
|
38
39
|
background: #393939!important;
|
|
39
40
|
}
|
|
40
41
|
`)
|
|
41
|
-
|
|
42
|
-
await ApiPageConfig.getPage({
|
|
43
|
-
appName: (gvc.glitter.window as any).appName,
|
|
44
|
-
type: 'template',
|
|
45
|
-
tag:'advertise',
|
|
46
|
-
})
|
|
47
|
-
).response.result[0]).config[0];
|
|
48
|
-
((gvc.glitter.window as any).glitterInitialHelper).getPageData( {
|
|
49
|
-
tag: widget.data.tag,
|
|
50
|
-
appName: widget.data.refer_app
|
|
51
|
-
}, (d2: any) => {
|
|
52
|
-
const data = d2.response.result[0]
|
|
53
|
-
function getFormData(ref: any) {
|
|
54
|
-
//判斷是否有上次的更新資料
|
|
55
|
-
ref= (window.parent as any).glitter.share.updated_form_data[`${widget.refer_app}_${widget.tag}`] || ref;
|
|
56
|
-
let formData = JSON.parse(JSON.stringify(ref || {}))
|
|
57
|
-
if ((widget.data.refer_app)) {
|
|
58
|
-
GlobalWidget.initialShowCaseData({
|
|
59
|
-
widget: widget,
|
|
60
|
-
gvc: gvc
|
|
61
|
-
});
|
|
62
|
-
if (gvc.glitter.document.body.clientWidth < 800 && (widget as any).mobile.refer === 'custom') {
|
|
63
|
-
((widget as any)[`mobile_editable`] ?? []).map((dd: any) => {
|
|
64
|
-
formData[dd] = JSON.parse(JSON.stringify(((widget as any).mobile.data.refer_form_data || data.page_config.formData)[dd] || {}))
|
|
65
|
-
});
|
|
66
|
-
// data.page_config.formData = (widget.data.refer_form_data || data.page_config.formData)
|
|
67
|
-
} else if (gvc.glitter.document.body.clientWidth >= 800 && (widget as any).desktop.refer === 'custom') {
|
|
68
|
-
((widget as any)[`desktop_editable`] ?? []).map((dd: any) => {
|
|
69
|
-
formData[dd] = JSON.parse(JSON.stringify(((widget as any).desktop.data.refer_form_data || data.page_config.formData)[dd] || {}))
|
|
70
|
-
});
|
|
42
|
+
const formData = obj.widget.formData;
|
|
71
43
|
|
|
72
|
-
|
|
73
|
-
|
|
44
|
+
if(formData.list && formData.list.length){
|
|
45
|
+
obj.gvc.glitter.innerDialog((gvc) => {
|
|
46
|
+
return gvc.bindView(() => {
|
|
74
47
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if(formData.list && formData.list.length){
|
|
80
|
-
obj.gvc.glitter.innerDialog((gvc) => {
|
|
81
|
-
return gvc.bindView(() => {
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
bind: id,
|
|
85
|
-
view: () => {
|
|
86
|
-
return html`
|
|
48
|
+
return {
|
|
49
|
+
bind: id,
|
|
50
|
+
view: () => {
|
|
51
|
+
return html`
|
|
87
52
|
<div class="swiper mySwiper_${id}" style="width:520px;max-width:100vw;height:auto !important;">
|
|
88
53
|
<div class="swiper-wrapper">
|
|
89
54
|
${
|
|
90
|
-
|
|
91
|
-
|
|
55
|
+
formData.list.map((dd:any) => {
|
|
56
|
+
return html`
|
|
92
57
|
<div class="swiper-slide pb-4 d-flex align-items-center justify-content-center position-relative"
|
|
93
58
|
style="background: none;
|
|
94
59
|
overflow: hidden;;
|
|
@@ -96,68 +61,66 @@ overflow: hidden;;
|
|
|
96
61
|
<img src="${dd.img || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}" style="width:520px;max-width:calc(100vw - 40px);max-height: 100vh;cursor: pointer;
|
|
97
62
|
border-radius: 25px;
|
|
98
63
|
" onclick="${gvc.event(() => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
64
|
+
gvc.glitter.href=dd.link;
|
|
65
|
+
gvc.closeDialog()
|
|
66
|
+
})}" >
|
|
102
67
|
<div class="position-absolute d-flex align-items-center justify-content-center"
|
|
103
68
|
style="top:0px;right: 0px;width:50px;height: 50px;
|
|
104
69
|
background: rgba(0,0,0,0.5);border-top-right-radius: 25px;border-bottom-left-radius: 10px;cursor: pointer;" onclick="${
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
70
|
+
(()=>{
|
|
71
|
+
if(gvc.glitter.htmlGenerate.isEditMode()){
|
|
72
|
+
return gvc.editorEvent(()=>{
|
|
73
|
+
gvc.closeDialog()
|
|
74
|
+
})
|
|
75
|
+
}else{
|
|
76
|
+
return gvc.event(()=>{
|
|
77
|
+
gvc.closeDialog()
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
})()}">
|
|
116
81
|
<i class="fa-regular fa-circle-xmark text-white fs-5"
|
|
117
82
|
></i>
|
|
118
83
|
</div>
|
|
119
84
|
</div>
|
|
120
85
|
`
|
|
121
|
-
|
|
122
|
-
|
|
86
|
+
}).join('')
|
|
87
|
+
}
|
|
123
88
|
</div>
|
|
124
89
|
<div class="swiper-pagination swiper-pagination-${id}"></div>
|
|
125
90
|
</div>`
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
91
|
+
},
|
|
92
|
+
divCreate: {
|
|
93
|
+
class: `vw-100 vh-100 position-fixed ${id} d-flex align-items-center justify-content-center`,
|
|
94
|
+
style: css`z-index: 999999;
|
|
130
95
|
background: rgba(0, 0, 0, 0.5);`
|
|
131
|
-
|
|
132
|
-
|
|
96
|
+
},
|
|
97
|
+
onCreate: () => {
|
|
133
98
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
99
|
+
const interval = setInterval(() => {
|
|
100
|
+
if ((gvc.glitter.window as any).Swiper) {
|
|
101
|
+
const swiper = new (gvc.glitter.window as any).Swiper(`.mySwiper_${id}`, {
|
|
102
|
+
// Optional parameters
|
|
103
|
+
loop: true,
|
|
104
|
+
// If we need pagination
|
|
105
|
+
pagination: {
|
|
106
|
+
el: `.swiper-pagination-${id}`,
|
|
107
|
+
clickable: true,
|
|
108
|
+
},
|
|
109
|
+
on: {
|
|
110
|
+
slideChange: function () {
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
},
|
|
113
|
+
},
|
|
149
114
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
}, 'first-banner', {})
|
|
115
|
+
});
|
|
116
|
+
clearTimeout(interval)
|
|
117
|
+
}
|
|
118
|
+
}, 100)
|
|
119
|
+
}
|
|
158
120
|
}
|
|
159
|
-
|
|
160
|
-
|
|
121
|
+
})
|
|
122
|
+
}, 'first-banner', {})
|
|
123
|
+
}
|
|
161
124
|
|
|
162
125
|
|
|
163
126
|
return ``
|
package/package.json
CHANGED
|
@@ -454,7 +454,6 @@ class CheckoutEvent {
|
|
|
454
454
|
}
|
|
455
455
|
else {
|
|
456
456
|
const refer = JSON.parse(JSON.stringify(variant.stockList));
|
|
457
|
-
console.log(`refer.stockList===>`, variant.stockList);
|
|
458
457
|
Object.keys(refer).forEach(key => {
|
|
459
458
|
var _a;
|
|
460
459
|
if ((key !== data.pos_store) &&
|
|
@@ -464,7 +463,6 @@ class CheckoutEvent {
|
|
|
464
463
|
delete refer[key];
|
|
465
464
|
}
|
|
466
465
|
});
|
|
467
|
-
console.log(`refer===>`, refer);
|
|
468
466
|
const returnData = new stock_js_1.Stock(this.app, this.token).allocateStock(refer, item.count);
|
|
469
467
|
variant.stockList = Object.assign(Object.assign({}, variant.stockList), refer);
|
|
470
468
|
variant.deduction_log = Object.assign(Object.assign({}, variant.deduction_log), returnData.deductionLog);
|