@lancom/shared 0.0.295 → 0.0.297
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/models/product-layers.js +4 -3
- package/assets/js/utils/export-print-to-svg.js +12 -20
- package/assets/js/utils/fabric/wireframe.js +4 -4
- package/assets/js/utils/fabric-helper.js +2 -2
- package/assets/js/utils/order.js +6 -3
- package/assets/js/utils/prints.js +8 -1
- package/assets/js/utils/product.js +11 -2
- package/assets/scss/ui_kit/_table.scss +1 -1
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.vue +10 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -1
- package/components/common/price.vue +10 -3
- package/components/common/product_side_with_print/product-side-with-print.vue +2 -1
- package/components/editor/editor.vue +14 -4
- package/components/editor/editor_layers/editor_layers_layer/editor-layers-layer.vue +4 -3
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +2 -2
- package/components/editor/editor_print_area_options/editor-print-area-options.scss +3 -2
- package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.scss +8 -0
- package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +10 -5
- package/components/editor/editor_product_details/editor-product-details.scss +18 -0
- package/components/editor/editor_product_details/editor-product-details.vue +50 -9
- package/components/editor/editor_workspace/editor-workspace.scss +4 -4
- package/components/editor/editor_workspace/editor-workspace.vue +0 -5
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.scss +12 -0
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +35 -4
- package/components/editor/mobile_editor_product_details/mobile-editor-product-details.scss +2 -2
- package/components/editor/mobile_editor_product_details/mobile-editor-product-details.vue +4 -6
- package/components/order/order_product_prints_preview/order-product-prints-preview.scss +9 -0
- package/components/order/order_product_prints_preview/order-product-prints-preview.vue +44 -0
- package/components/order/order_view/order-view.vue +8 -1
- package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.mixin.js +12 -0
- package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.scss +12 -1
- package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.vue +30 -3
- package/components/order/order_view/order_view_product/order-view-product.vue +23 -2
- package/components/product/gallery/gallery.vue +5 -2
- package/components/product/product_colors_selector/product-colors-selector.vue +7 -1
- package/components/product/product_print_preview/product-print-preview.vue +103 -0
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.vue +5 -2
- package/components/quotes/quote_view/quote-view.vue +9 -2
- package/feeds/google-shopping.js +6 -1
- package/mixins/add-to-cart.js +4 -1
- package/package.json +1 -1
- package/store/layers.js +1 -0
- package/store/product.js +3 -1
|
@@ -6,6 +6,18 @@
|
|
|
6
6
|
transition: background-color 0.5s ease;
|
|
7
7
|
background-color: white;
|
|
8
8
|
}
|
|
9
|
+
&__toggle-wireframe {
|
|
10
|
+
position: absolute;
|
|
11
|
+
z-index: 1001;
|
|
12
|
+
background: gainsboro;
|
|
13
|
+
padding: 6px;
|
|
14
|
+
top: 5px;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
&--active {
|
|
18
|
+
background: rgb(196, 226, 236);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
9
21
|
&__delete-object {
|
|
10
22
|
position: absolute;
|
|
11
23
|
z-index: 2;
|
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
}"
|
|
10
10
|
@mouseover="toogleBoundBox(true)"
|
|
11
11
|
@mouseleave="toogleBoundBox(false)">
|
|
12
|
+
<div
|
|
13
|
+
v-if="hasWireframeImage"
|
|
14
|
+
class="EditorWorkspaceSide__toggle-wireframe"
|
|
15
|
+
:class="{
|
|
16
|
+
'EditorWorkspaceSide__toggle-wireframe--active': visibleWireframe
|
|
17
|
+
}"
|
|
18
|
+
@click.stop.prevent="toggleWireframeImage">
|
|
19
|
+
{{ visibleWireframe ? 'Hide Wireframe' : 'Show Wireframe' }}
|
|
20
|
+
</div>
|
|
12
21
|
<div
|
|
13
22
|
v-if="deleteButtonPos"
|
|
14
23
|
:style="deleteButtonPosition"
|
|
@@ -98,6 +107,7 @@ export default {
|
|
|
98
107
|
},
|
|
99
108
|
data() {
|
|
100
109
|
return {
|
|
110
|
+
visibleWireframe: false,
|
|
101
111
|
fabricHelper: null,
|
|
102
112
|
redrawWithThrottle: throttle(this.redraw, 100, { trailing: false }),
|
|
103
113
|
saveLayersAsImageWithDebounce: debounce(this.saveLayersAsImage, 100),
|
|
@@ -115,12 +125,22 @@ export default {
|
|
|
115
125
|
...mapGetters('product', [
|
|
116
126
|
'product',
|
|
117
127
|
'layers',
|
|
128
|
+
'images',
|
|
118
129
|
'editableColor',
|
|
119
130
|
'editableLayers',
|
|
120
131
|
'selectedLayer',
|
|
121
132
|
'editorSize',
|
|
122
133
|
'editModeSelectedLayer'
|
|
123
134
|
]),
|
|
135
|
+
hasWireframeImage() {
|
|
136
|
+
return !!this.wireframeImage;
|
|
137
|
+
},
|
|
138
|
+
wireframeImage() {
|
|
139
|
+
return this.images.find(i => i.types?.includes('designer') && i.types?.includes(this.side));
|
|
140
|
+
},
|
|
141
|
+
sideEditableLayers() {
|
|
142
|
+
return this.editableLayers.filter(l => l.sideId === this.side);
|
|
143
|
+
},
|
|
124
144
|
printAreaLayers() {
|
|
125
145
|
return this.editableLayers.filter(l => !this.printArea || l.printArea === this.printArea._id);
|
|
126
146
|
},
|
|
@@ -171,6 +191,9 @@ export default {
|
|
|
171
191
|
editableColor() {
|
|
172
192
|
this.updateBackgroundImage();
|
|
173
193
|
},
|
|
194
|
+
visibleWireframe() {
|
|
195
|
+
this.updateBackgroundImage();
|
|
196
|
+
},
|
|
174
197
|
layers() {
|
|
175
198
|
this.redrawWithThrottle();
|
|
176
199
|
},
|
|
@@ -186,6 +209,7 @@ export default {
|
|
|
186
209
|
}
|
|
187
210
|
},
|
|
188
211
|
mounted() {
|
|
212
|
+
this.checkVisibleWireframe();
|
|
189
213
|
this.initEventsListeners();
|
|
190
214
|
this.initCanvas();
|
|
191
215
|
this.handleWorkspaceSize();
|
|
@@ -207,6 +231,12 @@ export default {
|
|
|
207
231
|
...mapMutations('layers', [
|
|
208
232
|
'setLayersThumbnail'
|
|
209
233
|
]),
|
|
234
|
+
checkVisibleWireframe() {
|
|
235
|
+
this.visibleWireframe = this.sideEditableLayers.length > 0;
|
|
236
|
+
},
|
|
237
|
+
toggleWireframeImage() {
|
|
238
|
+
this.visibleWireframe = !this.visibleWireframe;
|
|
239
|
+
},
|
|
210
240
|
adjustSelectedArtDPI() {
|
|
211
241
|
const measure = this.fabricHelper.getEditorDPI();
|
|
212
242
|
const scale = measure / 75;
|
|
@@ -217,7 +247,7 @@ export default {
|
|
|
217
247
|
},
|
|
218
248
|
calcWorkspaceSize() {
|
|
219
249
|
const sizes = {
|
|
220
|
-
xs:
|
|
250
|
+
xs: 330,
|
|
221
251
|
sm: 580,
|
|
222
252
|
md: 430,
|
|
223
253
|
lg: 600,
|
|
@@ -287,8 +317,7 @@ export default {
|
|
|
287
317
|
this.saveLayersAsImageWithDebounce();
|
|
288
318
|
},
|
|
289
319
|
async addLayersToCanvas() {
|
|
290
|
-
|
|
291
|
-
for (const layer of layers) {
|
|
320
|
+
for (const layer of this.sideEditableLayers) {
|
|
292
321
|
const params = {
|
|
293
322
|
layer,
|
|
294
323
|
active: this.isLayerSelected(layer)
|
|
@@ -301,7 +330,8 @@ export default {
|
|
|
301
330
|
},
|
|
302
331
|
updateBackgroundImage() {
|
|
303
332
|
const type = this.side === 'front' ? COLORS_IMAGES_TYPES.FRONT : COLORS_IMAGES_TYPES.BACK;
|
|
304
|
-
const
|
|
333
|
+
const wireframeImageUrl = this.visibleWireframe && this.wireframeImage?.large;
|
|
334
|
+
const imageUrl = wireframeImageUrl || getLargeColorImage(this.product, type, this.editableColor);
|
|
305
335
|
if (this.backgroundImage && this.backgroundImageUrl === imageUrl) {
|
|
306
336
|
return this.fabricHelper.setBackgroundImage(this.backgroundImage);
|
|
307
337
|
}
|
|
@@ -325,6 +355,7 @@ export default {
|
|
|
325
355
|
createTextLayer() {
|
|
326
356
|
window.scrollTo(0, 0);
|
|
327
357
|
this.createLayer({ type: 'text', isEditMode: true });
|
|
358
|
+
this.visibleWireframe = true;
|
|
328
359
|
},
|
|
329
360
|
setDeleteButtonPosition(pos) {
|
|
330
361
|
this.deleteButtonPos = pos;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
@click="show('details')">
|
|
8
8
|
<i class="icon-product MobileEditorProductDetails__menu-action-icon"></i>
|
|
9
9
|
<span class="MobileEditorProductDetails__menu-action-label">
|
|
10
|
-
|
|
10
|
+
Editor
|
|
11
11
|
</span>
|
|
12
12
|
</div>
|
|
13
13
|
<div
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
@click="hide"></i>
|
|
61
61
|
</div>
|
|
62
62
|
<div class="MobileEditorProductDetails__content custom-scrollbar-container">
|
|
63
|
-
<editor-
|
|
63
|
+
<editor-workspace v-if="currentTab === 'details'" />
|
|
64
64
|
<editor-layers v-if="currentTab === 'layers'" />
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
@@ -71,19 +71,17 @@
|
|
|
71
71
|
<script>
|
|
72
72
|
import { createNamespacedHelpers } from 'vuex';
|
|
73
73
|
import { EventBus } from '@lancom/shared/assets/js/utils/event-bus';
|
|
74
|
-
import
|
|
74
|
+
import EditorWorkspace from '../editor_workspace/editor-workspace';
|
|
75
75
|
import EditorLayers from '../editor_layers/editor-layers';
|
|
76
76
|
|
|
77
77
|
const { mapMutations } = createNamespacedHelpers('product');
|
|
78
78
|
|
|
79
79
|
export default {
|
|
80
80
|
name: 'MobileEditorProductDetails',
|
|
81
|
-
|
|
82
81
|
components: {
|
|
83
|
-
|
|
82
|
+
EditorWorkspace,
|
|
84
83
|
EditorLayers
|
|
85
84
|
},
|
|
86
|
-
|
|
87
85
|
props: {
|
|
88
86
|
addToCartDisabled: {
|
|
89
87
|
type: Boolean,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ProductPrintsPreview__wrapper d-flex justify-content-center">
|
|
3
|
+
<div
|
|
4
|
+
v-for="(side, index) of sides"
|
|
5
|
+
:key="index">
|
|
6
|
+
<div class="ProductPrintsPreview__preview">
|
|
7
|
+
<product-side-with-print
|
|
8
|
+
:product="product"
|
|
9
|
+
:side="side"
|
|
10
|
+
size="medium" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import ProductSideWithPrint from '@lancom/shared/components/common/product_side_with_print/product-side-with-print';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'ProductPrintsPreview',
|
|
21
|
+
components: {
|
|
22
|
+
ProductSideWithPrint
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
order: {
|
|
26
|
+
type: Object,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
product: {
|
|
30
|
+
type: Object,
|
|
31
|
+
required: true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
computed: {
|
|
35
|
+
sides() {
|
|
36
|
+
return Object.keys(this.product.printsThumbnails || {});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<style lang="scss" scoped>
|
|
43
|
+
@import 'order-product-prints-preview.scss';
|
|
44
|
+
</style>
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
Account name: {{ depositInfo.accountName }}
|
|
116
116
|
</div>
|
|
117
117
|
<div class="lc_regular16">
|
|
118
|
-
|
|
118
|
+
{{ bsbLabel }}: {{ depositInfo.BSB }}
|
|
119
119
|
</div>
|
|
120
120
|
<div class="lc_regular16">
|
|
121
121
|
Account: {{ depositInfo.account }}
|
|
@@ -205,6 +205,7 @@
|
|
|
205
205
|
</template>
|
|
206
206
|
|
|
207
207
|
<script>
|
|
208
|
+
import { mapGetters } from 'vuex';
|
|
208
209
|
import OrderViewMixin from './order-view.mixin';
|
|
209
210
|
import OrderViewProduct from './order_view_product/order-view-product';
|
|
210
211
|
|
|
@@ -219,6 +220,12 @@ export default {
|
|
|
219
220
|
type: Boolean,
|
|
220
221
|
default: true
|
|
221
222
|
}
|
|
223
|
+
},
|
|
224
|
+
computed: {
|
|
225
|
+
...mapGetters(['MESSAGES']),
|
|
226
|
+
bsbLabel() {
|
|
227
|
+
return this.MESSAGES.DIRECT_DEPOSIT_BSB || 'BSB';
|
|
228
|
+
},
|
|
222
229
|
}
|
|
223
230
|
};
|
|
224
231
|
</script>
|
|
@@ -17,6 +17,18 @@ export default {
|
|
|
17
17
|
defaultPreview: {
|
|
18
18
|
type: Boolean,
|
|
19
19
|
default: true
|
|
20
|
+
},
|
|
21
|
+
withBigImage: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
withImage: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
withTotals: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: true
|
|
20
32
|
}
|
|
21
33
|
},
|
|
22
34
|
computed: {
|
|
@@ -8,17 +8,24 @@
|
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
align-items: center;
|
|
10
10
|
}
|
|
11
|
+
&--column {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
11
14
|
}
|
|
12
15
|
&__image-wrapper {
|
|
13
16
|
width: 70px;
|
|
17
|
+
margin-right: 20px;
|
|
14
18
|
@media (max-width: $bp-extra-small-max) {
|
|
15
19
|
width: 200px;
|
|
16
20
|
margin-top: 20px;
|
|
17
21
|
}
|
|
22
|
+
&--large {
|
|
23
|
+
width: 900px;
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
18
26
|
}
|
|
19
27
|
&__info {
|
|
20
28
|
flex-grow: 1;
|
|
21
|
-
margin-left: 20px;
|
|
22
29
|
@media (max-width: $bp-medium-max) {
|
|
23
30
|
margin-left: 5px;
|
|
24
31
|
}
|
|
@@ -35,6 +42,10 @@
|
|
|
35
42
|
width: 200px;
|
|
36
43
|
height: 200px;
|
|
37
44
|
}
|
|
45
|
+
&--large {
|
|
46
|
+
width: 400px;
|
|
47
|
+
height: 400px;
|
|
48
|
+
}
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
&__features {
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="OrderProductColorSimpleProducts__wrapper"
|
|
4
|
+
:class="{
|
|
5
|
+
'OrderProductColorSimpleProducts__wrapper--column': withBigImage
|
|
6
|
+
}">
|
|
7
|
+
<div
|
|
8
|
+
v-if="withImage"
|
|
9
|
+
class="OrderProductColorSimpleProducts__image-wrapper"
|
|
10
|
+
:class="{
|
|
11
|
+
'OrderProductColorSimpleProducts__image-wrapper--large': withBigImage
|
|
12
|
+
}">
|
|
4
13
|
<div
|
|
5
14
|
class="OrderProductColorSimpleProducts__image"
|
|
15
|
+
:class="{
|
|
16
|
+
'OrderProductColorSimpleProducts__image--large': withBigImage
|
|
17
|
+
}"
|
|
6
18
|
@click="showImage(images, 0)">
|
|
7
19
|
<product-side-with-print
|
|
8
20
|
:product="group"
|
|
@@ -10,6 +22,19 @@
|
|
|
10
22
|
side="front"
|
|
11
23
|
size="medium" />
|
|
12
24
|
</div>
|
|
25
|
+
<div
|
|
26
|
+
v-if="entity && entity.printsThumbnails && entity.printsThumbnails.back"
|
|
27
|
+
class="OrderProductColorSimpleProducts__image"
|
|
28
|
+
:class="{
|
|
29
|
+
'OrderProductColorSimpleProducts__image--large': withBigImage
|
|
30
|
+
}"
|
|
31
|
+
@click="showImage(images, 1)">
|
|
32
|
+
<product-side-with-print
|
|
33
|
+
:product="group"
|
|
34
|
+
:default-preview="defaultPreview"
|
|
35
|
+
side="back"
|
|
36
|
+
size="medium" />
|
|
37
|
+
</div>
|
|
13
38
|
</div>
|
|
14
39
|
<div class="OrderProductColorSimpleProducts__info">
|
|
15
40
|
<div class="OrderProductColorSimpleProducts__features">
|
|
@@ -48,7 +73,9 @@
|
|
|
48
73
|
{{ group.amount }}
|
|
49
74
|
</div>
|
|
50
75
|
</div>
|
|
51
|
-
<div
|
|
76
|
+
<div
|
|
77
|
+
v-if="withTotals"
|
|
78
|
+
class="OrderProductColorSimpleProducts__total mt-6">
|
|
52
79
|
<div class="lc_title-small">
|
|
53
80
|
Total price:
|
|
54
81
|
</div>
|
|
@@ -33,18 +33,23 @@
|
|
|
33
33
|
:order="order"
|
|
34
34
|
:entity="product"
|
|
35
35
|
:group="group"
|
|
36
|
+
:with-image="withImage"
|
|
37
|
+
:with-big-image="withBigImage"
|
|
38
|
+
:with-totals="withTotals"
|
|
36
39
|
:default-preview="groupedProducts.size === 1"
|
|
37
40
|
class="OrderViewProduct__item" />
|
|
38
41
|
</div>
|
|
39
42
|
<div
|
|
40
|
-
v-if="hasPrints"
|
|
43
|
+
v-if="withPrints && hasPrints"
|
|
41
44
|
class="OrderViewProduct__decorations">
|
|
42
45
|
<order-product-prints
|
|
43
46
|
:order="order"
|
|
44
47
|
:entity="product"
|
|
45
48
|
:responsive="responsive" />
|
|
46
49
|
</div>
|
|
47
|
-
<div
|
|
50
|
+
<div
|
|
51
|
+
v-if="withTotals"
|
|
52
|
+
class="OrderViewProduct__subtotal lc_title">
|
|
48
53
|
Subtotal: {{ totalPrice | price(order.currency) }}
|
|
49
54
|
</div>
|
|
50
55
|
</div>
|
|
@@ -87,6 +92,22 @@ export default {
|
|
|
87
92
|
responsive: {
|
|
88
93
|
type: Boolean,
|
|
89
94
|
default: true
|
|
95
|
+
},
|
|
96
|
+
withImage: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: true
|
|
99
|
+
},
|
|
100
|
+
withBigImage: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: false
|
|
103
|
+
},
|
|
104
|
+
withPrints: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: true
|
|
107
|
+
},
|
|
108
|
+
withTotals: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: true
|
|
90
111
|
}
|
|
91
112
|
},
|
|
92
113
|
computed: {
|
|
@@ -148,8 +148,11 @@ export default {
|
|
|
148
148
|
hasValidFilters() {
|
|
149
149
|
return this.validFilters.length > 1;
|
|
150
150
|
},
|
|
151
|
+
galleryImages() {
|
|
152
|
+
return this.images.filter(i => !(i.types || []).includes('designer'));
|
|
153
|
+
},
|
|
151
154
|
validFilters() {
|
|
152
|
-
return this.filters.filter(filter => (this.
|
|
155
|
+
return this.filters.filter(filter => (this.galleryImages || []).some(i => this.isValidImageByFilter(filter, i)));
|
|
153
156
|
},
|
|
154
157
|
currentImage() {
|
|
155
158
|
return this.filteredImages[this.activeIndex];
|
|
@@ -164,7 +167,7 @@ export default {
|
|
|
164
167
|
return this.filteredImages.length > this.slidesPerRow;
|
|
165
168
|
},
|
|
166
169
|
filteredImages() {
|
|
167
|
-
const images = this.filterType ? this.
|
|
170
|
+
const images = this.filterType ? this.galleryImages.filter(i => this.isValidImageByFilter(this.filterType, i)) : this.galleryImages;
|
|
168
171
|
return images.map(image => {
|
|
169
172
|
const printType = this.product?.printTypes.find(({ _id }) => _id === image.printType);
|
|
170
173
|
const printArea = printType?.printAreas.find(({ printSizes }) => (printSizes || []).some(({ _id }) => _id === image.printSize)) || printType?.printAreas[0] || { printCost: [] };
|
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
ref="colorsSelectorOptions"
|
|
63
63
|
:display-products-count="true"
|
|
64
64
|
class="ProductColorsSelector__section" />
|
|
65
|
-
<div
|
|
65
|
+
<div
|
|
66
|
+
class="ProductColorsSelector__toggle-gst"
|
|
67
|
+
v-if="hasToggleGst">
|
|
66
68
|
<checkbox
|
|
67
69
|
v-model="inclGST"
|
|
68
70
|
:dark="true"
|
|
@@ -112,6 +114,10 @@ export default {
|
|
|
112
114
|
hasAnotherPrintBtn: {
|
|
113
115
|
type: Boolean,
|
|
114
116
|
default: true
|
|
117
|
+
},
|
|
118
|
+
hasToggleGst: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: true
|
|
115
121
|
}
|
|
116
122
|
},
|
|
117
123
|
computed: {
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ProductPrintPreview__wrapper">
|
|
3
|
+
<canvas ref="print"></canvas>
|
|
4
|
+
<div
|
|
5
|
+
class="ProductPrintPreview__export"
|
|
6
|
+
@click="exportPrintToSVG">
|
|
7
|
+
Export To SVG
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { exportPrintToSVG } from '@lancom/shared/assets/js/utils/export-print-to-svg';
|
|
14
|
+
import FabricHelper from '@lancom/shared/assets/js/utils/fabric-helper';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'ProductPrintPreview',
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
fabricHelper: null,
|
|
21
|
+
size: {
|
|
22
|
+
width: 540,
|
|
23
|
+
height: 540
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
props: {
|
|
28
|
+
product: {
|
|
29
|
+
type: Object,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
print: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
printSize: {
|
|
37
|
+
type: Object,
|
|
38
|
+
required: true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
layers() {
|
|
43
|
+
const layers = (this.print.layers || [])
|
|
44
|
+
.filter(l => !!l.params)
|
|
45
|
+
.map(l => ({ ...l.params }));
|
|
46
|
+
return layers;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
async mounted() {
|
|
50
|
+
console.log('print: ', this.print);
|
|
51
|
+
this.fabricHelper = new FabricHelper({
|
|
52
|
+
editor: this.$refs.print,
|
|
53
|
+
size: this.size
|
|
54
|
+
});
|
|
55
|
+
await this.drawLayers();
|
|
56
|
+
this.fabricHelper.buildWireframe({
|
|
57
|
+
...this.size,
|
|
58
|
+
// area: product.printAreas[this.sideId],
|
|
59
|
+
printSize: this.printSize,
|
|
60
|
+
product: this.product
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
methods: {
|
|
64
|
+
drawLayers() {
|
|
65
|
+
return this.layers.reduce(async (promise, layer) => {
|
|
66
|
+
await promise;
|
|
67
|
+
return new Promise(resolve => {
|
|
68
|
+
this.fabricHelper.createObject({ layer }).then(obj => {
|
|
69
|
+
resolve();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}, Promise.resolve());
|
|
73
|
+
},
|
|
74
|
+
exportPrintToSVG() {
|
|
75
|
+
exportPrintToSVG(this.layers, this.printSize);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="scss" scoped>
|
|
82
|
+
.ProductPrintPreview {
|
|
83
|
+
&__wrapper {
|
|
84
|
+
width: 540px;
|
|
85
|
+
height: 540px;
|
|
86
|
+
position: relative;
|
|
87
|
+
// background-image: url(~static/images/trasnparent-pattern.png);
|
|
88
|
+
canvas {
|
|
89
|
+
// border: 2px solid blue;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
&__export {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 50px;
|
|
95
|
+
right: 50px;
|
|
96
|
+
display: inline-block;
|
|
97
|
+
padding: 10px;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
background: rgb(110, 217, 246);
|
|
100
|
+
z-index: 99;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<div
|
|
40
40
|
v-if="product.quantityStock"
|
|
41
41
|
class="ProductSizeSelectorColor__in-stock">
|
|
42
|
-
{{
|
|
42
|
+
{{ currentQuantityStockLabel }} in stock
|
|
43
43
|
</div>
|
|
44
44
|
<div
|
|
45
45
|
v-else
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<div
|
|
53
53
|
v-if="product.quantityStock"
|
|
54
54
|
class="ProductSizeSelectorColor__in-stock">
|
|
55
|
-
{{
|
|
55
|
+
{{ currentQuantityStockLabel }} in stock
|
|
56
56
|
</div>
|
|
57
57
|
<div
|
|
58
58
|
v-else
|
|
@@ -104,6 +104,9 @@ export default {
|
|
|
104
104
|
computed: {
|
|
105
105
|
...mapGetters('product', ['isPrintPricing', 'usedSimpleProductsQuantity']),
|
|
106
106
|
...mapGetters(['gstTax', 'currency']),
|
|
107
|
+
currentQuantityStockLabel() {
|
|
108
|
+
return this.currentQuantityStock > 100 ? '100+' : this.currentQuantityStock;
|
|
109
|
+
},
|
|
107
110
|
pricing() {
|
|
108
111
|
return (this.isPrintPricing ? this.product.pricing : this.product.unprintedPricing) || [];
|
|
109
112
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<div><b>{{ MESSAGES.DIRECT_DEPOSIT_DETAILS || 'DIRECT DEPOSIT DETAILS'}}</b></div>
|
|
42
42
|
<div>Bank: {{ depositInfo.bank }}</div>
|
|
43
43
|
<div>Account name: {{ depositInfo.accountName }}</div>
|
|
44
|
-
<div>
|
|
44
|
+
<div>{{ bsbLabel }}: {{ depositInfo.BSB }}</div>
|
|
45
45
|
<div>Account: {{ depositInfo.account }}</div>
|
|
46
46
|
</td>
|
|
47
47
|
</tr>
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
</template>
|
|
63
63
|
|
|
64
64
|
<script>
|
|
65
|
+
import { mapGetters } from 'vuex';
|
|
65
66
|
import QuoteViewMixin from './quote-view.mixin';
|
|
66
67
|
import QuoteOptionView from './quote_option_view/quote-option-view';
|
|
67
68
|
|
|
@@ -70,7 +71,13 @@ export default {
|
|
|
70
71
|
components: {
|
|
71
72
|
QuoteOptionView
|
|
72
73
|
},
|
|
73
|
-
mixins: [QuoteViewMixin]
|
|
74
|
+
mixins: [QuoteViewMixin],
|
|
75
|
+
computed: {
|
|
76
|
+
...mapGetters(['MESSAGES']),
|
|
77
|
+
bsbLabel() {
|
|
78
|
+
return this.MESSAGES.DIRECT_DEPOSIT_BSB || 'BSB';
|
|
79
|
+
},
|
|
80
|
+
}
|
|
74
81
|
};
|
|
75
82
|
</script>
|
|
76
83
|
|
package/feeds/google-shopping.js
CHANGED
|
@@ -14,6 +14,11 @@ async function googleLocalShoppingFeed(axios, config, availableStores, country)
|
|
|
14
14
|
.map(i => fields.reduce((item, field) => ({ ...item, [field]: i[field] }), {}));
|
|
15
15
|
return result;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
const COUNTRIES_SIZE_SYSTEMS = {
|
|
19
|
+
GB: 'UK'
|
|
20
|
+
};
|
|
21
|
+
|
|
17
22
|
async function googleShoppingFeed(axios, config, availableStores, country) {
|
|
18
23
|
const { data } = await axios.get(`${config.LOCAL_API_URL}/feed/products?host=${config.HOST_NAME}&country=${country || ''}`);
|
|
19
24
|
const spliceFirstImage = images => (images || []).splice(0, 1)[0];
|
|
@@ -58,7 +63,7 @@ async function googleShoppingFeed(axios, config, availableStores, country) {
|
|
|
58
63
|
'g:id': { _text: sp.SKU },
|
|
59
64
|
'g:item_group_id': { _text: product.SKU },
|
|
60
65
|
'g:size': { _text: sp.size.name },
|
|
61
|
-
'g:size_system': country || 'AU',
|
|
66
|
+
'g:size_system': COUNTRIES_SIZE_SYSTEMS[country] || country || 'AU',
|
|
62
67
|
'g:size_type': 'regular',
|
|
63
68
|
'g:gender': { _text: product.gender },
|
|
64
69
|
'g:material': { _text: product.fabricInfoShort },
|
package/mixins/add-to-cart.js
CHANGED
|
@@ -22,6 +22,9 @@ export default {
|
|
|
22
22
|
'calculatingPrice',
|
|
23
23
|
'multipack'
|
|
24
24
|
]),
|
|
25
|
+
...mapGetters('layers', [
|
|
26
|
+
'layerThumbnails'
|
|
27
|
+
]),
|
|
25
28
|
isValidOrderQuantity() {
|
|
26
29
|
return this.isValidBigSizeOrderQuantity && this.isValidMiltipackOrderQuantity && (!this.minimumOrderQuantity || this.usedSimpleProductsQuantity >= this.minimumOrderQuantity);
|
|
27
30
|
},
|
|
@@ -40,7 +43,7 @@ export default {
|
|
|
40
43
|
...mapMutations('product', ['clearTemplate', 'setIsPrintPricing']),
|
|
41
44
|
...mapMutations('layers', ['resetLayers']),
|
|
42
45
|
async proceedToCard() {
|
|
43
|
-
const entities = generateCartProducts(this.product, this.template.simpleProducts, this.template.layers, this.isPrintPricing);
|
|
46
|
+
const entities = generateCartProducts(this.product, this.template.simpleProducts, this.template.layers, this.isPrintPricing, this.layerThumbnails);
|
|
44
47
|
await this.addToCart({
|
|
45
48
|
entities,
|
|
46
49
|
shop: this.shop,
|