ts-glitter 22.4.6 → 22.4.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/lib/glitterBundle/Glitter.css +74 -62
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +49 -32
- package/lowcode/backend-manager/bg-product.ts +57 -39
- package/lowcode/backend-manager/bg-widget.js +17 -0
- package/lowcode/backend-manager/bg-widget.ts +18 -0
- package/lowcode/cms-plugin/information/information-module.js +5 -5
- package/lowcode/cms-plugin/information/information-module.ts +9 -5
- package/lowcode/cms-plugin/menus-setting.js +69 -55
- package/lowcode/cms-plugin/menus-setting.ts +77 -61
- package/lowcode/cms-plugin/module/form-module.js +109 -89
- package/lowcode/cms-plugin/module/form-module.ts +680 -650
- package/lowcode/cms-plugin/module/product-excel.js +1 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +28 -10
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +29 -10
- package/lowcode/cms-plugin/shopping-allowance-manager.js +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +0 -1
- package/lowcode/cms-plugin/shopping-collections.js +367 -193
- package/lowcode/cms-plugin/shopping-collections.ts +664 -243
- package/lowcode/cms-plugin/shopping-information.js +392 -38
- package/lowcode/cms-plugin/shopping-information.ts +479 -87
- package/lowcode/cms-plugin/shopping-product-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-setting-advance.js +906 -766
- package/lowcode/cms-plugin/shopping-setting-advance.ts +977 -841
- package/lowcode/cms-plugin/shopping-setting-basic.js +1547 -1285
- package/lowcode/cms-plugin/shopping-setting-basic.ts +1742 -1466
- package/lowcode/cms-plugin/stock-stores.js +1 -0
- package/lowcode/cms-plugin/stock-stores.ts +1 -0
- package/lowcode/cms-plugin/user-list.js +47 -12
- package/lowcode/cms-plugin/user-list.ts +52 -14
- package/lowcode/css/editor.css +6 -0
- package/lowcode/glitterBundle/Glitter.css +74 -62
- package/lowcode/jslib/nestable/index.html +317 -0
- package/lowcode/jslib/nestable/jquery.nestable.js +484 -0
- package/lowcode/official_view_component/form-widget/input-custom.js +98 -6
- package/lowcode/official_view_component/form-widget/input-custom.ts +121 -16
- package/lowcode/public-components/headers/header-class.js +63 -0
- package/lowcode/public-components/headers/header-class.ts +65 -0
- package/lowcode/public-components/headers/sy-02.js +386 -400
- package/lowcode/public-components/headers/sy-02.ts +482 -492
- package/lowcode/public-components/headers/sy-03.js +42 -43
- package/lowcode/public-components/headers/sy-03.ts +46 -43
- package/lowcode/public-components/headers/sy-04.js +43 -41
- package/lowcode/public-components/headers/sy-04.ts +48 -41
- package/lowcode/public-components/headers/sy-05.js +30 -27
- package/lowcode/public-components/headers/sy-05.ts +33 -27
- package/lowcode/public-components/product/product-list.js +160 -148
- package/lowcode/public-components/product/product-list.ts +186 -165
- package/lowcode/public-models/product.ts +26 -1
- package/lowcode/src/glitterBundle/Glitter.css +74 -62
- package/package.json +1 -1
- package/rxmnt81tnk.json +1 -0
- package/src/api-public/controllers/shop.js +10 -4
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -9
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/mail.js +1 -1
- package/src/api-public/services/mail.js.map +1 -1
- package/src/api-public/services/mail.ts +1 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/monitor.ts +2 -0
- package/src/api-public/services/schedule.d.ts +0 -1
- package/src/api-public/services/schedule.js +12 -35
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +15 -39
- package/src/api-public/services/shopee.js +7 -17
- package/src/api-public/services/shopping.d.ts +27 -6
- package/src/api-public/services/shopping.js +364 -85
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +510 -101
- package/src/api-public/services/updated-table-checked.js +58 -1
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +62 -1
- package/src/api-public/services/user-update.js +14 -0
- package/src/api-public/services/user-update.js.map +1 -1
- package/src/api-public/services/user-update.ts +15 -0
- package/src/api-public/services/user.js +1 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +1 -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/helper/glitter-util.d.ts +1 -0
- package/src/index.js +7 -4
- package/src/index.js.map +1 -1
- package/src/index.ts +45 -36
- package/src/modules/firebase.js +1 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +1 -0
- package/src/seo-config.d.ts +2 -1
- package/src/seo-config.js +28 -22
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +33 -26
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +4 -3
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/src/services/system-schedule.ts +1 -0
|
@@ -19,505 +19,495 @@ export class Sy02 {
|
|
|
19
19
|
widget: widget,
|
|
20
20
|
browser: () => {
|
|
21
21
|
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
22
|
-
gvc.glitter.getModule(
|
|
23
|
-
|
|
24
|
-
});
|
|
22
|
+
gvc.glitter.getModule(HeaderClass.getChangePagePath(gvc), cl => (changePage = cl.changePage));
|
|
23
|
+
|
|
25
24
|
const colors = Color.getTheme(gvc, widget.formData);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
HeaderClass.addStyle(gvc);
|
|
26
|
+
|
|
27
|
+
function navbar() {
|
|
28
|
+
const id = gvc.glitter.getUUID();
|
|
29
|
+
const vm = { data: [] };
|
|
30
|
+
|
|
31
|
+
ApiUser.getPublicConfig(
|
|
32
|
+
widget.formData.menu_refer || 'menu-setting',
|
|
33
|
+
'manager',
|
|
34
|
+
(window as any).appName
|
|
35
|
+
).then(res => {
|
|
36
|
+
vm.data = res.response.value[Language.getLanguage()];
|
|
37
|
+
gvc.notifyDataChange(id);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
function resetToggle() {
|
|
41
|
+
function loop(data: any) {
|
|
42
|
+
data.map((dd: any) => {
|
|
43
|
+
(dd as any).open = false;
|
|
44
|
+
loop((dd as any).items ?? []);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
loop(vm.data);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function openParent(data: any, current_path: string[], depth: number) {
|
|
51
|
+
data.open = current_path[depth] === data.title;
|
|
52
|
+
|
|
53
|
+
if ((data.items || []).length > 0) {
|
|
54
|
+
for (const d87 of data.items) {
|
|
55
|
+
openParent(d87, current_path, depth + 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function loopItems(data: any, show_border: boolean, current_path: string[]) {
|
|
61
|
+
return data
|
|
62
|
+
.map((dd: any) => {
|
|
63
|
+
const path = [...current_path, dd.title];
|
|
64
|
+
|
|
65
|
+
function linkEvent() {
|
|
66
|
+
if (((dd as any).items ?? []).length === 0) {
|
|
67
|
+
if (dd.link) {
|
|
68
|
+
gvc.glitter.href = dd.link;
|
|
69
|
+
gvc.glitter.closeDrawer();
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
let og = dd.open;
|
|
73
|
+
resetToggle();
|
|
74
|
+
if (!og) {
|
|
75
|
+
dd.open = true;
|
|
76
|
+
}
|
|
77
|
+
for (const d4 of vm.data) {
|
|
78
|
+
openParent(d4, path, 0);
|
|
79
|
+
}
|
|
80
|
+
gvc.notifyDataChange(id);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function stopEvent(event: any) {
|
|
85
|
+
if (dd.link) {
|
|
86
|
+
gvc.glitter.href = dd.link;
|
|
87
|
+
gvc.glitter.closeDrawer();
|
|
88
|
+
}
|
|
89
|
+
event.stopPropagation();
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return html`
|
|
94
|
+
<li
|
|
95
|
+
style="${show_border
|
|
96
|
+
? `border-bottom: 1px solid ${widget.formData.theme_color['title'] ?? '#000'} !important;`
|
|
97
|
+
: ''}"
|
|
98
|
+
>
|
|
99
|
+
<div
|
|
100
|
+
class="nav-link d-flex justify-content-between"
|
|
101
|
+
style="padding: 16px; gap: 30px;"
|
|
102
|
+
onclick="${gvc.event(() => linkEvent())}"
|
|
103
|
+
>
|
|
104
|
+
<div
|
|
105
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'} !important;"
|
|
106
|
+
onclick="${gvc.event((_, event) => stopEvent(event))}"
|
|
107
|
+
>
|
|
108
|
+
${dd.title}
|
|
109
|
+
</div>
|
|
110
|
+
${(dd.items || []).length
|
|
111
|
+
? html` <i
|
|
112
|
+
class="fa-solid ${dd.open ? 'fa-angle-up' : 'fa-angle-down'}"
|
|
113
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'} !important;"
|
|
114
|
+
></i>`
|
|
115
|
+
: ''}
|
|
116
|
+
</div>
|
|
117
|
+
${dd.open
|
|
118
|
+
? html`<ul class="ps-3 pb-2">
|
|
119
|
+
${loopItems(dd.items ?? [], false, path)}
|
|
120
|
+
</ul>`
|
|
121
|
+
: ''}
|
|
122
|
+
</li>
|
|
123
|
+
`;
|
|
124
|
+
})
|
|
125
|
+
.join('');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
bind: id,
|
|
130
|
+
view: () => {
|
|
131
|
+
return loopItems(vm.data, true, []);
|
|
132
|
+
},
|
|
133
|
+
divCreate: {
|
|
134
|
+
class: 'navbar-nav me-auto mb-2 mb-lg-0',
|
|
135
|
+
elem: 'ul',
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function drawer() {
|
|
141
|
+
return gvc.bindView({
|
|
142
|
+
bind: gvc.glitter.getUUID(),
|
|
143
|
+
view: () => {
|
|
144
|
+
return html`<div
|
|
145
|
+
class="div d-flex align-items-center flex-column w-100 p-3"
|
|
146
|
+
style="border-bottom:1px solid ${widget.formData.theme_color['title']};"
|
|
147
|
+
>
|
|
148
|
+
<div class="d-flex align-items-center">
|
|
149
|
+
<div>
|
|
150
|
+
<div class="h-100" onclick="${gvc.event(() => changePage('index', 'home', {}))}">
|
|
151
|
+
${widget.formData.logo.type === 'text'
|
|
152
|
+
? html`
|
|
153
|
+
<div
|
|
154
|
+
class="fw-bold d-flex align-items-center justify-content-center h-logo-text-1"
|
|
155
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
156
|
+
>
|
|
157
|
+
${widget.formData.logo.value}
|
|
158
|
+
</div>
|
|
159
|
+
`
|
|
160
|
+
: html`<img class="h-logo-image" src="${widget.formData.logo.value}" /> `}
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="mb-3">${LanguageView.selectLanguage(gvc, colors)}</div>
|
|
165
|
+
<div class="position-relative">
|
|
166
|
+
<input
|
|
167
|
+
class="form-control fw-500 "
|
|
168
|
+
placeholder="${Language.text('find_product')}"
|
|
169
|
+
autocomplete="off"
|
|
170
|
+
onchange="${gvc.event(e => {
|
|
171
|
+
gvc.glitter.href = `/all-product?search=${e.value}`;
|
|
172
|
+
})}"
|
|
173
|
+
/>
|
|
174
|
+
<div class="h-glass-div">
|
|
175
|
+
<i class="fa-solid fa-magnifying-glass"></i>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
<div class="offcanvas-body p-0">${gvc.bindView(navbar())}</div>`;
|
|
180
|
+
},
|
|
181
|
+
divCreate: {
|
|
182
|
+
class: 'w-100 h-100',
|
|
183
|
+
style: `
|
|
184
|
+
z-index: 9999;
|
|
185
|
+
overflow-y: auto;
|
|
186
|
+
overflow-x: hidden;
|
|
187
|
+
background: ${colors.bgr ?? '#000'};
|
|
188
|
+
`,
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function menu() {
|
|
194
|
+
const id = gvc.glitter.getUUID();
|
|
195
|
+
const vm = {
|
|
196
|
+
data: [],
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
ApiUser.getPublicConfig(
|
|
200
|
+
widget.formData.menu_refer || 'menu-setting',
|
|
201
|
+
'manager',
|
|
202
|
+
(window as any).appName
|
|
203
|
+
).then(res => {
|
|
204
|
+
vm.data = res.response.value[Language.getLanguage()];
|
|
205
|
+
gvc.notifyDataChange(id);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
return gvc.bindView({
|
|
209
|
+
bind: id,
|
|
210
|
+
view: async () => {
|
|
211
|
+
const userData = await ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
|
|
212
|
+
|
|
213
|
+
function loopItems(data: any) {
|
|
214
|
+
return data
|
|
215
|
+
.map((dd: any) => {
|
|
216
|
+
if (!PdClass.menuVisibleVerify(userData, dd)) {
|
|
217
|
+
return '';
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return html` <li class="nav-item dropdown">
|
|
221
|
+
<a
|
|
222
|
+
class="nav-link header-link "
|
|
223
|
+
style="color: ${widget.formData.theme_color['title'] ??
|
|
224
|
+
'#000'} !important;cursor: pointer;font-size: 15px;"
|
|
225
|
+
onclick="${gvc.event(() => {
|
|
226
|
+
if (dd.link) {
|
|
227
|
+
gvc.glitter.href = dd.link;
|
|
228
|
+
}
|
|
229
|
+
})}"
|
|
230
|
+
>${dd.title} ${dd.items.length > 0 ? html`<i class="fa-solid fa-angle-down ms-2"></i>` : ''}</a
|
|
231
|
+
>
|
|
232
|
+
${dd.items.length > 0
|
|
233
|
+
? html` <ul
|
|
234
|
+
class="dropdown-menu"
|
|
235
|
+
style="background:${widget.formData.theme_color['background'] ??
|
|
236
|
+
'#000'} !important; cursor: pointer; z-index: 99999;"
|
|
237
|
+
>
|
|
238
|
+
${loopItems(dd.items)}
|
|
239
|
+
</ul>`
|
|
240
|
+
: ''}
|
|
241
|
+
</li>`;
|
|
242
|
+
})
|
|
243
|
+
.filter(Boolean)
|
|
244
|
+
.join('');
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return loopItems(vm.data);
|
|
248
|
+
},
|
|
249
|
+
divCreate: {
|
|
250
|
+
class: 'navbar-nav ms-3 me-auto flex-wrap',
|
|
251
|
+
style: 'flex-direction: row; gap: 8px;',
|
|
252
|
+
elem: 'ul',
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function defaultButton() {
|
|
258
|
+
const id = gvc.glitter.getUUID();
|
|
259
|
+
const vm = {
|
|
260
|
+
visible: false,
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
ApiUser.getPublicConfig('store-information', 'manager').then(res => {
|
|
264
|
+
if (res.response.value.ai_search) {
|
|
265
|
+
vm.visible = true;
|
|
266
|
+
gvc.notifyDataChange(id);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
const style = `
|
|
271
|
+
color: ${widget.formData.theme_color['title'] ?? '#000'} !important;
|
|
272
|
+
width: 30px;
|
|
273
|
+
height: 30px;
|
|
274
|
+
font-size: 15px;
|
|
275
|
+
border: 2px solid ${widget.formData.theme_color['title'] ?? '#000'} !important;
|
|
276
|
+
border-radius: 50%;
|
|
277
|
+
font-weight: 700 !important;
|
|
278
|
+
padding-bottom: 2px;
|
|
279
|
+
`;
|
|
280
|
+
|
|
281
|
+
return gvc.bindView({
|
|
282
|
+
bind: id,
|
|
283
|
+
view: () => {
|
|
284
|
+
return html`<div class="d-flex align-items-center justify-content-center " style="${style}">AI</div>`;
|
|
285
|
+
},
|
|
286
|
+
divCreate: () => {
|
|
287
|
+
return {
|
|
288
|
+
class: `nav-item ${vm.visible ? 'd-flex' : 'd-none'} align-items-center justify-content-center`,
|
|
289
|
+
style: 'width: 48px !important; cursor: pointer;',
|
|
290
|
+
option: [
|
|
291
|
+
{
|
|
292
|
+
key: 'onclick',
|
|
293
|
+
value: gvc.event(() => AiSearch.searchProduct(gvc)),
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
};
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function searchView() {
|
|
302
|
+
if (PdClass.isShoppingPage()) {
|
|
303
|
+
return '';
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const vm = {
|
|
307
|
+
id: gvc.glitter.getUUID(),
|
|
308
|
+
toggle: false,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
return gvc.bindView({
|
|
312
|
+
bind: vm.id,
|
|
313
|
+
view: () => {
|
|
314
|
+
if (!vm.toggle) {
|
|
315
|
+
return html`<i
|
|
316
|
+
class="fa-regular fa-magnifying-glass h-20px-pointer"
|
|
317
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
318
|
+
onclick="${gvc.event(() => {
|
|
319
|
+
vm.toggle = !vm.toggle;
|
|
320
|
+
gvc.notifyDataChange(vm.id);
|
|
321
|
+
})}"
|
|
322
|
+
></i>`;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return html`<a class="nav-link search-container d-flex align-items-center"
|
|
326
|
+
><i
|
|
327
|
+
class="fa-regular fa-circle-xmark h-20px-pointer"
|
|
328
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
329
|
+
onclick="${gvc.event(() => {
|
|
330
|
+
vm.toggle = !vm.toggle;
|
|
331
|
+
gvc.notifyDataChange(vm.id);
|
|
332
|
+
})}"
|
|
333
|
+
></i
|
|
334
|
+
><input
|
|
335
|
+
class="ms-3 form-control"
|
|
336
|
+
style="height:40px;"
|
|
337
|
+
placeholder="${Language.text('input_product_keyword')}"
|
|
338
|
+
autocomplete="off"
|
|
339
|
+
onchange="${gvc.event(e => {
|
|
340
|
+
gvc.glitter.href = `/all-product?search=${`${e.value}`.trim()}`;
|
|
341
|
+
vm.toggle = !vm.toggle;
|
|
342
|
+
gvc.notifyDataChange(vm.id);
|
|
343
|
+
})}"
|
|
344
|
+
/>
|
|
345
|
+
</a>`;
|
|
346
|
+
},
|
|
347
|
+
divCreate: {
|
|
348
|
+
class: 'nav-link search-container',
|
|
349
|
+
elem: 'a',
|
|
350
|
+
},
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function shoppingCount() {
|
|
355
|
+
const vm = {
|
|
356
|
+
id: gvc.glitter.getUUID(),
|
|
357
|
+
count: 0,
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
return gvc.bindView({
|
|
361
|
+
bind: vm.id,
|
|
362
|
+
view: () => {
|
|
363
|
+
return html`<span
|
|
364
|
+
class="position-relative"
|
|
365
|
+
onclick="${gvc.event(() => HeaderClass.rightCartMenu(gvc, widget))}"
|
|
366
|
+
>
|
|
367
|
+
<i
|
|
368
|
+
class="fa-duotone fa-cart-shopping h-20px-pointer"
|
|
369
|
+
style="color: ${widget.formData.theme_color['title'] ?? '#000'} !important;"
|
|
370
|
+
></i>
|
|
371
|
+
${gvc.bindView({
|
|
372
|
+
bind: gvc.glitter.getUUID(),
|
|
373
|
+
view: () => {
|
|
374
|
+
return new Promise(resolve => {
|
|
375
|
+
getCheckoutCount(count => {
|
|
376
|
+
vm.count = count;
|
|
377
|
+
resolve(
|
|
378
|
+
vm.count
|
|
379
|
+
? html` <div class="position-absolute" style="font-size: 10px; right: -10px; top: -6px;">
|
|
380
|
+
<div class="rounded-circle bg-danger h-checkout-count-icon">${vm.count}</div>
|
|
381
|
+
</div>`
|
|
382
|
+
: ''
|
|
383
|
+
);
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
},
|
|
387
|
+
})}
|
|
388
|
+
</span>`;
|
|
389
|
+
},
|
|
390
|
+
divCreate: {
|
|
391
|
+
class: 'nav-link js-cart-count',
|
|
392
|
+
},
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function view() {
|
|
397
|
+
return html` <!--Header Sy02-->
|
|
398
|
+
<div id="header-bgr" style="height: 76px;"></div>
|
|
29
399
|
<nav
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
400
|
+
class="navbar navbar-expand-lg vw-100 header header-place shadow position-fixed top-0 left-0 py-0"
|
|
401
|
+
style="background: ${widget.formData.theme_color['background'] ??
|
|
402
|
+
'#000'} !important; min-height: 76px; z-index:9999;"
|
|
34
403
|
>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
404
|
+
<div
|
|
405
|
+
class="mx-auto header-place h-100"
|
|
406
|
+
style="max-width: 100% !important; ${document.body.clientWidth > 1300
|
|
407
|
+
? 'min-width: 1280px !important;'
|
|
408
|
+
: 'width: 100%; padding-left: 10px; padding-right: 10px;'}"
|
|
409
|
+
>
|
|
410
|
+
<!--LOGO顯示區塊-->
|
|
411
|
+
<div class="d-flex align-items-center justify-content-center h-100 w-100 gap-2 px-0 px-md-3 px-lg-5">
|
|
412
|
+
<!--手機版選單-->
|
|
413
|
+
<div
|
|
414
|
+
class="d-flex d-lg-none align-items-center justify-content-center"
|
|
415
|
+
style="width: 40px !important; height: 40px !important;"
|
|
416
|
+
onclick="${gvc.event(() => {
|
|
417
|
+
gvc.glitter.setDrawer(drawer(), () => gvc.glitter.openDrawer(280));
|
|
418
|
+
})}"
|
|
419
|
+
>
|
|
420
|
+
<i
|
|
421
|
+
class="fa-solid fa-bars fa-fw d-md-none"
|
|
422
|
+
style="font-size: 20px; color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
423
|
+
></i>
|
|
424
|
+
</div>
|
|
425
|
+
<div
|
|
426
|
+
class="${widget.formData.logo.type === 'text' ? '' : `h-100`}"
|
|
427
|
+
onclick="${gvc.event(() => changePage('index', 'home', {}))}"
|
|
428
|
+
>
|
|
429
|
+
${widget.formData.logo.type === 'text'
|
|
430
|
+
? html`
|
|
431
|
+
<div
|
|
432
|
+
class="fw-bold d-flex align-items-center h-100 mb-1 mb-sm-auto"
|
|
433
|
+
style="font-size: 28px; line-height: 28px; cursor: pointer; color: ${widget.formData
|
|
434
|
+
.theme_color['title'] ?? '#000'};"
|
|
435
|
+
>
|
|
436
|
+
${widget.formData.logo.value}
|
|
437
|
+
</div>
|
|
438
|
+
`
|
|
439
|
+
: html`
|
|
440
|
+
<div class="d-flex align-items-center justify-content-center h-100 p-2">
|
|
441
|
+
<img src="${widget.formData.logo.value}" style="max-height: 100%;max-width:60px;" />
|
|
442
|
+
</div>
|
|
443
|
+
`}
|
|
444
|
+
</div>
|
|
445
|
+
<!--選單列表顯示區塊-->
|
|
446
|
+
<ul class="navbar-nav d-none d-md-block flex-fill ps-2">
|
|
447
|
+
${menu()}
|
|
448
|
+
</ul>
|
|
449
|
+
<div class="d-flex align-items-center ms-auto">
|
|
450
|
+
<!--固定按鈕顯示區塊-->
|
|
451
|
+
<ul class="navbar-nav flex-row ms-auto">
|
|
452
|
+
${defaultButton()}
|
|
453
|
+
${HeaderClass.hideShopperBtn()
|
|
454
|
+
? ''
|
|
455
|
+
: html`<li class="nav-item d-none d-sm-flex align-items-center justify-content-center">
|
|
456
|
+
${searchView()}
|
|
457
|
+
</li>`}
|
|
458
|
+
<li
|
|
459
|
+
class="nav-item d-flex align-items-center justify-content-center"
|
|
460
|
+
style="width:40px !important;"
|
|
461
|
+
>
|
|
462
|
+
${shoppingCount()}
|
|
463
|
+
</li>
|
|
464
|
+
<li
|
|
465
|
+
class="nav-item d-flex align-items-center justify-content-center ms-3 "
|
|
466
|
+
onclick="${gvc.event(() => {
|
|
467
|
+
if (GlobalUser.token) {
|
|
468
|
+
changePage('account_userinfo', 'page', {});
|
|
469
|
+
} else {
|
|
470
|
+
if (localStorage.getItem('redirect_cart') === 'true') {
|
|
471
|
+
localStorage.removeItem('redirect_cart');
|
|
472
|
+
}
|
|
473
|
+
changePage('login', 'page', {});
|
|
474
|
+
}
|
|
475
|
+
})}"
|
|
476
|
+
>
|
|
45
477
|
<div
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
bind: id,
|
|
54
|
-
view: () => {
|
|
55
|
-
return html` <div
|
|
56
|
-
class="div d-flex align-items-center flex-column w-100 p-3"
|
|
57
|
-
style="border-bottom:1px solid ${widget.formData.theme_color['title']};"
|
|
58
|
-
>
|
|
59
|
-
<div class="d-flex align-items-center ">
|
|
60
|
-
<div>
|
|
61
|
-
<div
|
|
62
|
-
class="h-100"
|
|
63
|
-
onclick="${gvc.event(() => {
|
|
64
|
-
changePage('index', 'home', {});
|
|
65
|
-
})}"
|
|
66
|
-
>
|
|
67
|
-
${widget.formData.logo.type === 'text'
|
|
68
|
-
? html`
|
|
69
|
-
<div
|
|
70
|
-
class=" fw-bold d-flex align-items-center justify-content-center"
|
|
71
|
-
style="width: 150px; margin-bottom: 20px;font-size: 36px;color: ${widget
|
|
72
|
-
.formData.theme_color['title'] ?? '#000'};"
|
|
73
|
-
>
|
|
74
|
-
${widget.formData.logo.value}
|
|
75
|
-
</div>
|
|
76
|
-
`
|
|
77
|
-
: html`<img
|
|
78
|
-
style="width: 150px;
|
|
79
|
-
background-position: center;
|
|
80
|
-
background-size: cover;
|
|
81
|
-
background-repeat: no-repeat;
|
|
82
|
-
border-radius: 10px;
|
|
83
|
-
margin-bottom: 20px;"
|
|
84
|
-
src="${widget.formData.logo.value}"
|
|
85
|
-
/> `}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
<div class="mb-3">${LanguageView.selectLanguage(gvc, colors)}</div>
|
|
90
|
-
<div class="position-relative">
|
|
91
|
-
<input
|
|
92
|
-
class="form-control fw-500 "
|
|
93
|
-
placeholder="${Language.text('find_product')}"
|
|
94
|
-
autocomplete="off"
|
|
95
|
-
value=""
|
|
96
|
-
onchange="${gvc.event((e, event) => {
|
|
97
|
-
gvc.glitter.href = `/all-product?search=${e.value}`;
|
|
98
|
-
})}"
|
|
99
|
-
/>
|
|
100
|
-
|
|
101
|
-
<div
|
|
102
|
-
style=" position: absolute;
|
|
103
|
-
right: 10px;
|
|
104
|
-
top: 50%;
|
|
105
|
-
transform: translateY(-50%);
|
|
106
|
-
color: rgb(107, 114, 128);"
|
|
107
|
-
>
|
|
108
|
-
<i class="fa-solid fa-magnifying-glass"></i>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<div class="offcanvas-body p-0 ">
|
|
114
|
-
${gvc.bindView(() => {
|
|
115
|
-
const id = gvc.glitter.getUUID();
|
|
116
|
-
const vm = {
|
|
117
|
-
data: [],
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
ApiUser.getPublicConfig(
|
|
121
|
-
widget.formData.menu_refer || 'menu-setting',
|
|
122
|
-
'manager',
|
|
123
|
-
(window as any).appName
|
|
124
|
-
).then(res => {
|
|
125
|
-
vm.data = res.response.value[Language.getLanguage()];
|
|
126
|
-
gvc.notifyDataChange(id);
|
|
127
|
-
});
|
|
128
|
-
return {
|
|
129
|
-
bind: id,
|
|
130
|
-
view: () => {
|
|
131
|
-
function resetToggle() {
|
|
132
|
-
function loop(data: any) {
|
|
133
|
-
data.map((dd: any) => {
|
|
134
|
-
(dd as any).open = false;
|
|
135
|
-
loop((dd as any).items ?? []);
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
loop(vm.data);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function loopItems(data: any, show_border: boolean) {
|
|
143
|
-
return data
|
|
144
|
-
.map((dd: any) => {
|
|
145
|
-
return html`
|
|
146
|
-
<li
|
|
147
|
-
style="${show_border
|
|
148
|
-
? `border-bottom: 1px solid ${widget.formData.theme_color['title'] ?? '#000'} !important;`
|
|
149
|
-
: ``}"
|
|
150
|
-
>
|
|
151
|
-
<div
|
|
152
|
-
class="nav-link d-flex justify-content-between"
|
|
153
|
-
style="padding: 16px;"
|
|
154
|
-
onclick="${gvc.event(() => {
|
|
155
|
-
if (((dd as any).items ?? []).length === 0) {
|
|
156
|
-
if (dd.link) {
|
|
157
|
-
gvc.glitter.href = dd.link;
|
|
158
|
-
gvc.glitter.closeDrawer();
|
|
159
|
-
}
|
|
160
|
-
} else {
|
|
161
|
-
let og = dd.open;
|
|
162
|
-
resetToggle();
|
|
163
|
-
if (!og) {
|
|
164
|
-
dd.open = true;
|
|
165
|
-
}
|
|
166
|
-
gvc.notifyDataChange(id);
|
|
167
|
-
}
|
|
168
|
-
})}"
|
|
169
|
-
>
|
|
170
|
-
<div
|
|
171
|
-
style="color: ${widget.formData.theme_color['title'] ??
|
|
172
|
-
'#000'} !important;"
|
|
173
|
-
onclick="${gvc.event((e, event) => {
|
|
174
|
-
if (dd.link) {
|
|
175
|
-
gvc.glitter.href = dd.link;
|
|
176
|
-
gvc.glitter.closeDrawer();
|
|
177
|
-
}
|
|
178
|
-
event.stopPropagation();
|
|
179
|
-
event.preventDefault();
|
|
180
|
-
})}"
|
|
181
|
-
>
|
|
182
|
-
${dd.title}
|
|
183
|
-
</div>
|
|
184
|
-
${(dd.items ?? []).length
|
|
185
|
-
? html` <i
|
|
186
|
-
class="fa-solid ${dd.open
|
|
187
|
-
? `fa-angle-up`
|
|
188
|
-
: `fa-angle-down`}"
|
|
189
|
-
style="color: ${widget.formData.theme_color[
|
|
190
|
-
'title'
|
|
191
|
-
] ?? '#000'} !important;"
|
|
192
|
-
></i>`
|
|
193
|
-
: ``}
|
|
194
|
-
</div>
|
|
195
|
-
${dd.open
|
|
196
|
-
? `<ul class="ps-3 pb-2">${loopItems(dd.items ?? [], false)}</ul>`
|
|
197
|
-
: ``}
|
|
198
|
-
</li>
|
|
199
|
-
`;
|
|
200
|
-
})
|
|
201
|
-
.join('');
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return loopItems(vm.data, true);
|
|
205
|
-
},
|
|
206
|
-
divCreate: {
|
|
207
|
-
class: `navbar-nav me-auto mb-2 mb-lg-0`,
|
|
208
|
-
style: ``,
|
|
209
|
-
elem: `ul`,
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
})}
|
|
213
|
-
</div>`;
|
|
214
|
-
},
|
|
215
|
-
divCreate: {
|
|
216
|
-
class: `w-100 h-100`,
|
|
217
|
-
style: `z-index: 9999;overflow-y:auto;
|
|
218
|
-
background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
219
|
-
},
|
|
220
|
-
};
|
|
221
|
-
}),
|
|
222
|
-
() => {
|
|
223
|
-
gvc.glitter.openDrawer(280);
|
|
224
|
-
}
|
|
225
|
-
);
|
|
226
|
-
})}"
|
|
478
|
+
class="h-member-button"
|
|
479
|
+
style="${(() => {
|
|
480
|
+
const bgr = widget.formData.theme_color['solid-button-bg'] ?? '#000';
|
|
481
|
+
const color = widget.formData.theme_color['solid-button-text'] ?? '#000';
|
|
482
|
+
return `background: ${bgr}; color: ${color};`;
|
|
483
|
+
})()}"
|
|
227
484
|
>
|
|
228
|
-
|
|
229
|
-
class="fa-solid fa-bars fa-fw d-md-none "
|
|
230
|
-
style="font-size: 20px;
|
|
231
|
-
color: ${widget.formData.theme_color['title'] ?? '#000'};"
|
|
232
|
-
></i>
|
|
233
|
-
</div>
|
|
234
|
-
<div class="${widget.formData.logo.type === 'text' ? `` : `h-100`}"
|
|
235
|
-
onclick="${gvc.event(() => {
|
|
236
|
-
changePage('index', 'home', {});
|
|
237
|
-
})}"> ${
|
|
238
|
-
widget.formData.logo.type === 'text'
|
|
239
|
-
? html`
|
|
240
|
-
<div
|
|
241
|
-
class=" fw-bold d-flex align-items-center h-100 mb-1 mb-sm-auto"
|
|
242
|
-
style="font-size: 28px;line-height: 28px;color: ${widget.formData.theme_color[
|
|
243
|
-
'title'
|
|
244
|
-
] ?? '#000'};"
|
|
245
|
-
>
|
|
246
|
-
${widget.formData.logo.value}
|
|
247
|
-
</div>
|
|
248
|
-
`
|
|
249
|
-
: html`
|
|
250
|
-
<div class="d-flex align-items-center justify-content-center h-100 py-2">
|
|
251
|
-
<img
|
|
252
|
-
src="${widget.formData.logo.value}"
|
|
253
|
-
style="max-height: 100%;max-width:200px;"
|
|
254
|
-
/>
|
|
255
|
-
</div>
|
|
256
|
-
`
|
|
257
|
-
}
|
|
485
|
+
${GlobalUser.token ? Language.text('member_management') : Language.text('member_login')}
|
|
258
486
|
</div>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
data: [],
|
|
265
|
-
};
|
|
266
|
-
ApiUser.getPublicConfig(
|
|
267
|
-
widget.formData.menu_refer || 'menu-setting',
|
|
268
|
-
'manager',
|
|
269
|
-
(window as any).appName
|
|
270
|
-
).then(res => {
|
|
271
|
-
vm.data = res.response.value[Language.getLanguage()];
|
|
272
|
-
gvc.notifyDataChange(id);
|
|
273
|
-
});
|
|
274
|
-
return {
|
|
275
|
-
bind: id,
|
|
276
|
-
view: async () => {
|
|
277
|
-
const userData = await ApiUser.getUserData(gvc.glitter.share.GlobalUser.token, 'me');
|
|
278
|
-
|
|
279
|
-
function loopItems(data: any) {
|
|
280
|
-
return data
|
|
281
|
-
.map((dd: any) => {
|
|
282
|
-
if (!PdClass.menuVisibleVerify(userData, dd)) {
|
|
283
|
-
return '';
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return html` <li class="nav-item dropdown">
|
|
287
|
-
<a
|
|
288
|
-
class="nav-link header-link "
|
|
289
|
-
style="color: ${widget.formData.theme_color['title'] ??
|
|
290
|
-
'#000'} !important;cursor: pointer;font-size: 15px;"
|
|
291
|
-
onclick="${gvc.event(() => {
|
|
292
|
-
if (dd.link) {
|
|
293
|
-
gvc.glitter.href = dd.link;
|
|
294
|
-
}
|
|
295
|
-
})}"
|
|
296
|
-
>${dd.title}
|
|
297
|
-
${dd.items.length > 0
|
|
298
|
-
? `<i class="fa-solid fa-angle-down ms-2"></i>`
|
|
299
|
-
: ``}</a
|
|
300
|
-
>
|
|
301
|
-
${dd.items.length > 0
|
|
302
|
-
? html` <ul
|
|
303
|
-
class="dropdown-menu"
|
|
304
|
-
style="background:${widget.formData.theme_color['background'] ??
|
|
305
|
-
'#000'} !important; cursor: pointer; z-index: 99999;"
|
|
306
|
-
>
|
|
307
|
-
${loopItems(dd.items)}
|
|
308
|
-
</ul>`
|
|
309
|
-
: ``}
|
|
310
|
-
</li>`;
|
|
311
|
-
})
|
|
312
|
-
.filter(Boolean)
|
|
313
|
-
.join('');
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
return loopItems(vm.data);
|
|
317
|
-
},
|
|
318
|
-
divCreate: {
|
|
319
|
-
class: `navbar-nav ms-3 me-auto`,
|
|
320
|
-
style: `flex-direction: row; gap: 15px;`,
|
|
321
|
-
elem: `ul`,
|
|
322
|
-
},
|
|
323
|
-
};
|
|
324
|
-
})}
|
|
325
|
-
</ul>
|
|
326
|
-
<div class="d-flex align-items-center ms-auto">
|
|
327
|
-
<!--固定按鈕顯示區塊-->
|
|
328
|
-
<ul class="navbar-nav flex-row ms-auto">
|
|
329
|
-
${gvc.bindView(() => {
|
|
330
|
-
const id = gvc.glitter.getUUID();
|
|
331
|
-
const vm = {
|
|
332
|
-
visible: false,
|
|
333
|
-
};
|
|
334
|
-
ApiUser.getPublicConfig('store-information', 'manager').then(res => {
|
|
335
|
-
if (res.response.value.ai_search) {
|
|
336
|
-
vm.visible = true;
|
|
337
|
-
gvc.notifyDataChange(id);
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
return {
|
|
341
|
-
bind: id,
|
|
342
|
-
view: () => {
|
|
343
|
-
return html` <div
|
|
344
|
-
class="d-flex align-items-center justify-content-center "
|
|
345
|
-
style="color: ${widget.formData.theme_color['title'] ??
|
|
346
|
-
'#000'} !important;width:30px;height:30px;font-size: 15px;
|
|
347
|
-
border: 2px solid ${widget.formData.theme_color['title'] ?? '#000'} !important;
|
|
348
|
-
border-radius: 50%;
|
|
349
|
-
font-weight: 700 !important;
|
|
350
|
-
padding-bottom: 2px;
|
|
351
|
-
"
|
|
352
|
-
>
|
|
353
|
-
AI
|
|
354
|
-
</div>`;
|
|
355
|
-
},
|
|
356
|
-
divCreate: () => {
|
|
357
|
-
return {
|
|
358
|
-
class: `nav-item ${vm.visible ? `d-flex` : `d-none`} align-items-center justify-content-center`,
|
|
359
|
-
style: `width:48px !important;cursor: pointer;`,
|
|
360
|
-
option: [
|
|
361
|
-
{
|
|
362
|
-
key: 'onclick',
|
|
363
|
-
value: gvc.event(() => {
|
|
364
|
-
AiSearch.searchProduct(gvc);
|
|
365
|
-
}),
|
|
366
|
-
},
|
|
367
|
-
],
|
|
368
|
-
};
|
|
369
|
-
},
|
|
370
|
-
};
|
|
371
|
-
})}
|
|
372
|
-
${
|
|
373
|
-
HeaderClass.hideShopperBtn()
|
|
374
|
-
? ``
|
|
375
|
-
: `<li class="nav-item d-none d-sm-flex align-items-center justify-content-center "
|
|
376
|
-
>
|
|
377
|
-
${gvc.bindView(() => {
|
|
378
|
-
const vm = {
|
|
379
|
-
id: gvc.glitter.getUUID(),
|
|
380
|
-
toggle: false,
|
|
381
|
-
};
|
|
382
|
-
return {
|
|
383
|
-
bind: vm.id,
|
|
384
|
-
view: () => {
|
|
385
|
-
if (PdClass.isShoppingPage()) {
|
|
386
|
-
return ``;
|
|
387
|
-
}
|
|
388
|
-
if (!vm.toggle) {
|
|
389
|
-
return html`<i
|
|
390
|
-
class="fa-regular fa-magnifying-glass"
|
|
391
|
-
style="color: ${widget.formData.theme_color['title'] ??
|
|
392
|
-
'#000'};cursor: pointer;font-size:20px;"
|
|
393
|
-
onclick="${gvc.event(() => {
|
|
394
|
-
vm.toggle = !vm.toggle;
|
|
395
|
-
gvc.notifyDataChange(vm.id);
|
|
396
|
-
})}"
|
|
397
|
-
></i>`;
|
|
398
|
-
} else {
|
|
399
|
-
return html`<a class="nav-link search-container d-flex align-items-center"
|
|
400
|
-
><i
|
|
401
|
-
class="fa-regular fa-circle-xmark"
|
|
402
|
-
style="color: ${widget.formData.theme_color['title'] ??
|
|
403
|
-
'#000'};cursor: pointer;font-size:20px;"
|
|
404
|
-
onclick="${gvc.event(() => {
|
|
405
|
-
vm.toggle = !vm.toggle;
|
|
406
|
-
gvc.notifyDataChange(vm.id);
|
|
407
|
-
})}"
|
|
408
|
-
></i
|
|
409
|
-
><input
|
|
410
|
-
class="ms-3 form-control"
|
|
411
|
-
style="height:40px;"
|
|
412
|
-
placeholder="${Language.text('input_product_keyword')}"
|
|
413
|
-
autocomplete="off"
|
|
414
|
-
onchange="${gvc.event((e, event) => {
|
|
415
|
-
gvc.glitter.href = `/all-product?search=${`${e.value}`.trim()}`;
|
|
416
|
-
vm.toggle = !vm.toggle;
|
|
417
|
-
gvc.notifyDataChange(vm.id);
|
|
418
|
-
})}"
|
|
419
|
-
/>
|
|
420
|
-
</a>`;
|
|
421
|
-
}
|
|
422
|
-
},
|
|
423
|
-
divCreate: {
|
|
424
|
-
class: `nav-link search-container`,
|
|
425
|
-
elem: `a`,
|
|
426
|
-
},
|
|
427
|
-
};
|
|
428
|
-
})}
|
|
429
|
-
</li>`
|
|
430
|
-
}
|
|
431
|
-
<li class="nav-item d-flex align-items-center justify-content-center"
|
|
432
|
-
style="width:40px !important;">
|
|
433
|
-
${gvc.bindView(() => {
|
|
434
|
-
const vm = {
|
|
435
|
-
id: gvc.glitter.getUUID(),
|
|
436
|
-
count: 0,
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
return {
|
|
440
|
-
bind: vm.id,
|
|
441
|
-
view: () => {
|
|
442
|
-
return html`<span
|
|
443
|
-
class="position-relative"
|
|
444
|
-
onclick="${gvc.event(() => {
|
|
445
|
-
HeaderClass.rightCartMenu(gvc, widget);
|
|
446
|
-
})}"
|
|
447
|
-
>
|
|
448
|
-
<i
|
|
449
|
-
class="fa-duotone fa-cart-shopping"
|
|
450
|
-
style="color: ${widget.formData.theme_color['title'] ??
|
|
451
|
-
'#000'} !important;cursor: pointer;font-size:20px;"
|
|
452
|
-
></i>
|
|
453
|
-
${gvc.bindView(() => {
|
|
454
|
-
return {
|
|
455
|
-
bind: gvc.glitter.getUUID(),
|
|
456
|
-
view: () => {
|
|
457
|
-
return new Promise((resolve, reject) => {
|
|
458
|
-
getCheckoutCount(count => {
|
|
459
|
-
vm.count = count;
|
|
460
|
-
resolve(
|
|
461
|
-
vm.count
|
|
462
|
-
? html` <div
|
|
463
|
-
class="position-absolute"
|
|
464
|
-
style="font-size: 10px;right: -10px;top: -6px;"
|
|
465
|
-
>
|
|
466
|
-
<div
|
|
467
|
-
class="rounded-circle bg-danger text-white align-items-center justify-content-center fw-500 d-flex"
|
|
468
|
-
style="width:18px;height: 18px;color: white !important;background:#fe5541;"
|
|
469
|
-
>
|
|
470
|
-
${vm.count}
|
|
471
|
-
</div>
|
|
472
|
-
</div>`
|
|
473
|
-
: ``
|
|
474
|
-
);
|
|
475
|
-
});
|
|
476
|
-
});
|
|
477
|
-
},
|
|
478
|
-
};
|
|
479
|
-
})}
|
|
480
|
-
</span>`;
|
|
481
|
-
},
|
|
482
|
-
divCreate: {
|
|
483
|
-
class: `nav-link js-cart-count `,
|
|
484
|
-
},
|
|
485
|
-
};
|
|
486
|
-
})}
|
|
487
|
-
</li>
|
|
488
|
-
<li
|
|
489
|
-
class="nav-item d-flex align-items-center justify-content-center ms-3 "
|
|
490
|
-
|
|
491
|
-
onclick="${gvc.event(() => {
|
|
492
|
-
if (GlobalUser.token) {
|
|
493
|
-
changePage('account_userinfo', 'page', {});
|
|
494
|
-
} else {
|
|
495
|
-
if (localStorage.getItem('redirect_cart') === 'true') {
|
|
496
|
-
localStorage.removeItem('redirect_cart');
|
|
497
|
-
}
|
|
498
|
-
changePage('login', 'page', {});
|
|
499
|
-
}
|
|
500
|
-
})}"
|
|
501
|
-
>
|
|
502
|
-
<div
|
|
503
|
-
|
|
504
|
-
style="background: ${widget.formData.theme_color['solid-button-bg'] ?? '#000'};
|
|
505
|
-
color: ${widget.formData.theme_color['solid-button-text'] ?? '#000'}; cursor: pointer;
|
|
506
|
-
display: flex;
|
|
507
|
-
width: 100px;
|
|
508
|
-
padding: 7px;
|
|
509
|
-
justify-content: center;
|
|
510
|
-
align-items: center;
|
|
511
|
-
gap: 10px;
|
|
512
|
-
border-radius: 5px;"
|
|
513
|
-
>
|
|
514
|
-
${GlobalUser.token ? Language.text('member_management') : Language.text('member_login')}
|
|
515
|
-
</div>
|
|
516
|
-
</li>
|
|
517
|
-
</ul>
|
|
518
|
-
</div>
|
|
519
|
-
</div>
|
|
487
|
+
</li>
|
|
488
|
+
</ul>
|
|
489
|
+
</div>
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
520
492
|
</nav>`;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return gvc.bindView({
|
|
496
|
+
bind: gvc.glitter.getUUID(),
|
|
497
|
+
view: () => view(),
|
|
498
|
+
onCreate: () => {
|
|
499
|
+
setTimeout(() => {
|
|
500
|
+
const nav = document.querySelector('nav');
|
|
501
|
+
const headerBgr = document.getElementById('header-bgr');
|
|
502
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
503
|
+
for (let entry of entries) {
|
|
504
|
+
if (headerBgr) headerBgr.style.height = `${entry.contentRect.height}px`;
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
nav && resizeObserver.observe(nav);
|
|
508
|
+
}, 200);
|
|
509
|
+
},
|
|
510
|
+
});
|
|
521
511
|
},
|
|
522
512
|
mobile: () => {
|
|
523
513
|
return HeaderMobile.mian({
|