@lancom/shared 0.0.183 → 0.0.184
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/assets/js/api/admin.js +18 -3
- package/components/faq/faq.vue +20 -28
- package/components/product/gallery/gallery.vue +2 -0
- package/components/product/product_reviews/product-reviews.vue +1 -0
- package/mixins/meta-info.js +8 -3
- package/nuxt.config.js +1 -0
- package/package.json +1 -1
- package/store/product.js +20 -1
- package/store/products.js +14 -1
package/assets/js/api/admin.js
CHANGED
|
@@ -365,9 +365,9 @@ export default {
|
|
|
365
365
|
async fetchWarehouses(params) {
|
|
366
366
|
return sortByName(await _get('admin/warehouse', params));
|
|
367
367
|
},
|
|
368
|
-
fetchWarehouseLocations(params) {
|
|
369
|
-
|
|
370
|
-
},
|
|
368
|
+
// fetchWarehouseLocations(params) {
|
|
369
|
+
// return _get('admin/warehouse/locations', params);
|
|
370
|
+
// },
|
|
371
371
|
fetchWarehouseById(id) {
|
|
372
372
|
return _get(`admin/warehouse/${id}`);
|
|
373
373
|
},
|
|
@@ -386,6 +386,21 @@ export default {
|
|
|
386
386
|
removeWarehouseTask(id) {
|
|
387
387
|
return _delete(`admin/warehouse-task/${id}`);
|
|
388
388
|
},
|
|
389
|
+
fetchWarehouseLocations(params) {
|
|
390
|
+
return _get('admin/warehouse-locations', params);
|
|
391
|
+
},
|
|
392
|
+
fetchWarehouseLocationById(id) {
|
|
393
|
+
return _get(`admin/warehouse-locations/${id}`);
|
|
394
|
+
},
|
|
395
|
+
saveWarehouseLocation(item) {
|
|
396
|
+
return item._id ? _put(`admin/warehouse-locations/${item._id}`, item) : _post('admin/warehouse-locations', item);
|
|
397
|
+
},
|
|
398
|
+
removeWarehouseLocation(id) {
|
|
399
|
+
return _delete(`admin/warehouse-locations/${id}`);
|
|
400
|
+
},
|
|
401
|
+
moveToWarehouseLocation(move) {
|
|
402
|
+
return _post(`admin/warehouse-locations/move`, move);
|
|
403
|
+
},
|
|
389
404
|
async fetchBanners(params) {
|
|
390
405
|
return sortByName(await _get('admin/banners', params));
|
|
391
406
|
},
|
package/components/faq/faq.vue
CHANGED
|
@@ -31,39 +31,31 @@
|
|
|
31
31
|
class="icon-cancel FAQ__group-caret"
|
|
32
32
|
:class="{ active: openedGroup === group.type }"></i>
|
|
33
33
|
</div>
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
<div
|
|
35
|
+
v-show="openedGroup === group.type"
|
|
36
|
+
class="FAQ__group-content view-transition">
|
|
37
37
|
<div
|
|
38
|
-
v-
|
|
39
|
-
|
|
38
|
+
v-for="entity in group.entities"
|
|
39
|
+
:key="entity._id"
|
|
40
|
+
:ref="entity._id"
|
|
41
|
+
class="FAQ__entity">
|
|
40
42
|
<div
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<div
|
|
46
|
-
class="FAQ__entity-header"
|
|
47
|
-
@click="toggleEntity(entity)">
|
|
48
|
-
<div class="FAQ__entity-title">
|
|
49
|
-
{{ entity.question }}
|
|
50
|
-
</div>
|
|
51
|
-
<i
|
|
52
|
-
class="icon-angle-down FAQ__entity-header-caret"
|
|
53
|
-
:class="{ active: openedEntities.includes(entity._id) }"></i>
|
|
43
|
+
class="FAQ__entity-header"
|
|
44
|
+
@click="toggleEntity(entity)">
|
|
45
|
+
<div class="FAQ__entity-title">
|
|
46
|
+
{{ entity.question }}
|
|
54
47
|
</div>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</transition>
|
|
48
|
+
<i
|
|
49
|
+
class="icon-angle-down FAQ__entity-header-caret"
|
|
50
|
+
:class="{ active: openedEntities.includes(entity._id) }"></i>
|
|
51
|
+
</div>
|
|
52
|
+
<div
|
|
53
|
+
v-show="openedEntities.includes(entity._id)"
|
|
54
|
+
class="FAQ__entity-body view-transition"
|
|
55
|
+
v-html="entity.answer">
|
|
64
56
|
</div>
|
|
65
57
|
</div>
|
|
66
|
-
</
|
|
58
|
+
</div>
|
|
67
59
|
</div>
|
|
68
60
|
</div>
|
|
69
61
|
</div>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
:key="updateCarouselTime"
|
|
8
8
|
:arrows="true"
|
|
9
9
|
:dots="true"
|
|
10
|
+
:infinite="false"
|
|
10
11
|
:swipe="false"
|
|
11
12
|
:speed="800"
|
|
12
13
|
@beforeChange="onChange">
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
:key="updateCarouselTime"
|
|
56
57
|
:slides-per-row="slidesPerRow"
|
|
57
58
|
:arrows="true"
|
|
59
|
+
:infinite="false"
|
|
58
60
|
:dots="true"
|
|
59
61
|
:speed="800">
|
|
60
62
|
<div
|
package/mixins/meta-info.js
CHANGED
|
@@ -9,7 +9,12 @@ const metaInfo = {
|
|
|
9
9
|
},
|
|
10
10
|
computed: {
|
|
11
11
|
...mapGetters('page', ['routeInfo']),
|
|
12
|
-
...mapGetters(['shop'])
|
|
12
|
+
...mapGetters(['shop']),
|
|
13
|
+
pageTitle() {
|
|
14
|
+
const { title, meta = {} } = this.routeInfo || {};
|
|
15
|
+
const pageItemMeta = this.pageItem?.meta || {};
|
|
16
|
+
return this.fillWithItemData(pageItemMeta.title || meta.title || title || this.generateTitleFromRoute());
|
|
17
|
+
}
|
|
13
18
|
},
|
|
14
19
|
methods: {
|
|
15
20
|
generateTitleFromRoute() {
|
|
@@ -30,10 +35,10 @@ const metaInfo = {
|
|
|
30
35
|
head() {
|
|
31
36
|
const hasQueryParams = Object.keys(this.$route.query || {}).length > 0;
|
|
32
37
|
|
|
33
|
-
const {
|
|
38
|
+
const { short_text: shortText, image, meta = {} } = this.routeInfo || {};
|
|
34
39
|
const pageItemMeta = this.pageItem?.meta || {};
|
|
35
40
|
|
|
36
|
-
const pageTitle = this.
|
|
41
|
+
const pageTitle = this.pageTitle;
|
|
37
42
|
|
|
38
43
|
const metaTags = [{
|
|
39
44
|
hid: 'og:title',
|
package/nuxt.config.js
CHANGED
|
@@ -42,6 +42,7 @@ module.exports = (config, axios, { raygunClient } = {}) => ({
|
|
|
42
42
|
'@/node_modules/@lancom/shared/plugins/global-components',
|
|
43
43
|
'@/node_modules/@lancom/shared/plugins/directives',
|
|
44
44
|
'@/node_modules/@lancom/shared/plugins/vue-js-modal',
|
|
45
|
+
'@/node_modules/@lancom/shared/plugins/v-style',
|
|
45
46
|
'@/node_modules/@lancom/shared/plugins/vee-validate',
|
|
46
47
|
{ src: '@/node_modules/@lancom/shared/plugins/vue-toastr', ssr: false },
|
|
47
48
|
{ src: '@/node_modules/@lancom/shared/plugins/vue-hummer', ssr: false },
|
package/package.json
CHANGED
package/store/product.js
CHANGED
|
@@ -120,7 +120,26 @@ export const getters = {
|
|
|
120
120
|
...printTypesMinQuantity
|
|
121
121
|
);
|
|
122
122
|
},
|
|
123
|
-
images: ({ images }) =>
|
|
123
|
+
images: ({ images, product }) => {
|
|
124
|
+
const productImages = images.map((image, index) => {
|
|
125
|
+
const types = (image.types || []).filter(t => ['front', 'back', 'model'].includes(t));
|
|
126
|
+
return {
|
|
127
|
+
...image,
|
|
128
|
+
alt: [
|
|
129
|
+
product.name,
|
|
130
|
+
product.brand?.name,
|
|
131
|
+
(types[0] || '').toUpperCase(),
|
|
132
|
+
types[0] && images.reduce((id, img, i) => {
|
|
133
|
+
if (i <= index && (img.types || []).includes(types[0])) {
|
|
134
|
+
id++;
|
|
135
|
+
}
|
|
136
|
+
return id;
|
|
137
|
+
}, 0)
|
|
138
|
+
].filter(n => !!n).join(' ')
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
return productImages;
|
|
142
|
+
},
|
|
124
143
|
editableSide: ({ editableSide }) => editableSide,
|
|
125
144
|
priceIncludeGST: ({ priceIncludeGST }) => priceIncludeGST,
|
|
126
145
|
hasUnprintedPrice: ({ product }) => product.minUnprintedPrice || product.maxUnprintedPrice
|
package/store/products.js
CHANGED
|
@@ -5,6 +5,8 @@ export const state = () => ({
|
|
|
5
5
|
page: 1,
|
|
6
6
|
count: 500,
|
|
7
7
|
perPage: 2,
|
|
8
|
+
minPrice: 0,
|
|
9
|
+
maxPrice: 0,
|
|
8
10
|
types: [],
|
|
9
11
|
colors: [],
|
|
10
12
|
brands: [],
|
|
@@ -23,6 +25,8 @@ export const getters = {
|
|
|
23
25
|
attributes: ({ attributes }) => attributes || [],
|
|
24
26
|
page: ({ page }) => page,
|
|
25
27
|
count: ({ count }) => count,
|
|
28
|
+
minPrice: ({ minPrice }) => minPrice,
|
|
29
|
+
maxPrice: ({ maxPrice }) => maxPrice,
|
|
26
30
|
perPage: ({ perPage }) => perPage,
|
|
27
31
|
loadError: ({ loadError }) => loadError,
|
|
28
32
|
placeholder: ({ placeholder }) => placeholder
|
|
@@ -33,7 +37,8 @@ export const actions = {
|
|
|
33
37
|
try {
|
|
34
38
|
commit('setLoadError', null);
|
|
35
39
|
const {
|
|
36
|
-
products, count, page, perPage, productTypes, colors, brands, tags, attributes
|
|
40
|
+
products, count, page, perPage, productTypes, colors, brands, tags, attributes,
|
|
41
|
+
minPrice, maxPrice
|
|
37
42
|
} = await api.fetchProducts(shop, params);
|
|
38
43
|
commit('setProducts', products);
|
|
39
44
|
commit('setPage', page);
|
|
@@ -44,6 +49,8 @@ export const actions = {
|
|
|
44
49
|
commit('setBrands', brands);
|
|
45
50
|
commit('setTags', tags);
|
|
46
51
|
commit('setAttributes', attributes);
|
|
52
|
+
commit('setMinPrice', minPrice);
|
|
53
|
+
commit('setMaxPrice', maxPrice);
|
|
47
54
|
} catch (e) {
|
|
48
55
|
const { status, data } = e?.response || {};
|
|
49
56
|
const statusCode = status || 500;
|
|
@@ -78,6 +85,12 @@ export const mutations = {
|
|
|
78
85
|
setColors(state, colors) {
|
|
79
86
|
state.colors = colors;
|
|
80
87
|
},
|
|
88
|
+
setMinPrice(state, minPrice) {
|
|
89
|
+
state.minPrice = minPrice;
|
|
90
|
+
},
|
|
91
|
+
setMaxPrice(state, maxPrice) {
|
|
92
|
+
state.maxPrice = maxPrice;
|
|
93
|
+
},
|
|
81
94
|
setBrands(state, brands) {
|
|
82
95
|
state.brands = brands;
|
|
83
96
|
},
|