ts-glitter 16.2.6 → 16.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/glitter-base/global/currency.d.ts +19 -0
- package/lowcode/glitter-base/global/currency.js.map +1 -0
- package/lowcode/glitter-base/global/global-user.d.ts +5 -0
- package/lowcode/glitter-base/global/global-user.js.map +1 -1
- package/lowcode/glitter-base/global/language.d.ts +22 -0
- package/lowcode/glitter-base/global/language.js.map +1 -0
- package/lowcode/glitter-base/route/shopping.d.ts +28 -2
- package/lowcode/glitter-base/route/shopping.js.map +1 -1
- package/lowcode/glitterBundle/api/base.js.map +1 -1
- package/lowcode/public-components/product/product-list.js +63 -48
- package/lowcode/public-components/product/product-list.ts +62 -49
- package/package.json +1 -1
- package/src/api-public/services/shopping.js +1 -0
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +1 -0
- package/src/helper/glitter-util.d.ts +4 -1
- package/src/helper/glitter-util.js +3 -2
- package/src/helper/glitter-util.js.map +1 -1
- package/src/helper/glitter-util.ts +4 -3
- package/src/index.js +178 -117
- package/src/index.js.map +1 -1
- package/src/index.ts +121 -66
- package/src/seo-config.d.ts +1 -6
- package/src/seo-config.js +71 -73
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +99 -97
|
@@ -648,8 +648,10 @@ export class ProductList {
|
|
|
648
648
|
if (!vm.collections || vm.collections.length === 0) {
|
|
649
649
|
vm.title = all_text;
|
|
650
650
|
} else {
|
|
651
|
-
let collectionObj = vm.collections.find((item:
|
|
652
|
-
|
|
651
|
+
let collectionObj = vm.collections.find((item:any) => {
|
|
652
|
+
const language_data=item.language_data && item.language_data[Language.getLanguage()]
|
|
653
|
+
const code=((language_data && language_data.seo && language_data.seo.domain) || item.code) || (language_data && language_data.title) || item.title;
|
|
654
|
+
return (code) === decodeURIComponent(extractCategoryTitleFromUrl(location.href)) ;
|
|
653
655
|
});
|
|
654
656
|
try {
|
|
655
657
|
if(!collectionObj){
|
|
@@ -658,63 +660,74 @@ export class ProductList {
|
|
|
658
660
|
});
|
|
659
661
|
}
|
|
660
662
|
}catch (e){}
|
|
661
|
-
|
|
663
|
+
if(collectionObj){
|
|
664
|
+
const language_data=collectionObj.language_data
|
|
665
|
+
vm.title=(language_data && (language_data[Language.getLanguage()] && language_data[Language.getLanguage()].title)) || collectionObj.title;
|
|
666
|
+
}else{
|
|
667
|
+
vm.title=all_text
|
|
668
|
+
}
|
|
662
669
|
}
|
|
663
670
|
gvc.notifyDataChange(ids.pageTitle);
|
|
664
671
|
}
|
|
665
672
|
|
|
666
673
|
function setAdTag(data: any) {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
674
|
+
try {
|
|
675
|
+
const path = location.pathname;
|
|
676
|
+
const pathParts = path.split('/');
|
|
677
|
+
const collectionIndex = pathParts.indexOf('collections');
|
|
678
|
+
const index = collectionIndex + 1;
|
|
679
|
+
const collection = pathParts[index];
|
|
680
|
+
const collectionName = decodeURIComponent(collection);
|
|
681
|
+
|
|
682
|
+
function findObjectByValue(arr: any, value: string): any {
|
|
683
|
+
for (const item of arr) {
|
|
684
|
+
const language_data=item.language_data
|
|
685
|
+
const code=(language_data && language_data[Language.getLanguage()] && language_data[Language.getLanguage()].seo && language_data[Language.getLanguage()].seo.domain) || item.code
|
|
686
|
+
if (code === value) {
|
|
687
|
+
return item;
|
|
688
|
+
}
|
|
689
|
+
if (item.array.length > 0) {
|
|
690
|
+
const found = findObjectByValue(item.array, value);
|
|
691
|
+
if (found) {
|
|
692
|
+
return found;
|
|
693
|
+
}
|
|
683
694
|
}
|
|
684
695
|
}
|
|
696
|
+
return null;
|
|
685
697
|
}
|
|
686
|
-
return null;
|
|
687
|
-
}
|
|
688
698
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
699
|
+
if ((window as any).gtag) {
|
|
700
|
+
if (collectionName) {
|
|
701
|
+
const foundObject = findObjectByValue(data, collectionName);
|
|
702
|
+
Ad.gtagEvent('view_item_list', {
|
|
703
|
+
items: [
|
|
704
|
+
{
|
|
705
|
+
item_id: collectionName,
|
|
706
|
+
item_name: foundObject.title,
|
|
707
|
+
},
|
|
708
|
+
],
|
|
709
|
+
});
|
|
710
|
+
Ad.fbqEvent('ViewContent', {
|
|
711
|
+
content_ids: [collectionName],
|
|
712
|
+
content_type: 'product_group',
|
|
713
|
+
});
|
|
714
|
+
} else {
|
|
715
|
+
Ad.gtagEvent('view_item_list', {
|
|
716
|
+
items: [
|
|
717
|
+
{
|
|
718
|
+
item_id: 'all-product',
|
|
719
|
+
item_name: '所有商品',
|
|
720
|
+
},
|
|
721
|
+
],
|
|
722
|
+
});
|
|
723
|
+
Ad.fbqEvent('ViewContent', {
|
|
724
|
+
content_ids: ['all-product'],
|
|
725
|
+
content_type: 'product_group',
|
|
726
|
+
});
|
|
727
|
+
}
|
|
717
728
|
}
|
|
729
|
+
}catch (e) {
|
|
730
|
+
console.log(e)
|
|
718
731
|
}
|
|
719
732
|
}
|
|
720
733
|
|
package/package.json
CHANGED
|
@@ -94,6 +94,7 @@ class Shopping {
|
|
|
94
94
|
}
|
|
95
95
|
async getProduct(query) {
|
|
96
96
|
var _a, _b;
|
|
97
|
+
console.log(`query=>`, query);
|
|
97
98
|
try {
|
|
98
99
|
query.language = (_a = query.language) !== null && _a !== void 0 ? _a : (await app_js_1.App.getDefLanguage(this.app));
|
|
99
100
|
query.show_hidden = (_b = query.show_hidden) !== null && _b !== void 0 ? _b : 'true';
|