ts-glitter 21.5.2 → 21.5.4
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/cms-plugin/account-info.js +79 -67
- package/lowcode/cms-plugin/account-info.ts +327 -311
- package/lowcode/cms-plugin/information/information-module.ts +3 -1
- package/lowcode/cms-plugin/list-header-option.js +1 -0
- package/lowcode/cms-plugin/list-header-option.ts +1 -0
- package/lowcode/cms-plugin/shopping-information.js +468 -0
- package/lowcode/cms-plugin/shopping-information.ts +557 -0
- package/lowcode/cms-plugin/shopping-market-shopee.js +283 -231
- package/lowcode/cms-plugin/shopping-market-shopee.ts +401 -361
- package/lowcode/cms-plugin/shopping-order-manager.js +16 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +18 -3
- package/lowcode/glitter-base/global/language.js +4 -1
- package/lowcode/glitter-base/global/language.ts +4 -2
- package/lowcode/glitter-base/route/shopee.js +48 -11
- package/lowcode/glitter-base/route/shopee.ts +119 -80
- package/lowcode/glitterBundle/plugins/html-render.js +121 -90
- package/lowcode/glitterBundle/plugins/html-render.ts +367 -318
- package/lowcode/modules/image-library.js +2 -3
- package/lowcode/modules/image-library.ts +21 -7
- package/lowcode/public-components/checkout/index.js +90 -41
- package/lowcode/public-components/checkout/index.ts +101 -49
- package/lowcode/public-components/footer/footer-initial.js +11 -2
- package/lowcode/public-components/footer/footer-initial.ts +29 -18
- package/lowcode/public-components/headers/header-class.js +47 -35
- package/lowcode/public-components/headers/header-class.ts +54 -38
- package/lowcode/public-components/headers/sy-02.js +1 -1
- package/lowcode/public-components/headers/sy-02.ts +1 -1
- package/lowcode/public-components/headers/sy-03.js +1 -1
- package/lowcode/public-components/headers/sy-03.ts +1 -1
- package/lowcode/public-components/headers/sy-04.js +1 -1
- package/lowcode/public-components/headers/sy-04.ts +1 -1
- package/lowcode/public-components/headers/sy-05.js +1 -2
- package/lowcode/public-components/headers/sy-05.ts +1 -1
- package/lowcode/public-components/layout-plugin/social-links-01.js +122 -3
- package/lowcode/public-components/layout-plugin/social-links-01.ts +135 -10
- package/lowcode/public-components/product/pd-card-01.js +23 -14
- package/lowcode/public-components/product/pd-card-01.ts +25 -14
- package/lowcode/public-components/product/pd-card-02.js +23 -16
- package/lowcode/public-components/product/pd-card-02.ts +25 -16
- package/lowcode/public-components/product/pd-card-03.js +25 -16
- package/lowcode/public-components/product/pd-card-03.ts +27 -16
- package/lowcode/public-components/product/pd-class.js +1 -1
- package/lowcode/public-components/product/pd-class.ts +1 -1
- package/lowcode/public-components/terms-related/index.js +13 -2
- package/lowcode/public-components/terms-related/index.ts +15 -2
- package/lowcode/public-components/user-manager/um-class.js +490 -501
- package/lowcode/public-components/user-manager/um-class.ts +872 -882
- package/lowcode/public-components/user-manager/um-info.js +41 -40
- package/lowcode/public-components/user-manager/um-info.ts +54 -56
- package/lowcode/public-components/user-manager/um-login.js +10 -13
- package/lowcode/public-components/user-manager/um-login.ts +15 -23
- package/lowcode/public-components/user-manager/um-orderlist.js +60 -51
- package/lowcode/public-components/user-manager/um-orderlist.ts +289 -275
- package/lowcode/public-components/user-manager/um-rebate.js +104 -82
- package/lowcode/public-components/user-manager/um-rebate.ts +294 -267
- package/lowcode/public-components/user-manager/um-receive.js +582 -0
- package/lowcode/public-components/user-manager/um-receive.ts +599 -0
- package/lowcode/public-components/user-manager/um-wishlist.js +72 -68
- package/lowcode/public-components/user-manager/um-wishlist.ts +240 -230
- package/package.json +1 -1
- package/src/api-public/controllers/shopee.js +17 -0
- package/src/api-public/controllers/shopee.js.map +1 -1
- package/src/api-public/controllers/shopee.ts +32 -0
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/post.js +17 -7
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/rebate.js +2 -11
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/rebate.ts +5 -12
- package/src/api-public/services/shopee.d.ts +23 -2
- package/src/api-public/services/shopee.js +230 -111
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +1012 -838
- package/src/api-public/services/user.js +2 -2
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +3 -3
- package/src/index.js +17 -7
- package/src/index.js.map +1 -1
- package/src/modules/tool.d.ts +4 -4
- package/src/modules/tool.js +2 -1
- package/src/modules/tool.js.map +1 -1
- package/src/services/backend-service.js +17 -7
- package/src/services/backend-service.js.map +1 -1
- package/src/services/template.d.ts +1 -1
- package/src/services/template.js +24 -18
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +34 -37
|
@@ -216,20 +216,29 @@ export class ProductCard01 {
|
|
|
216
216
|
})}"
|
|
217
217
|
/>
|
|
218
218
|
<div class="child add-cart-child">
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
219
|
+
${(() => {
|
|
220
|
+
const isAllUnderstocking = prod.variants.every((item) => item.show_understocking === 'true');
|
|
221
|
+
const stockTotal = prod.variants.reduce((sum, item) => sum + item.stock, 0);
|
|
222
|
+
const isSoldOut = isAllUnderstocking && stockTotal === 0;
|
|
223
|
+
return html `<div
|
|
224
|
+
class="w-100 h-100 p-3 add-cart-text"
|
|
225
|
+
onclick="${gvc.event((_, event) => {
|
|
226
|
+
event.stopPropagation();
|
|
227
|
+
if (!isSoldOut) {
|
|
228
|
+
PdClass.addCartAction({
|
|
229
|
+
gvc: gvc,
|
|
230
|
+
titleFontColor: titleFontColor,
|
|
231
|
+
prod: prod,
|
|
232
|
+
vm: vm,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
})}"
|
|
236
|
+
>
|
|
237
|
+
${isSoldOut
|
|
238
|
+
? html `<i class="fa-solid fa-ban me-2"></i>${Language.text('sold_out')}`
|
|
239
|
+
: html `<i class="fa-regular fa-cart-shopping me-2"></i>${Language.text('add_to_cart')}`}
|
|
240
|
+
</div>`;
|
|
241
|
+
})()}
|
|
233
242
|
</div>
|
|
234
243
|
</div>
|
|
235
244
|
<div class="card-collapse-parent cursor_pointer">
|
|
@@ -233,20 +233,31 @@ export class ProductCard01 {
|
|
|
233
233
|
})}"
|
|
234
234
|
/>
|
|
235
235
|
<div class="child add-cart-child">
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
236
|
+
${(() => {
|
|
237
|
+
const isAllUnderstocking = prod.variants.every((item: any) => item.show_understocking === 'true');
|
|
238
|
+
const stockTotal = prod.variants.reduce((sum: number, item: any) => sum + item.stock, 0);
|
|
239
|
+
const isSoldOut = isAllUnderstocking && stockTotal === 0;
|
|
240
|
+
|
|
241
|
+
return html`<div
|
|
242
|
+
class="w-100 h-100 p-3 add-cart-text"
|
|
243
|
+
onclick="${gvc.event((_, event) => {
|
|
244
|
+
event.stopPropagation();
|
|
245
|
+
|
|
246
|
+
if (!isSoldOut) {
|
|
247
|
+
PdClass.addCartAction({
|
|
248
|
+
gvc: gvc,
|
|
249
|
+
titleFontColor: titleFontColor,
|
|
250
|
+
prod: prod,
|
|
251
|
+
vm: vm,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
})}"
|
|
255
|
+
>
|
|
256
|
+
${isSoldOut
|
|
257
|
+
? html`<i class="fa-solid fa-ban me-2"></i>${Language.text('sold_out')}`
|
|
258
|
+
: html`<i class="fa-regular fa-cart-shopping me-2"></i>${Language.text('add_to_cart')}`}
|
|
259
|
+
</div>`;
|
|
260
|
+
})()}
|
|
250
261
|
</div>
|
|
251
262
|
</div>
|
|
252
263
|
<div class="card-collapse-parent cursor_pointer">
|
|
@@ -205,7 +205,7 @@ export class ProductCard02 {
|
|
|
205
205
|
})}"
|
|
206
206
|
/>
|
|
207
207
|
</div>
|
|
208
|
-
|
|
208
|
+
|
|
209
209
|
<div class="card-collapse-parent">
|
|
210
210
|
<div class="d-flex card-title-container justify-content-between align-items-center">
|
|
211
211
|
<div class="row gx-0 mb-1" style="max-width:calc(100% - 50px);">
|
|
@@ -229,21 +229,28 @@ export class ProductCard02 {
|
|
|
229
229
|
</div>
|
|
230
230
|
</div>
|
|
231
231
|
<div class="add-cart-child">
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
232
|
+
${(() => {
|
|
233
|
+
const isAllUnderstocking = prod.variants.every((item) => item.show_understocking === 'true');
|
|
234
|
+
const stockTotal = prod.variants.reduce((sum, item) => sum + item.stock, 0);
|
|
235
|
+
const isSoldOut = isAllUnderstocking && stockTotal === 0;
|
|
236
|
+
return html `<div
|
|
237
|
+
class="w-100 h-100 p-3 add-cart-text"
|
|
238
|
+
style="border-radius: 50%; color: ${borderButtonText}; border: 1px solid ${borderButtonBgr};"
|
|
239
|
+
onclick="${gvc.event((_, event) => {
|
|
240
|
+
event.stopPropagation();
|
|
241
|
+
if (!isSoldOut) {
|
|
242
|
+
PdClass.addCartAction({
|
|
243
|
+
gvc: gvc,
|
|
244
|
+
titleFontColor: titleFontColor,
|
|
245
|
+
prod: prod,
|
|
246
|
+
vm: vm,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
})}"
|
|
250
|
+
>
|
|
251
|
+
${isSoldOut ? html `<i class="fa-solid fa-ban"></i>` : html `<i class="fa-solid fa-cart-plus"></i>`}
|
|
252
|
+
</div>`;
|
|
253
|
+
})()}
|
|
247
254
|
</div>
|
|
248
255
|
</div>
|
|
249
256
|
</div>
|
|
@@ -223,7 +223,7 @@ export class ProductCard02 {
|
|
|
223
223
|
})}"
|
|
224
224
|
/>
|
|
225
225
|
</div>
|
|
226
|
-
|
|
226
|
+
|
|
227
227
|
<div class="card-collapse-parent">
|
|
228
228
|
<div class="d-flex card-title-container justify-content-between align-items-center">
|
|
229
229
|
<div class="row gx-0 mb-1" style="max-width:calc(100% - 50px);">
|
|
@@ -249,21 +249,30 @@ export class ProductCard02 {
|
|
|
249
249
|
</div>
|
|
250
250
|
</div>
|
|
251
251
|
<div class="add-cart-child">
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
252
|
+
${(() => {
|
|
253
|
+
const isAllUnderstocking = prod.variants.every((item: any) => item.show_understocking === 'true');
|
|
254
|
+
const stockTotal = prod.variants.reduce((sum: number, item: any) => sum + item.stock, 0);
|
|
255
|
+
const isSoldOut = isAllUnderstocking && stockTotal === 0;
|
|
256
|
+
|
|
257
|
+
return html`<div
|
|
258
|
+
class="w-100 h-100 p-3 add-cart-text"
|
|
259
|
+
style="border-radius: 50%; color: ${borderButtonText}; border: 1px solid ${borderButtonBgr};"
|
|
260
|
+
onclick="${gvc.event((_, event) => {
|
|
261
|
+
event.stopPropagation();
|
|
262
|
+
|
|
263
|
+
if (!isSoldOut) {
|
|
264
|
+
PdClass.addCartAction({
|
|
265
|
+
gvc: gvc,
|
|
266
|
+
titleFontColor: titleFontColor,
|
|
267
|
+
prod: prod,
|
|
268
|
+
vm: vm,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
})}"
|
|
272
|
+
>
|
|
273
|
+
${isSoldOut ? html`<i class="fa-solid fa-ban"></i>` : html`<i class="fa-solid fa-cart-plus"></i>`}
|
|
274
|
+
</div>`;
|
|
275
|
+
})()}
|
|
267
276
|
</div>
|
|
268
277
|
</div>
|
|
269
278
|
</div>
|
|
@@ -211,7 +211,7 @@ export class ProductCard03 {
|
|
|
211
211
|
})}"
|
|
212
212
|
/>
|
|
213
213
|
</div>
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
<div class="card-collapse-parent">
|
|
216
216
|
<div class="card-title-container" style="min-height:auto;">
|
|
217
217
|
<div class="row gx-0 mb-2">
|
|
@@ -235,21 +235,30 @@ export class ProductCard03 {
|
|
|
235
235
|
</div>
|
|
236
236
|
</div>
|
|
237
237
|
<div class="add-cart-child">
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
238
|
+
${(() => {
|
|
239
|
+
const isAllUnderstocking = prod.variants.every((item) => item.show_understocking === 'true');
|
|
240
|
+
const stockTotal = prod.variants.reduce((sum, item) => sum + item.stock, 0);
|
|
241
|
+
const isSoldOut = isAllUnderstocking && stockTotal === 0;
|
|
242
|
+
return html `<div
|
|
243
|
+
class="w-100 h-100 p-3 add-cart-text"
|
|
244
|
+
style="color: ${borderButtonText}; border: 1px solid ${borderButtonBgr};"
|
|
245
|
+
onclick="${gvc.event((_, event) => {
|
|
246
|
+
event.stopPropagation();
|
|
247
|
+
if (!isSoldOut) {
|
|
248
|
+
PdClass.addCartAction({
|
|
249
|
+
gvc: gvc,
|
|
250
|
+
titleFontColor: titleFontColor,
|
|
251
|
+
prod: prod,
|
|
252
|
+
vm: vm,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
})}"
|
|
256
|
+
>
|
|
257
|
+
${isSoldOut
|
|
258
|
+
? html `<i class="fa-solid fa-ban me-2"></i>${Language.text('sold_out')}`
|
|
259
|
+
: html `<i class="fa-solid fa-cart-plus me-2"></i>${Language.text('add_to_cart')}`}
|
|
260
|
+
</div>`;
|
|
261
|
+
})()}
|
|
253
262
|
</div>
|
|
254
263
|
</div>
|
|
255
264
|
</div>
|
|
@@ -229,7 +229,7 @@ export class ProductCard03 {
|
|
|
229
229
|
})}"
|
|
230
230
|
/>
|
|
231
231
|
</div>
|
|
232
|
-
|
|
232
|
+
|
|
233
233
|
<div class="card-collapse-parent">
|
|
234
234
|
<div class="card-title-container" style="min-height:auto;">
|
|
235
235
|
<div class="row gx-0 mb-2">
|
|
@@ -255,21 +255,32 @@ export class ProductCard03 {
|
|
|
255
255
|
</div>
|
|
256
256
|
</div>
|
|
257
257
|
<div class="add-cart-child">
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
258
|
+
${(() => {
|
|
259
|
+
const isAllUnderstocking = prod.variants.every((item: any) => item.show_understocking === 'true');
|
|
260
|
+
const stockTotal = prod.variants.reduce((sum: number, item: any) => sum + item.stock, 0);
|
|
261
|
+
const isSoldOut = isAllUnderstocking && stockTotal === 0;
|
|
262
|
+
|
|
263
|
+
return html`<div
|
|
264
|
+
class="w-100 h-100 p-3 add-cart-text"
|
|
265
|
+
style="color: ${borderButtonText}; border: 1px solid ${borderButtonBgr};"
|
|
266
|
+
onclick="${gvc.event((_, event) => {
|
|
267
|
+
event.stopPropagation();
|
|
268
|
+
|
|
269
|
+
if (!isSoldOut) {
|
|
270
|
+
PdClass.addCartAction({
|
|
271
|
+
gvc: gvc,
|
|
272
|
+
titleFontColor: titleFontColor,
|
|
273
|
+
prod: prod,
|
|
274
|
+
vm: vm,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
})}"
|
|
278
|
+
>
|
|
279
|
+
${isSoldOut
|
|
280
|
+
? html`<i class="fa-solid fa-ban me-2"></i>${Language.text('sold_out')}`
|
|
281
|
+
: html`<i class="fa-solid fa-cart-plus me-2"></i>${Language.text('add_to_cart')}`}
|
|
282
|
+
</div>`;
|
|
283
|
+
})()}
|
|
273
284
|
</div>
|
|
274
285
|
</div>
|
|
275
286
|
</div>
|
|
@@ -414,7 +414,7 @@ export class PdClass {
|
|
|
414
414
|
const glitter = window.glitter;
|
|
415
415
|
return ['hidden/', 'shop/'].find((dd) => {
|
|
416
416
|
return (glitter.getUrlParameter('page') || '').startsWith(dd) || ((glitter.getUrlParameter('page_refer') || '').startsWith(dd));
|
|
417
|
-
})
|
|
417
|
+
});
|
|
418
418
|
}
|
|
419
419
|
static changePage(prod, gvc) {
|
|
420
420
|
const glitter = gvc.glitter;
|
|
@@ -579,7 +579,7 @@ export class PdClass {
|
|
|
579
579
|
const glitter = (window as any).glitter;
|
|
580
580
|
return ['hidden/','shop/'].find((dd)=>{
|
|
581
581
|
return (glitter.getUrlParameter('page') || '').startsWith(dd) || ((glitter.getUrlParameter('page_refer') || '').startsWith(dd))
|
|
582
|
-
})
|
|
582
|
+
});
|
|
583
583
|
}
|
|
584
584
|
// document.querySelector('.check_out_cart_data').scrollIntoView()
|
|
585
585
|
static changePage(prod: any, gvc: GVC) {
|
|
@@ -63,7 +63,10 @@ export class TermsRelated {
|
|
|
63
63
|
'shipment_list_archive',
|
|
64
64
|
'reconciliation_area',
|
|
65
65
|
'app-design',
|
|
66
|
-
'auto_fcm_push',
|
|
66
|
+
'auto_fcm_push',
|
|
67
|
+
'auto_fcm_advertise',
|
|
68
|
+
'auto_fcm_history',
|
|
69
|
+
'pos_setting',
|
|
67
70
|
].includes(glitter.getUrlParameter('page'))) {
|
|
68
71
|
return yield new Promise((resolve, reject) => {
|
|
69
72
|
glitter.getModule(new URL('./cms-plugin/cms-router.js', gvc.glitter.root_path).href, res => {
|
|
@@ -85,7 +88,15 @@ export class TermsRelated {
|
|
|
85
88
|
});
|
|
86
89
|
});
|
|
87
90
|
}
|
|
88
|
-
else if ([
|
|
91
|
+
else if ([
|
|
92
|
+
'account_userinfo',
|
|
93
|
+
'voucher-list',
|
|
94
|
+
'rebate',
|
|
95
|
+
'order_list',
|
|
96
|
+
'wishlist',
|
|
97
|
+
'recipient_info',
|
|
98
|
+
'account_edit',
|
|
99
|
+
].includes(page)) {
|
|
89
100
|
return yield new Promise((resolve, reject) => {
|
|
90
101
|
glitter.getModule(new URL('./cms-plugin/account-info.js', gvc.glitter.root_path).href, res => {
|
|
91
102
|
document.querySelector(`.${id}`).outerHTML = res.main(gvc);
|
|
@@ -66,7 +66,10 @@ export class TermsRelated {
|
|
|
66
66
|
'shipment_list_archive',
|
|
67
67
|
'reconciliation_area',
|
|
68
68
|
'app-design',
|
|
69
|
-
'auto_fcm_push',
|
|
69
|
+
'auto_fcm_push',
|
|
70
|
+
'auto_fcm_advertise',
|
|
71
|
+
'auto_fcm_history',
|
|
72
|
+
'pos_setting',
|
|
70
73
|
].includes(glitter.getUrlParameter('page'))
|
|
71
74
|
) {
|
|
72
75
|
return await new Promise((resolve, reject) => {
|
|
@@ -86,7 +89,17 @@ export class TermsRelated {
|
|
|
86
89
|
(document.querySelector(`.${id}`) as any).outerHTML = res.inputVerificationCode(gvc);
|
|
87
90
|
});
|
|
88
91
|
});
|
|
89
|
-
} else if (
|
|
92
|
+
} else if (
|
|
93
|
+
[
|
|
94
|
+
'account_userinfo',
|
|
95
|
+
'voucher-list',
|
|
96
|
+
'rebate',
|
|
97
|
+
'order_list',
|
|
98
|
+
'wishlist',
|
|
99
|
+
'recipient_info',
|
|
100
|
+
'account_edit',
|
|
101
|
+
].includes(page)
|
|
102
|
+
) {
|
|
90
103
|
//個人檔案相關頁面
|
|
91
104
|
return await new Promise((resolve, reject) => {
|
|
92
105
|
glitter.getModule(new URL('./cms-plugin/account-info.js', gvc.glitter.root_path).href, res => {
|