@lancom/shared 0.0.380 → 0.0.381
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/components/common/postcode_select/postcode-select.vue +5 -1
- package/layouts/products.vue +10 -0
- package/mixins/meta-info.js +23 -16
- package/mixins/product-view.js +3 -0
- package/package.json +1 -1
- package/pages/faq/_group/index.vue +5 -0
- package/pages/faq/index.vue +5 -0
- package/pages/news/_alias.vue +3 -0
- package/pages/news/index.vue +5 -0
- package/pages/news/tag/_tag.vue +3 -0
|
@@ -117,6 +117,9 @@ export default {
|
|
|
117
117
|
type: Boolean,
|
|
118
118
|
default: false
|
|
119
119
|
},
|
|
120
|
+
postcodesRange: {
|
|
121
|
+
type: String
|
|
122
|
+
},
|
|
120
123
|
disabled: {
|
|
121
124
|
type: Boolean,
|
|
122
125
|
default: false
|
|
@@ -168,12 +171,13 @@ export default {
|
|
|
168
171
|
}
|
|
169
172
|
},
|
|
170
173
|
methods: {
|
|
171
|
-
async handleSearch(query) {
|
|
174
|
+
async handleSearch(query = '') {
|
|
172
175
|
if (query.trim().length > 1) {
|
|
173
176
|
this.isLoading = true;
|
|
174
177
|
const country = this.codeCountry || this.country;
|
|
175
178
|
const countryName = country ? (['GB','UK'].includes(country.isoCode) ? 'UK' : (country.name || country)) : 'Australia';
|
|
176
179
|
const params = {
|
|
180
|
+
postcode: this.postcodesRange,
|
|
177
181
|
query: query.trim(),
|
|
178
182
|
country: countryName
|
|
179
183
|
};
|
package/layouts/products.vue
CHANGED
|
@@ -105,6 +105,16 @@
|
|
|
105
105
|
const page = +this.$route.query.page;
|
|
106
106
|
return `${this.breadcrumbs[this.breadcrumbs.length - 1]?.to}${page > 1 ? `?page=${page}` : ''}`;
|
|
107
107
|
},
|
|
108
|
+
pageItemType() {
|
|
109
|
+
return 'product';
|
|
110
|
+
},
|
|
111
|
+
pageItemImage() {
|
|
112
|
+
const images = this.products.reduce((images, product) => {
|
|
113
|
+
const image = getProductLargeCover(product, 'front') || getProductMediumCover(product, 'front');
|
|
114
|
+
return image ? [...images, image] : images;
|
|
115
|
+
}, []);
|
|
116
|
+
return images.slice(0, 1);
|
|
117
|
+
},
|
|
108
118
|
currentBrand() {
|
|
109
119
|
return this.findByRouteParam(this.brands, 'brand');
|
|
110
120
|
},
|
package/mixins/meta-info.js
CHANGED
|
@@ -51,6 +51,10 @@ const metaInfo = {
|
|
|
51
51
|
hid: 'og:title',
|
|
52
52
|
property: 'og:title',
|
|
53
53
|
content: pageTitle
|
|
54
|
+
}, {
|
|
55
|
+
hid: 'og:type',
|
|
56
|
+
property: 'og:type',
|
|
57
|
+
content: this.pageItemType || 'website'
|
|
54
58
|
}];
|
|
55
59
|
|
|
56
60
|
const canonical = this.getCanonical();
|
|
@@ -91,23 +95,26 @@ const metaInfo = {
|
|
|
91
95
|
});
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
const pageImage = this.pageItemImage || this.pageItem?.image || (this.pageItem?.images && this.pageItem?.images
|
|
98
|
+
const pageImage = this.pageItemImage || this.pageItem?.image || (this.pageItem?.images?.length > 0 && this.pageItem?.images) || image;
|
|
95
99
|
if (pageImage) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
const pageImages = Array.isArray(pageImage) ? pageImage : [pageImage];
|
|
101
|
+
for (const image of pageImages) {
|
|
102
|
+
const pageImageUrl = staticLink(typeof image === 'string' ? image : (image.medium || image.large));
|
|
103
|
+
metaTags.push({
|
|
104
|
+
hid: 'og:image',
|
|
105
|
+
property: 'og:image',
|
|
106
|
+
content: pageImageUrl
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
link.push({
|
|
110
|
+
hid: 'preloadImage',
|
|
111
|
+
rel: 'preload',
|
|
112
|
+
fetchpriority: 'high',
|
|
113
|
+
as: 'image',
|
|
114
|
+
type: 'image/webp',
|
|
115
|
+
href: pageImageUrl
|
|
116
|
+
});
|
|
117
|
+
}
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
const pageTags = pageItemMeta?.tags?.length > 0 ? pageItemMeta.tags : meta.tags;
|
package/mixins/product-view.js
CHANGED
package/package.json
CHANGED
package/pages/faq/index.vue
CHANGED
package/pages/news/_alias.vue
CHANGED
package/pages/news/index.vue
CHANGED