ts-glitter 13.8.65 → 13.8.71
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 +107 -7
- package/lowcode/Entry.ts +146 -43
- package/lowcode/api/pageConfig.js +10 -0
- package/lowcode/api/pageConfig.ts +11 -0
- package/lowcode/cms-plugin/POS-setting.js +11 -10
- package/lowcode/cms-plugin/POS-setting.ts +18 -17
- package/lowcode/cms-plugin/module/form-check.js +1 -0
- package/lowcode/cms-plugin/module/form-check.ts +1 -1
- package/lowcode/cms-plugin/pos-pages/payment-page.js +2 -6
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +2 -7
- package/lowcode/config.js +3 -1
- package/lowcode/config.ts +3 -1
- package/lowcode/glitterBundle/GVController.js +3 -1
- package/lowcode/glitterBundle/GVController.ts +3 -1
- package/lowcode/glitterBundle/module/PageManager.js +4 -0
- package/lowcode/glitterBundle/module/PageManager.ts +7 -0
- package/lowcode/glitterBundle/module/html-generate.js +10 -0
- package/lowcode/glitterBundle/module/html-generate.ts +13 -0
- package/lowcode/jspage/main.js +0 -18
- package/lowcode/jspage/main.ts +1 -28
- package/lowcode/official_event/page/change-page.ts +0 -1
- package/lowcode/public-components/product/pd-card-01.js +22 -18
- package/lowcode/public-components/product/pd-card-01.ts +33 -29
- package/lowcode/public-components/product/pd-card-02.js +31 -22
- package/lowcode/public-components/product/pd-card-02.ts +40 -31
- package/lowcode/public-components/product/pd-card-03.js +25 -20
- package/lowcode/public-components/product/pd-card-03.ts +36 -31
- package/lowcode/public-components/product/product-detail.js +16 -3
- package/lowcode/public-components/product/product-detail.ts +20 -7
- package/lowcode/public-components/user-manager/um-class.js +493 -0
- package/lowcode/public-components/user-manager/um-class.ts +489 -0
- package/lowcode/public-components/user-manager/um-info.js +476 -0
- package/lowcode/public-components/user-manager/um-info.ts +572 -0
- package/lowcode/public-components/user-manager/um-orderlist.js +170 -0
- package/lowcode/public-components/user-manager/um-orderlist.ts +297 -0
- package/lowcode/public-components/user-manager/um-rebate.js +225 -0
- package/lowcode/public-components/user-manager/um-rebate.ts +251 -0
- package/lowcode/public-components/user-manager/um-wishlist.js +170 -0
- package/lowcode/public-components/user-manager/um-wishlist.ts +260 -0
- package/lowcode/view-model/saas-view-model.js +378 -204
- package/lowcode/view-model/saas-view-model.ts +837 -655
- package/package.json +1 -1
- package/src/api-public/controllers/ai-chat.js +10 -5
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +10 -5
- package/src/api-public/services/ai-robot.d.ts +0 -1
- package/src/api-public/services/ai-robot.js +2 -2
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/ai-robot.ts +2 -2
- package/src/api-public/services/chat.js.map +1 -1
- package/src/api-public/services/fb-message.js.map +1 -1
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/user.js +31 -19
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +32 -21
- package/src/controllers/ai.js.map +1 -1
- package/src/controllers/app.js +24 -7
- package/src/controllers/app.js.map +1 -1
- package/src/controllers/app.ts +58 -41
- package/src/controllers/index.js +1 -0
- package/src/controllers/index.js.map +1 -1
- package/src/controllers/index.ts +1 -0
- package/src/index.js +3 -3
- package/src/index.js.map +1 -1
- package/src/index.ts +2 -0
- package/src/services/app.d.ts +1 -0
- package/src/services/app.js +21 -0
- package/src/services/app.js.map +1 -1
- package/src/services/app.ts +26 -0
|
@@ -1192,11 +1192,7 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1192
1192
|
gvc.glitter.innerDialog((gvc) => {
|
|
1193
1193
|
gvc.glitter.runJsInterFace('credit_card', {
|
|
1194
1194
|
amount: `${orderDetail.total}`,
|
|
1195
|
-
memo: orderDetail.
|
|
1196
|
-
.map((data) => {
|
|
1197
|
-
return `${data.title} * ${data.count}`;
|
|
1198
|
-
})
|
|
1199
|
-
.join(','),
|
|
1195
|
+
memo: `訂單ID:${orderDetail.id}`,
|
|
1200
1196
|
}, (res) => {
|
|
1201
1197
|
if (res.result) {
|
|
1202
1198
|
gvc.closeDialog();
|
|
@@ -1637,7 +1633,7 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1637
1633
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
1638
1634
|
yield IminPrintInstance.printAndFeedPaper(5);
|
|
1639
1635
|
yield IminPrintInstance.setQrCodeSize(2);
|
|
1640
|
-
yield IminPrintInstance.setDoubleQRSize(
|
|
1636
|
+
yield IminPrintInstance.setDoubleQRSize(4);
|
|
1641
1637
|
yield IminPrintInstance.setDoubleQR1MarginLeft(10);
|
|
1642
1638
|
yield IminPrintInstance.setDoubleQR2MarginLeft(520);
|
|
1643
1639
|
const ba = (new Blob([invoice.qrcode_0]).size - (new Blob([invoice.qrcode_1]).size)) * 1.1;
|
|
@@ -1238,18 +1238,13 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1238
1238
|
function next() {
|
|
1239
1239
|
PaymentPage.selectInvoice(gvc, orderDetail, vm, passData);
|
|
1240
1240
|
}
|
|
1241
|
-
|
|
1242
1241
|
gvc.glitter.innerDialog(
|
|
1243
1242
|
(gvc: GVC) => {
|
|
1244
1243
|
gvc.glitter.runJsInterFace(
|
|
1245
1244
|
'credit_card',
|
|
1246
1245
|
{
|
|
1247
1246
|
amount: `${orderDetail.total}`,
|
|
1248
|
-
memo: orderDetail.
|
|
1249
|
-
.map((data: any) => {
|
|
1250
|
-
return `${data.title} * ${data.count}`;
|
|
1251
|
-
})
|
|
1252
|
-
.join(','),
|
|
1247
|
+
memo: `訂單ID:${orderDetail.id}`,
|
|
1253
1248
|
},
|
|
1254
1249
|
(res: any) => {
|
|
1255
1250
|
if (res.result) {
|
|
@@ -1735,7 +1730,7 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
|
|
|
1735
1730
|
setTimeout(async ()=>{
|
|
1736
1731
|
await IminPrintInstance.printAndFeedPaper(5)
|
|
1737
1732
|
await IminPrintInstance.setQrCodeSize(2);
|
|
1738
|
-
await IminPrintInstance.setDoubleQRSize(
|
|
1733
|
+
await IminPrintInstance.setDoubleQRSize(4)
|
|
1739
1734
|
await IminPrintInstance.setDoubleQR1MarginLeft(10)
|
|
1740
1735
|
await IminPrintInstance.setDoubleQR2MarginLeft(520)
|
|
1741
1736
|
const ba=(new Blob([invoice.qrcode_0]).size - (new Blob([invoice.qrcode_1]).size))*1.1
|
package/lowcode/config.js
CHANGED
package/lowcode/config.ts
CHANGED
|
@@ -456,7 +456,9 @@ export function init(metaURL, fun) {
|
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
if (cf.pageConfig.type === GVCType.Page) {
|
|
459
|
-
|
|
459
|
+
if (cf.pageConfig.push_stack) {
|
|
460
|
+
PageManager.setHistory(cf.pageConfig.tag, cf.c_type);
|
|
461
|
+
}
|
|
460
462
|
cf.pageConfig.carry_search.map((dd) => {
|
|
461
463
|
gvc.glitter.setUrlParameter(dd.key, dd.value);
|
|
462
464
|
});
|
|
@@ -485,7 +485,9 @@ export function init(metaURL: string, fun: (gvc: GVC, glitter: Glitter, gBundle:
|
|
|
485
485
|
}
|
|
486
486
|
|
|
487
487
|
if (cf.pageConfig.type === GVCType.Page) {
|
|
488
|
-
|
|
488
|
+
if(cf.pageConfig.push_stack){
|
|
489
|
+
PageManager.setHistory(cf.pageConfig.tag, cf.c_type)
|
|
490
|
+
}
|
|
489
491
|
cf.pageConfig.carry_search.map((dd)=>{
|
|
490
492
|
gvc.glitter.setUrlParameter(dd.key,dd.value)
|
|
491
493
|
})
|
|
@@ -21,6 +21,7 @@ export var GVCType;
|
|
|
21
21
|
export class PageConfig {
|
|
22
22
|
constructor(par) {
|
|
23
23
|
this.scrollTop = 0;
|
|
24
|
+
this.push_stack = par.push_stack;
|
|
24
25
|
this.carry_search = par.carry_search || [];
|
|
25
26
|
this.initial = false;
|
|
26
27
|
this.search = par.search || '';
|
|
@@ -133,6 +134,7 @@ export class PageManager {
|
|
|
133
134
|
id: glitter.getUUID(),
|
|
134
135
|
obj: obj,
|
|
135
136
|
goBack: true,
|
|
137
|
+
push_stack: false,
|
|
136
138
|
src: url,
|
|
137
139
|
tag: tag,
|
|
138
140
|
carry_search: option.carry_search,
|
|
@@ -262,6 +264,7 @@ export class PageManager {
|
|
|
262
264
|
goBack: goBack,
|
|
263
265
|
src: url,
|
|
264
266
|
tag: tag,
|
|
267
|
+
push_stack: true,
|
|
265
268
|
deleteResource: () => {
|
|
266
269
|
},
|
|
267
270
|
createResource: () => {
|
|
@@ -320,6 +323,7 @@ export class PageManager {
|
|
|
320
323
|
goBack: true,
|
|
321
324
|
src: url,
|
|
322
325
|
tag: tag,
|
|
326
|
+
push_stack: false,
|
|
323
327
|
deleteResource: () => {
|
|
324
328
|
},
|
|
325
329
|
createResource: () => {
|
|
@@ -40,6 +40,7 @@ export class PageConfig {
|
|
|
40
40
|
public goBack: boolean;
|
|
41
41
|
public src: string;
|
|
42
42
|
public tag: string;
|
|
43
|
+
public push_stack:boolean;
|
|
43
44
|
public createResource: () => void;
|
|
44
45
|
public deleteResource: (destroy: boolean) => void;
|
|
45
46
|
public type: GVCType;
|
|
@@ -63,6 +64,7 @@ export class PageConfig {
|
|
|
63
64
|
goBack: boolean,
|
|
64
65
|
src: string,
|
|
65
66
|
tag: string,
|
|
67
|
+
push_stack:boolean,
|
|
66
68
|
createResource: () => void,
|
|
67
69
|
deleteResource: (destroy: boolean) => void,
|
|
68
70
|
type: GVCType,
|
|
@@ -73,6 +75,7 @@ export class PageConfig {
|
|
|
73
75
|
search?: string,
|
|
74
76
|
carry_search?: {key:string,value:string}[]
|
|
75
77
|
}) {
|
|
78
|
+
this.push_stack=par.push_stack;
|
|
76
79
|
this.carry_search=par.carry_search || []
|
|
77
80
|
this.initial = false
|
|
78
81
|
this.search = par.search || '';
|
|
@@ -190,8 +193,10 @@ export class PageManager {
|
|
|
190
193
|
id: glitter.getUUID(),
|
|
191
194
|
obj: obj,
|
|
192
195
|
goBack: true,
|
|
196
|
+
push_stack:false,
|
|
193
197
|
src: url,
|
|
194
198
|
tag: tag,
|
|
199
|
+
|
|
195
200
|
carry_search: option.carry_search,
|
|
196
201
|
deleteResource: () => {
|
|
197
202
|
},
|
|
@@ -345,6 +350,7 @@ export class PageManager {
|
|
|
345
350
|
goBack: goBack,
|
|
346
351
|
src: url,
|
|
347
352
|
tag: tag,
|
|
353
|
+
push_stack:true,
|
|
348
354
|
deleteResource: () => {
|
|
349
355
|
},
|
|
350
356
|
createResource: () => {
|
|
@@ -421,6 +427,7 @@ export class PageManager {
|
|
|
421
427
|
goBack: true,
|
|
422
428
|
src: url,
|
|
423
429
|
tag: tag,
|
|
430
|
+
push_stack:false,
|
|
424
431
|
deleteResource: () => {
|
|
425
432
|
},
|
|
426
433
|
createResource: () => {
|
|
@@ -2383,6 +2383,11 @@ HtmlGenerate.renameWidgetID = (dd) => {
|
|
|
2383
2383
|
HtmlGenerate.setHome = (obj) => {
|
|
2384
2384
|
var _a, _b;
|
|
2385
2385
|
const glitter = Glitter.glitter;
|
|
2386
|
+
if (obj.tag === 'backend_manager') {
|
|
2387
|
+
glitter.setUrlParameter('page', 'backend_manager');
|
|
2388
|
+
location.reload();
|
|
2389
|
+
return;
|
|
2390
|
+
}
|
|
2386
2391
|
glitter.setHome('glitterBundle/plugins/html-render.js', obj.tag, {
|
|
2387
2392
|
app_config: obj.app_config,
|
|
2388
2393
|
page_config: (_a = obj.page_config) !== null && _a !== void 0 ? _a : {},
|
|
@@ -2394,6 +2399,11 @@ HtmlGenerate.setHome = (obj) => {
|
|
|
2394
2399
|
HtmlGenerate.changePage = (obj) => {
|
|
2395
2400
|
var _a, _b;
|
|
2396
2401
|
const glitter = Glitter.glitter;
|
|
2402
|
+
if (obj.tag === 'backend_manager') {
|
|
2403
|
+
glitter.setUrlParameter('page', 'backend_manager');
|
|
2404
|
+
location.reload();
|
|
2405
|
+
return;
|
|
2406
|
+
}
|
|
2397
2407
|
console.log(`changePage-time:`, window.renderClock.stop());
|
|
2398
2408
|
glitter.changePage('glitterBundle/plugins/html-render.js', obj.tag, obj.goBack, {
|
|
2399
2409
|
app_config: obj.app_config,
|
|
@@ -573,6 +573,12 @@ export class HtmlGenerate {
|
|
|
573
573
|
|
|
574
574
|
public static setHome = (obj: { page_config?: any; app_config?: any; config: any; editMode?: any; data: any; tag: string; option?: any }) => {
|
|
575
575
|
const glitter = Glitter.glitter;
|
|
576
|
+
//複寫back_manager的頁面,避免堆棧問題
|
|
577
|
+
if(obj.tag==='backend_manager'){
|
|
578
|
+
glitter.setUrlParameter('page','backend_manager')
|
|
579
|
+
location.reload()
|
|
580
|
+
return
|
|
581
|
+
}
|
|
576
582
|
|
|
577
583
|
glitter.setHome(
|
|
578
584
|
'glitterBundle/plugins/html-render.js',
|
|
@@ -589,6 +595,13 @@ export class HtmlGenerate {
|
|
|
589
595
|
};
|
|
590
596
|
public static changePage = (obj: { page_config?: any; config: any; editMode?: any; data: any; tag: string; goBack: boolean; option?: any; app_config?: any }) => {
|
|
591
597
|
const glitter = Glitter.glitter;
|
|
598
|
+
//複寫back_manager的頁面,避免堆棧問題
|
|
599
|
+
if(obj.tag==='backend_manager'){
|
|
600
|
+
glitter.setUrlParameter('page','backend_manager')
|
|
601
|
+
location.reload()
|
|
602
|
+
return
|
|
603
|
+
}
|
|
604
|
+
|
|
592
605
|
console.log(`changePage-time:`, (window as any).renderClock.stop());
|
|
593
606
|
glitter.changePage(
|
|
594
607
|
'glitterBundle/plugins/html-render.js',
|
package/lowcode/jspage/main.js
CHANGED
|
@@ -180,15 +180,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
180
180
|
else {
|
|
181
181
|
dialog.dataLoading({ visible: true });
|
|
182
182
|
}
|
|
183
|
-
glitter.share.top_inset = yield new Promise((resolve, reject) => {
|
|
184
|
-
glitter.runJsInterFace('getTopInset', {}, (response) => {
|
|
185
|
-
resolve(response.data);
|
|
186
|
-
}, {
|
|
187
|
-
webFunction: () => {
|
|
188
|
-
return { data: 0 };
|
|
189
|
-
},
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
183
|
if (parseInt(glitter.share.top_inset, 10)) {
|
|
193
184
|
gvc.addStyle(css `
|
|
194
185
|
.scroll-in {
|
|
@@ -200,15 +191,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
200
191
|
}
|
|
201
192
|
`);
|
|
202
193
|
}
|
|
203
|
-
glitter.share.bottom_inset = yield new Promise((resolve, reject) => {
|
|
204
|
-
glitter.runJsInterFace('getBottomInset', {}, (response) => {
|
|
205
|
-
resolve(response.data);
|
|
206
|
-
}, {
|
|
207
|
-
webFunction: () => {
|
|
208
|
-
return { data: 0 };
|
|
209
|
-
},
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
194
|
const waitGetData = [
|
|
213
195
|
() => __awaiter(this, void 0, void 0, function* () {
|
|
214
196
|
return yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
package/lowcode/jspage/main.ts
CHANGED
|
@@ -203,20 +203,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
203
203
|
} else {
|
|
204
204
|
dialog.dataLoading({visible: true})
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
glitter.runJsInterFace(
|
|
208
|
-
'getTopInset',
|
|
209
|
-
{},
|
|
210
|
-
(response: any) => {
|
|
211
|
-
resolve(response.data);
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
webFunction: () => {
|
|
215
|
-
return {data: 0};
|
|
216
|
-
},
|
|
217
|
-
}
|
|
218
|
-
)
|
|
219
|
-
})
|
|
206
|
+
|
|
220
207
|
if (parseInt(glitter.share.top_inset, 10)) {
|
|
221
208
|
gvc.addStyle(css`
|
|
222
209
|
.scroll-in {
|
|
@@ -229,20 +216,6 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
229
216
|
`)
|
|
230
217
|
}
|
|
231
218
|
|
|
232
|
-
glitter.share.bottom_inset = await new Promise((resolve, reject) => {
|
|
233
|
-
glitter.runJsInterFace(
|
|
234
|
-
'getBottomInset',
|
|
235
|
-
{},
|
|
236
|
-
(response: any) => {
|
|
237
|
-
resolve(response.data);
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
webFunction: () => {
|
|
241
|
-
return {data: 0};
|
|
242
|
-
},
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
})
|
|
246
219
|
|
|
247
220
|
|
|
248
221
|
const waitGetData = [
|
|
@@ -6,7 +6,6 @@ import {GVC} from "../../glitterBundle/GVController.js";
|
|
|
6
6
|
const html = String.raw
|
|
7
7
|
class ChangePage {
|
|
8
8
|
public static changePage(link: string, type: 'home' | 'page', subData: any) {
|
|
9
|
-
|
|
10
9
|
$('.new_page_loading').removeClass('d-none')
|
|
11
10
|
const glitter=(window as any).glitter;
|
|
12
11
|
return new Promise(async (resolve, reject) => {
|
|
@@ -134,7 +134,21 @@ export class ProductCard01 {
|
|
|
134
134
|
letter-spacing: -0.98px;
|
|
135
135
|
}
|
|
136
136
|
`);
|
|
137
|
-
return html `<div
|
|
137
|
+
return html `<div
|
|
138
|
+
class="card mb-7 card-border"
|
|
139
|
+
onclick="${gvc.event(() => {
|
|
140
|
+
let path = '';
|
|
141
|
+
if (!(prod.seo && prod.seo.domain)) {
|
|
142
|
+
glitter.setUrlParameter('product_id', subData.id);
|
|
143
|
+
path = 'products';
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
glitter.setUrlParameter('product_id', undefined);
|
|
147
|
+
path = `products/${prod.seo.domain}`;
|
|
148
|
+
}
|
|
149
|
+
changePage(path, 'page', {});
|
|
150
|
+
})}"
|
|
151
|
+
>
|
|
138
152
|
<div
|
|
139
153
|
class="card-img-top parent card-image"
|
|
140
154
|
style="background-image: url('${(() => {
|
|
@@ -149,18 +163,6 @@ export class ProductCard01 {
|
|
|
149
163
|
}
|
|
150
164
|
return rela_link;
|
|
151
165
|
})()}')"
|
|
152
|
-
onclick="${gvc.event(() => {
|
|
153
|
-
let path = '';
|
|
154
|
-
if (!(prod.seo && prod.seo.domain)) {
|
|
155
|
-
glitter.setUrlParameter('product_id', subData.id);
|
|
156
|
-
path = 'products';
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
glitter.setUrlParameter('product_id', undefined);
|
|
160
|
-
path = `products/${prod.seo.domain}`;
|
|
161
|
-
}
|
|
162
|
-
changePage(path, 'page', {});
|
|
163
|
-
})}"
|
|
164
166
|
>
|
|
165
167
|
<div class="child add-cart-child">
|
|
166
168
|
<div
|
|
@@ -206,7 +208,8 @@ export class ProductCard01 {
|
|
|
206
208
|
</div>
|
|
207
209
|
<div
|
|
208
210
|
class="wishBt wish-button"
|
|
209
|
-
onclick="${gvc.event(() => {
|
|
211
|
+
onclick="${gvc.event((e, event) => {
|
|
212
|
+
event.stopPropagation();
|
|
210
213
|
if (CheckInput.isEmpty(GlobalUser.token)) {
|
|
211
214
|
changePage('login', 'page', {});
|
|
212
215
|
return;
|
|
@@ -265,8 +268,7 @@ export class ProductCard01 {
|
|
|
265
268
|
return `NT.$ ${minPrice.toLocaleString()}`;
|
|
266
269
|
})()}
|
|
267
270
|
</div>
|
|
268
|
-
|
|
269
|
-
${(() => {
|
|
271
|
+
${(() => {
|
|
270
272
|
var _a, _b;
|
|
271
273
|
const minPrice = Math.min(...prod.variants.map((dd) => {
|
|
272
274
|
return dd.sale_price;
|
|
@@ -274,9 +276,11 @@ export class ProductCard01 {
|
|
|
274
276
|
const comparePrice = (_b = ((_a = prod.variants.find((dd) => {
|
|
275
277
|
return dd.sale_price === minPrice;
|
|
276
278
|
})) !== null && _a !== void 0 ? _a : {}).compare_price) !== null && _b !== void 0 ? _b : 0;
|
|
277
|
-
|
|
279
|
+
if (comparePrice > 0 && minPrice < comparePrice) {
|
|
280
|
+
return html `<div class="text-decoration-line-through card-cost-price">NT.$ ${comparePrice.toLocaleString()}</div>`;
|
|
281
|
+
}
|
|
282
|
+
return '';
|
|
278
283
|
})()}
|
|
279
|
-
</div>
|
|
280
284
|
</div>
|
|
281
285
|
</div>
|
|
282
286
|
</div>
|
|
@@ -138,7 +138,20 @@ export class ProductCard01 {
|
|
|
138
138
|
}
|
|
139
139
|
`);
|
|
140
140
|
|
|
141
|
-
return html`<div
|
|
141
|
+
return html`<div
|
|
142
|
+
class="card mb-7 card-border"
|
|
143
|
+
onclick="${gvc.event(() => {
|
|
144
|
+
let path = '';
|
|
145
|
+
if (!(prod.seo && prod.seo.domain)) {
|
|
146
|
+
glitter.setUrlParameter('product_id', subData.id);
|
|
147
|
+
path = 'products';
|
|
148
|
+
} else {
|
|
149
|
+
glitter.setUrlParameter('product_id', undefined);
|
|
150
|
+
path = `products/${prod.seo.domain}`;
|
|
151
|
+
}
|
|
152
|
+
changePage(path, 'page', {});
|
|
153
|
+
})}"
|
|
154
|
+
>
|
|
142
155
|
<div
|
|
143
156
|
class="card-img-top parent card-image"
|
|
144
157
|
style="background-image: url('${(() => {
|
|
@@ -153,17 +166,6 @@ export class ProductCard01 {
|
|
|
153
166
|
}
|
|
154
167
|
return rela_link;
|
|
155
168
|
})()}')"
|
|
156
|
-
onclick="${gvc.event(() => {
|
|
157
|
-
let path = '';
|
|
158
|
-
if (!(prod.seo && prod.seo.domain)) {
|
|
159
|
-
glitter.setUrlParameter('product_id', subData.id);
|
|
160
|
-
path = 'products';
|
|
161
|
-
} else {
|
|
162
|
-
glitter.setUrlParameter('product_id', undefined);
|
|
163
|
-
path = `products/${prod.seo.domain}`;
|
|
164
|
-
}
|
|
165
|
-
changePage(path, 'page', {});
|
|
166
|
-
})}"
|
|
167
169
|
>
|
|
168
170
|
<div class="child add-cart-child">
|
|
169
171
|
<div
|
|
@@ -209,7 +211,8 @@ export class ProductCard01 {
|
|
|
209
211
|
</div>
|
|
210
212
|
<div
|
|
211
213
|
class="wishBt wish-button"
|
|
212
|
-
onclick="${gvc.event(() => {
|
|
214
|
+
onclick="${gvc.event((e, event) => {
|
|
215
|
+
event.stopPropagation();
|
|
213
216
|
if (CheckInput.isEmpty(GlobalUser.token)) {
|
|
214
217
|
changePage('login', 'page', {});
|
|
215
218
|
return;
|
|
@@ -269,22 +272,23 @@ export class ProductCard01 {
|
|
|
269
272
|
return `NT.$ ${minPrice.toLocaleString()}`;
|
|
270
273
|
})()}
|
|
271
274
|
</div>
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
return
|
|
286
|
-
}
|
|
287
|
-
|
|
275
|
+
${(() => {
|
|
276
|
+
const minPrice = Math.min(
|
|
277
|
+
...prod.variants.map((dd: { sale_price: number }) => {
|
|
278
|
+
return dd.sale_price;
|
|
279
|
+
})
|
|
280
|
+
);
|
|
281
|
+
const comparePrice =
|
|
282
|
+
(
|
|
283
|
+
prod.variants.find((dd: { sale_price: number }) => {
|
|
284
|
+
return dd.sale_price === minPrice;
|
|
285
|
+
}) ?? {}
|
|
286
|
+
).compare_price ?? 0;
|
|
287
|
+
if (comparePrice > 0 && minPrice < comparePrice) {
|
|
288
|
+
return html`<div class="text-decoration-line-through card-cost-price">NT.$ ${comparePrice.toLocaleString()}</div>`;
|
|
289
|
+
}
|
|
290
|
+
return '';
|
|
291
|
+
})()}
|
|
288
292
|
</div>
|
|
289
293
|
</div>
|
|
290
294
|
</div>
|
|
@@ -15,18 +15,20 @@ import { Tool } from '../../modules/tool.js';
|
|
|
15
15
|
const html = String.raw;
|
|
16
16
|
export class ProductCard02 {
|
|
17
17
|
static main(gvc, widget, subData) {
|
|
18
|
-
var _a, _b;
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
19
|
const glitter = gvc.glitter;
|
|
20
20
|
const wishId = glitter.getUUID();
|
|
21
21
|
const prod = subData.content;
|
|
22
22
|
const titleFontColor = (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
|
|
23
|
+
const borderButtonBgr = (_b = glitter.share.globalValue['theme_color.0.border-button-bg']) !== null && _b !== void 0 ? _b : '#fff';
|
|
24
|
+
const borderButtonText = (_c = glitter.share.globalValue['theme_color.0.border-button-text']) !== null && _c !== void 0 ? _c : '#333333';
|
|
23
25
|
const vm = {
|
|
24
26
|
quantity: '1',
|
|
25
27
|
data: prod,
|
|
26
28
|
specs: prod.specs.map((spec) => {
|
|
27
29
|
return spec.option[0].title;
|
|
28
30
|
}),
|
|
29
|
-
wishStatus: ((
|
|
31
|
+
wishStatus: ((_d = glitter.share.wishList) !== null && _d !== void 0 ? _d : []).some((item) => {
|
|
30
32
|
return item.id === prod.id;
|
|
31
33
|
}),
|
|
32
34
|
};
|
|
@@ -73,8 +75,10 @@ export class ProductCard02 {
|
|
|
73
75
|
display: flex;
|
|
74
76
|
align-items: center;
|
|
75
77
|
justify-content: center;
|
|
76
|
-
background: #
|
|
77
|
-
color:
|
|
78
|
+
background: #fff;
|
|
79
|
+
color: ${borderButtonText};
|
|
80
|
+
border: 1px solid ${borderButtonBgr};
|
|
81
|
+
border-radius: 10px;
|
|
78
82
|
}
|
|
79
83
|
.wish-button {
|
|
80
84
|
cursor: pointer;
|
|
@@ -131,7 +135,22 @@ export class ProductCard02 {
|
|
|
131
135
|
letter-spacing: -0.98px;
|
|
132
136
|
}
|
|
133
137
|
`);
|
|
134
|
-
return html `<div
|
|
138
|
+
return html `<div
|
|
139
|
+
class="card mb-7 card-border"
|
|
140
|
+
style="cursor: pointer"
|
|
141
|
+
onclick="${gvc.event(() => {
|
|
142
|
+
let path = '';
|
|
143
|
+
if (!(prod.seo && prod.seo.domain)) {
|
|
144
|
+
glitter.setUrlParameter('product_id', subData.id);
|
|
145
|
+
path = 'products';
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
glitter.setUrlParameter('product_id', undefined);
|
|
149
|
+
path = `products/${prod.seo.domain}`;
|
|
150
|
+
}
|
|
151
|
+
changePage(path, 'page', {});
|
|
152
|
+
})}"
|
|
153
|
+
>
|
|
135
154
|
<div
|
|
136
155
|
class="card-img-top parent card-image"
|
|
137
156
|
style="background-image: url('${(() => {
|
|
@@ -146,22 +165,11 @@ export class ProductCard02 {
|
|
|
146
165
|
}
|
|
147
166
|
return rela_link;
|
|
148
167
|
})()}')"
|
|
149
|
-
onclick="${gvc.event(() => {
|
|
150
|
-
let path = '';
|
|
151
|
-
if (!(prod.seo && prod.seo.domain)) {
|
|
152
|
-
glitter.setUrlParameter('product_id', subData.id);
|
|
153
|
-
path = 'products';
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
glitter.setUrlParameter('product_id', undefined);
|
|
157
|
-
path = `products/${prod.seo.domain}`;
|
|
158
|
-
}
|
|
159
|
-
changePage(path, 'page', {});
|
|
160
|
-
})}"
|
|
161
168
|
></div>
|
|
162
169
|
<div
|
|
163
170
|
class="wishBt wish-button"
|
|
164
|
-
onclick="${gvc.event(() => {
|
|
171
|
+
onclick="${gvc.event((e, event) => {
|
|
172
|
+
event.stopPropagation();
|
|
165
173
|
if (CheckInput.isEmpty(GlobalUser.token)) {
|
|
166
174
|
changePage('login', 'page', {});
|
|
167
175
|
return;
|
|
@@ -220,8 +228,7 @@ export class ProductCard02 {
|
|
|
220
228
|
return `NT.$ ${minPrice.toLocaleString()}`;
|
|
221
229
|
})()}
|
|
222
230
|
</div>
|
|
223
|
-
|
|
224
|
-
${(() => {
|
|
231
|
+
${(() => {
|
|
225
232
|
var _a, _b;
|
|
226
233
|
const minPrice = Math.min(...prod.variants.map((dd) => {
|
|
227
234
|
return dd.sale_price;
|
|
@@ -229,9 +236,11 @@ export class ProductCard02 {
|
|
|
229
236
|
const comparePrice = (_b = ((_a = prod.variants.find((dd) => {
|
|
230
237
|
return dd.sale_price === minPrice;
|
|
231
238
|
})) !== null && _a !== void 0 ? _a : {}).compare_price) !== null && _b !== void 0 ? _b : 0;
|
|
232
|
-
|
|
239
|
+
if (comparePrice > 0 && minPrice < comparePrice) {
|
|
240
|
+
return html `<div class="text-decoration-line-through card-cost-price">NT.$ ${comparePrice.toLocaleString()}</div>`;
|
|
241
|
+
}
|
|
242
|
+
return '';
|
|
233
243
|
})()}
|
|
234
|
-
</div>
|
|
235
244
|
</div>
|
|
236
245
|
</div>
|
|
237
246
|
<div class="add-cart-child">
|