ts-glitter 21.3.9 → 21.4.1
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 +18 -1
- package/lowcode/Entry.ts +19 -1
- package/lowcode/api/pageConfig.js +29 -10
- package/lowcode/api/pageConfig.ts +43 -11
- package/lowcode/backend-manager/bg-blog.js +5 -0
- package/lowcode/backend-manager/bg-blog.ts +5 -0
- package/lowcode/cms-plugin/menus-setting.js +15 -6
- package/lowcode/cms-plugin/menus-setting.ts +23 -6
- package/lowcode/cms-plugin/module/user-excel.js +11 -5
- package/lowcode/cms-plugin/module/user-excel.ts +11 -5
- package/lowcode/cms-plugin/shopping-discount-setting.js +236 -234
- package/lowcode/cms-plugin/shopping-discount-setting.ts +137 -134
- package/lowcode/cms-plugin/third-party-line.js +34 -0
- package/lowcode/cms-plugin/third-party-line.ts +34 -0
- package/lowcode/editor-components/global-editor.js +60 -0
- package/lowcode/editor-components/global-editor.ts +65 -0
- package/lowcode/editor-components/global-widget/bridge.js +40 -34
- package/lowcode/editor-components/global-widget/bridge.ts +42 -34
- package/lowcode/glitterBundle/html-component/global-widget.js +265 -170
- package/lowcode/glitterBundle/html-component/global-widget.ts +264 -159
- package/lowcode/index.html +1 -1
- package/lowcode/jspage/function-page/tool-setting.js +9 -1
- package/lowcode/jspage/function-page/tool-setting.ts +9 -1
- package/lowcode/jspage/main.js +78 -16
- package/lowcode/jspage/main.ts +108 -22
- package/lowcode/official_view_component/official/component.js +17 -10
- package/lowcode/official_view_component/official/component.ts +38 -27
- package/lowcode/public-components/blogs/blogs-01.js +200 -140
- package/lowcode/public-components/blogs/blogs-01.ts +232 -145
- package/lowcode/public-components/checkout/index.js +5 -3
- package/lowcode/public-components/checkout/index.ts +6 -4
- package/lowcode/public-components/headers/head-initial.ts +1 -1
- package/lowcode/public-components/headers/sy-02.js +1 -0
- package/lowcode/public-components/headers/sy-02.ts +1 -0
- package/lowcode/public-components/headers/sy-03.js +1 -0
- package/lowcode/public-components/headers/sy-03.ts +1 -0
- package/lowcode/public-components/headers/sy-04.js +1 -0
- package/lowcode/public-components/headers/sy-04.ts +1 -0
- package/lowcode/public-components/headers/sy-05.js +1 -0
- package/lowcode/public-components/headers/sy-05.ts +1 -0
- package/lowcode/public-components/product/product-detail.js +2 -2
- package/lowcode/public-components/product/product-detail.ts +4 -4
- package/lowcode/public-components/terms-related/index.ts +1 -0
- package/lowcode/public-components/user-manager/um-login.js +7 -1
- package/lowcode/public-components/user-manager/um-login.ts +8 -1
- package/package.json +1 -1
- package/src/api-public/models/glitter-finance.js +1 -2
- package/src/api-public/models/glitter-finance.js.map +1 -1
- package/src/api-public/services/checkout-event.js +1 -0
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +1 -0
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/user.js +11 -18
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +4 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/controllers/template.js +2 -2
- package/src/controllers/template.js.map +1 -1
- package/src/controllers/template.ts +5 -2
- package/src/firebase/message.js +1 -2
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +1 -2
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/index.js +8 -18
- package/src/index.js.map +1 -5
- package/src/index.ts +1 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/run.js +1 -2
- package/src/run.js.map +1 -1
- package/src/seo-config.d.ts +1 -1
- package/src/seo-config.js +13 -12
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +18 -12
- package/src/services/app.d.ts +2 -1
- package/src/services/app.js +11 -19
- package/src/services/app.js.map +1 -1
- package/src/services/app.ts +5 -2
- package/src/services/backend-service.js +7 -17
- package/src/services/backend-service.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/seo.d.ts +2 -1
- package/src/services/seo.js +7 -4
- package/src/services/seo.js.map +1 -1
- package/src/services/seo.ts +7 -4
- package/src/services/ses.js +1 -2
- package/src/services/ses.js.map +1 -1
- package/src/services/template.d.ts +3 -1
- package/src/services/template.js +55 -34
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +68 -35
- package/nxv0ptv53w.json +0 -1
- package/omr85cp878.json +0 -1
|
@@ -5,159 +5,246 @@ import { Language } from '../../glitter-base/global/language.js';
|
|
|
5
5
|
import { ApiCart } from '../../glitter-base/route/api-cart.js';
|
|
6
6
|
import { Article } from '../../glitter-base/route/article.js';
|
|
7
7
|
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
8
|
+
import { ApiPageConfig } from '../../api/pageConfig.js';
|
|
9
|
+
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
10
|
+
|
|
11
|
+
const html = String.raw;
|
|
8
12
|
|
|
9
13
|
export class Blogs01 {
|
|
10
14
|
static main(gvc: GVC, subData: any) {
|
|
15
|
+
let initial = false;
|
|
16
|
+
return gvc.bindView(() => {
|
|
17
|
+
const bid = gvc.glitter.getUUID();
|
|
18
|
+
return {
|
|
19
|
+
bind: bid,
|
|
20
|
+
view: () => {
|
|
21
|
+
return ``;
|
|
22
|
+
},
|
|
23
|
+
divCreate: {
|
|
24
|
+
class: `${bid}`,
|
|
25
|
+
},
|
|
26
|
+
onCreate: async () => {
|
|
27
|
+
if (!initial) {
|
|
28
|
+
try {
|
|
29
|
+
initial = true;
|
|
11
30
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
} else {
|
|
45
|
-
gvc.notifyDataChange(['js-cart-count']);
|
|
46
|
-
gvc.glitter.share.reloadCartData && gvc.glitter.share.reloadCartData();
|
|
47
|
-
if (document.querySelector('.customer-message')) {
|
|
48
|
-
document.querySelector('.customer-message')!.remove();
|
|
49
|
-
}
|
|
50
|
-
clearInterval(interVal);
|
|
51
|
-
}
|
|
52
|
-
}, 300);
|
|
53
|
-
} else {
|
|
54
|
-
localStorage.setItem('block-refresh-cart', 'false');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return new gvc.glitter.htmlGenerate(subData.content.config, [], subData.content).render(
|
|
58
|
-
gvc,
|
|
59
|
-
{
|
|
60
|
-
class: `w-100`,
|
|
61
|
-
style: `position:relative;`,
|
|
62
|
-
containerID: gvc.glitter.getUUID(),
|
|
63
|
-
tag: gvc.glitter.getUUID(),
|
|
64
|
-
jsFinish: () => {},
|
|
65
|
-
onCreate: () => {},
|
|
66
|
-
document: document,
|
|
67
|
-
},
|
|
68
|
-
{}
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// 判斷是隱形賣場決定是否可見
|
|
73
|
-
if (subData.content.page_type === 'hidden') {
|
|
74
|
-
if (subData.content.show_auth.auth === 'all') {
|
|
75
|
-
return startRender();
|
|
76
|
-
} else if (subData.content.show_auth.auth === 'password') {
|
|
77
|
-
if (localStorage.getItem('password_to_see_' + subData.content.tag) === subData.content.show_auth.value) {
|
|
78
|
-
return startRender();
|
|
79
|
-
}
|
|
80
|
-
return gvc.bindView(() => {
|
|
81
|
-
const rid = gvc.glitter.getUUID();
|
|
82
|
-
return {
|
|
83
|
-
bind: rid,
|
|
84
|
-
view: () => {
|
|
85
|
-
return ``;
|
|
86
|
-
},
|
|
87
|
-
divCreate: {
|
|
88
|
-
option: [{ key: 'id', value: rid }],
|
|
89
|
-
},
|
|
90
|
-
onCreate: () => {
|
|
91
|
-
function checkPwd() {
|
|
92
|
-
const pwd = window.prompt(Language.text('enter_website_password'), '');
|
|
93
|
-
localStorage.setItem('password_to_see_' + subData.content.tag, pwd ?? '');
|
|
94
|
-
if (subData.content.show_auth.value === pwd) {
|
|
95
|
-
document.querySelector(`#${rid}`)!.outerHTML = startRender();
|
|
31
|
+
const [o_header] = await Promise.all([
|
|
32
|
+
new Promise<any>((resolve, reject)=>{
|
|
33
|
+
(window as any).glitterInitialHelper.getPageData('c_header',(res:any)=>{
|
|
34
|
+
console.log(`res===>`,res)
|
|
35
|
+
resolve(res)
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]);
|
|
39
|
+
console.log(`o_header===>`,o_header)
|
|
40
|
+
subData.content.config=subData.content.config.filter((dd:any)=> dd.data.tag!=='c_header')
|
|
41
|
+
//pages的自訂View
|
|
42
|
+
const view = (() => {
|
|
43
|
+
if (subData.content.generator !== 'page_editor') {
|
|
44
|
+
const dd = subData.content;
|
|
45
|
+
return html` <div
|
|
46
|
+
class="container mx-auto fr-view mb-5"
|
|
47
|
+
style="max-width: 1100px;font-family: 'Source Sans Pro', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'STHeiti', 'WenQuanYi Micro Hei', SimSun, sans-serif;"
|
|
48
|
+
>
|
|
49
|
+
<h1
|
|
50
|
+
class="my-5 w-100 text-center p-0"
|
|
51
|
+
style="color:${subData.content.title};font-size:${document.body.clientWidth > 800
|
|
52
|
+
? `32px`
|
|
53
|
+
: `24px`};font-weight: 600;"
|
|
54
|
+
>
|
|
55
|
+
${(dd.language_data && dd.language_data[Language.getLanguage()].title) || dd.title}
|
|
56
|
+
</h1>
|
|
57
|
+
${(dd.language_data && dd.language_data[Language.getLanguage()].text) || dd.text}
|
|
58
|
+
</div>`;
|
|
96
59
|
} else {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
} else {
|
|
133
|
-
if (GlobalUser.token) {
|
|
134
|
-
dialog.errorMessage({ text: Language.text('no_access_permission') });
|
|
135
|
-
gvc.glitter.href = '/index';
|
|
60
|
+
function startRender() {
|
|
61
|
+
// 隱形賣場和一頁商店,預設加入購物車
|
|
62
|
+
if (
|
|
63
|
+
subData.content.relative_data &&
|
|
64
|
+
['shopping', 'hidden'].includes(subData.content.page_type) &&
|
|
65
|
+
localStorage.getItem('block-refresh-cart') !== 'true'
|
|
66
|
+
) {
|
|
67
|
+
const clock = gvc.glitter.ut.clock();
|
|
68
|
+
const interVal = setInterval(() => {
|
|
69
|
+
if (clock.stop() < 2000) {
|
|
70
|
+
new ApiCart(ApiCart.globalCart).setCart(cart => {
|
|
71
|
+
subData.content.relative_data.map((dd: any) => {
|
|
72
|
+
const line_item = cart.line_items.find((d1: any) => {
|
|
73
|
+
return (
|
|
74
|
+
`${d1.id}-${d1.spec.join('-')}` === `${dd.product_id}-${dd.variant.spec.join('-')}`
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
if (!line_item) {
|
|
78
|
+
cart.line_items.push({
|
|
79
|
+
id: dd.product_id,
|
|
80
|
+
spec: dd.variant.spec,
|
|
81
|
+
count: 1,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
} else {
|
|
87
|
+
gvc.notifyDataChange(['js-cart-count']);
|
|
88
|
+
gvc.glitter.share.reloadCartData && gvc.glitter.share.reloadCartData();
|
|
89
|
+
if (document.querySelector('.customer-message')) {
|
|
90
|
+
document.querySelector('.customer-message')!.remove();
|
|
91
|
+
}
|
|
92
|
+
clearInterval(interVal);
|
|
93
|
+
}
|
|
94
|
+
}, 300);
|
|
136
95
|
} else {
|
|
137
|
-
|
|
138
|
-
gvc.glitter.href = '/login';
|
|
96
|
+
localStorage.setItem('block-refresh-cart', 'false');
|
|
139
97
|
}
|
|
98
|
+
return new gvc.glitter.htmlGenerate(subData.content.config, [], subData.content).render(
|
|
99
|
+
gvc,
|
|
100
|
+
{
|
|
101
|
+
class: `w-100`,
|
|
102
|
+
style: `position:relative;`,
|
|
103
|
+
containerID: gvc.glitter.getUUID(),
|
|
104
|
+
tag: gvc.glitter.getUUID(),
|
|
105
|
+
jsFinish: () => {},
|
|
106
|
+
onCreate: () => {},
|
|
107
|
+
document: document,
|
|
108
|
+
},
|
|
109
|
+
{}
|
|
110
|
+
);
|
|
140
111
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
112
|
+
|
|
113
|
+
// 判斷是隱形賣場決定是否可見
|
|
114
|
+
if (subData.content.page_type === 'hidden') {
|
|
115
|
+
if (subData.content.show_auth.auth === 'all') {
|
|
116
|
+
return startRender();
|
|
117
|
+
} else if (subData.content.show_auth.auth === 'password') {
|
|
118
|
+
if (
|
|
119
|
+
localStorage.getItem('password_to_see_' + subData.content.tag) ===
|
|
120
|
+
subData.content.show_auth.value
|
|
121
|
+
) {
|
|
122
|
+
return startRender();
|
|
123
|
+
}
|
|
124
|
+
return gvc.bindView(() => {
|
|
125
|
+
const rid = gvc.glitter.getUUID();
|
|
126
|
+
return {
|
|
127
|
+
bind: rid,
|
|
128
|
+
view: () => {
|
|
129
|
+
return ``;
|
|
130
|
+
},
|
|
131
|
+
divCreate: {
|
|
132
|
+
option: [{ key: 'id', value: rid }],
|
|
133
|
+
},
|
|
134
|
+
onCreate: () => {
|
|
135
|
+
function checkPwd() {
|
|
136
|
+
const pwd = window.prompt(Language.text('enter_website_password'), '');
|
|
137
|
+
localStorage.setItem('password_to_see_' + subData.content.tag, pwd ?? '');
|
|
138
|
+
if (subData.content.show_auth.value === pwd) {
|
|
139
|
+
document.querySelector(`#${rid}`)!.outerHTML = startRender();
|
|
140
|
+
} else {
|
|
141
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
142
|
+
dialog.checkYesOrNot({
|
|
143
|
+
text: Language.text('incorrect_website_password'),
|
|
144
|
+
callback: () => {
|
|
145
|
+
gvc.glitter.closeDiaLog();
|
|
146
|
+
checkPwd();
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
checkPwd();
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
} else if (subData.content.show_auth.auth === 'member_type') {
|
|
157
|
+
return gvc.bindView(() => {
|
|
158
|
+
const rid = gvc.glitter.getUUID();
|
|
159
|
+
return {
|
|
160
|
+
bind: rid,
|
|
161
|
+
view: () => {
|
|
162
|
+
return ``;
|
|
163
|
+
},
|
|
164
|
+
divCreate: {
|
|
165
|
+
option: [{ key: 'id', value: rid }],
|
|
166
|
+
},
|
|
167
|
+
onCreate: () => {
|
|
168
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
169
|
+
UmClass.getUserData(gvc).then((resp: any) => {
|
|
170
|
+
try {
|
|
171
|
+
const mem = resp.member.find((d: any) => {
|
|
172
|
+
return d.trigger;
|
|
173
|
+
});
|
|
174
|
+
if (subData.content.show_auth.value.includes(mem.id)) {
|
|
175
|
+
document.querySelector(`#${rid}`)!.outerHTML = startRender();
|
|
176
|
+
} else {
|
|
177
|
+
if (GlobalUser.token) {
|
|
178
|
+
dialog.errorMessage({ text: Language.text('no_access_permission') });
|
|
179
|
+
gvc.glitter.href = '/index';
|
|
180
|
+
} else {
|
|
181
|
+
GlobalUser.loginRedirect = location.href;
|
|
182
|
+
gvc.glitter.href = '/login';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} catch (e) {
|
|
186
|
+
if (GlobalUser.token) {
|
|
187
|
+
dialog.errorMessage({ text: Language.text('no_access_permission') });
|
|
188
|
+
gvc.glitter.href = '/index';
|
|
189
|
+
} else {
|
|
190
|
+
GlobalUser.loginRedirect = location.href;
|
|
191
|
+
gvc.glitter.href = '/login';
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
} else {
|
|
199
|
+
return startRender();
|
|
200
|
+
}
|
|
145
201
|
} else {
|
|
146
|
-
|
|
147
|
-
gvc.glitter.href = '/login';
|
|
202
|
+
return startRender();
|
|
148
203
|
}
|
|
149
204
|
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
205
|
+
})();
|
|
206
|
+
//取得HeaderView
|
|
207
|
+
let ogHeaderView = new gvc.glitter.htmlGenerate(o_header.response.result[0].config, [], {}).render(
|
|
208
|
+
gvc,
|
|
209
|
+
{
|
|
210
|
+
class: `w-100`,
|
|
211
|
+
style: `position:relative;`,
|
|
212
|
+
containerID: gvc.glitter.getUUID(),
|
|
213
|
+
tag: gvc.glitter.getUUID(),
|
|
214
|
+
jsFinish: () => {},
|
|
215
|
+
onCreate: () => {},
|
|
216
|
+
document: document,
|
|
217
|
+
},
|
|
218
|
+
{}
|
|
219
|
+
);
|
|
220
|
+
// //判斷有自訂Header調整自訂選單內容
|
|
221
|
+
// if (c_header.response.value && c_header.response.value[0] && c_header.response.value[0].header_refer!=='def') {
|
|
222
|
+
// ogHeaderView=new gvc.glitter.htmlGenerate([c_header.response.value[0]], [], {}).render(
|
|
223
|
+
// gvc,
|
|
224
|
+
// {
|
|
225
|
+
// class: `w-100`,
|
|
226
|
+
// style: `position:relative;`,
|
|
227
|
+
// containerID: gvc.glitter.getUUID(),
|
|
228
|
+
// tag: gvc.glitter.getUUID(),
|
|
229
|
+
// jsFinish: () => {},
|
|
230
|
+
// onCreate: () => {},
|
|
231
|
+
// document: document,
|
|
232
|
+
// },
|
|
233
|
+
// {}
|
|
234
|
+
// )
|
|
235
|
+
// }
|
|
236
|
+
document.querySelector(`.${bid}`)!.outerHTML = [
|
|
237
|
+
ogHeaderView,
|
|
238
|
+
view
|
|
239
|
+
].join('');
|
|
240
|
+
initial = true;
|
|
241
|
+
} catch (e) {
|
|
242
|
+
console.log(e)
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
});
|
|
161
248
|
}
|
|
162
249
|
|
|
163
250
|
static async getMain(gvc: GVC) {
|
|
@@ -168,9 +255,9 @@ ${(dd.language_data && dd.language_data[Language.getLanguage()].text) || dd.text
|
|
|
168
255
|
page: 0,
|
|
169
256
|
tag: page.substring(page.indexOf('/') + 1, page.length),
|
|
170
257
|
}).then(res => {
|
|
171
|
-
if(!res.response.data[0]){
|
|
172
|
-
gvc.glitter.href='/index'
|
|
173
|
-
}else{
|
|
258
|
+
if (!res.response.data[0]) {
|
|
259
|
+
gvc.glitter.href = '/index';
|
|
260
|
+
} else {
|
|
174
261
|
resolve(Blogs01.main(gvc, res.response.data[0]));
|
|
175
262
|
}
|
|
176
263
|
});
|
|
@@ -121,7 +121,9 @@ export class CheckoutIndex {
|
|
|
121
121
|
function refreshCartData() {
|
|
122
122
|
apiCart = getCartData();
|
|
123
123
|
const dialog = new ShareDialog(gvc.glitter);
|
|
124
|
-
|
|
124
|
+
if (!loadings.page) {
|
|
125
|
+
dialog.dataLoading({ visible: true });
|
|
126
|
+
}
|
|
125
127
|
const beta = false;
|
|
126
128
|
if (!beta) {
|
|
127
129
|
new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -269,7 +271,7 @@ export class CheckoutIndex {
|
|
|
269
271
|
gvc.addMtScript([
|
|
270
272
|
{
|
|
271
273
|
src: `${gvc.glitter.root_path}/jslib/lottie-player.js`,
|
|
272
|
-
}
|
|
274
|
+
}
|
|
273
275
|
], () => { }, () => { });
|
|
274
276
|
vm.cartData = FakeOrder.data;
|
|
275
277
|
ApiWallet.getRebateConfig({ type: 'me' }).then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -3078,7 +3080,7 @@ export class CheckoutIndex {
|
|
|
3078
3080
|
class: `check_out_cart_data text-start`,
|
|
3079
3081
|
style: gvc.glitter.getUrlParameter('page') === 'checkout'
|
|
3080
3082
|
? `background:#f0f0f0;`
|
|
3081
|
-
: `background:#f0f0f0;padding-top:10px;border-radius:10px;`,
|
|
3083
|
+
: `background:#f0f0f0;padding-top:10px;border-radius:10px;max-width:1200px;margin:0 auto;`,
|
|
3082
3084
|
},
|
|
3083
3085
|
onCreate: () => {
|
|
3084
3086
|
if (gvc.glitter.getUrlParameter('page') !== 'checkout') {
|
|
@@ -146,9 +146,11 @@ export class CheckoutIndex {
|
|
|
146
146
|
//重取購物車資料
|
|
147
147
|
apiCart = getCartData();
|
|
148
148
|
const dialog = new ShareDialog(gvc.glitter);
|
|
149
|
-
|
|
149
|
+
//初次載入不需要加載動畫
|
|
150
|
+
if(!loadings.page){
|
|
151
|
+
dialog.dataLoading({ visible: true });
|
|
152
|
+
}
|
|
150
153
|
const beta = false;
|
|
151
|
-
|
|
152
154
|
if (!beta) {
|
|
153
155
|
new Promise(async resolve => {
|
|
154
156
|
new Promise(resolve => {
|
|
@@ -318,7 +320,7 @@ export class CheckoutIndex {
|
|
|
318
320
|
[
|
|
319
321
|
{
|
|
320
322
|
src: `${gvc.glitter.root_path}/jslib/lottie-player.js`,
|
|
321
|
-
}
|
|
323
|
+
}
|
|
322
324
|
],
|
|
323
325
|
() => {},
|
|
324
326
|
() => {}
|
|
@@ -3374,7 +3376,7 @@ export class CheckoutIndex {
|
|
|
3374
3376
|
style:
|
|
3375
3377
|
gvc.glitter.getUrlParameter('page') === 'checkout'
|
|
3376
3378
|
? `background:#f0f0f0;`
|
|
3377
|
-
: `background:#f0f0f0;padding-top:10px;border-radius:10px;`,
|
|
3379
|
+
: `background:#f0f0f0;padding-top:10px;border-radius:10px;max-width:1200px;margin:0 auto;`,
|
|
3378
3380
|
},
|
|
3379
3381
|
onCreate: () => {
|
|
3380
3382
|
if (gvc.glitter.getUrlParameter('page') !== 'checkout') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GVC } from '../../glitterBundle/GVController.js';
|
|
2
2
|
|
|
3
3
|
export class HeadInitial{
|
|
4
|
-
public static initial(cf: { browser: () => string; mobile: () => string, gvc: GVC }) {
|
|
4
|
+
public static initial(cf: { browser: () => string; mobile: () => string, gvc: GVC,widget:any }) {
|
|
5
5
|
const gvc = cf.gvc;
|
|
6
6
|
if(gvc.glitter.share.is_application){
|
|
7
7
|
|
|
@@ -15,6 +15,7 @@ const html = String.raw;
|
|
|
15
15
|
export class Sy02 {
|
|
16
16
|
public static main(gvc: GVC, widget: any, subData: any) {
|
|
17
17
|
return HeadInitial.initial({
|
|
18
|
+
widget:widget,
|
|
18
19
|
browser: () => {
|
|
19
20
|
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
20
21
|
gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
|
|
@@ -15,6 +15,7 @@ const html = String.raw;
|
|
|
15
15
|
export class Sy03 {
|
|
16
16
|
public static main(gvc: GVC, widget: any, subData: any) {
|
|
17
17
|
return HeadInitial.initial({
|
|
18
|
+
widget:widget,
|
|
18
19
|
browser: () => {
|
|
19
20
|
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
20
21
|
gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
|
|
@@ -15,6 +15,7 @@ const html = String.raw;
|
|
|
15
15
|
export class Sy04 {
|
|
16
16
|
public static main(gvc: GVC, widget: any, subData: any) {
|
|
17
17
|
return HeadInitial.initial({
|
|
18
|
+
widget:widget,
|
|
18
19
|
browser: () => {
|
|
19
20
|
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
20
21
|
gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
|
|
@@ -131,8 +131,8 @@ export class ProductDetail {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
return html ` <div class="mx-auto pb-5" style="max-width:1100px;word-break: break-all;white-space: normal;">
|
|
134
|
-
<div class="breadcrumb mb-0 d-flex align-items-center py-3" style="cursor:pointer; gap:10px;">
|
|
135
|
-
${book_mark
|
|
134
|
+
<div class="breadcrumb mb-0 d-flex align-items-center py-3 " style="cursor:pointer; gap:10px;">
|
|
135
|
+
${window.page_refer ? `` : book_mark
|
|
136
136
|
.map(dd => {
|
|
137
137
|
return html ` <li
|
|
138
138
|
class="breadcrumb-item "
|
|
@@ -141,15 +141,15 @@ export class ProductDetail {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
return html` <div class="mx-auto pb-5" style="max-width:1100px;word-break: break-all;white-space: normal;">
|
|
144
|
-
<div class="breadcrumb mb-0 d-flex align-items-center py-3" style="cursor:pointer; gap:10px;">
|
|
145
|
-
${book_mark
|
|
144
|
+
<div class="breadcrumb mb-0 d-flex align-items-center py-3 " style="cursor:pointer; gap:10px;">
|
|
145
|
+
${(window as any).page_refer ? ``:book_mark
|
|
146
146
|
.map(dd => {
|
|
147
147
|
return html` <li
|
|
148
148
|
class="breadcrumb-item "
|
|
149
149
|
style="margin-top: 0px;color:${ProductModule.titleFontColor};"
|
|
150
150
|
onclick="${gvc.event(() => {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
dd.event();
|
|
152
|
+
})}"
|
|
153
153
|
>
|
|
154
154
|
${dd.title}
|
|
155
155
|
</li>`;
|
|
@@ -34,6 +34,7 @@ export class TermsRelated {
|
|
|
34
34
|
}) &&
|
|
35
35
|
`${glitter.getUrlParameter('page')}`.split('/')[1]
|
|
36
36
|
) {
|
|
37
|
+
|
|
37
38
|
return await new Promise((resolve, reject) => {
|
|
38
39
|
glitter.getModule(new URL('./public-components/blogs/blogs-01.js', gvc.glitter.root_path).href, res => {
|
|
39
40
|
resolve(res.getMain(obj.gvc));
|
|
@@ -619,6 +619,7 @@ export class UMLogin {
|
|
|
619
619
|
return [
|
|
620
620
|
(() => {
|
|
621
621
|
function callLogin() {
|
|
622
|
+
var _a;
|
|
622
623
|
if (glitter.deviceType !== glitter.deviceTypeEnum.Web) {
|
|
623
624
|
gvc.glitter.runJsInterFace('line_login', {
|
|
624
625
|
id: widget.share.line.id,
|
|
@@ -632,7 +633,12 @@ export class UMLogin {
|
|
|
632
633
|
}
|
|
633
634
|
else {
|
|
634
635
|
const redirect_url = location.origin + location.pathname;
|
|
635
|
-
|
|
636
|
+
widget.share.line.support_scope = (_a = widget.share.line.support_scope) !== null && _a !== void 0 ? _a : [];
|
|
637
|
+
gvc.glitter.href = `https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=${widget.share.line.id}&redirect_uri=${encodeURI(redirect_url)}&state=line_login&scope=${[
|
|
638
|
+
'profile',
|
|
639
|
+
'openid',
|
|
640
|
+
'email'
|
|
641
|
+
].concat(widget.share.line.support_scope).join('%20')}&nonce=09876xyz`;
|
|
636
642
|
}
|
|
637
643
|
}
|
|
638
644
|
return {
|
|
@@ -660,9 +660,16 @@ export class UMLogin {
|
|
|
660
660
|
);
|
|
661
661
|
} else {
|
|
662
662
|
const redirect_url = location.origin + location.pathname;
|
|
663
|
+
widget.share.line.support_scope=widget.share.line.support_scope??[]
|
|
663
664
|
gvc.glitter.href = `https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=${widget.share.line.id}&redirect_uri=${encodeURI(
|
|
664
665
|
redirect_url
|
|
665
|
-
)}&state=line_login&scope
|
|
666
|
+
)}&state=line_login&scope=${
|
|
667
|
+
[
|
|
668
|
+
'profile',
|
|
669
|
+
'openid',
|
|
670
|
+
'email'
|
|
671
|
+
].concat(widget.share.line.support_scope).join('%20')
|
|
672
|
+
}&nonce=09876xyz`;
|
|
666
673
|
}
|
|
667
674
|
}
|
|
668
675
|
|