@lancom/shared 0.0.424 → 0.0.426
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 +7 -33
- package/assets/js/api/index.js +3 -17
- package/components/common/coupon_select/coupon-select.vue +2 -12
- package/components/common/phone_input/phone-input.vue +3 -15
- package/components/common/postcode_select/postcode-select.vue +1 -3
- package/components/customer/customer_navigation_menu/customer-navigation-menu.vue +7 -11
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +7 -19
- package/components/product/editor_pricing/editor-pricing.vue +16 -10
- package/components/product/product.vue +12 -0
- package/components/product/product_reviews/product-reviews.vue +6 -6
- package/components/product/related_products/related-products.vue +4 -4
- package/package.json +1 -1
- package/routes/index.js +0 -10
- package/store/auth.js +0 -1
- package/store/index.js +3 -12
- package/store/product.js +21 -1
- package/assets/js/utils/share-promises/index.js +0 -76
- package/components/customer/customer_preferences_form/customer-preferences-form.scss +0 -12
- package/components/customer/customer_preferences_form/customer-preferences-form.vue +0 -87
- package/components/pages/customer/preferences/preferences.vue +0 -79
- package/components/resource/resource_view/resource-view.mixin.js +0 -74
- package/components/resource/resource_view/resource-view.scss +0 -13
- package/components/resource/resource_view/resource-view.vue +0 -97
- package/components/resource/resource_view/resource_view_prints/resource-view-prints.scss +0 -7
- package/components/resource/resource_view/resource_view_prints/resource-view-prints.vue +0 -42
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource-view-print.scss +0 -5
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource-view-print.vue +0 -54
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource-view-print-products.scss +0 -0
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource-view-print-products.vue +0 -45
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource_view_print_product/resource-view-print-product.scss +0 -0
- package/components/resource/resource_view/resource_view_prints/resource_view_print/resource_view_print_products/resource_view_print_product/resource-view-print-product.vue +0 -44
- package/pages/customer/preferences.vue +0 -33
- package/pages/order/_token/resource/_resource.vue +0 -53
package/assets/js/api/admin.js
CHANGED
|
@@ -3,12 +3,6 @@ import { _get, _post, _delete, _put } from './helpers';
|
|
|
3
3
|
import { sortSizes } from './../utils/sizes';
|
|
4
4
|
import { sortByName } from './../utils/filters';
|
|
5
5
|
|
|
6
|
-
const CACHE = {
|
|
7
|
-
PRINT_AREAS: 'print-areas',
|
|
8
|
-
PACKAGES: 'packages'
|
|
9
|
-
};
|
|
10
|
-
const promiseCache = new Map();
|
|
11
|
-
|
|
12
6
|
export default {
|
|
13
7
|
updateInventoryFromLink(link, warehouse) {
|
|
14
8
|
const url = `admin/products/inventory/link${warehouse ? `?warehouse=${warehouse}` : ''}`;
|
|
@@ -116,9 +110,6 @@ export default {
|
|
|
116
110
|
saveOrder(order) {
|
|
117
111
|
return order._id ? _put(`admin/order/${order._id}`, order) : _post('admin/order', order);
|
|
118
112
|
},
|
|
119
|
-
validateOrderDate(order, field) {
|
|
120
|
-
return _post(`admin/order/${order._id}/validate-date`, { [field]: order[field] });
|
|
121
|
-
},
|
|
122
113
|
fetchPurchaseOrders(params) {
|
|
123
114
|
return _get(`admin/purchase-orders`, params);
|
|
124
115
|
},
|
|
@@ -224,13 +215,8 @@ export default {
|
|
|
224
215
|
removeCategory(id) {
|
|
225
216
|
return _delete(`admin/categories/${id}`);
|
|
226
217
|
},
|
|
227
|
-
dropPackagesCache() {
|
|
228
|
-
promiseCache.delete(CACHE.PACKAGES);
|
|
229
|
-
},
|
|
230
218
|
fetchPackages() {
|
|
231
|
-
|
|
232
|
-
promiseCache.set(CACHE.PACKAGES, promise);
|
|
233
|
-
return promise;
|
|
219
|
+
return _get('admin/packages');
|
|
234
220
|
},
|
|
235
221
|
fetchPackageById(id) {
|
|
236
222
|
return _get(`admin/packages/${id}`);
|
|
@@ -674,16 +660,8 @@ export default {
|
|
|
674
660
|
removePrintType(id) {
|
|
675
661
|
return _delete(`admin/print-types/${id}`);
|
|
676
662
|
},
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
},
|
|
680
|
-
fetchPrintAreas(params) {
|
|
681
|
-
if (params) {
|
|
682
|
-
return _get('admin/print-areas', params);
|
|
683
|
-
}
|
|
684
|
-
const promise = promiseCache.get(CACHE.PRINT_AREAS) || _get('admin/print-areas');
|
|
685
|
-
promiseCache.set(CACHE.PRINT_AREAS, promise);
|
|
686
|
-
return promise;
|
|
663
|
+
fetchPrintAreas() {
|
|
664
|
+
return _get('admin/print-areas');
|
|
687
665
|
},
|
|
688
666
|
fetchPrintAreaById(id) {
|
|
689
667
|
return _get(`admin/print-areas/${id}`);
|
|
@@ -694,8 +672,8 @@ export default {
|
|
|
694
672
|
removePrintArea(id) {
|
|
695
673
|
return _delete(`admin/print-areas/${id}`);
|
|
696
674
|
},
|
|
697
|
-
fetchPrintSizes(
|
|
698
|
-
return _get('admin/print-sizes'
|
|
675
|
+
fetchPrintSizes() {
|
|
676
|
+
return _get('admin/print-sizes');
|
|
699
677
|
},
|
|
700
678
|
fetchPrintSizeById(id) {
|
|
701
679
|
return _get(`admin/print-sizes/${id}`);
|
|
@@ -826,11 +804,7 @@ export default {
|
|
|
826
804
|
findResources(query) {
|
|
827
805
|
return _get(`admin/order/resources?search=${query || ''}`);
|
|
828
806
|
},
|
|
829
|
-
approveMockupRequest(order, resource) {
|
|
830
|
-
const shopId = order.shop?._id || order.shop;
|
|
831
|
-
return _post(`admin/shop/${shopId}/order/${order._id}/resources/${resource._id}/approve-request`, {});
|
|
832
|
-
},
|
|
833
807
|
getReOrderReport(params) {
|
|
834
|
-
return _get(
|
|
835
|
-
}
|
|
808
|
+
return _get(`admin/reports/re-order`, params);
|
|
809
|
+
},
|
|
836
810
|
};
|
package/assets/js/api/index.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
+
|
|
1
2
|
import { _get, _post, _put, _delete, _patch } from './helpers';
|
|
2
3
|
import adminApi from './admin';
|
|
3
4
|
import { unminifySimpleProducts } from './utils/simple-products';
|
|
4
5
|
import { unminifyProduct } from './utils/product';
|
|
5
|
-
import { getSharePromise } from './../utils/share-promises';
|
|
6
|
-
|
|
7
|
-
const shareRequestsPromises = getSharePromise(5 * 60 * 1000);
|
|
8
6
|
|
|
9
7
|
const api = {
|
|
10
|
-
clearAllSharePromises() {
|
|
11
|
-
return _post('clear-share-promises');
|
|
12
|
-
},
|
|
13
8
|
fetchClientSettings(shop, params) {
|
|
14
9
|
return _get(`shop/${shop}/client-settings`, params);
|
|
15
10
|
},
|
|
@@ -25,9 +20,6 @@ const api = {
|
|
|
25
20
|
saveCustomer(customer, shop) {
|
|
26
21
|
return customer._id ? _patch(`shop/${shop}/customer/${customer.accessToken}`, customer) : _post(`shop/${shop}/customer`, customer);
|
|
27
22
|
},
|
|
28
|
-
fetchCustomer(accessToken, shop) {
|
|
29
|
-
return _get(`shop/${shop}/customer/${accessToken}`);
|
|
30
|
-
},
|
|
31
23
|
authCustomer(customer, shop) {
|
|
32
24
|
return _post(`shop/${shop}/customer/login`, customer);
|
|
33
25
|
},
|
|
@@ -77,8 +69,7 @@ const api = {
|
|
|
77
69
|
return _get(`shop/${shop}/menus`);
|
|
78
70
|
},
|
|
79
71
|
fetchBanners(shop, params) {
|
|
80
|
-
|
|
81
|
-
return shareRequestsPromises.share(KEY, () => _get(`shop/${shop}/banners`, params));
|
|
72
|
+
return _get(`shop/${shop}/banners`, params);
|
|
82
73
|
},
|
|
83
74
|
fetchProductsKits(shop, params) {
|
|
84
75
|
return _get(`shop/${shop}/products-kit`, params);
|
|
@@ -93,8 +84,7 @@ const api = {
|
|
|
93
84
|
return _get(`shop/${shop}/news/${alias}?preview=${preview}`);
|
|
94
85
|
},
|
|
95
86
|
fetchNewsTags(shop, params) {
|
|
96
|
-
|
|
97
|
-
return shareRequestsPromises.share(KEY, () => _get(`shop/${shop}/news-tag`, params));
|
|
87
|
+
return _get(`shop/${shop}/news-tag`, params);
|
|
98
88
|
},
|
|
99
89
|
fetchNewsTag(shop, alias) {
|
|
100
90
|
return _get(`shop/${shop}/news-tag/${alias}`);
|
|
@@ -132,10 +122,6 @@ const api = {
|
|
|
132
122
|
addOrderTimeline(id, item) {
|
|
133
123
|
return _post(`order/${id}/timeline`, item);
|
|
134
124
|
},
|
|
135
|
-
approveOrderMockup(order, resource) {
|
|
136
|
-
const shopId = order.shop?._id || order.shop;
|
|
137
|
-
return _post(`shop/${shopId}/order/${order._id}/resources/${resource._id}/approve`, resource);
|
|
138
|
-
},
|
|
139
125
|
generateApprovalPDFs(token) {
|
|
140
126
|
return _post(`order/${token}/approval-pdfs`);
|
|
141
127
|
},
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
<div
|
|
75
75
|
v-else
|
|
76
76
|
class="lc_caption form-help is-danger">
|
|
77
|
-
Invalid coupon: Min Order for Coupon: {{ minOrderValue | price(currency) }}
|
|
77
|
+
Invalid coupon: Min Order for Coupon: {{ value.minOrderValue | price(currency) }}
|
|
78
78
|
</div>
|
|
79
79
|
<div v-if="hasQualifyingProducts" class="lc_caption mb-10">
|
|
80
80
|
<div v-if="noQualifyingProductsInCart">
|
|
@@ -129,18 +129,8 @@ export default {
|
|
|
129
129
|
hasQualifyingProductsInCart() {
|
|
130
130
|
return this.sumQualifyingProductsInCart > 0;
|
|
131
131
|
},
|
|
132
|
-
minOrderValue() {
|
|
133
|
-
const value = [
|
|
134
|
-
this.value,
|
|
135
|
-
...(this.value?.values || [])
|
|
136
|
-
]
|
|
137
|
-
.filter(v => v?.minOrderValue > 0)
|
|
138
|
-
.sort((a, b) => a.minOrderValue - b.minOrderValue)[0];
|
|
139
|
-
|
|
140
|
-
return value?.minOrderValue || 0;
|
|
141
|
-
},
|
|
142
132
|
isValidPricing() {
|
|
143
|
-
return !this.minOrderValue || this.pricing.coupon;
|
|
133
|
+
return !this.value?.minOrderValue || this.pricing.coupon;
|
|
144
134
|
},
|
|
145
135
|
model: {
|
|
146
136
|
get() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div
|
|
3
|
+
<div class="form-row">
|
|
4
4
|
<label
|
|
5
5
|
v-if="labelless"
|
|
6
|
-
|
|
6
|
+
class="form-label"
|
|
7
7
|
@click="$refs.phone.$el.focus()">
|
|
8
8
|
{{ displayLabelText }}
|
|
9
9
|
</label>
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
:disabled="disabled"
|
|
32
32
|
:name="'phone' + uniqueKey"
|
|
33
33
|
type="text"
|
|
34
|
+
class="form-field"
|
|
34
35
|
:class="{
|
|
35
|
-
[inputClassname]: true,
|
|
36
36
|
'is-danger': errors.length,
|
|
37
37
|
filled: model,
|
|
38
38
|
labelless
|
|
@@ -115,18 +115,6 @@ export default {
|
|
|
115
115
|
namePrefix: {
|
|
116
116
|
type: String,
|
|
117
117
|
default: ''
|
|
118
|
-
},
|
|
119
|
-
containerClassname: {
|
|
120
|
-
type: String,
|
|
121
|
-
default: 'form-row'
|
|
122
|
-
},
|
|
123
|
-
labelClassname: {
|
|
124
|
-
type: String,
|
|
125
|
-
default: 'form-label'
|
|
126
|
-
},
|
|
127
|
-
inputClassname: {
|
|
128
|
-
type: String,
|
|
129
|
-
default: 'form-field'
|
|
130
118
|
}
|
|
131
119
|
},
|
|
132
120
|
data() {
|
|
@@ -177,9 +177,7 @@ export default {
|
|
|
177
177
|
if (this.suburb) {
|
|
178
178
|
const option = this.createOptionFromSuburb(this.suburb);
|
|
179
179
|
this.selected = option;
|
|
180
|
-
|
|
181
|
-
await this.handleSearch(this.selected.value.trim());
|
|
182
|
-
}
|
|
180
|
+
await this.handleSearch(this.selected.value.trim())
|
|
183
181
|
}
|
|
184
182
|
},
|
|
185
183
|
methods: {
|
|
@@ -15,12 +15,6 @@
|
|
|
15
15
|
<script>
|
|
16
16
|
export default {
|
|
17
17
|
name: 'CustomerMenu',
|
|
18
|
-
props: {
|
|
19
|
-
activeMenuItem: {
|
|
20
|
-
type: String,
|
|
21
|
-
required: true
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
18
|
data() {
|
|
25
19
|
return {
|
|
26
20
|
menuItems: [{
|
|
@@ -35,12 +29,14 @@ export default {
|
|
|
35
29
|
label: 'Coupons',
|
|
36
30
|
key: 'coupons',
|
|
37
31
|
url: '/customer/coupons'
|
|
38
|
-
}, {
|
|
39
|
-
label: 'Preferences',
|
|
40
|
-
key: 'preferences',
|
|
41
|
-
url: '/customer/preferences'
|
|
42
32
|
}]
|
|
43
33
|
};
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
activeMenuItem: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
44
40
|
}
|
|
45
41
|
};
|
|
46
42
|
</script>
|
|
@@ -72,5 +68,5 @@ export default {
|
|
|
72
68
|
background-color: $green;
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
|
-
}
|
|
71
|
+
}
|
|
76
72
|
</style>
|
|
@@ -176,7 +176,6 @@ export default {
|
|
|
176
176
|
backgroundImageUrl: null,
|
|
177
177
|
backgroundImageLoaded: false,
|
|
178
178
|
deleteButtonPos: null,
|
|
179
|
-
offsetWarningVisible: false,
|
|
180
179
|
drawingInProcess: false,
|
|
181
180
|
breakpoints: new Breakpoints()
|
|
182
181
|
};
|
|
@@ -192,7 +191,10 @@ export default {
|
|
|
192
191
|
'selectedLayer',
|
|
193
192
|
'selectedLayerCopy',
|
|
194
193
|
'editorSize',
|
|
195
|
-
'editModeSelectedLayer'
|
|
194
|
+
'editModeSelectedLayer',
|
|
195
|
+
'offsetWarningVisible',
|
|
196
|
+
'showRecommendationToUseLargerImage',
|
|
197
|
+
'showErrorAboutSmallImage'
|
|
196
198
|
]),
|
|
197
199
|
editableLayersCount() {
|
|
198
200
|
return this.editableLayers?.length;
|
|
@@ -240,21 +242,6 @@ export default {
|
|
|
240
242
|
height: `${height * ratio}px`,
|
|
241
243
|
};
|
|
242
244
|
},
|
|
243
|
-
showRecommendationToUseLargerImage() {
|
|
244
|
-
return (
|
|
245
|
-
this.selectedLayer &&
|
|
246
|
-
this.selectedLayer.type === 'art' &&
|
|
247
|
-
this.selectedLayer.dpi >= 75 &&
|
|
248
|
-
this.selectedLayer.dpi <= 100
|
|
249
|
-
);
|
|
250
|
-
},
|
|
251
|
-
showErrorAboutSmallImage() {
|
|
252
|
-
return (
|
|
253
|
-
this.selectedLayer &&
|
|
254
|
-
this.selectedLayer.type === 'art' &&
|
|
255
|
-
this.selectedLayer.dpi < 75
|
|
256
|
-
);
|
|
257
|
-
},
|
|
258
245
|
printAreaIsSmall() {
|
|
259
246
|
const code = this.printAreaSize?.alias || this.printAreaSize;
|
|
260
247
|
return code === 'rect10';
|
|
@@ -315,7 +302,8 @@ export default {
|
|
|
315
302
|
'setSelectedLayerField',
|
|
316
303
|
'setEditModeSelectedLayer',
|
|
317
304
|
'setSelectedLayer',
|
|
318
|
-
'removeTemplateLayer'
|
|
305
|
+
'removeTemplateLayer',
|
|
306
|
+
'setOffsetWarningVisible'
|
|
319
307
|
]),
|
|
320
308
|
...mapMutations('layers', [
|
|
321
309
|
'setLayersThumbnail'
|
|
@@ -480,7 +468,7 @@ export default {
|
|
|
480
468
|
this.deleteButtonPos = pos;
|
|
481
469
|
},
|
|
482
470
|
setOffsetWarningVisibility(visible) {
|
|
483
|
-
this.
|
|
471
|
+
this.setOffsetWarningVisible(visible);
|
|
484
472
|
},
|
|
485
473
|
toogleBoundBox(state, option) {
|
|
486
474
|
if (!this.fabricHelper || ['mini', 'xs'].includes(this.breakpoints.is)) {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
v-else-if="isValidOrderQuantity"
|
|
65
65
|
class="EditorPricing__main-alert">
|
|
66
66
|
<img src="~static/images/smile.svg" />
|
|
67
|
-
All good to go!
|
|
67
|
+
{{ hasPrintIssues ? 'Proceed with order, Will be in touch regarding print issue' : 'All good to go!' }}
|
|
68
68
|
</div>
|
|
69
69
|
|
|
70
70
|
<div
|
|
@@ -108,7 +108,6 @@ import addToCartMixin from '@lancom/shared/mixins/add-to-cart';
|
|
|
108
108
|
|
|
109
109
|
export default {
|
|
110
110
|
name: 'EditorPricing',
|
|
111
|
-
mixins: [addToCartMixin],
|
|
112
111
|
filters: {
|
|
113
112
|
price,
|
|
114
113
|
tax,
|
|
@@ -119,13 +118,7 @@ export default {
|
|
|
119
118
|
EditorPricingDetails,
|
|
120
119
|
AddToCartBtn
|
|
121
120
|
},
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
price: null,
|
|
125
|
-
showDetails: false,
|
|
126
|
-
calculatePriceWithDebounce: debounce(() => this.calculateProductPrice({ shop: this.shop, country: this.country, currency: this.currency }), 500)
|
|
127
|
-
};
|
|
128
|
-
},
|
|
121
|
+
mixins: [addToCartMixin],
|
|
129
122
|
props: {
|
|
130
123
|
hasCartBtn: {
|
|
131
124
|
type: Boolean,
|
|
@@ -136,6 +129,13 @@ export default {
|
|
|
136
129
|
default: true
|
|
137
130
|
}
|
|
138
131
|
},
|
|
132
|
+
data() {
|
|
133
|
+
return {
|
|
134
|
+
price: null,
|
|
135
|
+
showDetails: false,
|
|
136
|
+
calculatePriceWithDebounce: debounce(() => this.calculateProductPrice({ shop: this.shop, country: this.country, currency: this.currency }), 500)
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
139
|
computed: {
|
|
140
140
|
...mapGetters(['shop', 'country', 'currency']),
|
|
141
141
|
...mapGetters('product', [
|
|
@@ -149,8 +149,14 @@ export default {
|
|
|
149
149
|
'isPrintPricing',
|
|
150
150
|
'minimumOrderQuantity',
|
|
151
151
|
'priceIncludeGST',
|
|
152
|
-
'multipack'
|
|
152
|
+
'multipack',
|
|
153
|
+
'offsetWarningVisible',
|
|
154
|
+
'showRecommendationToUseLargerImage',
|
|
155
|
+
'showErrorAboutSmallImage'
|
|
153
156
|
]),
|
|
157
|
+
hasPrintIssues() {
|
|
158
|
+
return this.offsetWarningVisible || this.showRecommendationToUseLargerImage || this.showErrorAboutSmallImage;
|
|
159
|
+
},
|
|
154
160
|
hasUsedSimpleProducts() {
|
|
155
161
|
return this.usedSimpleProducts.length > 0;
|
|
156
162
|
},
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
<section class="Product__section">
|
|
33
33
|
<wizard-editor />
|
|
34
34
|
</section>
|
|
35
|
+
<!-- <section class="Product__section">
|
|
36
|
+
<product-colors-selector v-if="productDetails" />
|
|
37
|
+
</section> -->
|
|
38
|
+
<!-- <section class="Product__section">
|
|
39
|
+
<product-tier-prices :product="product" />
|
|
40
|
+
</section> -->
|
|
35
41
|
<section class="Product__section">
|
|
36
42
|
<product-fabric-and-size-info :product="product" />
|
|
37
43
|
</section>
|
|
@@ -53,17 +59,23 @@ import RelatedProducts from '@lancom/shared/components/product/related_products/
|
|
|
53
59
|
import Gallery from '@lancom/shared/components/product/gallery/gallery';
|
|
54
60
|
import { generateProductLink } from '@lancom/shared/assets/js/utils/product';
|
|
55
61
|
import ProductMainInfo from './layouts/product_main_info/product-main-info';
|
|
62
|
+
import ProductColorsSelector from './product_colors_selector/product-colors-selector';
|
|
63
|
+
import ProductTierPrices from './layouts/product_tier_prices/product-tier-prices';
|
|
56
64
|
import ProductFabricAndSizeInfo from './layouts/product_fabric_and_size_info/product-fabric-and-size-info';
|
|
57
65
|
import ProductPackaging from './layouts/product_packaging/product-packaging';
|
|
58
66
|
import ProductModelMeasurements from './layouts/product_model_measurements/product-model-measurements';
|
|
59
67
|
import ProductSizeTable from './layouts/product_size_table/product-size-table';
|
|
60
68
|
import WizardEditor from './wizard-editor/wizard-editor.vue';
|
|
61
69
|
|
|
70
|
+
|
|
71
|
+
// import ProductLabelsCustomization from './layouts/product_labels_customization/product-labels-customization';
|
|
62
72
|
|
|
63
73
|
export default {
|
|
64
74
|
name: 'Product',
|
|
65
75
|
components: {
|
|
66
76
|
ProductMainInfo,
|
|
77
|
+
ProductColorsSelector,
|
|
78
|
+
ProductTierPrices,
|
|
67
79
|
ProductFabricAndSizeInfo,
|
|
68
80
|
ProductPackaging,
|
|
69
81
|
ProductModelMeasurements,
|
|
@@ -41,12 +41,6 @@ export default {
|
|
|
41
41
|
ProductReview
|
|
42
42
|
},
|
|
43
43
|
mixins: [],
|
|
44
|
-
props: {
|
|
45
|
-
product: {
|
|
46
|
-
type: Object,
|
|
47
|
-
required: true
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
44
|
data() {
|
|
51
45
|
const reviews = this.product.reviews || [];
|
|
52
46
|
const [, mainReviewId] = (this.$route.hash || '').match(/review-([a-z0-9]+)/i) || [];
|
|
@@ -62,6 +56,12 @@ export default {
|
|
|
62
56
|
].filter(review => !!review)
|
|
63
57
|
};
|
|
64
58
|
},
|
|
59
|
+
props: {
|
|
60
|
+
product: {
|
|
61
|
+
type: Object,
|
|
62
|
+
required: true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
65
|
computed: {
|
|
66
66
|
currentReview() {
|
|
67
67
|
return this.reviews[this.activeIndex];
|
|
@@ -36,15 +36,15 @@ export default {
|
|
|
36
36
|
products: []
|
|
37
37
|
};
|
|
38
38
|
},
|
|
39
|
-
async fetch() {
|
|
40
|
-
const { products } = await api.fetchRelatedProducts(this.shop._id, this.product.alias, { needShuffle: true });
|
|
41
|
-
this.products = products.splice(0, 6);
|
|
42
|
-
},
|
|
43
39
|
computed: {
|
|
44
40
|
...mapGetters(['shop']),
|
|
45
41
|
hasProducts() {
|
|
46
42
|
return this.products.length > 0;
|
|
47
43
|
}
|
|
44
|
+
},
|
|
45
|
+
async fetch() {
|
|
46
|
+
const { products } = await api.fetchRelatedProducts(this.shop._id, this.product.alias, { needShuffle: true });
|
|
47
|
+
this.products = products.splice(0, 6);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
</script>
|
package/package.json
CHANGED
package/routes/index.js
CHANGED
|
@@ -87,11 +87,6 @@ module.exports = function(routes, resolve, config) {
|
|
|
87
87
|
path: '/order/:token/payment',
|
|
88
88
|
component: resolve('@lancom/shared/pages/order/_token/payment/index.vue'),
|
|
89
89
|
chunkName: 'pages/order/payment'
|
|
90
|
-
}, {
|
|
91
|
-
name: 'order-resource',
|
|
92
|
-
path: '/order/:token/resource/:resource',
|
|
93
|
-
component: resolve('@lancom/shared/pages/order/_token/resource/_resource.vue'),
|
|
94
|
-
chunkName: 'pages/order/resource'
|
|
95
90
|
}, {
|
|
96
91
|
name: 'order-payment-invoice',
|
|
97
92
|
path: '/order/:token/payment/invoice/:invoice',
|
|
@@ -147,11 +142,6 @@ module.exports = function(routes, resolve, config) {
|
|
|
147
142
|
path: '/customer/password/:token',
|
|
148
143
|
component: resolve('@lancom/shared/pages/customer/password/_token.vue'),
|
|
149
144
|
chunkName: 'pages/customer/password/reset'
|
|
150
|
-
}, {
|
|
151
|
-
name: 'customer-preferences',
|
|
152
|
-
path: '/customer/preferences',
|
|
153
|
-
component: resolve('@lancom/shared/pages/customer/preferences.vue'),
|
|
154
|
-
chunkName: 'pages/customer/preferences'
|
|
155
145
|
}, {
|
|
156
146
|
name: 'checkout-cart',
|
|
157
147
|
path: '/checkout/cart',
|
package/store/auth.js
CHANGED
|
@@ -18,7 +18,6 @@ export const getters = {
|
|
|
18
18
|
isGuestUser: state => !state.token,
|
|
19
19
|
isAdmin: state => checkRoles(state.user, ['admin']),
|
|
20
20
|
isContentEditor: state => checkRoles(state.user, ['admin', 'content-editor']),
|
|
21
|
-
isDesigner: state => checkRoles(state.user, ['admin', 'designer']),
|
|
22
21
|
isWarehouse: state => checkRoles(state.user, ['admin', 'warehouse']),
|
|
23
22
|
user: state => state.user,
|
|
24
23
|
userWarehouse: state => state.user?.warehouse,
|
package/store/index.js
CHANGED
|
@@ -4,13 +4,9 @@ import { getAuthToken } from '@lancom/shared/assets/js/utils/auth';
|
|
|
4
4
|
import { getShopCountrySettings } from '@lancom/shared/assets/js/utils/shop';
|
|
5
5
|
import { MESSAGES, COUNTRIES_MESSAGES } from '@/messages';
|
|
6
6
|
import { SETTINGS, COUNTRIES_SETTINGS } from '@/settings';
|
|
7
|
-
import { getSharePromise, clearAllSharePromises } from '@lancom/shared/assets/js/utils/share-promises';
|
|
8
|
-
|
|
9
7
|
const cookieparser = process.server ? require('cookieparser') : undefined;
|
|
10
8
|
const CLOSED_NOTIFICATION = 'lancom-closed-notification-1.0';
|
|
11
9
|
|
|
12
|
-
const shareShopInfo = getSharePromise(60 * 1000);
|
|
13
|
-
|
|
14
10
|
export const state = () => ({
|
|
15
11
|
googleClickId: null,
|
|
16
12
|
stockCountry: null,
|
|
@@ -73,14 +69,9 @@ export const actions = {
|
|
|
73
69
|
await commit('setShop', shop);
|
|
74
70
|
}
|
|
75
71
|
},
|
|
76
|
-
async nuxtServerInit({ commit }, { req
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
await api.clearAllSharePromises();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const shop = await shareShopInfo.share(process.env.HOST_NAME, () => api.fetchShopByUrl(process.env.HOST_NAME));
|
|
83
|
-
const menus = await shareShopInfo.share(`menus_${shop._id}`, () => api.fetchMenus(shop._id));
|
|
72
|
+
async nuxtServerInit({ commit }, { req }) {
|
|
73
|
+
const shop = await api.fetchShopByUrl(process.env.HOST_NAME);
|
|
74
|
+
const menus = await api.fetchMenus(shop._id);
|
|
84
75
|
commit('setMenus', menus);
|
|
85
76
|
commit('setShop', shop);
|
|
86
77
|
// if (req.headers.cookie) {
|
package/store/product.js
CHANGED
|
@@ -45,6 +45,7 @@ export const state = () => ({
|
|
|
45
45
|
selectedPrintUnderbases: {},
|
|
46
46
|
selectedPrintUnderbase: false,
|
|
47
47
|
editModeSelectedLayer: false,
|
|
48
|
+
offsetWarningVisible: false,
|
|
48
49
|
selectedPrintAreas: {},
|
|
49
50
|
productPricing: null,
|
|
50
51
|
selectedTab: null,
|
|
@@ -77,7 +78,7 @@ export const getters = {
|
|
|
77
78
|
usedBigSizeSimpleProductsQuantity: (state, { usedSimpleProducts }) => filterBigSize(usedSimpleProducts).reduce((sum, { amount }) => sum + amount, 0),
|
|
78
79
|
defaultSimpleProduct: ({ productDetails, editableColor }) => {
|
|
79
80
|
return editableColor && (
|
|
80
|
-
productDetails.simpleProducts.find(({ color, size }) => color._id === editableColor._id && size
|
|
81
|
+
productDetails.simpleProducts.find(({ color, size }) => color._id === editableColor._id && size.alias === 'small')
|
|
81
82
|
|| productDetails.simpleProducts.find(({ color }) => color._id === editableColor._id)
|
|
82
83
|
);
|
|
83
84
|
},
|
|
@@ -162,6 +163,22 @@ export const getters = {
|
|
|
162
163
|
const price = pricing?.prints?.prints?.reduce((sum , print) => sum + (+print.priceWithoutTax || 0), 0) || maxPrintsPrice;
|
|
163
164
|
return price;
|
|
164
165
|
},
|
|
166
|
+
offsetWarningVisible: ({ offsetWarningVisible }) => offsetWarningVisible,
|
|
167
|
+
showRecommendationToUseLargerImage: ({ selectedLayer }) => {
|
|
168
|
+
return (
|
|
169
|
+
selectedLayer &&
|
|
170
|
+
selectedLayer.type === 'art' &&
|
|
171
|
+
selectedLayer.dpi >= 75 &&
|
|
172
|
+
selectedLayer.dpi <= 100
|
|
173
|
+
);
|
|
174
|
+
},
|
|
175
|
+
showErrorAboutSmallImage: ({ selectedLayer }) => {
|
|
176
|
+
return (
|
|
177
|
+
selectedLayer &&
|
|
178
|
+
selectedLayer.type === 'art' &&
|
|
179
|
+
selectedLayer.dpi < 75
|
|
180
|
+
);
|
|
181
|
+
}
|
|
165
182
|
};
|
|
166
183
|
|
|
167
184
|
export const actions = {
|
|
@@ -319,6 +336,9 @@ export const mutations = {
|
|
|
319
336
|
setPriceIncludeGST(state, priceIncludeGST) {
|
|
320
337
|
state.priceIncludeGST = priceIncludeGST;
|
|
321
338
|
},
|
|
339
|
+
setOffsetWarningVisible(state, offsetWarningVisible) {
|
|
340
|
+
state.offsetWarningVisible = offsetWarningVisible;
|
|
341
|
+
},
|
|
322
342
|
setLoadError(state, error) {
|
|
323
343
|
state.loadError = error;
|
|
324
344
|
},
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const MAX_PROMISES_COUNT = 1000;
|
|
2
|
-
const DEFAULT_SHARE_LIFETIME = 10 * 1000;
|
|
3
|
-
|
|
4
|
-
export class SharePromises {
|
|
5
|
-
constructor(clearSharesTimeoutDelay) {
|
|
6
|
-
this.promises = new Map();
|
|
7
|
-
this.clearSharesTimeout = null;
|
|
8
|
-
this.clearSharesTimeoutDelay = clearSharesTimeoutDelay || DEFAULT_SHARE_LIFETIME;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
startClearTimeout(key) {
|
|
12
|
-
const promise = this.promises.get(key);
|
|
13
|
-
if (promise) {
|
|
14
|
-
clearTimeout(promise.timeout);
|
|
15
|
-
promise.timeout = setTimeout(() => {
|
|
16
|
-
this.promises.delete(key);
|
|
17
|
-
}, this.clearSharesTimeoutDelay);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
share(keyObj, promiseFactory) {
|
|
22
|
-
const key = `${keyObj}`;
|
|
23
|
-
let promise = this.promises.get(key);
|
|
24
|
-
if (!promise) {
|
|
25
|
-
this.checkMaxPromisesCount();
|
|
26
|
-
|
|
27
|
-
promise = {
|
|
28
|
-
promise: promiseFactory(),
|
|
29
|
-
timeout: null
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
this.promises.set(key, promise);
|
|
33
|
-
|
|
34
|
-
this.startClearTimeout(key);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
promise.promise = promise.promise.then((result) => result);
|
|
38
|
-
|
|
39
|
-
return promise.promise;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
checkMaxPromisesCount() {
|
|
43
|
-
if (this.promises.size >= MAX_PROMISES_COUNT) {
|
|
44
|
-
this.clear();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
clear() {
|
|
49
|
-
this.promises.forEach(promise => {
|
|
50
|
-
clearTimeout(promise.timeout);
|
|
51
|
-
});
|
|
52
|
-
this.promises.clear();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
clearPromise(keyObj) {
|
|
56
|
-
const key = `${keyObj}`;
|
|
57
|
-
let promise = this.promises.get(key);
|
|
58
|
-
if (promise) {
|
|
59
|
-
clearTimeout(promise.timeout);
|
|
60
|
-
this.promises.delete(key);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const allSharePromises = [];
|
|
66
|
-
export function getSharePromise(timeout) {
|
|
67
|
-
const sharePromise = new SharePromises(timeout);
|
|
68
|
-
allSharePromises.push(sharePromise);
|
|
69
|
-
return sharePromise;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function clearAllSharePromises() {
|
|
73
|
-
for (const sharePromise of allSharePromises) {
|
|
74
|
-
sharePromise.clear();
|
|
75
|
-
}
|
|
76
|
-
}
|