ts-glitter 21.5.3 → 21.5.4
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/account-info.js +79 -67
- package/lowcode/cms-plugin/account-info.ts +327 -311
- package/lowcode/cms-plugin/information/information-module.ts +3 -1
- package/lowcode/cms-plugin/list-header-option.js +1 -0
- package/lowcode/cms-plugin/list-header-option.ts +1 -0
- package/lowcode/cms-plugin/shopping-information.js +468 -0
- package/lowcode/cms-plugin/shopping-information.ts +557 -0
- package/lowcode/cms-plugin/shopping-market-shopee.js +283 -231
- package/lowcode/cms-plugin/shopping-market-shopee.ts +401 -361
- package/lowcode/cms-plugin/shopping-order-manager.js +16 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +18 -3
- package/lowcode/glitter-base/global/language.js +4 -1
- package/lowcode/glitter-base/global/language.ts +4 -2
- package/lowcode/glitter-base/route/shopee.js +48 -11
- package/lowcode/glitter-base/route/shopee.ts +119 -80
- package/lowcode/glitterBundle/plugins/html-render.js +121 -90
- package/lowcode/glitterBundle/plugins/html-render.ts +367 -318
- package/lowcode/modules/image-library.js +2 -3
- package/lowcode/modules/image-library.ts +21 -7
- package/lowcode/public-components/checkout/index.js +90 -41
- package/lowcode/public-components/checkout/index.ts +101 -49
- package/lowcode/public-components/footer/footer-initial.js +11 -2
- package/lowcode/public-components/footer/footer-initial.ts +29 -18
- package/lowcode/public-components/headers/header-class.js +47 -35
- package/lowcode/public-components/headers/header-class.ts +54 -38
- package/lowcode/public-components/layout-plugin/social-links-01.js +122 -3
- package/lowcode/public-components/layout-plugin/social-links-01.ts +135 -10
- package/lowcode/public-components/product/pd-card-01.js +23 -14
- package/lowcode/public-components/product/pd-card-01.ts +25 -14
- package/lowcode/public-components/product/pd-card-02.js +23 -16
- package/lowcode/public-components/product/pd-card-02.ts +25 -16
- package/lowcode/public-components/product/pd-card-03.js +25 -16
- package/lowcode/public-components/product/pd-card-03.ts +27 -16
- package/lowcode/public-components/terms-related/index.js +13 -2
- package/lowcode/public-components/terms-related/index.ts +15 -2
- package/lowcode/public-components/user-manager/um-class.js +490 -501
- package/lowcode/public-components/user-manager/um-class.ts +872 -882
- package/lowcode/public-components/user-manager/um-info.js +41 -40
- package/lowcode/public-components/user-manager/um-info.ts +54 -56
- package/lowcode/public-components/user-manager/um-login.js +10 -13
- package/lowcode/public-components/user-manager/um-login.ts +15 -23
- package/lowcode/public-components/user-manager/um-orderlist.js +60 -51
- package/lowcode/public-components/user-manager/um-orderlist.ts +289 -275
- package/lowcode/public-components/user-manager/um-rebate.js +104 -82
- package/lowcode/public-components/user-manager/um-rebate.ts +294 -267
- package/lowcode/public-components/user-manager/um-receive.js +582 -0
- package/lowcode/public-components/user-manager/um-receive.ts +599 -0
- package/lowcode/public-components/user-manager/um-wishlist.js +72 -68
- package/lowcode/public-components/user-manager/um-wishlist.ts +240 -230
- package/package.json +1 -1
- package/src/api-public/controllers/shopee.js +17 -0
- package/src/api-public/controllers/shopee.js.map +1 -1
- package/src/api-public/controllers/shopee.ts +32 -0
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/post.js +17 -7
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/rebate.js +2 -11
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/rebate.ts +5 -12
- package/src/api-public/services/shopee.d.ts +23 -2
- package/src/api-public/services/shopee.js +230 -111
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +1012 -838
- package/src/api-public/services/user.js +2 -2
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +3 -3
- package/src/index.js +17 -7
- package/src/index.js.map +1 -1
- package/src/modules/tool.d.ts +4 -4
- package/src/modules/tool.js +2 -1
- package/src/modules/tool.js.map +1 -1
- package/src/services/backend-service.js +17 -7
- package/src/services/backend-service.js.map +1 -1
- package/src/services/template.d.ts +1 -1
- package/src/services/template.js +24 -18
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +34 -37
|
@@ -1,346 +1,395 @@
|
|
|
1
1
|
import { init } from '../GVController.js';
|
|
2
2
|
import { TriggerEvent } from './trigger-event.js';
|
|
3
|
-
import { EditorConfig } from '../../editor-config.js';
|
|
4
3
|
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
5
4
|
import { FirstBanner } from '../../public-components/banner/first-banner.js';
|
|
6
5
|
import { Language } from '../../glitter-base/global/language.js';
|
|
7
|
-
import { Ad } from '../../public-components/public/ad.js';
|
|
8
6
|
import { ApplicationConfig } from '../../application-config.js';
|
|
9
7
|
|
|
8
|
+
const html = String.raw;
|
|
9
|
+
|
|
10
10
|
init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
glitter.share.htmlExtension = glitter.share.htmlExtension ?? {};
|
|
12
|
+
gBundle.app_config = gBundle.app_config ?? {};
|
|
13
|
+
gBundle.app_config.globalStyle = gBundle.app_config.globalStyle ?? [];
|
|
14
|
+
gBundle.app_config.globalScript = gBundle.app_config.globalScript ?? [];
|
|
15
|
+
const vm = {
|
|
16
|
+
loading: true,
|
|
17
|
+
mainView: '',
|
|
18
|
+
};
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
console.log(`the-page`, gvc.glitter.getUrlParameter('page'));
|
|
21
|
+
console.log(`waitCreateView-time:`, (window as any).renderClock.stop());
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(gBundle.page_config.initialList ?? []).map((dd: any) => {
|
|
39
|
-
if (dd.when === 'initial') {
|
|
40
|
-
if (dd.type === 'script') {
|
|
41
|
-
try {
|
|
42
|
-
TriggerEvent.trigger({
|
|
43
|
-
gvc: gvc, widget: (undefined as any), clickEvent: dd,
|
|
44
|
-
});
|
|
45
|
-
} catch (e) {
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
try {
|
|
49
|
-
eval(dd.src.official);
|
|
50
|
-
} catch (e) {
|
|
23
|
+
async function load() {
|
|
24
|
+
await new Promise(async resolve => {
|
|
25
|
+
for (const b of gBundle.app_config.initialList ?? []) {
|
|
26
|
+
try {
|
|
27
|
+
await TriggerEvent.trigger({
|
|
28
|
+
gvc: gvc,
|
|
29
|
+
widget: b as any,
|
|
30
|
+
clickEvent: b.src.event,
|
|
31
|
+
})
|
|
32
|
+
.then(() => {})
|
|
33
|
+
.catch(() => {});
|
|
34
|
+
} catch (e) {}
|
|
35
|
+
}
|
|
36
|
+
resolve(true);
|
|
37
|
+
});
|
|
51
38
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
await new Promise(async resolve => {
|
|
40
|
+
(gBundle.page_config.initialList ?? []).map((dd: any) => {
|
|
41
|
+
if (dd.when === 'initial') {
|
|
42
|
+
if (dd.type === 'script') {
|
|
43
|
+
try {
|
|
44
|
+
TriggerEvent.trigger({
|
|
45
|
+
gvc: gvc,
|
|
46
|
+
widget: undefined as any,
|
|
47
|
+
clickEvent: dd,
|
|
48
|
+
});
|
|
49
|
+
} catch (e) {}
|
|
50
|
+
} else {
|
|
51
|
+
try {
|
|
52
|
+
eval(dd.src.official);
|
|
53
|
+
} catch (e) {}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
resolve(true);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
(gBundle.page_config.initialStyleSheet ?? []).map(async (data: any) => {
|
|
61
|
+
if (data.type === 'script') {
|
|
62
|
+
try {
|
|
63
|
+
gvc.addStyleLink(data);
|
|
64
|
+
} catch (e) {}
|
|
65
|
+
} else {
|
|
66
|
+
try {
|
|
67
|
+
gvc.addStyle(data.src.official);
|
|
68
|
+
} catch (e) {}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!gBundle.data) {
|
|
74
|
+
gBundle.data = {};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
onCreateView: () => {
|
|
79
|
+
FirstBanner.main({ gvc: gvc });
|
|
80
|
+
//定義SEO TITLE
|
|
81
|
+
if (gBundle.page_config.seo && gBundle.page_config.seo.type === 'custom' && gBundle.page_config.seo.title) {
|
|
82
|
+
glitter.setUrlParameter(
|
|
83
|
+
'',
|
|
84
|
+
undefined,
|
|
85
|
+
[
|
|
86
|
+
gBundle.page_config.seo.title_prefix ?? '',
|
|
87
|
+
gBundle.page_config.seo.title ?? '',
|
|
88
|
+
gBundle.page_config.seo.title_suffix ?? '',
|
|
89
|
+
].join('')
|
|
90
|
+
);
|
|
91
|
+
} else {
|
|
92
|
+
glitter.setUrlParameter(
|
|
93
|
+
'',
|
|
94
|
+
undefined,
|
|
95
|
+
[
|
|
96
|
+
(window as any).home_seo.title_prefix ?? '',
|
|
97
|
+
(window as any).home_seo.title ?? '',
|
|
98
|
+
(window as any).home_seo.title_suffix ?? '',
|
|
99
|
+
].join('')
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
//判斷如果是帳號頁面,且未登入則重新導向
|
|
103
|
+
if (gvc.glitter.getUrlParameter('page') === 'account_userinfo' && !GlobalUser.token) {
|
|
104
|
+
gvc.glitter.href = '/login';
|
|
105
|
+
return '';
|
|
106
|
+
}
|
|
107
|
+
document.querySelector('body')!.style.background =
|
|
108
|
+
gBundle.app_config._background || glitter.share.globalValue[`theme_color.0.background`];
|
|
109
|
+
console.log(`onCreateView-time:`, (window as any).renderClock.stop());
|
|
110
|
+
const mainId = glitter.getUUID();
|
|
111
|
+
let map = [];
|
|
112
|
+
if (gBundle.page_config.resource_from !== 'own') {
|
|
113
|
+
map.push(
|
|
114
|
+
new glitter.htmlGenerate(gBundle.app_config.globalScript ?? [], [], gBundle.data, true).render(gvc, {
|
|
115
|
+
class: '',
|
|
116
|
+
style: '',
|
|
117
|
+
jsFinish: () => {
|
|
118
|
+
console.log(`jsFinish-time:`, (window as any).renderClock.stop());
|
|
119
|
+
load().then(() => {
|
|
120
|
+
if (vm.loading) {
|
|
121
|
+
vm.loading = false;
|
|
122
|
+
gvc.notifyDataChange(mainId);
|
|
123
|
+
window.history.replaceState({}, glitter.document.title, location.href);
|
|
63
124
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
);
|
|
129
|
+
let globalStyleLink = (gBundle.app_config.globalStyle ?? []).filter((dd: any) => dd.data.elem === 'link');
|
|
130
|
+
let check = globalStyleLink.length;
|
|
131
|
+
globalStyleLink.map((dd: any) => {
|
|
132
|
+
try {
|
|
133
|
+
$('#glitterPage').hide();
|
|
134
|
+
glitter
|
|
135
|
+
.addStyleLink(
|
|
136
|
+
dd.data.attr.find((dd: any) => {
|
|
137
|
+
return dd.attr === 'href';
|
|
138
|
+
}).value
|
|
139
|
+
)
|
|
140
|
+
.then(() => {
|
|
141
|
+
check--;
|
|
142
|
+
if (check === 0) {
|
|
143
|
+
$('#glitterPage').show();
|
|
68
144
|
}
|
|
69
|
-
|
|
145
|
+
});
|
|
146
|
+
} catch (e) {
|
|
147
|
+
return '';
|
|
148
|
+
}
|
|
70
149
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
//判斷如果是帳號頁面,且未登入則重新導向
|
|
93
|
-
if (gvc.glitter.getUrlParameter('page') === 'account_userinfo' && !GlobalUser.token) {
|
|
94
|
-
gvc.glitter.href = '/login';
|
|
95
|
-
return ``;
|
|
150
|
+
map.push(
|
|
151
|
+
new glitter.htmlGenerate(gBundle.app_config.globalStyle, [], gBundle.data, true).render(gvc, {
|
|
152
|
+
class: '',
|
|
153
|
+
style: '',
|
|
154
|
+
app_config: gBundle.app_config,
|
|
155
|
+
page_config: gBundle.page_config,
|
|
156
|
+
onCreate: () => {
|
|
157
|
+
console.log(`createRender`);
|
|
158
|
+
},
|
|
159
|
+
})
|
|
160
|
+
);
|
|
161
|
+
} else {
|
|
162
|
+
vm.loading = false;
|
|
163
|
+
}
|
|
164
|
+
let toggle_d_none = true;
|
|
165
|
+
map.push(
|
|
166
|
+
gvc.bindView({
|
|
167
|
+
bind: mainId,
|
|
168
|
+
view: () => {
|
|
169
|
+
if (vm.loading) {
|
|
170
|
+
return '';
|
|
96
171
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class: ``,
|
|
104
|
-
style: ``,
|
|
105
|
-
jsFinish: () => {
|
|
106
|
-
console.log(`jsFinish-time:`, (window as any).renderClock.stop());
|
|
107
|
-
load().then(() => {
|
|
108
|
-
if (vm.loading) {
|
|
109
|
-
vm.loading = false;
|
|
110
|
-
gvc.notifyDataChange(mainId);
|
|
111
|
-
window.history.replaceState({}, glitter.document.title, location.href);
|
|
112
|
-
}
|
|
172
|
+
return new Promise(async resolve => {
|
|
173
|
+
console.log(`Render-time:`, (window as any).renderClock.stop());
|
|
174
|
+
gBundle.config.formData = gBundle.page_config.formData;
|
|
175
|
+
if (gBundle.page_config.template) {
|
|
176
|
+
(window as any).glitterInitialHelper.getPageData(gBundle.page_config.template, (data: any) => {
|
|
177
|
+
const template_config = JSON.parse(JSON.stringify(data.response.result[0].config));
|
|
113
178
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
let check = globalStyleLink.length;
|
|
121
|
-
globalStyleLink.map((dd: any) => {
|
|
122
|
-
try {
|
|
123
|
-
$('#glitterPage').hide();
|
|
124
|
-
glitter.addStyleLink(dd.data.attr.find((dd: any) => {
|
|
125
|
-
return dd.attr === 'href';
|
|
126
|
-
}).value).then(() => {
|
|
127
|
-
check--;
|
|
128
|
-
if (check === 0) {
|
|
129
|
-
$('#glitterPage').show();
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
} catch (e) {
|
|
133
|
-
return ``;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
map.push(new glitter.htmlGenerate(gBundle.app_config.globalStyle, [], gBundle.data, true).render(gvc, {
|
|
137
|
-
class: ``,
|
|
138
|
-
style: ``,
|
|
139
|
-
app_config: gBundle.app_config,
|
|
140
|
-
page_config: gBundle.page_config,
|
|
141
|
-
onCreate: () => {
|
|
142
|
-
console.log(`createRender`);
|
|
143
|
-
},
|
|
144
|
-
}));
|
|
145
|
-
} else {
|
|
146
|
-
vm.loading = false;
|
|
147
|
-
}
|
|
148
|
-
let toggle_d_none = true;
|
|
149
|
-
map.push(gvc.bindView({
|
|
150
|
-
bind: mainId,
|
|
151
|
-
view: () => {
|
|
152
|
-
if (vm.loading) {
|
|
153
|
-
return ``;
|
|
154
|
-
}
|
|
155
|
-
return new Promise(async (resolve, reject) => {
|
|
156
|
-
console.log(`Render-time:`, (window as any).renderClock.stop());
|
|
157
|
-
(gBundle.config.formData = gBundle.page_config.formData);
|
|
158
|
-
if (gBundle.page_config.template) {
|
|
159
|
-
(window as any).glitterInitialHelper.getPageData(gBundle.page_config.template, (data: any) => {
|
|
160
|
-
const template_config = JSON.parse(JSON.stringify(data.response.result[0].config));
|
|
161
|
-
|
|
162
|
-
function findContainer(set: any) {
|
|
163
|
-
set.map((dd: any, index: number) => {
|
|
164
|
-
if (dd.type === 'glitter_article') {
|
|
165
|
-
if (gBundle.page_config.meta_article.view_type === 'rich_text') {
|
|
166
|
-
set[index].type = 'widget';
|
|
167
|
-
set[index].data.inner = gBundle.page_config.meta_article.content;
|
|
168
|
-
} else {
|
|
169
|
-
if (gBundle.editMode) {
|
|
170
|
-
set[index].type = 'widget';
|
|
171
|
-
set[index].data.inner = (gBundle.editMode && gBundle.editMode.render(gvc, {
|
|
172
|
-
class: ``,
|
|
173
|
-
style: ``,
|
|
174
|
-
app_config: gBundle.app_config,
|
|
175
|
-
page_config: gBundle.page_config,
|
|
176
|
-
}));
|
|
177
|
-
} else {
|
|
178
|
-
set[index].type = 'container';
|
|
179
|
-
set[index].data = {
|
|
180
|
-
'setting': gBundle.config,
|
|
181
|
-
'elem': 'div',
|
|
182
|
-
'style_from': set[index].style_from,
|
|
183
|
-
'class': set[index].class,
|
|
184
|
-
'style': set[index].style,
|
|
185
|
-
'classDataType': set[index].classDataType,
|
|
186
|
-
'dataType': set[index].dataType,
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function loopFormData(dd: any) {
|
|
191
|
-
dd.formData = gBundle.page_config.formData;
|
|
192
|
-
if (dd.type === 'container') {
|
|
193
|
-
loopFormData(dd.data.setting);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
loopFormData(set[index]);
|
|
198
|
-
}
|
|
199
|
-
} else if (dd.type === 'container') {
|
|
200
|
-
dd.data.setting = dd.data.setting ?? [];
|
|
201
|
-
dd.formData = data.response.result[0].page_config.formData;
|
|
202
|
-
findContainer(dd.data.setting);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
findContainer(template_config);
|
|
208
|
-
resolve(new glitter.htmlGenerate(template_config, [], gBundle.data, true).render(gvc, {
|
|
209
|
-
class: ``,
|
|
210
|
-
style: ``,
|
|
211
|
-
app_config: gBundle.app_config,
|
|
212
|
-
page_config: gBundle.page_config,
|
|
213
|
-
}));
|
|
214
|
-
});
|
|
179
|
+
function findContainer(set: any) {
|
|
180
|
+
set.map((dd: any, index: number) => {
|
|
181
|
+
if (dd.type === 'glitter_article') {
|
|
182
|
+
if (gBundle.page_config.meta_article.view_type === 'rich_text') {
|
|
183
|
+
set[index].type = 'widget';
|
|
184
|
+
set[index].data.inner = gBundle.page_config.meta_article.content;
|
|
215
185
|
} else {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
186
|
+
if (gBundle.editMode) {
|
|
187
|
+
set[index].type = 'widget';
|
|
188
|
+
set[index].data.inner =
|
|
189
|
+
gBundle.editMode &&
|
|
190
|
+
gBundle.editMode.render(gvc, {
|
|
191
|
+
class: '',
|
|
192
|
+
style: '',
|
|
193
|
+
app_config: gBundle.app_config,
|
|
194
|
+
page_config: gBundle.page_config,
|
|
195
|
+
});
|
|
196
|
+
} else {
|
|
197
|
+
set[index].type = 'container';
|
|
198
|
+
set[index].data = {
|
|
199
|
+
setting: gBundle.config,
|
|
200
|
+
elem: 'div',
|
|
201
|
+
style_from: set[index].style_from,
|
|
202
|
+
class: set[index].class,
|
|
203
|
+
style: set[index].style,
|
|
204
|
+
classDataType: set[index].classDataType,
|
|
205
|
+
dataType: set[index].dataType,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function loopFormData(dd: any) {
|
|
210
|
+
dd.formData = gBundle.page_config.formData;
|
|
211
|
+
if (dd.type === 'container') {
|
|
212
|
+
loopFormData(dd.data.setting);
|
|
225
213
|
}
|
|
214
|
+
}
|
|
226
215
|
|
|
227
|
-
|
|
228
|
-
(gBundle.editMode && editorView())
|
|
229
|
-
||
|
|
230
|
-
new glitter.htmlGenerate(gBundle.config, [], gBundle.data, true).render(gvc, {
|
|
231
|
-
class: ``,
|
|
232
|
-
style: ``,
|
|
233
|
-
app_config: gBundle.app_config,
|
|
234
|
-
page_config: gBundle.page_config,
|
|
235
|
-
is_page: true,
|
|
236
|
-
})
|
|
237
|
-
));
|
|
216
|
+
loopFormData(set[index]);
|
|
238
217
|
}
|
|
239
|
-
|
|
240
|
-
|
|
218
|
+
} else if (dd.type === 'container') {
|
|
219
|
+
dd.data.setting = dd.data.setting ?? [];
|
|
220
|
+
dd.formData = data.response.result[0].page_config.formData;
|
|
221
|
+
findContainer(dd.data.setting);
|
|
222
|
+
}
|
|
241
223
|
});
|
|
224
|
+
}
|
|
242
225
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
(document.querySelector(`[gvc-id='${gvc.id(mainId)}']`) as any).classList.remove('d-none');
|
|
263
|
-
}, 50);
|
|
264
|
-
},
|
|
265
|
-
}));
|
|
266
|
-
function acceptAd(){
|
|
267
|
-
// 設定所有 Google 服務的同意模式為 "granted"
|
|
268
|
-
const gtag = (window as any).gtag;
|
|
269
|
-
if(gtag){
|
|
270
|
-
gtag('consent', 'default', {
|
|
271
|
-
'ad_storage': 'granted', // 允許廣告 Cookie(Google Ads 轉換追蹤)
|
|
272
|
-
'analytics_storage': 'granted', // 允許分析數據(GA4)
|
|
273
|
-
'personalization_storage': 'granted', // 允許個人化(如 YouTube 影片嵌入)
|
|
274
|
-
'security_storage': 'granted', // 允許安全性 Cookie
|
|
275
|
-
'functionality_storage': 'granted' // 允許功能性 Cookie(如登入狀態)
|
|
276
|
-
});
|
|
226
|
+
findContainer(template_config);
|
|
227
|
+
resolve(
|
|
228
|
+
new glitter.htmlGenerate(template_config, [], gBundle.data, true).render(gvc, {
|
|
229
|
+
class: '',
|
|
230
|
+
style: '',
|
|
231
|
+
app_config: gBundle.app_config,
|
|
232
|
+
page_config: gBundle.page_config,
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
});
|
|
236
|
+
} else {
|
|
237
|
+
function editorView() {
|
|
238
|
+
return gBundle.editMode.render(gvc, {
|
|
239
|
+
class: '',
|
|
240
|
+
style: '',
|
|
241
|
+
containerID: `MainView`,
|
|
242
|
+
app_config: gBundle.app_config,
|
|
243
|
+
page_config: gBundle.page_config,
|
|
244
|
+
});
|
|
277
245
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
246
|
+
|
|
247
|
+
resolve(
|
|
248
|
+
(gBundle.editMode && editorView()) ||
|
|
249
|
+
new glitter.htmlGenerate(gBundle.config, [], gBundle.data, true).render(gvc, {
|
|
250
|
+
class: '',
|
|
251
|
+
style: '',
|
|
252
|
+
app_config: gBundle.app_config,
|
|
253
|
+
page_config: gBundle.page_config,
|
|
254
|
+
is_page: true,
|
|
255
|
+
})
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
divCreate: () => {
|
|
261
|
+
return {
|
|
262
|
+
class: glitter.htmlGenerate.styleEditor(gBundle.page_config).class() + (toggle_d_none ? ' d-none' : ''),
|
|
263
|
+
style: `
|
|
264
|
+
overflow-x: hidden;
|
|
265
|
+
min-height: 100%;
|
|
266
|
+
min-width: 100%;
|
|
267
|
+
${glitter.htmlGenerate.styleEditor(gBundle.page_config).style()}
|
|
268
|
+
`,
|
|
269
|
+
};
|
|
270
|
+
},
|
|
271
|
+
onCreate: () => {
|
|
272
|
+
(gBundle.page_config.initialList ?? []).map((dd: any) => {
|
|
273
|
+
if (dd.when === 'onCreate') {
|
|
274
|
+
try {
|
|
275
|
+
eval(dd.src.official);
|
|
276
|
+
} catch (e) {}
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
toggle_d_none = false;
|
|
280
|
+
setTimeout(() => {
|
|
281
|
+
$('.new_page_loading').addClass('d-none');
|
|
282
|
+
(document.querySelector(`[gvc-id='${gvc.id(mainId)}']`) as any).classList.remove('d-none');
|
|
283
|
+
}, 50);
|
|
284
|
+
},
|
|
285
|
+
})
|
|
286
|
+
);
|
|
287
|
+
function acceptAd() {
|
|
288
|
+
// 設定所有 Google 服務的同意模式為 "granted"
|
|
289
|
+
const gtag = (window as any).gtag;
|
|
290
|
+
if (gtag) {
|
|
291
|
+
gtag('consent', 'default', {
|
|
292
|
+
ad_storage: 'granted', // 允許廣告 Cookie(Google Ads 轉換追蹤)
|
|
293
|
+
analytics_storage: 'granted', // 允許分析數據(GA4)
|
|
294
|
+
personalization_storage: 'granted', // 允許個人化(如 YouTube 影片嵌入)
|
|
295
|
+
security_storage: 'granted', // 允許安全性 Cookie
|
|
296
|
+
functionality_storage: 'granted', // 允許功能性 Cookie(如登入狀態)
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
//如果是APP預設追蹤
|
|
301
|
+
if (ApplicationConfig.is_application) {
|
|
302
|
+
localStorage.setItem('cookie_accept', 'true');
|
|
303
|
+
}
|
|
304
|
+
if (localStorage.getItem('cookie_accept') == 'true') {
|
|
305
|
+
acceptAd();
|
|
306
|
+
}
|
|
307
|
+
if (
|
|
308
|
+
localStorage.getItem('cookie_accept') != 'true' &&
|
|
309
|
+
(window as any).store_info.cookie_check &&
|
|
310
|
+
!glitter.htmlGenerate.isEditMode()
|
|
311
|
+
) {
|
|
312
|
+
map.push(html`
|
|
313
|
+
<div
|
|
314
|
+
class="position-fixed rounded-3 d-flex align-items-center flex-column flex-sm-row p-3 privacy-notice shadow"
|
|
315
|
+
style="
|
|
316
|
+
width: 852px;
|
|
317
|
+
max-width: calc(100vw - 30px);
|
|
318
|
+
background: ${glitter.share.globalValue['theme_color.0.solid-button-bg']};
|
|
319
|
+
color: ${glitter.share.globalValue['theme_color.0.solid-button-text']};
|
|
320
|
+
z-index: 99999;
|
|
321
|
+
bottom: 30px;
|
|
322
|
+
transform: translateX(-50%);
|
|
323
|
+
left: 50%;
|
|
324
|
+
"
|
|
325
|
+
>
|
|
326
|
+
<div style="font-size: 14px;">${Language.text('cookie_use')}</div>
|
|
327
|
+
<div class="d-sm-none w-100 border-top my-3"></div>
|
|
328
|
+
<div
|
|
329
|
+
class="d-flex align-items-center justify-content-center fw-bold"
|
|
330
|
+
style="min-width: 150px;cursor: pointer;"
|
|
331
|
+
onclick="${gvc.event(() => {
|
|
281
332
|
localStorage.setItem('cookie_accept', 'true');
|
|
282
|
-
|
|
283
|
-
|
|
333
|
+
for (const b of document.querySelectorAll('.privacy-notice')) {
|
|
334
|
+
b.remove();
|
|
335
|
+
}
|
|
284
336
|
acceptAd();
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
">${Language.text('cookie_use')}</div>
|
|
293
|
-
<div class="d-sm-none w-100 border-top my-3"></div>
|
|
294
|
-
<div class="d-flex align-items-center justify-content-center fw-bold" style="min-width: 150px;cursor: pointer;" onclick="${gvc.event(() => {
|
|
295
|
-
localStorage.setItem('cookie_accept', 'true');
|
|
296
|
-
for (const b of document.querySelectorAll('.privacy-notice')) {
|
|
297
|
-
b.remove();
|
|
298
|
-
}
|
|
299
|
-
acceptAd();
|
|
300
|
-
})}">${Language.text('i_known')}</div>
|
|
301
|
-
</div>
|
|
302
|
-
`);
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// const userID = ((subData && subData.userID) || gvc.glitter.macAddress);
|
|
337
|
+
})}"
|
|
338
|
+
>
|
|
339
|
+
${Language.text('i_known')}
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
`);
|
|
343
|
+
}
|
|
307
344
|
|
|
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
|
-
|
|
345
|
+
if (
|
|
346
|
+
(window as any).store_info.chat_toggle &&
|
|
347
|
+
!glitter.share.is_application &&
|
|
348
|
+
!(
|
|
349
|
+
document.body.clientWidth < 800 &&
|
|
350
|
+
[
|
|
351
|
+
'account_userinfo',
|
|
352
|
+
'recipient_info',
|
|
353
|
+
'account_edit',
|
|
354
|
+
'order_list',
|
|
355
|
+
'voucher-list',
|
|
356
|
+
'rebate',
|
|
357
|
+
'wishlist',
|
|
358
|
+
].includes(gvc.glitter.getUrlParameter('page'))
|
|
359
|
+
)
|
|
360
|
+
) {
|
|
361
|
+
map.push(
|
|
362
|
+
gvc.bindView(() => {
|
|
363
|
+
return {
|
|
364
|
+
bind: gvc.glitter.getUUID(),
|
|
365
|
+
view: () => {
|
|
366
|
+
return new Promise(resolve => {
|
|
367
|
+
const url = new URL('./cms-plugin/customer-message-user.js', gvc.glitter.root_path);
|
|
368
|
+
gvc.glitter.getModule(url.href, CustomerMessageUser => {
|
|
369
|
+
resolve(
|
|
370
|
+
CustomerMessageUser.showCustomerMessage({
|
|
371
|
+
gvc: gvc,
|
|
372
|
+
userID: (() => {
|
|
373
|
+
if (GlobalUser.token) {
|
|
374
|
+
return GlobalUser.parseJWT(GlobalUser.token).payload.userID;
|
|
375
|
+
} else {
|
|
376
|
+
return gvc.glitter.macAddress;
|
|
377
|
+
}
|
|
378
|
+
})(),
|
|
379
|
+
})
|
|
380
|
+
);
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
},
|
|
384
|
+
divCreate: {
|
|
385
|
+
class: `customer-message`,
|
|
386
|
+
},
|
|
387
|
+
};
|
|
388
|
+
})
|
|
389
|
+
);
|
|
390
|
+
}
|
|
342
391
|
|
|
343
|
-
|
|
344
|
-
}
|
|
392
|
+
return map.join('');
|
|
393
|
+
},
|
|
394
|
+
};
|
|
345
395
|
});
|
|
346
|
-
|