ts-glitter 21.4.6 → 21.4.8
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 +2 -1
- package/lowcode/Entry.ts +2 -2
- package/lowcode/api/pageConfig.js +2 -0
- package/lowcode/api/pageConfig.ts +4 -2
- package/lowcode/cms-plugin/menus-setting.js +4 -9
- package/lowcode/cms-plugin/menus-setting.ts +4 -9
- package/lowcode/editor/normal-page-editor.js +2 -2
- package/lowcode/editor/normal-page-editor.ts +2 -2
- package/lowcode/glitter-base/route/api-cart.ts +1 -0
- package/lowcode/glitterBundle/html-component/global-widget.js +78 -2
- package/lowcode/glitterBundle/html-component/global-widget.ts +86 -16
- package/lowcode/jspage/main.js +10 -2
- package/lowcode/jspage/main.ts +14 -2
- package/lowcode/official_view_component/official/component.js +4 -0
- package/lowcode/official_view_component/official/component.ts +4 -1
- package/lowcode/public-components/blogs/blogs-01.js +139 -145
- package/lowcode/public-components/blogs/blogs-01.ts +9 -15
- package/lowcode/public-components/headers/header-class.js +3 -1
- package/lowcode/public-components/headers/header-class.ts +4 -1
- package/lowcode/public-components/headers/sy-02.js +13 -3
- package/lowcode/public-components/headers/sy-02.ts +14 -3
- package/lowcode/public-components/headers/sy-03.js +13 -3
- package/lowcode/public-components/headers/sy-03.ts +13 -3
- package/lowcode/public-components/headers/sy-04.js +13 -3
- package/lowcode/public-components/headers/sy-04.ts +13 -3
- package/lowcode/public-components/headers/sy-05.js +10 -3
- package/lowcode/public-components/headers/sy-05.ts +10 -3
- package/lowcode/public-components/product/pd-card-01.js +11 -1
- package/lowcode/public-components/product/pd-card-01.ts +10 -1
- package/lowcode/public-components/product/pd-card-02.js +13 -1
- package/lowcode/public-components/product/pd-card-02.ts +12 -1
- package/lowcode/public-components/product/pd-card-03.js +13 -1
- package/lowcode/public-components/product/pd-card-03.ts +12 -1
- package/lowcode/public-components/product/pd-class.js +32 -24
- package/lowcode/public-components/product/pd-class.ts +15 -5
- package/package.json +1 -1
- package/src/services/template.js +9 -11
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +5 -3
|
@@ -9,6 +9,7 @@ import { LanguageView } from '../public/language-view.js';
|
|
|
9
9
|
import { HeaderClass } from './header-class.js';
|
|
10
10
|
import { HeadInitial } from './head-initial.js';
|
|
11
11
|
import { HeaderMobile } from './header-mobile.js';
|
|
12
|
+
import { PdClass } from '../product/pd-class.js';
|
|
12
13
|
|
|
13
14
|
const html = String.raw;
|
|
14
15
|
|
|
@@ -40,7 +41,7 @@ export class Sy03 {
|
|
|
40
41
|
>
|
|
41
42
|
<!--手機版選單-->
|
|
42
43
|
<div
|
|
43
|
-
class="
|
|
44
|
+
class=" align-items-center justify-content-center ${PdClass.isShoppingPage() ? `d-none`:`d-flex d-lg-none`} "
|
|
44
45
|
style="width:45px !important;height:40px !important;"
|
|
45
46
|
onclick="${gvc.event(() => {
|
|
46
47
|
gvc.glitter.setDrawer(
|
|
@@ -103,7 +104,7 @@ export class Sy03 {
|
|
|
103
104
|
const vm = {
|
|
104
105
|
data: [],
|
|
105
106
|
};
|
|
106
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', (window as any).appName).then(
|
|
107
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(
|
|
107
108
|
res => {
|
|
108
109
|
vm.data = res.response.value[Language.getLanguage()];
|
|
109
110
|
gvc.notifyDataChange(id);
|
|
@@ -124,6 +125,9 @@ export class Sy03 {
|
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
function loopItems(data: any, show_border: boolean) {
|
|
128
|
+
if(PdClass.isShoppingPage()){
|
|
129
|
+
return ``
|
|
130
|
+
}
|
|
127
131
|
return data
|
|
128
132
|
.map((dd: any) => {
|
|
129
133
|
return html`
|
|
@@ -240,7 +244,7 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
|
240
244
|
const vm = {
|
|
241
245
|
data: [],
|
|
242
246
|
};
|
|
243
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', (window as any).appName).then(res => {
|
|
247
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(res => {
|
|
244
248
|
vm.data = res.response.value[Language.getLanguage()];
|
|
245
249
|
gvc.notifyDataChange(id);
|
|
246
250
|
});
|
|
@@ -248,6 +252,9 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
|
248
252
|
bind: id,
|
|
249
253
|
view: () => {
|
|
250
254
|
function loopItems(data: any) {
|
|
255
|
+
if(PdClass.isShoppingPage()){
|
|
256
|
+
return ``
|
|
257
|
+
}
|
|
251
258
|
return data
|
|
252
259
|
.map((dd: any) => {
|
|
253
260
|
return html` <li class="nav-item dropdown">
|
|
@@ -342,6 +349,9 @@ padding-bottom: 2px;
|
|
|
342
349
|
return {
|
|
343
350
|
bind: vm.id,
|
|
344
351
|
view: () => {
|
|
352
|
+
if(PdClass.isShoppingPage()){
|
|
353
|
+
return ``
|
|
354
|
+
}
|
|
345
355
|
if (!vm.toggle) {
|
|
346
356
|
return html`<i
|
|
347
357
|
class="fa-regular fa-magnifying-glass"
|
|
@@ -8,6 +8,7 @@ import { LanguageView } from '../public/language-view.js';
|
|
|
8
8
|
import { HeaderClass } from './header-class.js';
|
|
9
9
|
import { HeadInitial } from './head-initial.js';
|
|
10
10
|
import { HeaderMobile } from './header-mobile.js';
|
|
11
|
+
import { PdClass } from '../product/pd-class.js';
|
|
11
12
|
const html = String.raw;
|
|
12
13
|
export class Sy04 {
|
|
13
14
|
static main(gvc, widget, subData) {
|
|
@@ -30,7 +31,7 @@ export class Sy04 {
|
|
|
30
31
|
<div class="d-flex align-items-center justify-content-center h-100 gap-2">
|
|
31
32
|
<!--手機版選單-->
|
|
32
33
|
<div
|
|
33
|
-
class="d-flex d-lg-none align-items-center justify-content-center"
|
|
34
|
+
class="${PdClass.isShoppingPage() ? `d-none` : `d-flex d-lg-none`} align-items-center justify-content-center"
|
|
34
35
|
style="width:40px !important;height:40px !important;"
|
|
35
36
|
onclick="${gvc.event(() => {
|
|
36
37
|
gvc.glitter.setDrawer(gvc.bindView(() => {
|
|
@@ -105,7 +106,7 @@ export class Sy04 {
|
|
|
105
106
|
const vm = {
|
|
106
107
|
data: [],
|
|
107
108
|
};
|
|
108
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', window.appName).then(res => {
|
|
109
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', window.appName).then(res => {
|
|
109
110
|
vm.data = res.response.value[Language.getLanguage()];
|
|
110
111
|
gvc.notifyDataChange(id);
|
|
111
112
|
});
|
|
@@ -123,6 +124,9 @@ export class Sy04 {
|
|
|
123
124
|
loop(vm.data);
|
|
124
125
|
}
|
|
125
126
|
function loopItems(data, show_border) {
|
|
127
|
+
if (PdClass.isShoppingPage()) {
|
|
128
|
+
return ``;
|
|
129
|
+
}
|
|
126
130
|
return data
|
|
127
131
|
.map((dd) => {
|
|
128
132
|
var _a, _b, _c, _d, _e;
|
|
@@ -251,7 +255,7 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
|
|
|
251
255
|
const vm = {
|
|
252
256
|
data: [],
|
|
253
257
|
};
|
|
254
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', window.appName).then(res => {
|
|
258
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', window.appName).then(res => {
|
|
255
259
|
vm.data = res.response.value[Language.getLanguage()];
|
|
256
260
|
gvc.notifyDataChange(id);
|
|
257
261
|
});
|
|
@@ -259,6 +263,9 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
|
|
|
259
263
|
bind: id,
|
|
260
264
|
view: () => {
|
|
261
265
|
function loopItems(data) {
|
|
266
|
+
if (PdClass.isShoppingPage()) {
|
|
267
|
+
return ``;
|
|
268
|
+
}
|
|
262
269
|
return data
|
|
263
270
|
.map((dd) => {
|
|
264
271
|
var _a, _b;
|
|
@@ -347,6 +354,9 @@ padding-bottom: 2px;
|
|
|
347
354
|
bind: vm.id,
|
|
348
355
|
view: () => {
|
|
349
356
|
var _a, _b;
|
|
357
|
+
if (PdClass.isShoppingPage()) {
|
|
358
|
+
return ``;
|
|
359
|
+
}
|
|
350
360
|
if (!vm.toggle) {
|
|
351
361
|
return html `<i
|
|
352
362
|
class="fa-regular fa-magnifying-glass"
|
|
@@ -9,6 +9,7 @@ import { LanguageView } from '../public/language-view.js';
|
|
|
9
9
|
import { HeaderClass } from './header-class.js';
|
|
10
10
|
import { HeadInitial } from './head-initial.js';
|
|
11
11
|
import { HeaderMobile } from './header-mobile.js';
|
|
12
|
+
import { PdClass } from '../product/pd-class.js';
|
|
12
13
|
|
|
13
14
|
const html = String.raw;
|
|
14
15
|
|
|
@@ -33,7 +34,7 @@ export class Sy04 {
|
|
|
33
34
|
<div class="d-flex align-items-center justify-content-center h-100 gap-2">
|
|
34
35
|
<!--手機版選單-->
|
|
35
36
|
<div
|
|
36
|
-
class="d-flex d-lg-none align-items-center justify-content-center"
|
|
37
|
+
class="${PdClass.isShoppingPage() ? `d-none`:`d-flex d-lg-none`} align-items-center justify-content-center"
|
|
37
38
|
style="width:40px !important;height:40px !important;"
|
|
38
39
|
onclick="${gvc.event(() => {
|
|
39
40
|
gvc.glitter.setDrawer(
|
|
@@ -107,7 +108,7 @@ export class Sy04 {
|
|
|
107
108
|
const vm = {
|
|
108
109
|
data: [],
|
|
109
110
|
};
|
|
110
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', (window as any).appName).then(
|
|
111
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(
|
|
111
112
|
res => {
|
|
112
113
|
vm.data = res.response.value[Language.getLanguage()];
|
|
113
114
|
|
|
@@ -129,6 +130,9 @@ export class Sy04 {
|
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
function loopItems(data: any, show_border: boolean) {
|
|
133
|
+
if(PdClass.isShoppingPage()){
|
|
134
|
+
return ``
|
|
135
|
+
}
|
|
132
136
|
return data
|
|
133
137
|
.map((dd: any) => {
|
|
134
138
|
return html`
|
|
@@ -258,7 +262,7 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
|
258
262
|
const vm = {
|
|
259
263
|
data: [],
|
|
260
264
|
};
|
|
261
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', (window as any).appName).then(res => {
|
|
265
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then(res => {
|
|
262
266
|
vm.data = res.response.value[Language.getLanguage()];
|
|
263
267
|
gvc.notifyDataChange(id);
|
|
264
268
|
});
|
|
@@ -266,6 +270,9 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
|
|
|
266
270
|
bind: id,
|
|
267
271
|
view: () => {
|
|
268
272
|
function loopItems(data: any) {
|
|
273
|
+
if(PdClass.isShoppingPage()){
|
|
274
|
+
return ``
|
|
275
|
+
}
|
|
269
276
|
return data
|
|
270
277
|
.map((dd: any) => {
|
|
271
278
|
return html` <li class="nav-item dropdown">
|
|
@@ -353,6 +360,9 @@ padding-bottom: 2px;
|
|
|
353
360
|
return {
|
|
354
361
|
bind: vm.id,
|
|
355
362
|
view: () => {
|
|
363
|
+
if(PdClass.isShoppingPage()){
|
|
364
|
+
return ``
|
|
365
|
+
}
|
|
356
366
|
if (!vm.toggle) {
|
|
357
367
|
return html`<i
|
|
358
368
|
class="fa-regular fa-magnifying-glass"
|
|
@@ -4,6 +4,7 @@ import { LanguageView } from "../public/language-view.js";
|
|
|
4
4
|
import { Color } from "../public/color.js";
|
|
5
5
|
import { HeadInitial } from './head-initial.js';
|
|
6
6
|
import { HeaderMobile } from './header-mobile.js';
|
|
7
|
+
import { PdClass } from '../product/pd-class.js';
|
|
7
8
|
const html = String.raw;
|
|
8
9
|
export class Sy05 {
|
|
9
10
|
static main(gvc, widget, subData) {
|
|
@@ -27,7 +28,7 @@ export class Sy05 {
|
|
|
27
28
|
<div class="d-flex align-items-center justify-content-center h-100 w-100 gap-2">
|
|
28
29
|
<!--手機版選單-->
|
|
29
30
|
<div
|
|
30
|
-
class="d-flex align-items-center justify-content-center"
|
|
31
|
+
class="${PdClass.isShoppingPage() ? `d-none` : `d-flex d-lg-none`} align-items-center justify-content-center"
|
|
31
32
|
style="width:40px !important;height:40px !important;"
|
|
32
33
|
onclick="${gvc.event(() => {
|
|
33
34
|
gvc.glitter.setDrawer(gvc.bindView(() => {
|
|
@@ -78,7 +79,7 @@ export class Sy05 {
|
|
|
78
79
|
const vm = {
|
|
79
80
|
data: [],
|
|
80
81
|
};
|
|
81
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', window.appName).then((res) => {
|
|
82
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', window.appName).then((res) => {
|
|
82
83
|
vm.data = res.response.value[Language.getLanguage()];
|
|
83
84
|
gvc.notifyDataChange(id);
|
|
84
85
|
});
|
|
@@ -96,6 +97,9 @@ export class Sy05 {
|
|
|
96
97
|
loop(vm.data);
|
|
97
98
|
}
|
|
98
99
|
function loopItems(data, show_border) {
|
|
100
|
+
if (PdClass.isShoppingPage()) {
|
|
101
|
+
return ``;
|
|
102
|
+
}
|
|
99
103
|
return data
|
|
100
104
|
.map((dd) => {
|
|
101
105
|
var _a, _b, _c, _d, _e;
|
|
@@ -198,7 +202,7 @@ background: ${(_a = widget.formData.theme_color['background']) !== null && _a !=
|
|
|
198
202
|
const vm = {
|
|
199
203
|
data: [],
|
|
200
204
|
};
|
|
201
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', window.appName).then((res) => {
|
|
205
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', window.appName).then((res) => {
|
|
202
206
|
vm.data = res.response.value[Language.getLanguage()];
|
|
203
207
|
gvc.notifyDataChange(id);
|
|
204
208
|
});
|
|
@@ -206,6 +210,9 @@ background: ${(_a = widget.formData.theme_color['background']) !== null && _a !=
|
|
|
206
210
|
bind: id,
|
|
207
211
|
view: () => {
|
|
208
212
|
function loopItems(data) {
|
|
213
|
+
if (PdClass.isShoppingPage()) {
|
|
214
|
+
return ``;
|
|
215
|
+
}
|
|
209
216
|
return data
|
|
210
217
|
.map((dd) => {
|
|
211
218
|
var _a, _b;
|
|
@@ -9,6 +9,7 @@ import { HeaderClass } from './header-class.js';
|
|
|
9
9
|
import { getCheckoutCount } from '../../official_event/e-commerce/get-count.js';
|
|
10
10
|
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
11
11
|
import { HeaderMobile } from './header-mobile.js';
|
|
12
|
+
import { PdClass } from '../product/pd-class.js';
|
|
12
13
|
|
|
13
14
|
const html = String.raw;
|
|
14
15
|
|
|
@@ -34,7 +35,7 @@ export class Sy05 {
|
|
|
34
35
|
<div class="d-flex align-items-center justify-content-center h-100 w-100 gap-2">
|
|
35
36
|
<!--手機版選單-->
|
|
36
37
|
<div
|
|
37
|
-
class="d-flex align-items-center justify-content-center"
|
|
38
|
+
class="${PdClass.isShoppingPage() ? `d-none`:`d-flex d-lg-none`} align-items-center justify-content-center"
|
|
38
39
|
style="width:40px !important;height:40px !important;"
|
|
39
40
|
onclick="${gvc.event(() => {
|
|
40
41
|
gvc.glitter.setDrawer(
|
|
@@ -85,7 +86,7 @@ export class Sy05 {
|
|
|
85
86
|
const vm = {
|
|
86
87
|
data: [],
|
|
87
88
|
};
|
|
88
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', (window as any).appName).then((res) => {
|
|
89
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then((res) => {
|
|
89
90
|
vm.data = res.response.value[Language.getLanguage()];
|
|
90
91
|
gvc.notifyDataChange(id);
|
|
91
92
|
});
|
|
@@ -104,6 +105,9 @@ export class Sy05 {
|
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
function loopItems(data: any, show_border: boolean) {
|
|
108
|
+
if(PdClass.isShoppingPage()){
|
|
109
|
+
return ``
|
|
110
|
+
}
|
|
107
111
|
return data
|
|
108
112
|
.map((dd: any) => {
|
|
109
113
|
return html`
|
|
@@ -208,7 +212,7 @@ background: ${widget.formData.theme_color['background'] ?? '#000'};overflow-x: h
|
|
|
208
212
|
const vm = {
|
|
209
213
|
data: [],
|
|
210
214
|
};
|
|
211
|
-
ApiUser.getPublicConfig('menu-setting', 'manager', (window as any).appName).then((res) => {
|
|
215
|
+
ApiUser.getPublicConfig(widget.formData.menu_refer || 'menu-setting', 'manager', (window as any).appName).then((res) => {
|
|
212
216
|
vm.data = res.response.value[Language.getLanguage()];
|
|
213
217
|
gvc.notifyDataChange(id);
|
|
214
218
|
});
|
|
@@ -216,6 +220,9 @@ background: ${widget.formData.theme_color['background'] ?? '#000'};overflow-x: h
|
|
|
216
220
|
bind: id,
|
|
217
221
|
view: () => {
|
|
218
222
|
function loopItems(data: any) {
|
|
223
|
+
if(PdClass.isShoppingPage()){
|
|
224
|
+
return ``
|
|
225
|
+
}
|
|
219
226
|
return data
|
|
220
227
|
.map((dd: any) => {
|
|
221
228
|
return html` <li class="nav-item dropdown">
|
|
@@ -154,7 +154,17 @@ export class ProductCard01 {
|
|
|
154
154
|
return html ` <div
|
|
155
155
|
class="card mb-7 card-border"
|
|
156
156
|
onclick="${gvc.event(() => {
|
|
157
|
-
PdClass.
|
|
157
|
+
if (PdClass.isShoppingPage()) {
|
|
158
|
+
PdClass.addCartAction({
|
|
159
|
+
gvc: gvc,
|
|
160
|
+
titleFontColor: titleFontColor,
|
|
161
|
+
prod: prod,
|
|
162
|
+
vm: vm,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
PdClass.changePage(prod, gvc);
|
|
167
|
+
}
|
|
158
168
|
})}"
|
|
159
169
|
>
|
|
160
170
|
<div
|
|
@@ -172,7 +172,16 @@ export class ProductCard01 {
|
|
|
172
172
|
return html` <div
|
|
173
173
|
class="card mb-7 card-border"
|
|
174
174
|
onclick="${gvc.event(() => {
|
|
175
|
-
PdClass.
|
|
175
|
+
if(PdClass.isShoppingPage()){
|
|
176
|
+
PdClass.addCartAction({
|
|
177
|
+
gvc: gvc,
|
|
178
|
+
titleFontColor: titleFontColor,
|
|
179
|
+
prod: prod,
|
|
180
|
+
vm: vm,
|
|
181
|
+
})
|
|
182
|
+
}else{
|
|
183
|
+
PdClass.changePage(prod, gvc)
|
|
184
|
+
}
|
|
176
185
|
})}"
|
|
177
186
|
>
|
|
178
187
|
<div
|
|
@@ -142,7 +142,19 @@ export class ProductCard02 {
|
|
|
142
142
|
return html `<div
|
|
143
143
|
class="card mb-7 card-border"
|
|
144
144
|
style="cursor: pointer"
|
|
145
|
-
onclick="${gvc.event(() =>
|
|
145
|
+
onclick="${gvc.event(() => {
|
|
146
|
+
if (PdClass.isShoppingPage()) {
|
|
147
|
+
PdClass.addCartAction({
|
|
148
|
+
gvc: gvc,
|
|
149
|
+
titleFontColor: titleFontColor,
|
|
150
|
+
prod: prod,
|
|
151
|
+
vm: vm,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
PdClass.changePage(prod, gvc);
|
|
156
|
+
}
|
|
157
|
+
})}"
|
|
146
158
|
>
|
|
147
159
|
<div
|
|
148
160
|
class="card-img-top parent card-image position-relative"
|
|
@@ -161,7 +161,18 @@ export class ProductCard02 {
|
|
|
161
161
|
return html`<div
|
|
162
162
|
class="card mb-7 card-border"
|
|
163
163
|
style="cursor: pointer"
|
|
164
|
-
onclick="${gvc.event(() =>
|
|
164
|
+
onclick="${gvc.event(() => {
|
|
165
|
+
if(PdClass.isShoppingPage()){
|
|
166
|
+
PdClass.addCartAction({
|
|
167
|
+
gvc: gvc,
|
|
168
|
+
titleFontColor: titleFontColor,
|
|
169
|
+
prod: prod,
|
|
170
|
+
vm: vm,
|
|
171
|
+
})
|
|
172
|
+
}else{
|
|
173
|
+
PdClass.changePage(prod, gvc)
|
|
174
|
+
}
|
|
175
|
+
})}"
|
|
165
176
|
>
|
|
166
177
|
<div
|
|
167
178
|
class="card-img-top parent card-image position-relative"
|
|
@@ -148,7 +148,19 @@ export class ProductCard03 {
|
|
|
148
148
|
return html ` <div
|
|
149
149
|
class="card mb-7 card-border"
|
|
150
150
|
style="cursor: pointer"
|
|
151
|
-
onclick="${gvc.event(() =>
|
|
151
|
+
onclick="${gvc.event(() => {
|
|
152
|
+
if (PdClass.isShoppingPage()) {
|
|
153
|
+
PdClass.addCartAction({
|
|
154
|
+
gvc: gvc,
|
|
155
|
+
titleFontColor: titleFontColor,
|
|
156
|
+
prod: prod,
|
|
157
|
+
vm: vm,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
PdClass.changePage(prod, gvc);
|
|
162
|
+
}
|
|
163
|
+
})}"
|
|
152
164
|
>
|
|
153
165
|
<div
|
|
154
166
|
class="card-img-top parent card-image position-relative"
|
|
@@ -166,7 +166,18 @@ export class ProductCard03 {
|
|
|
166
166
|
return html` <div
|
|
167
167
|
class="card mb-7 card-border"
|
|
168
168
|
style="cursor: pointer"
|
|
169
|
-
onclick="${gvc.event(() =>
|
|
169
|
+
onclick="${gvc.event(() => {
|
|
170
|
+
if(PdClass.isShoppingPage()){
|
|
171
|
+
PdClass.addCartAction({
|
|
172
|
+
gvc: gvc,
|
|
173
|
+
titleFontColor: titleFontColor,
|
|
174
|
+
prod: prod,
|
|
175
|
+
vm: vm,
|
|
176
|
+
})
|
|
177
|
+
}else{
|
|
178
|
+
PdClass.changePage(prod, gvc)
|
|
179
|
+
}
|
|
180
|
+
})}"
|
|
170
181
|
>
|
|
171
182
|
<div
|
|
172
183
|
class="card-img-top parent card-image position-relative"
|
|
@@ -410,6 +410,12 @@ export class PdClass {
|
|
|
410
410
|
};
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
+
static isShoppingPage() {
|
|
414
|
+
const glitter = window.glitter;
|
|
415
|
+
return ['hidden/', 'shop/'].find((dd) => {
|
|
416
|
+
return (glitter.getUrlParameter('page') || '').startsWith(dd) || ((glitter.getUrlParameter('page_refer') || '').startsWith(dd));
|
|
417
|
+
}) || glitter.share.is_shop;
|
|
418
|
+
}
|
|
413
419
|
static changePage(prod, gvc) {
|
|
414
420
|
const glitter = gvc.glitter;
|
|
415
421
|
let path = '';
|
|
@@ -961,8 +967,8 @@ export class PdClass {
|
|
|
961
967
|
}));
|
|
962
968
|
}
|
|
963
969
|
viewMap.push(html `<button
|
|
964
|
-
class="add-cart-btn fw-bold fs-sm"
|
|
965
|
-
style="
|
|
970
|
+
class="${PdClass.isShoppingPage() ? `add-cart-imd-btn` : `add-cart-btn`} fw-bold fs-sm"
|
|
971
|
+
style="flex: 1;height:44px;"
|
|
966
972
|
onclick="${gvc.event(() => {
|
|
967
973
|
if (document.body.clientWidth < 800) {
|
|
968
974
|
this.addProductPopUp(obj, 'addCart', () => refreshAll());
|
|
@@ -998,35 +1004,37 @@ export class PdClass {
|
|
|
998
1004
|
>
|
|
999
1005
|
${isOutOfStock ? Language.text('preorder_item') : Language.text('add_to_cart')}
|
|
1000
1006
|
</button>`);
|
|
1001
|
-
|
|
1007
|
+
if (!PdClass.isShoppingPage()) {
|
|
1008
|
+
viewMap.push(html `<button
|
|
1002
1009
|
class="add-cart-imd-btn fw-bold fs-sm"
|
|
1003
1010
|
style="cursor: pointer; flex: 1;height:44px;"
|
|
1004
1011
|
onclick="${gvc.event(() => {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1012
|
+
if (document.body.clientWidth < 800) {
|
|
1013
|
+
this.addProductPopUp(obj, 'buyNow', () => {
|
|
1014
|
+
refreshAll();
|
|
1015
|
+
});
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
const buy_it = new ApiCart(ApiCart.buyItNow);
|
|
1019
|
+
buy_it.clearCart();
|
|
1020
|
+
buy_it.addToCart(`${prod.id}`, vm.specs, vm.quantity);
|
|
1021
|
+
ApiCart.toCheckOutPage(ApiCart.buyItNow);
|
|
1022
|
+
gvc.closeDialog();
|
|
1023
|
+
ApiTrack.track({
|
|
1024
|
+
event_name: 'AddToCart',
|
|
1025
|
+
custom_data: {
|
|
1026
|
+
currency: 'TWD',
|
|
1027
|
+
value: variant.sale_price,
|
|
1028
|
+
content_ids: [variant.sku || `${prod.id}-${vm.specs.join('-')}`],
|
|
1029
|
+
content_name: prod.title,
|
|
1030
|
+
content_type: 'product',
|
|
1031
|
+
},
|
|
1008
1032
|
});
|
|
1009
|
-
|
|
1010
|
-
}
|
|
1011
|
-
const buy_it = new ApiCart(ApiCart.buyItNow);
|
|
1012
|
-
buy_it.clearCart();
|
|
1013
|
-
buy_it.addToCart(`${prod.id}`, vm.specs, vm.quantity);
|
|
1014
|
-
ApiCart.toCheckOutPage(ApiCart.buyItNow);
|
|
1015
|
-
gvc.closeDialog();
|
|
1016
|
-
ApiTrack.track({
|
|
1017
|
-
event_name: 'AddToCart',
|
|
1018
|
-
custom_data: {
|
|
1019
|
-
currency: 'TWD',
|
|
1020
|
-
value: variant.sale_price,
|
|
1021
|
-
content_ids: [variant.sku || `${prod.id}-${vm.specs.join('-')}`],
|
|
1022
|
-
content_name: prod.title,
|
|
1023
|
-
content_type: 'product',
|
|
1024
|
-
},
|
|
1025
|
-
});
|
|
1026
|
-
})}"
|
|
1033
|
+
})}"
|
|
1027
1034
|
>
|
|
1028
1035
|
${Language.text('buy_it_now')}
|
|
1029
1036
|
</button>`);
|
|
1037
|
+
}
|
|
1030
1038
|
return viewMap.join('');
|
|
1031
1039
|
},
|
|
1032
1040
|
divCreate: {
|
|
@@ -575,6 +575,13 @@ export class PdClass {
|
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
+
static isShoppingPage(){
|
|
579
|
+
const glitter = (window as any).glitter;
|
|
580
|
+
return ['hidden/','shop/'].find((dd)=>{
|
|
581
|
+
return (glitter.getUrlParameter('page') || '').startsWith(dd) || ((glitter.getUrlParameter('page_refer') || '').startsWith(dd))
|
|
582
|
+
}) || glitter.share.is_shop;
|
|
583
|
+
}
|
|
584
|
+
// document.querySelector('.check_out_cart_data').scrollIntoView()
|
|
578
585
|
static changePage(prod: any, gvc: GVC) {
|
|
579
586
|
const glitter = gvc.glitter;
|
|
580
587
|
let path = '';
|
|
@@ -1178,8 +1185,8 @@ export class PdClass {
|
|
|
1178
1185
|
}
|
|
1179
1186
|
viewMap.push(
|
|
1180
1187
|
html`<button
|
|
1181
|
-
class="add-cart-btn fw-bold fs-sm"
|
|
1182
|
-
style="
|
|
1188
|
+
class="${PdClass.isShoppingPage() ? `add-cart-imd-btn`:`add-cart-btn`} fw-bold fs-sm"
|
|
1189
|
+
style="flex: 1;height:44px;"
|
|
1183
1190
|
onclick="${gvc.event(() => {
|
|
1184
1191
|
if (document.body.clientWidth < 800) {
|
|
1185
1192
|
this.addProductPopUp(obj, 'addCart', () => refreshAll());
|
|
@@ -1215,8 +1222,9 @@ export class PdClass {
|
|
|
1215
1222
|
${isOutOfStock ? Language.text('preorder_item') : Language.text('add_to_cart')}
|
|
1216
1223
|
</button>`
|
|
1217
1224
|
);
|
|
1218
|
-
|
|
1219
|
-
|
|
1225
|
+
if(!PdClass.isShoppingPage()){
|
|
1226
|
+
viewMap.push(
|
|
1227
|
+
html`<button
|
|
1220
1228
|
class="add-cart-imd-btn fw-bold fs-sm"
|
|
1221
1229
|
style="cursor: pointer; flex: 1;height:44px;"
|
|
1222
1230
|
onclick="${gvc.event(() => {
|
|
@@ -1245,7 +1253,9 @@ export class PdClass {
|
|
|
1245
1253
|
>
|
|
1246
1254
|
${Language.text('buy_it_now')}
|
|
1247
1255
|
</button>`
|
|
1248
|
-
|
|
1256
|
+
);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1249
1259
|
return viewMap.join('');
|
|
1250
1260
|
},
|
|
1251
1261
|
divCreate: {
|
package/package.json
CHANGED
package/src/services/template.js
CHANGED
|
@@ -360,17 +360,15 @@ class Template {
|
|
|
360
360
|
resolve(page_data);
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
b.config = c_config;
|
|
373
|
-
}
|
|
363
|
+
for (const b of response_) {
|
|
364
|
+
if (b.tag === 'c_header') {
|
|
365
|
+
console.log(`c_header->==>`, config.req.query.page_refer);
|
|
366
|
+
const c_config = (await new user_js_1.User(b.appName).getConfigV2({
|
|
367
|
+
key: 'c_header_' + config.req.query.page_refer,
|
|
368
|
+
user_id: 'manager'
|
|
369
|
+
}));
|
|
370
|
+
if (c_config && c_config[0]) {
|
|
371
|
+
b.config = c_config;
|
|
374
372
|
}
|
|
375
373
|
}
|
|
376
374
|
}
|