@lancom/shared 0.0.278 → 0.0.279
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 +3 -0
- package/components/common/progress_steps/progress-steps.scss +3 -1
- package/components/common/progress_steps/progress-steps.vue +9 -1
- package/components/editor/editor.vue +18 -1
- package/components/editor/editor_wizard/editor-wizard.scss +22 -0
- package/components/editor/editor_wizard/editor-wizard.vue +66 -0
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +1 -1
- package/components/product/wizard/wizard.scss +222 -0
- package/components/product/wizard/wizard.vue +274 -0
- package/components/product/wizard/wizard_print/wizard-print.scss +94 -0
- package/components/product/wizard/wizard_print/wizard-print.vue +130 -0
- package/components/product/wizard/wizard_print_area/wizard-print-area.scss +101 -0
- package/components/product/wizard/wizard_print_area/wizard-print-area.vue +86 -0
- package/components/product/wizard/wizard_print_layers/wizard-print-layers.scss +60 -0
- package/components/product/wizard/wizard_print_layers/wizard-print-layers.vue +67 -0
- package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.scss +47 -0
- package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +210 -0
- package/components/product/wizard/wizard_print_review/wizard-print-review.scss +0 -0
- package/components/product/wizard/wizard_print_review/wizard-print-review.vue +71 -0
- package/components/product/wizard/wizard_print_size/wizard-print-size.scss +68 -0
- package/components/product/wizard/wizard_print_size/wizard-print-size.vue +49 -0
- package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.scss +65 -0
- package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +106 -0
- package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.scss +65 -0
- package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.vue +116 -0
- package/components/product/wizard/wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form.scss +138 -0
- package/components/product/wizard/wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form.vue +157 -0
- package/components/product/wizard/wizard_print_type/wizard-print-type.scss +65 -0
- package/components/product/wizard/wizard_print_type/wizard-print-type.vue +49 -0
- package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.scss +87 -0
- package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +114 -0
- package/components/product/wizard/wizard_print_underbase/wizard-print-underbase.scss +65 -0
- package/components/product/wizard/wizard_print_underbase/wizard-print-underbase.vue +49 -0
- package/components/product/wizard/wizard_print_underbase/wizard_print_area_print_underbase/wizard-print-area-print-underbase.scss +87 -0
- package/components/product/wizard/wizard_print_underbase/wizard_print_area_print_underbase/wizard-print-area-print-underbase.vue +90 -0
- package/package.json +1 -1
- package/store/layers.js +6 -1
- package/store/product.js +42 -0
package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: contents">
|
|
3
|
+
<tr class="WizardPrintLayer__wrapper">
|
|
4
|
+
<td>
|
|
5
|
+
<div class="lc_regular14 hidden-sm-and-up">
|
|
6
|
+
Printable area
|
|
7
|
+
</div>
|
|
8
|
+
{{ layerPrintArea.name }}
|
|
9
|
+
</td>
|
|
10
|
+
<td>
|
|
11
|
+
<div class="lc_regular14 hidden-sm-and-up">
|
|
12
|
+
Print size
|
|
13
|
+
</div>
|
|
14
|
+
{{ layerPrintSize ? layerPrintSize.name : '-' }}
|
|
15
|
+
</td>
|
|
16
|
+
<td>
|
|
17
|
+
<div class="lc_regular14 hidden-sm-and-up">
|
|
18
|
+
Print type
|
|
19
|
+
</div>
|
|
20
|
+
{{ layerPrintType.name }}
|
|
21
|
+
</td>
|
|
22
|
+
<td>
|
|
23
|
+
<div class="lc_regular14 hidden-sm-and-up">
|
|
24
|
+
Print option
|
|
25
|
+
</div>
|
|
26
|
+
<v-popover
|
|
27
|
+
ref="popover"
|
|
28
|
+
trigger="hover"
|
|
29
|
+
:delay="{ show: 200, hide: 400 }"
|
|
30
|
+
popover-class="tooltip popover white">
|
|
31
|
+
<span
|
|
32
|
+
v-if="type === 'art'"
|
|
33
|
+
class="WizardPrintLayer__info-type">
|
|
34
|
+
<a
|
|
35
|
+
v-if="layer.file"
|
|
36
|
+
:href="layer.file.origin"
|
|
37
|
+
target="_blank">
|
|
38
|
+
Logo
|
|
39
|
+
</a>
|
|
40
|
+
<span v-else>
|
|
41
|
+
Logo
|
|
42
|
+
</span>
|
|
43
|
+
</span>
|
|
44
|
+
<span
|
|
45
|
+
v-else
|
|
46
|
+
class="WizardPrintLayer__info-type">
|
|
47
|
+
Text
|
|
48
|
+
</span>
|
|
49
|
+
<template slot="popover">
|
|
50
|
+
<div class="WizardPrintLayer__info">
|
|
51
|
+
<div
|
|
52
|
+
v-if="layer.type === 'text'"
|
|
53
|
+
class="WizardPrintLayer__info-text">
|
|
54
|
+
<div class="WizardPrintLayer__info-text-item">
|
|
55
|
+
<div class="WizardPrintLayer__info-text-title">
|
|
56
|
+
Text
|
|
57
|
+
</div>
|
|
58
|
+
<div class="WizardPrintLayer__info-text-content">
|
|
59
|
+
<span>{{ layer.copy }}</span>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div
|
|
63
|
+
v-if="layer.notes"
|
|
64
|
+
class="WizardPrintLayer__info-text-item">
|
|
65
|
+
<div class="WizardPrintLayer__info-text-title">
|
|
66
|
+
Notes
|
|
67
|
+
</div>
|
|
68
|
+
<div class="WizardPrintLayer__info-text-content">
|
|
69
|
+
<span>{{ layer.notes }}</span>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div
|
|
74
|
+
v-else-if="layer.type === 'art'">
|
|
75
|
+
<div class="WizardPrintLayer__info-art">
|
|
76
|
+
<a
|
|
77
|
+
:href="layer.file.origin"
|
|
78
|
+
target="_blank">
|
|
79
|
+
<img
|
|
80
|
+
v-if="layer.url"
|
|
81
|
+
:src="layer.url" />
|
|
82
|
+
<span v-else>
|
|
83
|
+
<i class="icon-blank"></i> Download logo
|
|
84
|
+
</span>
|
|
85
|
+
</a>
|
|
86
|
+
</div>
|
|
87
|
+
<div
|
|
88
|
+
v-if="layer.notes"
|
|
89
|
+
class="WizardPrintLayer__info-text">
|
|
90
|
+
<div class="WizardPrintLayer__info-text-item">
|
|
91
|
+
<div class="WizardPrintLayer__info-text-title">
|
|
92
|
+
Notes
|
|
93
|
+
</div>
|
|
94
|
+
<div class="WizardPrintLayer__info-text-content">
|
|
95
|
+
<span>{{ layer.notes }}</span>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</template>
|
|
102
|
+
</v-popover>
|
|
103
|
+
</td>
|
|
104
|
+
<td>
|
|
105
|
+
<div class="lc_regular14 hidden-sm-and-up">
|
|
106
|
+
Price
|
|
107
|
+
</div>
|
|
108
|
+
<div>
|
|
109
|
+
{{ layerPrintPricing | pricingRange }}
|
|
110
|
+
</div>
|
|
111
|
+
<v-popover
|
|
112
|
+
ref="popover"
|
|
113
|
+
trigger="hover"
|
|
114
|
+
:delay="{ show: 200, hide: 400 }"
|
|
115
|
+
popover-class="tooltip popover white"
|
|
116
|
+
class="WizardPrintLayer__layer-price">
|
|
117
|
+
<slot name="see-pricing">
|
|
118
|
+
<span class="lc_regular12 lc_gray-main">
|
|
119
|
+
see prices
|
|
120
|
+
</span>
|
|
121
|
+
</slot>
|
|
122
|
+
<template slot="popover">
|
|
123
|
+
<pricing-discounts-table :prices="layerPrintPricing" />
|
|
124
|
+
</template>
|
|
125
|
+
</v-popover>
|
|
126
|
+
</td>
|
|
127
|
+
<td v-if="editable && !layer.required">
|
|
128
|
+
<span
|
|
129
|
+
class="WizardPrintLayer__control"
|
|
130
|
+
@click="$emit('edit')">
|
|
131
|
+
<i class="icon-edit"></i>
|
|
132
|
+
</span>
|
|
133
|
+
<span
|
|
134
|
+
class="WizardPrintLayer__control"
|
|
135
|
+
@click="$emit('delete')">
|
|
136
|
+
<i class="icon-delete"></i>
|
|
137
|
+
</span>
|
|
138
|
+
</td>
|
|
139
|
+
</tr>
|
|
140
|
+
<tr v-if="layer.required">
|
|
141
|
+
<td colspan="6">
|
|
142
|
+
<div class="WizardPrintLayer__layer-form">
|
|
143
|
+
<wizard-text-or-logo-form :layer="layer" />
|
|
144
|
+
</div>
|
|
145
|
+
</td>
|
|
146
|
+
</tr>
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|
|
149
|
+
|
|
150
|
+
<script>
|
|
151
|
+
import { mapGetters } from 'vuex';
|
|
152
|
+
import { pricingRange } from '@lancom/shared/assets/js/utils/filters';
|
|
153
|
+
import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
|
|
154
|
+
import WizardTextOrLogoForm from './../../wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form';
|
|
155
|
+
|
|
156
|
+
export default {
|
|
157
|
+
name: 'WizardPrintLayer',
|
|
158
|
+
components: {
|
|
159
|
+
PricingDiscountsTable,
|
|
160
|
+
WizardTextOrLogoForm
|
|
161
|
+
},
|
|
162
|
+
filters: {
|
|
163
|
+
pricingRange
|
|
164
|
+
},
|
|
165
|
+
props: {
|
|
166
|
+
layer: {
|
|
167
|
+
type: Object,
|
|
168
|
+
required: true
|
|
169
|
+
},
|
|
170
|
+
editable: {
|
|
171
|
+
type: Boolean
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
computed: {
|
|
175
|
+
...mapGetters('product', ['product']),
|
|
176
|
+
type() {
|
|
177
|
+
return this.layer.type;
|
|
178
|
+
},
|
|
179
|
+
productPrintAreas() {
|
|
180
|
+
return this.product.printAreas || [];
|
|
181
|
+
},
|
|
182
|
+
layerPrintArea() {
|
|
183
|
+
return this.productPrintAreas.find(({ _id }) => _id === this.layer.printArea);
|
|
184
|
+
},
|
|
185
|
+
layerPrintSizes() {
|
|
186
|
+
const { printSize, sizes = [] } = this.layerPrintArea;
|
|
187
|
+
return [
|
|
188
|
+
printSize,
|
|
189
|
+
...sizes
|
|
190
|
+
.map(({ printSize }) => printSize)
|
|
191
|
+
.filter(({ _id }) => _id !== printSize._id)
|
|
192
|
+
];
|
|
193
|
+
},
|
|
194
|
+
layerPrintType() {
|
|
195
|
+
return this.product.printTypes.find(({ _id }) => _id === this.layer.printType);
|
|
196
|
+
},
|
|
197
|
+
layerPrintSize() {
|
|
198
|
+
return this.layerPrintSizes.find(({ _id }) => _id === this.layer.printSize);
|
|
199
|
+
},
|
|
200
|
+
layerPrintPricing() {
|
|
201
|
+
const printArea = this.layerPrintType.printAreas.find(({ printSizes }) => printSizes.map(({ _id }) => _id).includes(this.layer.printSize)) || this.layerPrintType.printAreas[0];
|
|
202
|
+
return printArea.printCost;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
</script>
|
|
207
|
+
|
|
208
|
+
<style lang="scss">
|
|
209
|
+
@import 'wizard-print-layer';
|
|
210
|
+
</style>
|
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="WizardPrintReview__wrapper">
|
|
3
|
+
<wizard-print-layers :layers="layers">
|
|
4
|
+
<template #see-pricing>
|
|
5
|
+
<span
|
|
6
|
+
style="position: absolute; left: 0; line-height: 16px; right: 0; font-style: italic; margin-top: -5px;"
|
|
7
|
+
class="lc_regular12 lc_gray-main lc_bold">
|
|
8
|
+
The final price is based on quantity of products printed, and will be calculated once product quantities are added below
|
|
9
|
+
</span>
|
|
10
|
+
</template>
|
|
11
|
+
</wizard-print-layers>
|
|
12
|
+
<div class="ProgressSteps__controls">
|
|
13
|
+
<btn
|
|
14
|
+
btn-class="white"
|
|
15
|
+
btn-label="BACK"
|
|
16
|
+
@onclick="$emit('prev')">
|
|
17
|
+
</btn>
|
|
18
|
+
<btn
|
|
19
|
+
btn-class="green"
|
|
20
|
+
btn-label="Add to order"
|
|
21
|
+
@onclick="goNext">
|
|
22
|
+
<i
|
|
23
|
+
slot="icon-after"
|
|
24
|
+
class="icon-arrow-right"></i>
|
|
25
|
+
</btn>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import { mapGetters, mapMutations } from 'vuex';
|
|
32
|
+
import gtm from '@lancom/shared/assets/js/utils/gtm';
|
|
33
|
+
import WizardPrintLayers from './../wizard_print_layers/wizard-print-layers';
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: 'WizardPrintReview',
|
|
37
|
+
components: {
|
|
38
|
+
WizardPrintLayers
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
...mapGetters('layers', ['editableLayers']),
|
|
42
|
+
layers() {
|
|
43
|
+
return this.editableLayers;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
methods: {
|
|
47
|
+
...mapMutations('product', ['addTemplateLayer', 'clearWizardData']),
|
|
48
|
+
...mapMutations('layers', ['setEditableLayers']),
|
|
49
|
+
goNext() {
|
|
50
|
+
this.editableLayers.forEach(editableLayer => {
|
|
51
|
+
gtm.push({
|
|
52
|
+
event: 'complete_printing_wizard',
|
|
53
|
+
type: editableLayer.type,
|
|
54
|
+
text: editableLayer.copy,
|
|
55
|
+
file: editableLayer.file,
|
|
56
|
+
notes: editableLayer.notes
|
|
57
|
+
});
|
|
58
|
+
this.addTemplateLayer(editableLayer);
|
|
59
|
+
});
|
|
60
|
+
this.clearWizardData();
|
|
61
|
+
this.setEditableLayers([]);
|
|
62
|
+
|
|
63
|
+
this.$emit('next');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style lang="scss">
|
|
70
|
+
@import 'wizard-print-review';
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.WizardPrintSize {
|
|
4
|
+
&__title {
|
|
5
|
+
font-weight: 800;
|
|
6
|
+
font-size: 28px;
|
|
7
|
+
line-height: 38px;
|
|
8
|
+
color: $black;
|
|
9
|
+
margin-bottom: 26px;
|
|
10
|
+
}
|
|
11
|
+
&__area {
|
|
12
|
+
margin-bottom: 20px;
|
|
13
|
+
}
|
|
14
|
+
&__sizes {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-around;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
margin: -10px 0 0 -10px;
|
|
19
|
+
width: calc(100% + 10px);
|
|
20
|
+
}
|
|
21
|
+
&__size {
|
|
22
|
+
width: 140px;
|
|
23
|
+
height: 122px;
|
|
24
|
+
margin: 10px 0 0 10px;
|
|
25
|
+
border: 1px solid $grey_3;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
position: relative;
|
|
32
|
+
&::after {
|
|
33
|
+
content: ' ';
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 10px;
|
|
36
|
+
right: 10px;
|
|
37
|
+
width: 20px;
|
|
38
|
+
height: 20px;
|
|
39
|
+
background: $gray;
|
|
40
|
+
border: 1px solid $grey_2;
|
|
41
|
+
border-radius: 10px;
|
|
42
|
+
}
|
|
43
|
+
&:hover {
|
|
44
|
+
border: 1px solid $green;
|
|
45
|
+
}
|
|
46
|
+
&--selected {
|
|
47
|
+
border: 1px solid $green;
|
|
48
|
+
&::after {
|
|
49
|
+
background-color: $green;
|
|
50
|
+
border: 1px solid $green;
|
|
51
|
+
background-image: url(/static/icons/checked.svg);
|
|
52
|
+
background-repeat: no-repeat;
|
|
53
|
+
background-position: center center;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
&-name {
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
line-height: 22px;
|
|
59
|
+
margin-top: 10px;
|
|
60
|
+
font-weight: bold;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
&__see-price {
|
|
64
|
+
margin-top: 5px;
|
|
65
|
+
font-size: 12px;
|
|
66
|
+
color: $gray_main;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="WizardPrintSize__wrapper">
|
|
3
|
+
<div class="WizardPrintSize__areas">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(editablePrintArea, index) in editablePrintAreas"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="WizardPrintSize__area">
|
|
8
|
+
<div class="WizardPrintSize__title">
|
|
9
|
+
{{ editablePrintArea.name }}
|
|
10
|
+
</div>
|
|
11
|
+
<wizard-print-area-print-size :editable-print-area="editablePrintArea" />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="ProgressSteps__controls">
|
|
15
|
+
<btn
|
|
16
|
+
btn-class="white"
|
|
17
|
+
btn-label="BACK"
|
|
18
|
+
@onclick="$emit('prev')">
|
|
19
|
+
</btn>
|
|
20
|
+
<btn
|
|
21
|
+
btn-class="green"
|
|
22
|
+
btn-label="NEXT"
|
|
23
|
+
@onclick="$emit('next')">
|
|
24
|
+
<i
|
|
25
|
+
slot="icon-after"
|
|
26
|
+
class="icon-arrow-right"></i>
|
|
27
|
+
</btn>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { mapGetters } from 'vuex';
|
|
34
|
+
import WizardPrintAreaPrintSize from './wizard_print_area_print_size/wizard-print-area-print-size';
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: 'WizardPrintSize',
|
|
38
|
+
components: {
|
|
39
|
+
WizardPrintAreaPrintSize
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
...mapGetters('product', ['editablePrintAreas'])
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="scss">
|
|
48
|
+
@import 'wizard-print-size';
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.WizardPrintAreaPrintSize {
|
|
4
|
+
&__title {
|
|
5
|
+
font-weight: 800;
|
|
6
|
+
font-size: 28px;
|
|
7
|
+
line-height: 38px;
|
|
8
|
+
color: $black;
|
|
9
|
+
margin-bottom: 26px;
|
|
10
|
+
}
|
|
11
|
+
&__sizes {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-around;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
margin: -10px 0 0 -10px;
|
|
16
|
+
width: calc(100% + 10px);
|
|
17
|
+
}
|
|
18
|
+
&__size {
|
|
19
|
+
width: 140px;
|
|
20
|
+
height: 122px;
|
|
21
|
+
margin: 10px 0 0 10px;
|
|
22
|
+
border: 1px solid $grey_3;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
position: relative;
|
|
29
|
+
&::after {
|
|
30
|
+
content: ' ';
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 10px;
|
|
33
|
+
right: 10px;
|
|
34
|
+
width: 20px;
|
|
35
|
+
height: 20px;
|
|
36
|
+
background: $gray;
|
|
37
|
+
border: 1px solid $grey_2;
|
|
38
|
+
border-radius: 10px;
|
|
39
|
+
}
|
|
40
|
+
&:hover {
|
|
41
|
+
border: 1px solid $green;
|
|
42
|
+
}
|
|
43
|
+
&--selected {
|
|
44
|
+
border: 1px solid $green;
|
|
45
|
+
&::after {
|
|
46
|
+
background-color: $green;
|
|
47
|
+
border: 1px solid $green;
|
|
48
|
+
background-image: url(/static/icons/checked.svg);
|
|
49
|
+
background-repeat: no-repeat;
|
|
50
|
+
background-position: center center;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
&-name {
|
|
54
|
+
font-size: 16px;
|
|
55
|
+
line-height: 22px;
|
|
56
|
+
margin-top: 10px;
|
|
57
|
+
font-weight: bold;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
&__see-price {
|
|
61
|
+
margin-top: 5px;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
color: $gray_main;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="WizardPrintAreaPrintSize__wrapper">
|
|
3
|
+
<div class="WizardPrintAreaPrintSize__sizes">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(size, index) in sizes"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="WizardPrintAreaPrintSize__size"
|
|
8
|
+
:class="{
|
|
9
|
+
'WizardPrintAreaPrintSize__size--selected': isSelectedSize(size)
|
|
10
|
+
}"
|
|
11
|
+
@click="selectPrintAreaSize(size)">
|
|
12
|
+
<div class="WizardPrintAreaPrintSize__size-name">
|
|
13
|
+
{{ size.name }}
|
|
14
|
+
</div>
|
|
15
|
+
<div class="WizardPrintAreaPrintSize__type-price mt-3">
|
|
16
|
+
<span>
|
|
17
|
+
{{ getSizePricing(size) | pricingRange }}
|
|
18
|
+
</span>
|
|
19
|
+
</div>
|
|
20
|
+
<v-popover
|
|
21
|
+
ref="popover"
|
|
22
|
+
trigger="hover"
|
|
23
|
+
:delay="{ show: 200, hide: 400 }"
|
|
24
|
+
popover-class="tooltip popover white"
|
|
25
|
+
class="WizardPrintAreaPrintSize__see-price">
|
|
26
|
+
see prices
|
|
27
|
+
<template slot="popover">
|
|
28
|
+
<pricing-table
|
|
29
|
+
:items="getSizePrintTypes(size)"
|
|
30
|
+
pricing-attr="sizePrintArea.printCost" />
|
|
31
|
+
</template>
|
|
32
|
+
</v-popover>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
import { mapGetters, mapMutations } from 'vuex';
|
|
40
|
+
import { pricingRange } from '@lancom/shared/assets/js/utils/filters';
|
|
41
|
+
import { getPrintAreaSizes } from '@lancom/shared/assets/js/utils/prints';
|
|
42
|
+
import PricingTable from '@lancom/shared/components/common/pricing_table/pricing-table';
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
name: 'WizardPrintAreaPrintSize',
|
|
46
|
+
components: {
|
|
47
|
+
PricingTable
|
|
48
|
+
},
|
|
49
|
+
filters: {
|
|
50
|
+
pricingRange
|
|
51
|
+
},
|
|
52
|
+
props: {
|
|
53
|
+
editablePrintArea: {
|
|
54
|
+
type: Object,
|
|
55
|
+
required: true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
computed: {
|
|
59
|
+
...mapGetters('product', ['product', 'selectedPrintAreas', 'availablePrintTypes']),
|
|
60
|
+
selectedPrintArea() {
|
|
61
|
+
return this.selectedPrintAreas[this.editablePrintArea._id];
|
|
62
|
+
},
|
|
63
|
+
sizes() {
|
|
64
|
+
return getPrintAreaSizes(this.editablePrintArea);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
mounted() {
|
|
68
|
+
if (!this.selectedPrintArea) {
|
|
69
|
+
const first = this.sizes[0];
|
|
70
|
+
if (first) {
|
|
71
|
+
this.selectPrintAreaSize(first);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
...mapMutations('product', ['setSelectedPrintArea']),
|
|
77
|
+
isSelectedSize(printArea) {
|
|
78
|
+
return this.selectedPrintArea?._id === printArea._id;
|
|
79
|
+
},
|
|
80
|
+
selectPrintAreaSize(size) {
|
|
81
|
+
this.setSelectedPrintArea({ printArea: this.editablePrintArea._id, size });
|
|
82
|
+
},
|
|
83
|
+
getSizePrintTypes({ _id }) {
|
|
84
|
+
return this.product.printTypes
|
|
85
|
+
.map(type => ({
|
|
86
|
+
...type,
|
|
87
|
+
sizePrintArea: type.printAreas.find(({ printSizes }) => printSizes.map(({ _id }) => _id).includes(_id))
|
|
88
|
+
}))
|
|
89
|
+
.filter(printType => this?.availablePrintTypes.includes(printType.type) && !!printType.sizePrintArea);
|
|
90
|
+
},
|
|
91
|
+
getSizePricing(size) {
|
|
92
|
+
const sizePrintTypes = this.getSizePrintTypes(size);
|
|
93
|
+
return sizePrintTypes.reduce((pricing, { sizePrintArea }) => {
|
|
94
|
+
return [
|
|
95
|
+
...pricing,
|
|
96
|
+
...sizePrintArea.printCost
|
|
97
|
+
];
|
|
98
|
+
}, []);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<style lang="scss">
|
|
105
|
+
@import 'wizard-print-area-print-size';
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.WizardPrintTextOrLogo {
|
|
4
|
+
&__title {
|
|
5
|
+
font-weight: 800;
|
|
6
|
+
font-size: 28px;
|
|
7
|
+
line-height: 38px;
|
|
8
|
+
color: $black;
|
|
9
|
+
margin-bottom: 26px;
|
|
10
|
+
}
|
|
11
|
+
&__sizes {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-around;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
margin: -10px 0 0 -10px;
|
|
16
|
+
width: calc(100% + 10px);
|
|
17
|
+
}
|
|
18
|
+
&__size {
|
|
19
|
+
width: 140px;
|
|
20
|
+
height: 122px;
|
|
21
|
+
margin: 10px 0 0 10px;
|
|
22
|
+
border: 1px solid $grey_3;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
position: relative;
|
|
29
|
+
&::after {
|
|
30
|
+
content: ' ';
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 10px;
|
|
33
|
+
right: 10px;
|
|
34
|
+
width: 20px;
|
|
35
|
+
height: 20px;
|
|
36
|
+
background: $gray;
|
|
37
|
+
border: 1px solid $grey_2;
|
|
38
|
+
border-radius: 10px;
|
|
39
|
+
}
|
|
40
|
+
&:hover {
|
|
41
|
+
border: 1px solid $green;
|
|
42
|
+
}
|
|
43
|
+
&--selected {
|
|
44
|
+
border: 1px solid $green;
|
|
45
|
+
&::after {
|
|
46
|
+
background-color: $green;
|
|
47
|
+
border: 1px solid $green;
|
|
48
|
+
background-image: url(/static/icons/checked.svg);
|
|
49
|
+
background-repeat: no-repeat;
|
|
50
|
+
background-position: center center;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
&-name {
|
|
54
|
+
font-size: 16px;
|
|
55
|
+
line-height: 22px;
|
|
56
|
+
margin-top: 10px;
|
|
57
|
+
font-weight: bold;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
&__see-price {
|
|
61
|
+
margin-top: 5px;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
color: $gray_main;
|
|
64
|
+
}
|
|
65
|
+
}
|