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
|
@@ -23,22 +23,21 @@ export class ProductList {
|
|
|
23
23
|
const text = Tool.randomString(5);
|
|
24
24
|
const height = (document.body.clientWidth > 768 ? 56 : 59) * (obj.length + 1);
|
|
25
25
|
const closeHeight = 56;
|
|
26
|
+
const currentPage = decodeURIComponent((obj.gvc.glitter.getUrlParameter('page') || '').split('/').reverse()[0]);
|
|
26
27
|
obj.gvc.addStyle(`
|
|
27
28
|
.box-item:hover {
|
|
28
|
-
background-color: #
|
|
29
|
+
background-color: #dddddd;
|
|
29
30
|
}
|
|
30
31
|
.box-container-${text} {
|
|
31
32
|
position: relative;
|
|
32
33
|
height: ${closeHeight}px;
|
|
33
|
-
overflow-y: hidden;
|
|
34
34
|
transition: height 0.3s ease-out;
|
|
35
35
|
}
|
|
36
36
|
.box-container-${text}.open-box {
|
|
37
37
|
max-height: ${height}px;
|
|
38
38
|
height: ${height}px;
|
|
39
|
-
overflow-y: auto;
|
|
40
39
|
}
|
|
41
|
-
.box-navbar
|
|
40
|
+
.box-navbar {
|
|
42
41
|
position: sticky;
|
|
43
42
|
top: 0;
|
|
44
43
|
min-height: 20px;
|
|
@@ -47,12 +46,14 @@ export class ProductList {
|
|
|
47
46
|
padding: 16px;
|
|
48
47
|
align-items: flex-start;
|
|
49
48
|
justify-content: space-between;
|
|
50
|
-
|
|
49
|
+
}
|
|
50
|
+
.box-navbar:hover {
|
|
51
|
+
background-color: #f5f5f5;
|
|
51
52
|
}
|
|
52
53
|
.arrow-icon-${text} {
|
|
53
54
|
color: #393939 !important;
|
|
54
55
|
box-shadow: none !important;
|
|
55
|
-
background
|
|
56
|
+
background: transparent;
|
|
56
57
|
background-image: url(${this.arrowDownDataImage('#000')}) !important;
|
|
57
58
|
background-repeat: no-repeat;
|
|
58
59
|
cursor: pointer;
|
|
@@ -66,20 +67,20 @@ export class ProductList {
|
|
|
66
67
|
transform: rotate(180deg);
|
|
67
68
|
}
|
|
68
69
|
.box-inside-${text} {
|
|
69
|
-
padding: 0 1.5rem 1.5rem;
|
|
70
|
-
|
|
70
|
+
padding: 0 0 1.5rem 1.5rem;
|
|
71
|
+
min-height: 56px;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
@media (max-width: 768px) {
|
|
74
75
|
.box-inside-${text} {
|
|
75
76
|
padding: 0 1rem 0.5rem;
|
|
76
|
-
overflow-x: hidden;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
`);
|
|
80
|
-
return html ` <div class="box-tag-${obj.tag} box-container-${text} ${obj.openOnInit ?
|
|
80
|
+
return html ` <div class="box-tag-${obj.tag} box-container-${text} ${obj.openOnInit ? 'open-box' : ''}">
|
|
81
81
|
<div
|
|
82
|
-
class="box-navbar
|
|
82
|
+
class="box-navbar ${(_a = obj.guideClass) !== null && _a !== void 0 ? _a : ''}"
|
|
83
|
+
style="${currentPage === (obj.code || obj.title) ? 'background-color: #dddddd' : ''}"
|
|
83
84
|
onclick="${obj.gvc.event(e => {
|
|
84
85
|
if (!obj.autoClose) {
|
|
85
86
|
const boxes = document.querySelectorAll(`.box-tag-${obj.tag}`);
|
|
@@ -98,30 +99,31 @@ export class ProductList {
|
|
|
98
99
|
e.parentElement.classList.toggle('open-box');
|
|
99
100
|
e.parentElement.querySelector(`.arrow-icon-${text}`).classList.toggle('open-box');
|
|
100
101
|
const container = window.document.querySelector(`.box-container-${text}`);
|
|
102
|
+
const inside = window.document.querySelector(`.box-inside-${text}`);
|
|
101
103
|
if (e.parentElement.classList.contains('open-box')) {
|
|
102
104
|
const si = setInterval(() => {
|
|
103
|
-
const inside = window.document.querySelector(`.box-inside-${text}`);
|
|
104
105
|
if (inside) {
|
|
105
106
|
const insideHeight = inside.clientHeight;
|
|
106
107
|
if (insideHeight + closeHeight < height) {
|
|
107
|
-
container.style.height = `${insideHeight + closeHeight + 20}px`;
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
|
-
container.style.height = `${height}px`;
|
|
111
110
|
}
|
|
111
|
+
container.style.height = `${height}px`;
|
|
112
|
+
inside.style.display = 'block';
|
|
112
113
|
clearInterval(si);
|
|
113
114
|
}
|
|
114
115
|
}, 100);
|
|
115
116
|
}
|
|
116
117
|
else {
|
|
117
118
|
container.style.height = `${closeHeight}px`;
|
|
119
|
+
inside.style.display = 'none';
|
|
118
120
|
}
|
|
119
121
|
}, 50);
|
|
120
122
|
})}"
|
|
121
123
|
>
|
|
122
124
|
<div
|
|
123
125
|
class="d-flex tx_700"
|
|
124
|
-
style="color: ${obj.fontColor};"
|
|
126
|
+
style="color: ${obj.fontColor}; cursor: pointer;"
|
|
125
127
|
onclick="${obj.gvc.event(() => {
|
|
126
128
|
obj.changePage('collections/' + obj.code, 'page', {});
|
|
127
129
|
obj.gvc.glitter.closeDrawer();
|
|
@@ -130,10 +132,15 @@ export class ProductList {
|
|
|
130
132
|
${obj.title}
|
|
131
133
|
</div>
|
|
132
134
|
<div class="d-flex">
|
|
133
|
-
<button class="box-tag-${obj.tag} arrow-icon-${text}"></button>
|
|
135
|
+
<button class="box-tag-${obj.tag} arrow-icon-${text} ${obj.openOnInit ? 'open-box' : ''}"></button>
|
|
134
136
|
</div>
|
|
135
137
|
</div>
|
|
136
|
-
<div
|
|
138
|
+
<div
|
|
139
|
+
class="box-inside-${text} ${obj.guideClass ? `box-inside-${obj.guideClass}` : ''} "
|
|
140
|
+
style="${obj.openOnInit ? '' : 'display: none;'}"
|
|
141
|
+
>
|
|
142
|
+
${obj.insideHTML}
|
|
143
|
+
</div>
|
|
137
144
|
</div>`;
|
|
138
145
|
}
|
|
139
146
|
static spinner() {
|
|
@@ -186,6 +193,7 @@ export class ProductList {
|
|
|
186
193
|
cl.changePage(index, type, subData);
|
|
187
194
|
};
|
|
188
195
|
});
|
|
196
|
+
const currentPage = decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0]);
|
|
189
197
|
function updateCollections(data) {
|
|
190
198
|
const flattenCollections = (collections, parentTitles = [], topLevelCollections = []) => {
|
|
191
199
|
let flattened = [];
|
|
@@ -200,7 +208,7 @@ export class ProductList {
|
|
|
200
208
|
else {
|
|
201
209
|
return title;
|
|
202
210
|
}
|
|
203
|
-
})(), array:
|
|
211
|
+
})(), array: array, product_id: product_id !== null && product_id !== void 0 ? product_id : [], checked: false, parentTitles: parentTitles.length ? [...parentTitles] : [], allCollections: parentTitles.length ? [...topLevelCollections] : [], subCollections: array.map(subCol => (() => {
|
|
204
212
|
const language_data = subCol.language_data;
|
|
205
213
|
if (language_data &&
|
|
206
214
|
language_data[Language.getLanguage()] &&
|
|
@@ -260,6 +268,13 @@ export class ProductList {
|
|
|
260
268
|
})());
|
|
261
269
|
return flattenCollections(data.collections, [], topLevelCollections);
|
|
262
270
|
}
|
|
271
|
+
function getTotalChildCount(item) {
|
|
272
|
+
if (item.array.length === 0) {
|
|
273
|
+
return 0;
|
|
274
|
+
}
|
|
275
|
+
const arr = item.array.filter(child => !child.hidden);
|
|
276
|
+
return arr.reduce((sum, child) => sum + getTotalChildCount(child), arr.length);
|
|
277
|
+
}
|
|
263
278
|
function getProductList() {
|
|
264
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
265
280
|
const orderByParam = glitter.getUrlParameter('order_by');
|
|
@@ -303,130 +318,125 @@ export class ProductList {
|
|
|
303
318
|
});
|
|
304
319
|
}
|
|
305
320
|
function getCollectionHTML() {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
const id = glitter.getUUID();
|
|
322
|
+
const undefinedOption = '請選擇項目';
|
|
323
|
+
let loading = true;
|
|
324
|
+
return gvc.bindView({
|
|
325
|
+
bind: id,
|
|
326
|
+
view: () => {
|
|
327
|
+
if (loading) {
|
|
328
|
+
return ProductList.spinner();
|
|
329
|
+
}
|
|
330
|
+
const firstCols = vm.collections.filter((item) => item.parentTitles.length === 0 && !Boolean(item.hidden));
|
|
331
|
+
function printUL(col) {
|
|
332
|
+
return html `<div
|
|
333
|
+
class="box-navbar"
|
|
334
|
+
style="${currentPage === (col.code || col.title) ? 'background: #dddddd;' : ''}"
|
|
335
|
+
onclick="${gvc.event(() => {
|
|
336
|
+
changePage(`collections/${col.code || col.title}`, 'page', {});
|
|
337
|
+
gvc.glitter.closeDrawer();
|
|
338
|
+
})}"
|
|
339
|
+
>
|
|
340
|
+
<div style="font-weight: 500;">
|
|
341
|
+
<div class="d-flex tx_700" style="color: ${fontColor}; cursor: pointer;">${col.title}</div>
|
|
342
|
+
</div>
|
|
343
|
+
</div>`;
|
|
344
|
+
}
|
|
345
|
+
function renderItem(item, depth, index) {
|
|
346
|
+
let subHTML = '';
|
|
347
|
+
try {
|
|
348
|
+
if (item.array.length > 0) {
|
|
349
|
+
item.array.map((col, index) => {
|
|
350
|
+
if (!Boolean(col.hidden)) {
|
|
351
|
+
subHTML += col.array.length > 0 ? renderItem(col, depth + 1, index) : printUL(col);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
const openOnInit = (() => {
|
|
356
|
+
const currentItem = vm.collections.find((col) => (col.code || col.title) === currentPage);
|
|
357
|
+
if (!currentItem)
|
|
358
|
+
return false;
|
|
359
|
+
return currentItem.parentTitles.includes(item.title);
|
|
360
|
+
})();
|
|
361
|
+
return html ` <div
|
|
362
|
+
class="${index + 1 === firstCols.length ? '' : ''}"
|
|
363
|
+
style="${item.array.length > 0 && subHTML.length > 0 ? '' : 'padding: 16px;'}"
|
|
364
|
+
>
|
|
365
|
+
${item.array.length > 0 && subHTML.length > 0
|
|
366
|
+
? ProductList.openBoxContainer({
|
|
367
|
+
gvc,
|
|
368
|
+
tag: `collection-box-${depth}-${index}`,
|
|
369
|
+
title: item.title,
|
|
370
|
+
code: item.code,
|
|
371
|
+
insideHTML: subHTML,
|
|
372
|
+
length: getTotalChildCount(item),
|
|
373
|
+
changePage,
|
|
374
|
+
fontColor,
|
|
375
|
+
openOnInit,
|
|
376
|
+
})
|
|
377
|
+
: html `<div
|
|
322
378
|
class="d-flex tx_700"
|
|
323
|
-
style="color: ${fontColor};"
|
|
379
|
+
style="color: ${fontColor}; cursor: pointer;"
|
|
324
380
|
onclick="${gvc.event(() => {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
381
|
+
changePage('collections/' + item.code, 'page', {});
|
|
382
|
+
gvc.glitter.closeDrawer();
|
|
383
|
+
})}"
|
|
328
384
|
>
|
|
329
|
-
${
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
else if (gvc.glitter.getUrlParameter('search')) {
|
|
334
|
-
return `${Language.text('search')}: ${gvc.glitter.getUrlParameter('search')}`;
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
return Language.text('all_products');
|
|
338
|
-
}
|
|
339
|
-
})()}
|
|
340
|
-
</div>
|
|
341
|
-
</li>
|
|
342
|
-
${cols
|
|
343
|
-
.map((item, index) => {
|
|
344
|
-
let subHTML = '';
|
|
345
|
-
if (item.subCollections.length > 0) {
|
|
346
|
-
for (const col of vm.collections) {
|
|
347
|
-
if (item.subCollections.includes(col.title) &&
|
|
348
|
-
col.parentTitles[0] === item.title &&
|
|
349
|
-
!Boolean(col.hidden)) {
|
|
350
|
-
subHTML += html `<ul
|
|
351
|
-
class="mt-1 pt-2 mx-n4 px-4 mb-n2 pb-2 box-item"
|
|
352
|
-
style="${decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0]) === (col.code || col.title)
|
|
353
|
-
? `background:#f5f5f5;`
|
|
354
|
-
: ``}"
|
|
355
|
-
onclick="${gvc.event(() => {
|
|
356
|
-
changePage(`collections/${col.code || col.title}`, 'page', {});
|
|
357
|
-
gvc.glitter.closeDrawer();
|
|
358
|
-
})}"
|
|
359
|
-
>
|
|
360
|
-
<li style="font-weight: 500; line-height: 40px;">
|
|
361
|
-
<div class="d-flex tx_700" style="color: ${fontColor};">${col.title}</div>
|
|
362
|
-
</li>
|
|
363
|
-
</ul>`;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return html ` <li
|
|
368
|
-
class="${index + 1 === cols.length ? '' : 'border-bottom'}"
|
|
369
|
-
style="${item.subCollections.length > 0 && subHTML.length > 0
|
|
370
|
-
? ''
|
|
371
|
-
: 'padding: 16px;'} cursor: pointer;"
|
|
372
|
-
>
|
|
373
|
-
${item.subCollections.length > 0 && subHTML.length > 0
|
|
374
|
-
? ProductList.openBoxContainer({
|
|
375
|
-
gvc,
|
|
376
|
-
tag: 'collection-box',
|
|
377
|
-
title: item.title,
|
|
378
|
-
code: item.code,
|
|
379
|
-
insideHTML: subHTML,
|
|
380
|
-
length: item.subCollections.length,
|
|
381
|
-
changePage,
|
|
382
|
-
fontColor,
|
|
383
|
-
openOnInit: [item.code]
|
|
384
|
-
.concat(vm.collections
|
|
385
|
-
.filter((col) => {
|
|
386
|
-
return (item.subCollections.includes(col.title) && col.parentTitles[0] === item.title);
|
|
387
|
-
})
|
|
388
|
-
.map((dd) => {
|
|
389
|
-
return dd.code || dd.title;
|
|
390
|
-
}))
|
|
391
|
-
.includes(decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0])),
|
|
392
|
-
})
|
|
393
|
-
: html `<div
|
|
394
|
-
class="d-flex tx_700"
|
|
395
|
-
style="color: ${fontColor};"
|
|
396
|
-
onclick="${gvc.event(() => {
|
|
397
|
-
changePage('collections/' + item.code, 'page', {});
|
|
398
|
-
gvc.glitter.closeDrawer();
|
|
399
|
-
})}"
|
|
400
|
-
>
|
|
401
|
-
${item.title}
|
|
402
|
-
</div>`}
|
|
403
|
-
</li>`;
|
|
404
|
-
})
|
|
405
|
-
.join('')}
|
|
406
|
-
</ul>`;
|
|
385
|
+
${item.title}
|
|
386
|
+
</div>`}
|
|
387
|
+
</div>`;
|
|
407
388
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
-
onCreate: () => {
|
|
413
|
-
if (loading) {
|
|
414
|
-
ApiShop.getCollection().then((data) => {
|
|
415
|
-
if (data.result && data.response.value.length > 0) {
|
|
416
|
-
setAdTag();
|
|
417
|
-
vm.allParents = ['(無)'].concat(data.response.value.map((item) => item.title));
|
|
418
|
-
vm.collections = updateCollections({
|
|
419
|
-
collections: data.response.value,
|
|
420
|
-
});
|
|
421
|
-
updatePageTitle();
|
|
422
|
-
}
|
|
423
|
-
loading = false;
|
|
424
|
-
gvc.notifyDataChange(id);
|
|
425
|
-
});
|
|
389
|
+
catch (error) {
|
|
390
|
+
console.error('Product-list RenderItem Error: ', error);
|
|
391
|
+
return '發生錯誤';
|
|
426
392
|
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
393
|
+
}
|
|
394
|
+
return html `<div class="${PdClass.isPhone() ? '' : 'border'} navbar-nav me-auto mb-2 mb-lg-0">
|
|
395
|
+
<div style="padding: 16px;">
|
|
396
|
+
<div
|
|
397
|
+
class="d-flex tx_700"
|
|
398
|
+
style="color: ${fontColor}; cursor: pointer;"
|
|
399
|
+
onclick="${gvc.event(() => {
|
|
400
|
+
changePage('all-product', 'page', {});
|
|
401
|
+
gvc.glitter.closeDrawer();
|
|
402
|
+
})}"
|
|
403
|
+
>
|
|
404
|
+
${(() => {
|
|
405
|
+
if (gvc.glitter.getUrlParameter('ai-search')) {
|
|
406
|
+
return Language.text('ai_choose');
|
|
407
|
+
}
|
|
408
|
+
else if (gvc.glitter.getUrlParameter('search')) {
|
|
409
|
+
return `${Language.text('search')}: ${gvc.glitter.getUrlParameter('search')}`;
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
return Language.text('all_products');
|
|
413
|
+
}
|
|
414
|
+
})()}
|
|
415
|
+
</div>
|
|
416
|
+
</div>
|
|
417
|
+
${firstCols.map((item, index) => renderItem(item, 0, index)).join('')}
|
|
418
|
+
</div>`;
|
|
419
|
+
},
|
|
420
|
+
divCreate: {
|
|
421
|
+
style: PdClass.isPhone() ? '' : 'position: sticky; top: 7.5rem;',
|
|
422
|
+
},
|
|
423
|
+
onCreate: () => {
|
|
424
|
+
if (loading) {
|
|
425
|
+
ApiShop.getCollection().then((data) => {
|
|
426
|
+
if (data.result && data.response.value.length > 0) {
|
|
427
|
+
setAdTag();
|
|
428
|
+
vm.allParents = [undefinedOption].concat(data.response.value.map((item) => item.title));
|
|
429
|
+
vm.collections = updateCollections({
|
|
430
|
+
collections: data.response.value,
|
|
431
|
+
});
|
|
432
|
+
updatePageTitle();
|
|
433
|
+
}
|
|
434
|
+
loading = false;
|
|
435
|
+
gvc.notifyDataChange(id);
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
});
|
|
430
440
|
}
|
|
431
441
|
function collectionTitle(titleText) {
|
|
432
442
|
var _a, _b, _c;
|
|
@@ -536,7 +546,9 @@ export class ProductList {
|
|
|
536
546
|
<div class="container d-flex mt-2" style="min-height: 1000px;">
|
|
537
547
|
<div
|
|
538
548
|
class="d-none d-sm-block mt-4"
|
|
539
|
-
style="${PdClass.isPad()
|
|
549
|
+
style="${PdClass.isPad()
|
|
550
|
+
? 'width: 180px; min-width: 180px;'
|
|
551
|
+
: 'width: 282px; min-width: 282px; margin-bottom: 300px;'}"
|
|
540
552
|
>
|
|
541
553
|
${getCollectionHTML()}
|
|
542
554
|
</div>
|
|
@@ -553,17 +565,11 @@ export class ProductList {
|
|
|
553
565
|
})}
|
|
554
566
|
</div>`}
|
|
555
567
|
<div class="d-flex justify-content-between mb-3">
|
|
556
|
-
${
|
|
557
|
-
? html `<
|
|
558
|
-
${gvc.bindView({
|
|
559
|
-
bind: ids.pageTitle,
|
|
560
|
-
view: () => vm.title,
|
|
561
|
-
})}
|
|
562
|
-
</div>`
|
|
563
|
-
: html `<button
|
|
568
|
+
${PdClass.isPhone()
|
|
569
|
+
? html `<button
|
|
564
570
|
class="filter-btn"
|
|
565
571
|
onclick="${gvc.event(() => {
|
|
566
|
-
glitter.setDrawer(html `<div class="
|
|
572
|
+
glitter.setDrawer(html `<div class="py-3 px-2" style="height: 100vh; overflow: scroll;">
|
|
567
573
|
<div
|
|
568
574
|
class="fw-500 mb-3"
|
|
569
575
|
style="font-size: 24px; color: ${fontColor};padding-top:${gvc.glitter.share
|
|
@@ -579,7 +585,13 @@ export class ProductList {
|
|
|
579
585
|
>
|
|
580
586
|
<i class="fa-regular fa-filter-list me-1"></i>
|
|
581
587
|
${Language.text('filter')}
|
|
582
|
-
</button>`
|
|
588
|
+
</button>`
|
|
589
|
+
: html `<div class="fw-500" style="font-size: 24px; color: ${fontColor}">
|
|
590
|
+
${gvc.bindView({
|
|
591
|
+
bind: ids.pageTitle,
|
|
592
|
+
view: () => vm.title,
|
|
593
|
+
})}
|
|
594
|
+
</div>`}
|
|
583
595
|
<select
|
|
584
596
|
class="form-select form-select-xs"
|
|
585
597
|
style="width: 200px;"
|