@lancom/shared 0.0.379 → 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 +7 -1
- 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
- package/store/product.js +5 -3
- package/store/products.js +3 -1
|
@@ -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
|
@@ -62,7 +62,10 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
62
62
|
const pageItem = store.getters['product/product'];
|
|
63
63
|
const loadError = store.getters['product/loadError'];
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
// console.log('loadError: ', loadError);
|
|
66
|
+
if (loadError?.redirectLink) {
|
|
67
|
+
return redirect(301, loadError?.redirectLink);
|
|
68
|
+
} else if (loadError) {
|
|
66
69
|
error(loadError);
|
|
67
70
|
}
|
|
68
71
|
|
|
@@ -91,6 +94,9 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
91
94
|
stockCountryId() {
|
|
92
95
|
return this.stockCountry?._id || null;
|
|
93
96
|
},
|
|
97
|
+
pageItemType() {
|
|
98
|
+
return 'product';
|
|
99
|
+
},
|
|
94
100
|
pageItemImage() {
|
|
95
101
|
return this.mainProductImageSrc;
|
|
96
102
|
},
|
package/package.json
CHANGED
package/pages/faq/index.vue
CHANGED
package/pages/news/_alias.vue
CHANGED
package/pages/news/index.vue
CHANGED
package/pages/news/tag/_tag.vue
CHANGED
package/store/product.js
CHANGED
|
@@ -172,12 +172,14 @@ export const actions = {
|
|
|
172
172
|
commit('setIsPrintPricing', true);
|
|
173
173
|
}
|
|
174
174
|
} catch (e) {
|
|
175
|
-
console.log(e);
|
|
175
|
+
// console.log(e);
|
|
176
176
|
const { status, data } = e?.response || {};
|
|
177
|
+
// console.log('data: ', data);
|
|
177
178
|
const statusCode = status || 500;
|
|
178
179
|
commit('setLoadError', {
|
|
179
180
|
statusCode,
|
|
180
|
-
message: data?.error || 'Product not found'
|
|
181
|
+
message: data?.error || 'Product not found',
|
|
182
|
+
redirectLink: data?.redirectLink || null
|
|
181
183
|
});
|
|
182
184
|
}
|
|
183
185
|
},
|
|
@@ -265,7 +267,7 @@ export const actions = {
|
|
|
265
267
|
printType: selectedPrintType?._id
|
|
266
268
|
}
|
|
267
269
|
});
|
|
268
|
-
console.log('layer: ', layer);
|
|
270
|
+
// console.log('layer: ', layer);
|
|
269
271
|
if (preselect) {
|
|
270
272
|
commit('setSelectedLayer', layer);
|
|
271
273
|
}
|
package/store/products.js
CHANGED
|
@@ -69,11 +69,13 @@ export const actions = {
|
|
|
69
69
|
return { products };
|
|
70
70
|
} catch (e) {
|
|
71
71
|
const { status, data } = e?.response || {};
|
|
72
|
+
// console.log(e.response.data)
|
|
72
73
|
const statusCode = status || 500;
|
|
73
74
|
// console.log('statusCode: ', statusCode, data?.error || 'Post not found');
|
|
74
75
|
commit('setLoadError', {
|
|
75
76
|
statusCode,
|
|
76
|
-
error: data?.error || 'Post not found'
|
|
77
|
+
error: data?.error || 'Post not found',
|
|
78
|
+
redirectLink: data?.redirectLink || null
|
|
77
79
|
});
|
|
78
80
|
throw e;
|
|
79
81
|
}
|