@lancom/shared 0.0.432 → 0.0.433
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/index.js +1 -1
- package/components/checkout/cart/cart.vue +1 -3
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.mixin.js +3 -1
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.scss +14 -2
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.vue +13 -2
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.scss +2 -2
- package/components/checkout/cart/cart_shipping/cart-shipping.vue +1 -1
- package/components/checkout/order/order-payment-information/order-payment-information.vue +10 -2
- package/components/customer/customer.vue +13 -17
- package/components/customer/customer_form/customer-form.vue +7 -2
- package/components/editor/editor_colors/editor-colors.scss +6 -3
- package/components/editor/editor_colors/editor-colors.vue +1 -1
- package/components/editor/editor_layers/editor-layers.scss +40 -1
- package/components/editor/editor_layers/editor-layers.vue +112 -67
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.scss +19 -1
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +114 -21
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.scss +15 -1
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +20 -3
- package/components/editor/editor_workspace/editor-workspace.vue +17 -6
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +25 -20
- package/components/product/editor_pricing/editor-pricing.scss +2 -1
- package/components/product/other_products/other_product/other-product.scss +9 -0
- package/components/product/other_products/other_product/other-product.vue +21 -12
- package/components/product/product_check_delivery/product-check-delivery.scss +115 -0
- package/components/product/product_check_delivery/product-check-delivery.vue +135 -30
- package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +4 -47
- package/components/product/product_pricing_tiers/product-pricing-tiers.scss +2 -0
- package/components/product/product_pricing_tiers/product-pricing-tiers.vue +25 -6
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.scss +6 -1
- package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +9 -6
- package/components/products/children_categories/children-categories.vue +14 -7
- package/components/products/products_aside/products-aside.vue +14 -2
- package/components/static_page/static-page.scss +15 -1
- package/components/static_page/static-page.vue +7 -0
- package/mixins/layouts/products.js +3 -2
- package/mixins/multipack.mixin.js +61 -0
- package/package.json +1 -1
- package/plugins/headers.js +1 -0
- package/plugins/save-state.js +6 -2
- package/static/images/empty-layers.png +0 -0
- package/store/cart.js +20 -3
- package/store/index.js +1 -1
- package/store/product.js +2 -2
package/assets/js/api/index.js
CHANGED
|
@@ -42,7 +42,7 @@ const api = {
|
|
|
42
42
|
return _get(`shop/${shop}/customer/${customer._id}/coupons`);
|
|
43
43
|
},
|
|
44
44
|
fetchChildrenCategories(category, params) {
|
|
45
|
-
return _get(`category/${category}/children`, params);
|
|
45
|
+
return _get(`category/${category || 'null'}/children`, params);
|
|
46
46
|
},
|
|
47
47
|
searchProducts(shop, text, save) {
|
|
48
48
|
return _get(`shop/${shop}/products/search`, { text, save });
|
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
@suburb="handleSuburbChange" />
|
|
32
32
|
<cart-price-info @loaded="loadedPricing($event)" />
|
|
33
33
|
</div>
|
|
34
|
-
<div class="Cart__postcode-container">
|
|
35
|
-
|
|
36
|
-
</div>
|
|
34
|
+
<div class="Cart__postcode-container"></div>
|
|
37
35
|
<div class="Cart__coupon-container">
|
|
38
36
|
<coupon-select
|
|
39
37
|
v-model="cartCoupon"
|
|
@@ -33,7 +33,9 @@ export default {
|
|
|
33
33
|
computed: {
|
|
34
34
|
...mapGetters('cart', [
|
|
35
35
|
'cartPricing',
|
|
36
|
-
'cartProductsPricing'
|
|
36
|
+
'cartProductsPricing',
|
|
37
|
+
'cartPricingCalculating',
|
|
38
|
+
'cartSaving'
|
|
37
39
|
]),
|
|
38
40
|
images() {
|
|
39
41
|
return getProductColorImages(this.group, this.group.color);
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
.CartEntityColorSimpleProducts {
|
|
4
4
|
&__wrapper {
|
|
5
5
|
display: flex;
|
|
6
|
-
position: relative;
|
|
6
|
+
position: relative;
|
|
7
7
|
@media (max-width: $bp-extra-small-max) {
|
|
8
|
-
flex-direction: column;
|
|
8
|
+
flex-direction: column;
|
|
9
9
|
align-items: center;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -98,4 +98,16 @@
|
|
|
98
98
|
font-size: 20px;
|
|
99
99
|
cursor: pointer;
|
|
100
100
|
}
|
|
101
|
+
&__overlay {
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
right: 0;
|
|
106
|
+
bottom: 0;
|
|
107
|
+
background: rgba(255, 255, 255, 0.8);
|
|
108
|
+
z-index: 99;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
}
|
|
101
113
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="CartEntityColorSimpleProducts__wrapper">
|
|
3
|
+
<div
|
|
4
|
+
v-if="isLoading"
|
|
5
|
+
class="CartEntityColorSimpleProducts__overlay">
|
|
6
|
+
<spinner />
|
|
7
|
+
</div>
|
|
3
8
|
<div class="CartEntityColorSimpleProducts__image-wrapper">
|
|
4
9
|
<div
|
|
5
10
|
class="CartEntityColorSimpleProducts__image"
|
|
@@ -52,7 +57,6 @@
|
|
|
52
57
|
class="lc_title-small mt-8">
|
|
53
58
|
|
|
54
59
|
</div>
|
|
55
|
-
|
|
56
60
|
</div>
|
|
57
61
|
<cart-entity-color-simple-product
|
|
58
62
|
v-for="simpleProduct in group.simpleProducts"
|
|
@@ -97,6 +101,7 @@
|
|
|
97
101
|
<script>
|
|
98
102
|
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
99
103
|
import ProductSideWithPrint from '@lancom/shared/components/common/product_side_with_print/product-side-with-print';
|
|
104
|
+
import Spinner from '@lancom/shared/components/common/spinner';
|
|
100
105
|
import CartEntityColorSimpleProduct from './cart_entity_color_simple_product/cart-entity-color-simple-product';
|
|
101
106
|
import CartEntityColorSimpleProducts from './cart-entity-color-simple-products.mixin';
|
|
102
107
|
|
|
@@ -107,11 +112,17 @@ export default {
|
|
|
107
112
|
},
|
|
108
113
|
components: {
|
|
109
114
|
CartEntityColorSimpleProduct,
|
|
110
|
-
ProductSideWithPrint
|
|
115
|
+
ProductSideWithPrint,
|
|
116
|
+
Spinner
|
|
111
117
|
},
|
|
112
118
|
mixins: [
|
|
113
119
|
CartEntityColorSimpleProducts
|
|
114
120
|
],
|
|
121
|
+
computed: {
|
|
122
|
+
isLoading() {
|
|
123
|
+
return this.cartPricingCalculating || this.cartSaving;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
115
126
|
methods: {
|
|
116
127
|
onChangeQty() {}
|
|
117
128
|
}
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
88
88
|
return this.MESSAGES.CART_POSTCODE_INFO || 'Enter postcode to calculate shipping';
|
|
89
89
|
},
|
|
90
90
|
onlyPostcode() {
|
|
91
|
-
return !!this.SETTINGS.CART_ONLY_POSTCODE && this.country?.isoCode === '
|
|
91
|
+
return !!this.SETTINGS.CART_ONLY_POSTCODE && this.country?.isoCode === 'GB';
|
|
92
92
|
},
|
|
93
93
|
postcodeLabel() {
|
|
94
94
|
return this.onlyPostcode ? 'Postcode' : (this.MESSAGES.CART_POSTCODE || 'Postcode');
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
</span>
|
|
36
36
|
</label>
|
|
37
37
|
<label
|
|
38
|
+
v-if="availableApplePayment"
|
|
38
39
|
class="form-label OrderPaymentInformation__checkbox"
|
|
39
40
|
@click="updatePaymentType('apple')">
|
|
40
41
|
<checked-icon :checked="paymentMethod === 'apple'" />
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
</span>
|
|
44
45
|
</label>
|
|
45
46
|
<label
|
|
47
|
+
v-if="availablePaypalPayment"
|
|
46
48
|
class="form-label OrderPaymentInformation__checkbox"
|
|
47
49
|
@click="updatePaymentType('paypal')">
|
|
48
50
|
<checked-icon :checked="paymentMethod === 'paypal'" />
|
|
@@ -143,11 +145,17 @@ export default {
|
|
|
143
145
|
},
|
|
144
146
|
computed: {
|
|
145
147
|
...mapGetters('auth', ['user']),
|
|
146
|
-
...mapGetters(['MESSAGES']),
|
|
148
|
+
...mapGetters(['MESSAGES', 'SETTINGS']),
|
|
147
149
|
...mapGetters(['country', 'currency', 'app', 'googleClickId']),
|
|
148
150
|
...mapGetters(['orderSettings']),
|
|
149
151
|
...mapGetters('order', ['card']),
|
|
150
|
-
...mapGetters('cart', ['entities', 'notEmptySimpleProducts', 'cartPricing'])
|
|
152
|
+
...mapGetters('cart', ['entities', 'notEmptySimpleProducts', 'cartPricing']),
|
|
153
|
+
availableApplePayment() {
|
|
154
|
+
return !this.SETTINGS?.HIDDEN_APPLE_PAYMENT
|
|
155
|
+
},
|
|
156
|
+
availablePaypalPayment() {
|
|
157
|
+
return !this.SETTINGS?.HIDDEN_PAYPAL_PAYMENT
|
|
158
|
+
}
|
|
151
159
|
},
|
|
152
160
|
watch: {
|
|
153
161
|
isDepositPayment() {
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="CustomerPage__wrapper">
|
|
3
3
|
<div class="row">
|
|
4
|
-
<div class="col-12">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
:btn-block="true"
|
|
18
|
-
@onclick="isRegister = true" />
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
4
|
+
<div class="col-sm-6 col-12">
|
|
5
|
+
<btn
|
|
6
|
+
:btn-class="isRegister ? 'white' : 'green'"
|
|
7
|
+
btn-label="LOG IN"
|
|
8
|
+
:btn-block="true"
|
|
9
|
+
@onclick="isRegister = false" />
|
|
10
|
+
</div>
|
|
11
|
+
<div class="col-sm-6 col-12">
|
|
12
|
+
<btn
|
|
13
|
+
:btn-class="isRegister ? 'green' : 'white'"
|
|
14
|
+
btn-label="REGISTER"
|
|
15
|
+
:btn-block="true"
|
|
16
|
+
@onclick="isRegister = true" />
|
|
21
17
|
</div>
|
|
22
18
|
</div>
|
|
23
19
|
<div class="row">
|
|
@@ -172,8 +172,10 @@
|
|
|
172
172
|
<div class="col-12">
|
|
173
173
|
<postcode-select
|
|
174
174
|
:suburb="customer.suburb"
|
|
175
|
+
:only-postcode="onlyPostcode"
|
|
175
176
|
:labelless="true"
|
|
176
|
-
|
|
177
|
+
:label-text="onlyPostcode ? 'Postcode' : 'Address'"
|
|
178
|
+
:placeholder="onlyPostcode ? 'Postcode' : 'Suburb'"
|
|
177
179
|
@select="handleSuburbChange">
|
|
178
180
|
</postcode-select>
|
|
179
181
|
<div class="form-row">
|
|
@@ -232,7 +234,10 @@ export default {
|
|
|
232
234
|
};
|
|
233
235
|
},
|
|
234
236
|
computed: {
|
|
235
|
-
...mapGetters(['shop'])
|
|
237
|
+
...mapGetters(['shop', 'SETTINGS', 'country']),
|
|
238
|
+
onlyPostcode() {
|
|
239
|
+
return !!this.SETTINGS.CART_ONLY_POSTCODE && this.country?.isoCode === 'GB';
|
|
240
|
+
}
|
|
236
241
|
},
|
|
237
242
|
methods: {
|
|
238
243
|
async submit() {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
&__color {
|
|
16
16
|
width: 114px;
|
|
17
|
-
height: 142px;
|
|
17
|
+
min-height: 142px;
|
|
18
18
|
border-radius: 12px;
|
|
19
19
|
border: #EFEFEF;
|
|
20
20
|
background: #EFEFEF;
|
|
@@ -26,15 +26,18 @@
|
|
|
26
26
|
margin: 0px;
|
|
27
27
|
border-radius: 12px;
|
|
28
28
|
overflow: hidden;
|
|
29
|
+
background: #fff;
|
|
29
30
|
}
|
|
30
31
|
&-name {
|
|
31
32
|
display: flex;
|
|
32
33
|
padding: 4px 10px;
|
|
33
34
|
text-align: center;
|
|
34
35
|
overflow: hidden;
|
|
35
|
-
white-space: nowrap;
|
|
36
|
-
text-overflow: ellipsis;
|
|
37
36
|
margin-top: 2px;
|
|
37
|
+
color: #000;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
font-weight: 300;
|
|
40
|
+
line-height: 20px;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
&__divider {
|
|
@@ -24,6 +24,45 @@
|
|
|
24
24
|
&__pricing {
|
|
25
25
|
margin-top: 30px;
|
|
26
26
|
}
|
|
27
|
+
&__list {
|
|
28
|
+
&--placeholder {
|
|
29
|
+
height: 350px;
|
|
30
|
+
background-image: url(~/static/images/empty-layers.png);
|
|
31
|
+
background-repeat: no-repeat;
|
|
32
|
+
background-position: center;
|
|
33
|
+
background-size: 374px 98px;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
&__empty {
|
|
40
|
+
width: 306px;
|
|
41
|
+
margin-top: 175px;
|
|
42
|
+
&-header {
|
|
43
|
+
color: #18181B;
|
|
44
|
+
text-align: center;
|
|
45
|
+
font-size: 16px;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
line-height: 22px;
|
|
48
|
+
}
|
|
49
|
+
&-description {
|
|
50
|
+
color: #71717A;
|
|
51
|
+
text-align: center;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
font-weight: 300;
|
|
54
|
+
line-height: 20px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
&__workspace {
|
|
58
|
+
height: 700px;
|
|
59
|
+
position: relative;
|
|
60
|
+
::v-deep {
|
|
61
|
+
.tabs--primary {
|
|
62
|
+
display: none !important;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
27
66
|
}
|
|
28
67
|
.EditorLayersGroup {
|
|
29
68
|
&__wrapper {
|
|
@@ -42,4 +81,4 @@
|
|
|
42
81
|
transform: rotateZ(-90deg);
|
|
43
82
|
}
|
|
44
83
|
}
|
|
45
|
-
}
|
|
84
|
+
}
|
|
@@ -3,79 +3,105 @@
|
|
|
3
3
|
<transition
|
|
4
4
|
name="fade"
|
|
5
5
|
mode="out-in">
|
|
6
|
-
<div
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
<div
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
<div>
|
|
7
|
+
<div
|
|
8
|
+
v-if="editModeSelectedLayer"
|
|
9
|
+
key="edit"
|
|
10
|
+
ignore-document-click
|
|
11
|
+
class="EditorLayers__edit-layer-container view-transition">
|
|
12
|
+
<component
|
|
13
|
+
:is="editableLayerType"
|
|
14
|
+
:layer="selectedLayer"
|
|
15
|
+
@set-layer-field="setLayerField">
|
|
16
|
+
<template #header="{ invalid }">
|
|
17
|
+
<div class="EditorLayers__close-wrapper">
|
|
18
|
+
<div
|
|
19
|
+
class="lc_regular16 EditorLayers__close-editable"
|
|
20
|
+
@click="closeEditableLayer(invalid)">
|
|
21
|
+
<i class="icon-arrow-left EditorLayers__close-editable-icon"></i>
|
|
22
|
+
See all design layers
|
|
23
|
+
</div>
|
|
24
|
+
<div>
|
|
25
|
+
<btn
|
|
26
|
+
btn-class="green"
|
|
27
|
+
btn-label="Save"
|
|
28
|
+
@onclick="closeEditableLayer(invalid)" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
<template #after-canvas="{ invalid }">
|
|
33
|
+
<editor-print-area-options
|
|
34
|
+
v-if="selectedLayer"
|
|
35
|
+
:selected="selectedLayerPrintArea"
|
|
36
|
+
:side="selectedLayer.sideId"
|
|
37
|
+
:product="product"
|
|
38
|
+
:layers="editableLayers"
|
|
39
|
+
@select="handlePrintAreaSelect" />
|
|
40
|
+
</template>
|
|
41
|
+
</component>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
v-else
|
|
45
|
+
key="list"
|
|
46
|
+
ignore-document-click
|
|
47
|
+
class="EditorLayers__list-wrapper">
|
|
48
|
+
<editor-layers-toolbar
|
|
49
|
+
:disabled-templates="disabledTemplates"
|
|
50
|
+
@layer-added="handleLayerAdded">
|
|
51
|
+
</editor-layers-toolbar>
|
|
52
|
+
<div
|
|
53
|
+
v-if="editableLayersGroups.length === 0"
|
|
54
|
+
class="EditorLayers__list EditorLayers__list--placeholder">
|
|
55
|
+
<div class="EditorLayers__empty">
|
|
56
|
+
<div class="EditorLayers__empty-header">
|
|
57
|
+
No layers yet
|
|
22
58
|
</div>
|
|
23
|
-
<div>
|
|
24
|
-
|
|
25
|
-
btn-class="green"
|
|
26
|
-
btn-label="Save"
|
|
27
|
-
@onclick="closeEditableLayer(invalid)" />
|
|
59
|
+
<div class="EditorLayers__empty-description">
|
|
60
|
+
Start building your design by adding text or artwork. Your layers will appear here.
|
|
28
61
|
</div>
|
|
29
62
|
</div>
|
|
30
|
-
</
|
|
31
|
-
</component>
|
|
32
|
-
</div>
|
|
33
|
-
<div
|
|
34
|
-
v-else
|
|
35
|
-
key="list"
|
|
36
|
-
ignore-document-click
|
|
37
|
-
class="EditorLayers__list-wrapper view-transition">
|
|
38
|
-
<editor-layers-toolbar
|
|
39
|
-
@layer-added="handleLayerAdded">
|
|
40
|
-
</editor-layers-toolbar>
|
|
41
|
-
<div v-if="editableLayersGroups.length > 0">
|
|
63
|
+
</div>
|
|
42
64
|
<div
|
|
43
|
-
v-
|
|
44
|
-
|
|
45
|
-
class="EditorLayersGroup__wrapper">
|
|
65
|
+
v-else
|
|
66
|
+
class="EditorLayers__list">
|
|
46
67
|
<div
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<div
|
|
68
|
+
v-for="group in editableLayersGroups"
|
|
69
|
+
:key="group.printArea._id"
|
|
70
|
+
class="EditorLayersGroup__wrapper">
|
|
71
|
+
<div
|
|
72
|
+
@click="toggleOpenedGroup(group.printArea)"
|
|
73
|
+
class="EditorLayersGroup__header">
|
|
74
|
+
<div>
|
|
75
|
+
<h5 class="lc_h5">
|
|
76
|
+
{{ group | groupLabel }}
|
|
77
|
+
</h5>
|
|
78
|
+
<div class="lc_caption">{{ group.printArea.side }}</div>
|
|
79
|
+
</div>
|
|
80
|
+
<div
|
|
81
|
+
class="EditorLayersGroup__arrow"
|
|
82
|
+
:class="{ opened: openedGroup === group.printArea._id }">
|
|
83
|
+
<i class="icon-arrow-left"></i>
|
|
84
|
+
</div>
|
|
54
85
|
</div>
|
|
55
86
|
<div
|
|
56
|
-
class="
|
|
57
|
-
|
|
58
|
-
<
|
|
87
|
+
class="EditorLayers__list-content"
|
|
88
|
+
v-if="openedGroup === group.printArea._id">
|
|
89
|
+
<editor-layers-layer
|
|
90
|
+
v-for="(layer, index) in group.layers"
|
|
91
|
+
:key="`${layer.createdAt}-${index}`"
|
|
92
|
+
:layer="layer"
|
|
93
|
+
:active="selectedLayer && selectedLayer.createdAt === layer.createdAt"
|
|
94
|
+
:visible-move-up="layer !== group.layers[0]"
|
|
95
|
+
:visible-move-down="layer !== group.layers[group.layers.length - 1]"
|
|
96
|
+
@select="setSelectedLayer(layer)"
|
|
97
|
+
@edit="editLayer(layer)"
|
|
98
|
+
@duplicate="duplicateLayer(layer)"
|
|
99
|
+
@remove="removeLayer(layer)"
|
|
100
|
+
@up="moveUp(layer)"
|
|
101
|
+
@down="moveDown(layer)">
|
|
102
|
+
</editor-layers-layer>
|
|
59
103
|
</div>
|
|
60
104
|
</div>
|
|
61
|
-
<div
|
|
62
|
-
class="EditorLayers__list-content"
|
|
63
|
-
v-if="openedGroup === group.printArea._id">
|
|
64
|
-
<editor-layers-layer
|
|
65
|
-
v-for="(layer, index) in group.layers"
|
|
66
|
-
:key="`${layer.createdAt}-${index}`"
|
|
67
|
-
:layer="layer"
|
|
68
|
-
:active="selectedLayer && selectedLayer.createdAt === layer.createdAt"
|
|
69
|
-
:visible-move-up="layer !== group.layers[0]"
|
|
70
|
-
:visible-move-down="layer !== group.layers[group.layers.length - 1]"
|
|
71
|
-
@select="setSelectedLayer(layer)"
|
|
72
|
-
@edit="editLayer(layer)"
|
|
73
|
-
@duplicate="duplicateLayer(layer)"
|
|
74
|
-
@remove="removeLayer(layer)"
|
|
75
|
-
@up="moveUp(layer)"
|
|
76
|
-
@down="moveDown(layer)">
|
|
77
|
-
</editor-layers-layer>
|
|
78
|
-
</div>
|
|
79
105
|
</div>
|
|
80
106
|
</div>
|
|
81
107
|
</div>
|
|
@@ -91,6 +117,7 @@
|
|
|
91
117
|
<script>
|
|
92
118
|
import { createNamespacedHelpers } from 'vuex';
|
|
93
119
|
import EditorPricing from '@lancom/shared/components/product/editor_pricing/editor-pricing';
|
|
120
|
+
import EditorPrintAreaOptions from '@lancom/shared/components/editor/editor_print_area_options/editor-print-area-options';
|
|
94
121
|
import { cloneLayerModel } from '@lancom/shared/assets/js/models/product-layers';
|
|
95
122
|
import { getAllPrintAreas } from '@lancom/shared/assets/js/utils/product';
|
|
96
123
|
import EditorLayerForms from './editor_layer_forms';
|
|
@@ -108,6 +135,7 @@ export default {
|
|
|
108
135
|
},
|
|
109
136
|
components: {
|
|
110
137
|
...EditorLayerForms,
|
|
138
|
+
EditorPrintAreaOptions,
|
|
111
139
|
EditorLayersLayer,
|
|
112
140
|
EditorLayersToolbar,
|
|
113
141
|
EditorPricing
|
|
@@ -116,6 +144,10 @@ export default {
|
|
|
116
144
|
hasPricing: {
|
|
117
145
|
type: Boolean,
|
|
118
146
|
default: true
|
|
147
|
+
},
|
|
148
|
+
disabledTemplates: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
default: false
|
|
119
151
|
}
|
|
120
152
|
},
|
|
121
153
|
data() {
|
|
@@ -130,7 +162,8 @@ export default {
|
|
|
130
162
|
'editableLayers',
|
|
131
163
|
'selectedLayer',
|
|
132
164
|
'editModeSelectedLayer',
|
|
133
|
-
'editableSide'
|
|
165
|
+
'editableSide',
|
|
166
|
+
'selectedPrintArea'
|
|
134
167
|
]),
|
|
135
168
|
editableLayerType() {
|
|
136
169
|
return this.selectedLayer ? `editor-layer-form-${this.selectedLayer.type}` : null;
|
|
@@ -138,8 +171,9 @@ export default {
|
|
|
138
171
|
editableLayersGroups() {
|
|
139
172
|
const printAreas = getAllPrintAreas(this.product);
|
|
140
173
|
const groups = new Map();
|
|
174
|
+
console.log('this.editableLayers: ', this.editableLayers);
|
|
141
175
|
this.editableLayers.forEach(layer => {
|
|
142
|
-
const printArea = printAreas.find(pa => (pa.parentPrintArea || pa._id) === layer.printArea && pa.printSize._id === layer.printSize) || { _id: null, name: 'Layers'};
|
|
176
|
+
const printArea = printAreas.find(pa => (pa.parentPrintArea || pa._id) === layer.printArea && pa.printSize._id === layer.printSize) || { _id: null, name: 'Layers' };
|
|
143
177
|
if (printArea) {
|
|
144
178
|
const defaultGroup = { layers: [], printArea };
|
|
145
179
|
const group = groups.get(printArea._id) || defaultGroup;
|
|
@@ -148,6 +182,9 @@ export default {
|
|
|
148
182
|
}
|
|
149
183
|
});
|
|
150
184
|
return Array.from(groups.values());
|
|
185
|
+
},
|
|
186
|
+
selectedLayerPrintArea() {
|
|
187
|
+
return this.selectedLayer.printArea;
|
|
151
188
|
}
|
|
152
189
|
},
|
|
153
190
|
watch: {
|
|
@@ -192,7 +229,7 @@ export default {
|
|
|
192
229
|
toggleOpenedGroup(printArea, foreOpen) {
|
|
193
230
|
this.openedGroup = (printArea?._id === this.openedGroup && !foreOpen) ? null : printArea?._id;
|
|
194
231
|
if (printArea) {
|
|
195
|
-
if (this.editableSide.id !== printArea.side) {
|
|
232
|
+
if (printArea.side && this.editableSide.id !== printArea.side) {
|
|
196
233
|
this.setEditableSide({ id: printArea.side });
|
|
197
234
|
}
|
|
198
235
|
this.setEditablePrintArea(printArea);
|
|
@@ -240,6 +277,14 @@ export default {
|
|
|
240
277
|
this.setSelectedLayer(null);
|
|
241
278
|
}
|
|
242
279
|
this.setEditModeSelectedLayer(false);
|
|
280
|
+
},
|
|
281
|
+
handlePrintAreaSelect(option) {
|
|
282
|
+
const printArea = option.printArea;
|
|
283
|
+
this.setLayerField({ field: 'printArea', value: printArea.parentPrintArea || printArea._id });
|
|
284
|
+
|
|
285
|
+
const printSize = printArea.printSize._id;
|
|
286
|
+
this.setLayerField({ field: 'printSize', value: printSize });
|
|
287
|
+
console.log('handlePrintAreaSelect: ', option, this.selectedLayer);
|
|
243
288
|
}
|
|
244
289
|
}
|
|
245
290
|
};
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
@import "@/assets/scss/variables";
|
|
2
2
|
|
|
3
3
|
.EditorLayerFormText {
|
|
4
|
+
&__preview {
|
|
5
|
+
padding: 16px;
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
margin-bottom: 16px;
|
|
10
|
+
background: #fff;
|
|
11
|
+
position: relative;
|
|
12
|
+
canvas {
|
|
13
|
+
background: #fff;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
transition: border-color 0.2s ease;
|
|
17
|
+
&:hover {
|
|
18
|
+
border-color: #7D6AEF;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
4
22
|
&__content {
|
|
5
23
|
padding-top: 24px;
|
|
6
24
|
}
|
|
@@ -46,4 +64,4 @@
|
|
|
46
64
|
align-items: center;
|
|
47
65
|
justify-content: space-between;
|
|
48
66
|
}
|
|
49
|
-
}
|
|
67
|
+
}
|