ts-glitter 17.2.1 → 17.2.3
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/form-view/editor/image-selector.js +7 -3
- package/lowcode/form-view/editor/image-selector.ts +75 -69
- package/lowcode/glitterBundle/Glitter.ts +1 -0
- package/lowcode/official_view_component/official/component.js +1 -3
- package/lowcode/official_view_component/official/component.ts +3 -4
- package/lowcode/public-components/footer/footer-01.js +3 -1
- package/lowcode/public-components/footer/footer-01.ts +3 -1
- package/lowcode/public-components/footer/footer-02.js +3 -1
- package/lowcode/public-components/footer/footer-02.ts +3 -1
- package/lowcode/public-components/footer/footer-03.js +3 -1
- package/lowcode/public-components/footer/footer-03.ts +3 -1
- package/lowcode/public-components/product/pd-card-01.js +22 -11
- package/lowcode/public-components/product/pd-card-01.ts +23 -11
- package/lowcode/public-components/product/pd-card-02.js +22 -11
- package/lowcode/public-components/product/pd-card-02.ts +22 -11
- package/lowcode/public-components/product/pd-card-03.js +22 -11
- package/lowcode/public-components/product/pd-card-03.ts +23 -11
- package/package.json +1 -1
- package/src/api-public/services/shopping.js +0 -4
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +0 -4
- package/src/services/page.js +0 -1
- package/src/services/page.js.map +1 -1
- package/src/services/page.ts +0 -1
package/lowcode/Entry.js
CHANGED
|
@@ -89,7 +89,7 @@ export class Entry {
|
|
|
89
89
|
}
|
|
90
90
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
|
|
91
91
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
92
|
-
glitter.share.editerVersion = 'V_17.2.
|
|
92
|
+
glitter.share.editerVersion = 'V_17.2.3';
|
|
93
93
|
glitter.share.start = new Date();
|
|
94
94
|
const vm = {
|
|
95
95
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class Entry {
|
|
|
90
90
|
}
|
|
91
91
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
92
92
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
93
|
-
glitter.share.editerVersion = 'V_17.2.
|
|
93
|
+
glitter.share.editerVersion = 'V_17.2.3';
|
|
94
94
|
glitter.share.start = new Date();
|
|
95
95
|
const vm: {
|
|
96
96
|
appConfig: any;
|
|
@@ -29,10 +29,14 @@ export class ImageSelector {
|
|
|
29
29
|
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
30
30
|
widget.bundle.refresh && widget.bundle.refresh();
|
|
31
31
|
gvc.notifyDataChange(id);
|
|
32
|
-
}, html `
|
|
32
|
+
}, html `
|
|
33
|
+
<div class="d-flex flex-column"
|
|
34
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫
|
|
35
|
+
</div>`, { mul: false });
|
|
33
36
|
}
|
|
34
37
|
return html `
|
|
35
|
-
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;"
|
|
38
|
+
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">
|
|
39
|
+
${widget.bundle.form_title}
|
|
36
40
|
<button
|
|
37
41
|
class="btn-size-sm btn-gray "
|
|
38
42
|
style=""
|
|
@@ -55,7 +59,7 @@ background-image: url('${src || BgWidget.noImageURL}');background-size: cover;ba
|
|
|
55
59
|
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
56
60
|
style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
|
|
57
61
|
>
|
|
58
|
-
|
|
62
|
+
${(src && (src !== BgWidget.noImageURL)) ? ` <button
|
|
59
63
|
class="btn-size-sm btn-gray position-absolute"
|
|
60
64
|
style="top:5px;right:5px;"
|
|
61
65
|
type="button"
|
|
@@ -14,24 +14,30 @@ export class ImageSelector {
|
|
|
14
14
|
return {
|
|
15
15
|
bind: id,
|
|
16
16
|
view: () => {
|
|
17
|
-
if(typeof widget.bundle.form_data[widget.bundle.form_key]==='object'){
|
|
18
|
-
widget.bundle.form_data[widget.bundle.form_key]=widget.bundle.form_data[widget.bundle.form_key].value
|
|
17
|
+
if (typeof widget.bundle.form_data[widget.bundle.form_key] === 'object') {
|
|
18
|
+
widget.bundle.form_data[widget.bundle.form_key] = widget.bundle.form_data[widget.bundle.form_key].value
|
|
19
19
|
}
|
|
20
20
|
const src = widget.bundle.form_data[widget.bundle.form_key];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
|
|
22
|
+
function selectImage() {
|
|
23
|
+
imageLibrary.selectImageLibrary(
|
|
24
|
+
gvc,
|
|
25
|
+
(urlArray) => {
|
|
26
|
+
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
27
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
28
|
+
gvc.notifyDataChange(id)
|
|
29
|
+
},
|
|
30
|
+
html`
|
|
31
|
+
<div class="d-flex flex-column"
|
|
32
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">圖片庫
|
|
33
|
+
</div>`,
|
|
34
|
+
{mul: false}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
return html`
|
|
34
|
-
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;"
|
|
39
|
+
<div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">
|
|
40
|
+
${widget.bundle.form_title}
|
|
35
41
|
<button
|
|
36
42
|
class="btn-size-sm btn-gray "
|
|
37
43
|
style=""
|
|
@@ -54,81 +60,81 @@ background-image: url('${src || BgWidget.noImageURL}');background-size: cover;ba
|
|
|
54
60
|
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
55
61
|
style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
|
|
56
62
|
>
|
|
57
|
-
|
|
63
|
+
${(src && (src !== BgWidget.noImageURL)) ? ` <button
|
|
58
64
|
class="btn-size-sm btn-gray position-absolute"
|
|
59
65
|
style="top:5px;right:5px;"
|
|
60
66
|
type="button"
|
|
61
67
|
onclick="${gvc.event(() => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
(window as any).glitter.getModule(gvc.glitter.root_path + `backend-manager/bg-widget.js`, async (BgWidget: any) => {
|
|
69
|
+
const tag = gvc.glitter.generateCheckSum(src, 9);
|
|
70
|
+
let alt = (await ApiUser.getPublicConfig(`alt_` + tag, 'manager')).response.value || {alt: ''};
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
async function set_alt() {
|
|
73
|
+
ApiUser.setPublicConfig({
|
|
74
|
+
key: `alt_` + tag,
|
|
75
|
+
value: alt,
|
|
76
|
+
user_id: 'manager',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
80
|
+
BgWidget.settingDialog({
|
|
81
|
+
gvc: gvc,
|
|
82
|
+
title: '設定圖片描述',
|
|
83
|
+
innerHTML: (gvc: GVC) => {
|
|
84
|
+
return `<div>${BgWidget.textArea({
|
|
85
|
+
gvc: gvc,
|
|
86
|
+
title: `ALT描述`,
|
|
87
|
+
default: alt.alt,
|
|
88
|
+
placeHolder: `請輸入ALT描述`,
|
|
89
|
+
callback: (text: string) => {
|
|
90
|
+
alt.alt = text;
|
|
91
|
+
},
|
|
92
|
+
})}</div>`;
|
|
93
|
+
},
|
|
94
|
+
footer_html: (gvc: GVC) => {
|
|
95
|
+
let array = [
|
|
96
|
+
BgWidget.cancel(
|
|
97
|
+
gvc.event(() => {
|
|
98
|
+
gvc.closeDialog();
|
|
99
|
+
})
|
|
100
|
+
),
|
|
101
|
+
BgWidget.save(
|
|
102
|
+
gvc.event(() => {
|
|
103
|
+
set_alt();
|
|
104
|
+
gvc.closeDialog();
|
|
105
|
+
})
|
|
106
|
+
),
|
|
107
|
+
];
|
|
108
|
+
return array.join('');
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
})}"
|
|
107
113
|
>
|
|
108
114
|
<span class="tx_700" style="">ALT</span>
|
|
109
115
|
</button>
|
|
110
116
|
<i
|
|
111
117
|
class="fa-regular fa-eye"
|
|
112
118
|
onclick="${gvc.event(() => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
(window.parent as any).glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', src);
|
|
120
|
+
// gvc.glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', dd);
|
|
121
|
+
})}"
|
|
116
122
|
></i>
|
|
117
123
|
<i
|
|
118
124
|
class="fa-regular fa-trash"
|
|
119
125
|
onclick="${gvc.event(() => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
></i
|
|
126
|
+
widget.bundle.form_data[widget.bundle.form_key] = BgWidget.noImageURL;
|
|
127
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
128
|
+
gvc.notifyDataChange(id);
|
|
129
|
+
})}"
|
|
130
|
+
></i>` : `
|
|
125
131
|
<button
|
|
126
132
|
class="btn-size-sm btn-gray "
|
|
127
133
|
style=""
|
|
128
134
|
type="button"
|
|
129
135
|
onclick="${gvc.event(() => {
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
selectImage()
|
|
137
|
+
})}"
|
|
132
138
|
>
|
|
133
139
|
<span class="tx_700" style="">選擇圖片</span>
|
|
134
140
|
</button>
|
|
@@ -160,8 +160,8 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
160
160
|
function updatePageConfig(formData, type, oWidget) {
|
|
161
161
|
oWidget && (widget = oWidget);
|
|
162
162
|
const ref = (widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData;
|
|
163
|
-
viewConfig.formData = getFormData(ref);
|
|
164
163
|
window.parent.glitter.share.updated_form_data[`${page_request_config.appName}_${tag}`] = ref;
|
|
164
|
+
viewConfig.formData = getFormData(ref);
|
|
165
165
|
const view = getView();
|
|
166
166
|
window.parent.glitter.share.loading_dialog.dataLoading({ visible: true });
|
|
167
167
|
setTimeout(() => {
|
|
@@ -840,7 +840,6 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
840
840
|
}));
|
|
841
841
|
});
|
|
842
842
|
try {
|
|
843
|
-
console.log(`getPageData-${parent_array.tag}`, parent_array);
|
|
844
843
|
window.glitterInitialHelper.share[`getPageData-${window.appName}-${parent_array.tag}`].data.response.result[0].config = parent_array;
|
|
845
844
|
}
|
|
846
845
|
catch (error) {
|
|
@@ -1311,7 +1310,6 @@ font-weight: 700;" onclick="${gvc.event(() => {
|
|
|
1311
1310
|
if (!pageData.template_config || !pageData.template_config.tag || (!pageData.template_config.tag.find((dd) => {
|
|
1312
1311
|
return dd === "商品卡片";
|
|
1313
1312
|
}))) {
|
|
1314
|
-
console.log(`pageData.template_config.tag`, pageData.template_config.tag);
|
|
1315
1313
|
if ((gvc.glitter.getUrlParameter('device') === 'mobile') && pageData.template_config.tag.includes('標頭元件')) {
|
|
1316
1314
|
}
|
|
1317
1315
|
else if ((gvc.glitter.getUrlParameter('device') !== 'mobile') && pageData.template_config.tag.includes('APP-Header')) {
|
|
@@ -152,9 +152,9 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
152
152
|
|
|
153
153
|
function updatePageConfig(formData: any, type: any, oWidget: any) {
|
|
154
154
|
oWidget && (widget = oWidget);
|
|
155
|
-
const ref=(widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData
|
|
156
|
-
viewConfig.formData = getFormData(ref);
|
|
155
|
+
const ref=(widget.data.refer_app) ? (widget.data.refer_form_data || data.page_config.formData) : data.page_config.formData;
|
|
157
156
|
(window.parent as any).glitter.share.updated_form_data[`${page_request_config.appName}_${tag}`]=ref;
|
|
157
|
+
viewConfig.formData = getFormData(ref);
|
|
158
158
|
const view = getView();
|
|
159
159
|
(window.parent as any).glitter.share.loading_dialog.dataLoading({visible: true})
|
|
160
160
|
setTimeout(() => {
|
|
@@ -859,7 +859,6 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
859
859
|
})
|
|
860
860
|
});
|
|
861
861
|
try {
|
|
862
|
-
console.log(`getPageData-${parent_array.tag}`, parent_array);
|
|
863
862
|
(window as any).glitterInitialHelper.share[`getPageData-${(window as any).appName}-${parent_array.tag}`].data.response.result[0].config = parent_array;
|
|
864
863
|
} catch (error) {
|
|
865
864
|
console.log(`error->`, error)
|
|
@@ -903,6 +902,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
903
902
|
|
|
904
903
|
}
|
|
905
904
|
}
|
|
905
|
+
|
|
906
906
|
subData.editor_updated_callback && subData.editor_updated_callback(oWidget);
|
|
907
907
|
}
|
|
908
908
|
|
|
@@ -1348,7 +1348,6 @@ font-weight: 700;" onclick="${gvc.event(() => {
|
|
|
1348
1348
|
if (!pageData.template_config || !pageData.template_config.tag || (!pageData.template_config.tag.find((dd: any) => {
|
|
1349
1349
|
return dd === "商品卡片"
|
|
1350
1350
|
}))) {
|
|
1351
|
-
console.log(`pageData.template_config.tag`, pageData.template_config.tag)
|
|
1352
1351
|
if ((gvc.glitter.getUrlParameter('device') === 'mobile') && pageData.template_config.tag.includes('標頭元件')) {
|
|
1353
1352
|
|
|
1354
1353
|
} else if ((gvc.glitter.getUrlParameter('device') !== 'mobile') && pageData.template_config.tag.includes('APP-Header')) {
|
|
@@ -199,7 +199,9 @@ export class Footer01 {
|
|
|
199
199
|
}
|
|
200
200
|
})}"
|
|
201
201
|
>
|
|
202
|
-
<a class="f-aclass" title="${chi.title}"
|
|
202
|
+
<a class="f-aclass" title="${chi.title}" onclick="${gvc.event((e, event) => {
|
|
203
|
+
event.preventDefault();
|
|
204
|
+
})}" href="${chi.link}">${chi.title}</a>
|
|
203
205
|
</li>`;
|
|
204
206
|
})
|
|
205
207
|
.join('')}
|
|
@@ -212,7 +212,9 @@ export class Footer01 {
|
|
|
212
212
|
}
|
|
213
213
|
})}"
|
|
214
214
|
>
|
|
215
|
-
<a class="f-aclass" title="${chi.title}"
|
|
215
|
+
<a class="f-aclass" title="${chi.title}" onclick="${gvc.event((e,event) => {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
})}" href="${chi.link}">${chi.title}</a>
|
|
216
218
|
</li>`;
|
|
217
219
|
})
|
|
218
220
|
.join('')}
|
|
@@ -124,7 +124,9 @@ export class Footer02 {
|
|
|
124
124
|
}
|
|
125
125
|
})}"
|
|
126
126
|
>
|
|
127
|
-
<a class="f-aclass" title="${chi.title}"
|
|
127
|
+
<a class="f-aclass" title="${chi.title}" onclick="${gvc.event((e, event) => {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
})}" href="${chi.link}">${chi.title}</a>
|
|
128
130
|
</li>`;
|
|
129
131
|
})
|
|
130
132
|
.join('')}
|
|
@@ -139,7 +139,9 @@ export class Footer02 {
|
|
|
139
139
|
}
|
|
140
140
|
})}"
|
|
141
141
|
>
|
|
142
|
-
<a class="f-aclass" title="${chi.title}"
|
|
142
|
+
<a class="f-aclass" title="${chi.title}" onclick="${gvc.event((e,event) => {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
})}" href="${chi.link}">${chi.title}</a>
|
|
143
145
|
</li>`;
|
|
144
146
|
})
|
|
145
147
|
.join('')}
|
|
@@ -173,7 +173,9 @@ export class Footer02 {
|
|
|
173
173
|
}
|
|
174
174
|
})}"
|
|
175
175
|
>
|
|
176
|
-
<a class="f-aclass" title="${chi.title}"
|
|
176
|
+
<a class="f-aclass" title="${chi.title}" onclick="${gvc.event((e, event) => {
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
})}" href="${chi.link}">${chi.title}</a>
|
|
177
179
|
</li>`;
|
|
178
180
|
})
|
|
179
181
|
.join('')}
|
|
@@ -187,7 +187,9 @@ export class Footer02 {
|
|
|
187
187
|
}
|
|
188
188
|
})}"
|
|
189
189
|
>
|
|
190
|
-
<a class="f-aclass" title="${chi.title}"
|
|
190
|
+
<a class="f-aclass" title="${chi.title}" onclick="${gvc.event((e,event) => {
|
|
191
|
+
event.preventDefault();
|
|
192
|
+
})}" href="${chi.link}">${chi.title}</a>
|
|
191
193
|
</li>`;
|
|
192
194
|
})
|
|
193
195
|
.join('')}
|
|
@@ -151,6 +151,18 @@ export class ProductCard01 {
|
|
|
151
151
|
}
|
|
152
152
|
`);
|
|
153
153
|
const labelID = glitter.getUUID();
|
|
154
|
+
function getImgSrc(index) {
|
|
155
|
+
const innerText = prod.preview_image[index] || prod.preview_image[0] || ProductCard01.noImageURL;
|
|
156
|
+
let rela_link = innerText;
|
|
157
|
+
if (innerText.includes('size1440_s*px$_')) {
|
|
158
|
+
[150, 600, 1200, 1440].reverse().map((dd) => {
|
|
159
|
+
if (document.body.clientWidth < dd) {
|
|
160
|
+
rela_link = innerText.replace('size1440_s*px$_', `size${dd}_s*px$_`);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return rela_link;
|
|
165
|
+
}
|
|
154
166
|
return html ` <div
|
|
155
167
|
class="card mb-7 card-border"
|
|
156
168
|
onclick="${gvc.event(() => {
|
|
@@ -192,18 +204,17 @@ export class ProductCard01 {
|
|
|
192
204
|
})}
|
|
193
205
|
<img
|
|
194
206
|
class="card-image-fit-center "
|
|
195
|
-
src="${(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
[150, 600, 1200, 1440].reverse().map((dd) => {
|
|
200
|
-
if (document.body.clientWidth < dd) {
|
|
201
|
-
rela_link = innerText.replace('size1440_s*px$_', `size${dd}_s*px$_`);
|
|
202
|
-
}
|
|
203
|
-
});
|
|
207
|
+
src="${getImgSrc(0)}"
|
|
208
|
+
onmouseover="${gvc.event((e, event) => {
|
|
209
|
+
if (widget.formData.show_second === 'true') {
|
|
210
|
+
e.src = getImgSrc(1);
|
|
204
211
|
}
|
|
205
|
-
|
|
206
|
-
|
|
212
|
+
})}"
|
|
213
|
+
onmouseleave="${gvc.event((e, event) => {
|
|
214
|
+
if (widget.formData.show_second === 'true') {
|
|
215
|
+
e.src = getImgSrc(0);
|
|
216
|
+
}
|
|
217
|
+
})}"
|
|
207
218
|
/>
|
|
208
219
|
<div class="child add-cart-child">
|
|
209
220
|
<div
|
|
@@ -154,7 +154,20 @@ export class ProductCard01 {
|
|
|
154
154
|
letter-spacing: -0.98px;
|
|
155
155
|
}
|
|
156
156
|
`);
|
|
157
|
+
|
|
157
158
|
const labelID = glitter.getUUID();
|
|
159
|
+
function getImgSrc(index:number){
|
|
160
|
+
const innerText = prod.preview_image[index] || prod.preview_image[0] || ProductCard01.noImageURL;
|
|
161
|
+
let rela_link = innerText;
|
|
162
|
+
if (innerText.includes('size1440_s*px$_')) {
|
|
163
|
+
[150, 600, 1200, 1440].reverse().map((dd) => {
|
|
164
|
+
if (document.body.clientWidth < dd) {
|
|
165
|
+
rela_link = innerText.replace('size1440_s*px$_', `size${dd}_s*px$_`);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return rela_link;
|
|
170
|
+
}
|
|
158
171
|
return html` <div
|
|
159
172
|
class="card mb-7 card-border"
|
|
160
173
|
onclick="${gvc.event(() => {
|
|
@@ -196,18 +209,17 @@ export class ProductCard01 {
|
|
|
196
209
|
})}
|
|
197
210
|
<img
|
|
198
211
|
class="card-image-fit-center "
|
|
199
|
-
src="${(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
src="${getImgSrc(0)}"
|
|
213
|
+
onmouseover="${gvc.event((e,event)=>{
|
|
214
|
+
if(widget.formData.show_second==='true'){
|
|
215
|
+
e.src=getImgSrc(1)
|
|
216
|
+
}
|
|
217
|
+
})}"
|
|
218
|
+
onmouseleave="${gvc.event((e,event)=>{
|
|
219
|
+
if(widget.formData.show_second==='true'){
|
|
220
|
+
e.src=getImgSrc(0)
|
|
208
221
|
}
|
|
209
|
-
|
|
210
|
-
})()}"
|
|
222
|
+
})}"
|
|
211
223
|
/>
|
|
212
224
|
<div class="child add-cart-child">
|
|
213
225
|
<div
|
|
@@ -141,6 +141,18 @@ export class ProductCard02 {
|
|
|
141
141
|
}
|
|
142
142
|
`);
|
|
143
143
|
const labelID = glitter.getUUID();
|
|
144
|
+
function getImgSrc(index) {
|
|
145
|
+
const innerText = prod.preview_image[index] || prod.preview_image[0] || ProductCard02.noImageURL;
|
|
146
|
+
let rela_link = innerText;
|
|
147
|
+
if (innerText.includes('size1440_s*px$_')) {
|
|
148
|
+
[150, 600, 1200, 1440].reverse().map((dd) => {
|
|
149
|
+
if (document.body.clientWidth < dd) {
|
|
150
|
+
rela_link = innerText.replace('size1440_s*px$_', `size${dd}_s*px$_`);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return rela_link;
|
|
155
|
+
}
|
|
144
156
|
return html `<div
|
|
145
157
|
class="card mb-7 card-border"
|
|
146
158
|
style="cursor: pointer"
|
|
@@ -183,18 +195,17 @@ export class ProductCard02 {
|
|
|
183
195
|
})}
|
|
184
196
|
<img
|
|
185
197
|
class="card-image-fit-center"
|
|
186
|
-
src="${(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
[150, 600, 1200, 1440].reverse().map((dd) => {
|
|
191
|
-
if (document.body.clientWidth < dd) {
|
|
192
|
-
rela_link = innerText.replace('size1440_s*px$_', `size${dd}_s*px$_`);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
198
|
+
src="${getImgSrc(0)}"
|
|
199
|
+
onmouseover="${gvc.event((e, event) => {
|
|
200
|
+
if (widget.formData.show_second === 'true') {
|
|
201
|
+
e.src = getImgSrc(1);
|
|
195
202
|
}
|
|
196
|
-
|
|
197
|
-
|
|
203
|
+
})}"
|
|
204
|
+
onmouseleave="${gvc.event((e, event) => {
|
|
205
|
+
if (widget.formData.show_second === 'true') {
|
|
206
|
+
e.src = getImgSrc(0);
|
|
207
|
+
}
|
|
208
|
+
})}"
|
|
198
209
|
/>
|
|
199
210
|
</div>
|
|
200
211
|
<div
|
|
@@ -144,6 +144,18 @@ export class ProductCard02 {
|
|
|
144
144
|
}
|
|
145
145
|
`);
|
|
146
146
|
const labelID = glitter.getUUID();
|
|
147
|
+
function getImgSrc(index:number){
|
|
148
|
+
const innerText = prod.preview_image[index] || prod.preview_image[0] || ProductCard02.noImageURL;
|
|
149
|
+
let rela_link = innerText;
|
|
150
|
+
if (innerText.includes('size1440_s*px$_')) {
|
|
151
|
+
[150, 600, 1200, 1440].reverse().map((dd) => {
|
|
152
|
+
if (document.body.clientWidth < dd) {
|
|
153
|
+
rela_link = innerText.replace('size1440_s*px$_', `size${dd}_s*px$_`);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return rela_link;
|
|
158
|
+
}
|
|
147
159
|
return html`<div
|
|
148
160
|
class="card mb-7 card-border"
|
|
149
161
|
style="cursor: pointer"
|
|
@@ -187,18 +199,17 @@ export class ProductCard02 {
|
|
|
187
199
|
})}
|
|
188
200
|
<img
|
|
189
201
|
class="card-image-fit-center"
|
|
190
|
-
src="${(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
202
|
+
src="${getImgSrc(0)}"
|
|
203
|
+
onmouseover="${gvc.event((e,event)=>{
|
|
204
|
+
if(widget.formData.show_second==='true'){
|
|
205
|
+
e.src=getImgSrc(1)
|
|
206
|
+
}
|
|
207
|
+
})}"
|
|
208
|
+
onmouseleave="${gvc.event((e,event)=>{
|
|
209
|
+
if(widget.formData.show_second==='true'){
|
|
210
|
+
e.src=getImgSrc(0)
|
|
199
211
|
}
|
|
200
|
-
|
|
201
|
-
})()}"
|
|
212
|
+
})}"
|
|
202
213
|
/>
|
|
203
214
|
</div>
|
|
204
215
|
<div
|