@lancom/shared 0.0.277 → 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 +6 -0
- package/assets/js/utils/quote.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/order/order_view/order-view.scss +1 -1
- package/components/product/gallery/gallery.scss +21 -0
- package/components/product/gallery/gallery.vue +33 -4
- 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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
.WizardPrintAreaPrintType {
|
|
3
|
+
&__title {
|
|
4
|
+
font-weight: 800;
|
|
5
|
+
font-size: 28px;
|
|
6
|
+
line-height: 38px;
|
|
7
|
+
color: $black;
|
|
8
|
+
margin-bottom: 26px;
|
|
9
|
+
}
|
|
10
|
+
&__types {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
justify-content: space-around;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
margin: -10px 0 0 -10px;
|
|
15
|
+
width: calc(100% + 10px);
|
|
16
|
+
}
|
|
17
|
+
&__type {
|
|
18
|
+
width: 194px;
|
|
19
|
+
min-height: 122px;
|
|
20
|
+
margin: 10px 0 0 10px;
|
|
21
|
+
padding: 20px 0;
|
|
22
|
+
border: 1px solid $grey_3;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: flex-start;
|
|
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
|
+
text-align: center;
|
|
59
|
+
text-transform: uppercase;
|
|
60
|
+
}
|
|
61
|
+
&-checkbox {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 10px;
|
|
64
|
+
right: 0px;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
}
|
|
67
|
+
&-icon {
|
|
68
|
+
height: 50px;
|
|
69
|
+
width: 130px;
|
|
70
|
+
background-position: center;
|
|
71
|
+
background-size: contain;
|
|
72
|
+
background-repeat: no-repeat;
|
|
73
|
+
margin: 3px 0;
|
|
74
|
+
}
|
|
75
|
+
&-description {
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
line-height: 16px;
|
|
78
|
+
text-align: center;
|
|
79
|
+
color: $gray_main;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&__see-price {
|
|
83
|
+
margin-top: 5px;
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
color: $gray_main;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="WizardPrintAreaPrintType__wrapper">
|
|
3
|
+
<div class="WizardPrintAreaPrintType__types">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(type, index) in types"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="WizardPrintAreaPrintType__type"
|
|
8
|
+
:class="{
|
|
9
|
+
'WizardPrintAreaPrintType__type--selected': isSelectedType(type)
|
|
10
|
+
}"
|
|
11
|
+
@click="selectPrintType(type)">
|
|
12
|
+
<div
|
|
13
|
+
v-if="type.icon"
|
|
14
|
+
class="WizardPrintAreaPrintType__type-icon"
|
|
15
|
+
:style="{
|
|
16
|
+
'background-image': `url('${type.icon}')`
|
|
17
|
+
}"></div>
|
|
18
|
+
<div class="WizardPrintAreaPrintType__type-name">
|
|
19
|
+
{{ type.displayName || type.name }}
|
|
20
|
+
</div>
|
|
21
|
+
<div
|
|
22
|
+
v-if="type.description"
|
|
23
|
+
class="WizardPrintAreaPrintType__type-description mt-7">
|
|
24
|
+
{{ type.description }}
|
|
25
|
+
</div>
|
|
26
|
+
<div class="WizardPrintAreaPrintType__type-price mt-7">
|
|
27
|
+
<span>
|
|
28
|
+
{{ getPrinTypePricing(type) | pricingRange }}
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
<v-popover
|
|
32
|
+
ref="popover"
|
|
33
|
+
trigger="hover"
|
|
34
|
+
:delay="{ show: 200, hide: 400 }"
|
|
35
|
+
popover-class="tooltip popover white"
|
|
36
|
+
class="WizardPrintAreaPrintType__see-price">
|
|
37
|
+
see prices
|
|
38
|
+
<template slot="popover">
|
|
39
|
+
<pricing-discounts-table :prices="getPrinTypePricing(type)" />
|
|
40
|
+
</template>
|
|
41
|
+
</v-popover>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
import { mapGetters, mapMutations } from 'vuex';
|
|
49
|
+
import { sortByOrder } from '@lancom/shared/assets/js/utils/product';
|
|
50
|
+
import { pricingRange } from '@lancom/shared/assets/js/utils/filters';
|
|
51
|
+
import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
name: 'WizardPrintAreaPrintType',
|
|
55
|
+
components: {
|
|
56
|
+
PricingDiscountsTable
|
|
57
|
+
},
|
|
58
|
+
filters: {
|
|
59
|
+
pricingRange
|
|
60
|
+
},
|
|
61
|
+
props: {
|
|
62
|
+
editablePrintArea: {
|
|
63
|
+
type: Object,
|
|
64
|
+
required: true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
computed: {
|
|
68
|
+
...mapGetters('product', ['selectedPrintAreas', 'selectedPrintTypes', 'product', 'availablePrintTypes', 'selectedPrintUnderbases']),
|
|
69
|
+
selectedPrintArea() {
|
|
70
|
+
return this.selectedPrintAreas[this.editablePrintArea._id];
|
|
71
|
+
},
|
|
72
|
+
selectedPrintType() {
|
|
73
|
+
return this.selectedPrintTypes[this.editablePrintArea._id];
|
|
74
|
+
},
|
|
75
|
+
selectedPrintUnderbase() {
|
|
76
|
+
return this.selectedPrintUnderbases[this.editablePrintArea._id];
|
|
77
|
+
},
|
|
78
|
+
types() {
|
|
79
|
+
const available = this.availablePrintTypes || [];
|
|
80
|
+
const isScreenPrint = available.includes('screen print');
|
|
81
|
+
const types = this.product.printTypes
|
|
82
|
+
.filter(printType => this.availablePrintTypes.includes(printType.type) && !!this.getPrinTypeArea(printType) && (!isScreenPrint || !!printType.hasUnderbase === this.selectedPrintUnderbase));
|
|
83
|
+
return sortByOrder(types);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
mounted() {
|
|
87
|
+
if (!this.selectedPrintType) {
|
|
88
|
+
const type = this.types[0];
|
|
89
|
+
if (type) {
|
|
90
|
+
this.selectPrintType(type);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
methods: {
|
|
95
|
+
...mapMutations('product', ['setSelectedPrintTypes']),
|
|
96
|
+
isSelectedType(type) {
|
|
97
|
+
return this.selectedPrintType && this.selectedPrintType._id === type._id;
|
|
98
|
+
},
|
|
99
|
+
selectPrintType(type) {
|
|
100
|
+
this.setSelectedPrintTypes({ printArea: this.editablePrintArea._id, type });
|
|
101
|
+
},
|
|
102
|
+
getPrinTypePricing(printType) {
|
|
103
|
+
return this.getPrinTypeArea(printType)?.printCost;
|
|
104
|
+
},
|
|
105
|
+
getPrinTypeArea({ printAreas }) {
|
|
106
|
+
return printAreas.find(({ printSizes }) => printSizes.map(({ _id }) => _id).includes(this.selectedPrintArea?._id)) || printAreas[0];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<style lang="scss">
|
|
113
|
+
@import 'wizard-print-area-print-type';
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.WizardPrintUnderbase {
|
|
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,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="WizardPrintUnderbase__wrapper">
|
|
3
|
+
<div class="WizardPrintUnderbase__areas">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(editablePrintArea, index) in editablePrintAreas"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="WizardPrintUnderbase__area">
|
|
8
|
+
<div class="WizardPrintUnderbase__title">
|
|
9
|
+
{{ editablePrintArea.name }}
|
|
10
|
+
</div>
|
|
11
|
+
<wizard-print-area-print-underbase :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 WizardPrintAreaPrintUnderbase from './wizard_print_area_print_underbase/wizard-print-area-print-underbase';
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: 'WizardPrintUnderbase',
|
|
38
|
+
components: {
|
|
39
|
+
WizardPrintAreaPrintUnderbase
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
...mapGetters('product', ['editablePrintAreas'])
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="scss">
|
|
48
|
+
@import 'wizard-print-underbase';
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
.WizardPrintType {
|
|
3
|
+
&__title {
|
|
4
|
+
font-weight: 800;
|
|
5
|
+
font-size: 28px;
|
|
6
|
+
line-height: 38px;
|
|
7
|
+
color: $black;
|
|
8
|
+
margin-bottom: 26px;
|
|
9
|
+
}
|
|
10
|
+
&__types {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
justify-content: space-around;
|
|
13
|
+
flex-wrap: wrap;
|
|
14
|
+
margin: -10px 0 0 -10px;
|
|
15
|
+
width: calc(100% + 10px);
|
|
16
|
+
}
|
|
17
|
+
&__type {
|
|
18
|
+
width: 234px;
|
|
19
|
+
min-height: 122px;
|
|
20
|
+
margin: 10px 0 0 10px;
|
|
21
|
+
padding: 10px 0;
|
|
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
|
+
text-align: center;
|
|
59
|
+
text-transform: uppercase;
|
|
60
|
+
}
|
|
61
|
+
&-checkbox {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 10px;
|
|
64
|
+
right: 0px;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
}
|
|
67
|
+
&-icon {
|
|
68
|
+
height: 50px;
|
|
69
|
+
width: 130px;
|
|
70
|
+
background-position: center;
|
|
71
|
+
background-size: contain;
|
|
72
|
+
background-repeat: no-repeat;
|
|
73
|
+
margin: 3px 0;
|
|
74
|
+
}
|
|
75
|
+
&-description {
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
line-height: 16px;
|
|
78
|
+
text-align: center;
|
|
79
|
+
color: $gray_main;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&__see-price {
|
|
83
|
+
margin-top: 5px;
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
color: $gray_main;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="WizardPrintAreaPrintType__wrapper">
|
|
3
|
+
<div class="WizardPrintAreaPrintType__types">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(type, index) in types"
|
|
6
|
+
:key="index"
|
|
7
|
+
class="WizardPrintAreaPrintType__type"
|
|
8
|
+
:class="{
|
|
9
|
+
'WizardPrintAreaPrintType__type--selected': type.value === selectedPrintUnderbase
|
|
10
|
+
}"
|
|
11
|
+
@click="selectPrintUnderbase(type)">
|
|
12
|
+
<div
|
|
13
|
+
class="WizardPrintAreaPrintType__type-icon"
|
|
14
|
+
:style="{
|
|
15
|
+
'background-image': `url('/images/${ type.value ? 'white-base-crop.jpg' : 'no-base-crop.jpg' }')`
|
|
16
|
+
}"
|
|
17
|
+
@click="previewUnderbase(type.value ? 1 : 0)"></div>
|
|
18
|
+
<div class="WizardPrintAreaPrintType__type-name">
|
|
19
|
+
{{ type.label }}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import { mapGetters, mapMutations } from 'vuex';
|
|
28
|
+
import ImageViewer from '@lancom/shared/components/common/image_viewer/image-viewer';
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: 'WizardPrintAreaPrintUnderbase',
|
|
32
|
+
props: {
|
|
33
|
+
editablePrintArea: {
|
|
34
|
+
type: Object,
|
|
35
|
+
required: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
...mapGetters('product', ['selectedPrintUnderbases']),
|
|
40
|
+
selectedPrintUnderbase() {
|
|
41
|
+
return this.selectedPrintUnderbases[this.editablePrintArea._id];
|
|
42
|
+
},
|
|
43
|
+
types() {
|
|
44
|
+
return [{
|
|
45
|
+
label: 'base layer not required',
|
|
46
|
+
value: false
|
|
47
|
+
}, {
|
|
48
|
+
label: 'add white ink base',
|
|
49
|
+
value: true
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
mounted() {
|
|
54
|
+
this.setSelectedPrintTypes({ printArea: this.editablePrintArea._id, type: null });
|
|
55
|
+
this.selectPrintUnderbase(true);
|
|
56
|
+
},
|
|
57
|
+
methods: {
|
|
58
|
+
...mapMutations('product', ['setSelectedPrintTypes', 'setSelectedPrintUnderbases', 'setSelectedPrintType']),
|
|
59
|
+
selectPrintUnderbase(type) {
|
|
60
|
+
this.setSelectedPrintUnderbases({ printArea: this.editablePrintArea._id, underbase: type.value });
|
|
61
|
+
},
|
|
62
|
+
previewUnderbase(index) {
|
|
63
|
+
this.$modal.show(
|
|
64
|
+
ImageViewer,
|
|
65
|
+
{
|
|
66
|
+
items: [{
|
|
67
|
+
src: '/images/no-base.jpg'
|
|
68
|
+
}, {
|
|
69
|
+
src: '/images/white-base.jpg'
|
|
70
|
+
}],
|
|
71
|
+
index
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'image-viewer-modal',
|
|
75
|
+
root: this.$root,
|
|
76
|
+
width: '100%',
|
|
77
|
+
height: 'auto',
|
|
78
|
+
adaptive: true,
|
|
79
|
+
clickToClose: true,
|
|
80
|
+
transition: 'from-top-to-bottom'
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<style lang="scss">
|
|
89
|
+
@import 'wizard-print-area-print-underbase';
|
|
90
|
+
</style>
|
package/package.json
CHANGED
package/store/layers.js
CHANGED
|
@@ -4,12 +4,14 @@ import Vue from 'vue';
|
|
|
4
4
|
|
|
5
5
|
export const state = () => ({
|
|
6
6
|
editableLayer: null,
|
|
7
|
+
editableLayers: [],
|
|
7
8
|
layerThumbnails: {}
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
export const getters = {
|
|
11
12
|
layerThumbnails: ({ layerThumbnails }) => layerThumbnails,
|
|
12
|
-
editableLayer: ({ editableLayer }) => editableLayer
|
|
13
|
+
editableLayer: ({ editableLayer }) => editableLayer,
|
|
14
|
+
editableLayers: ({ editableLayers }) => editableLayers
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export const actions = {
|
|
@@ -22,6 +24,9 @@ export const mutations = {
|
|
|
22
24
|
setEditableLayer(state, layer) {
|
|
23
25
|
state.editableLayer = layer;
|
|
24
26
|
},
|
|
27
|
+
setEditableLayers(state, editableLayers) {
|
|
28
|
+
state.editableLayers = editableLayers;
|
|
29
|
+
},
|
|
25
30
|
resetLayers(state) {
|
|
26
31
|
state.layerThumbnails = {};
|
|
27
32
|
}
|
package/store/product.js
CHANGED
|
@@ -35,7 +35,10 @@ export const state = () => ({
|
|
|
35
35
|
editableColor: null,
|
|
36
36
|
selectedLayer: null,
|
|
37
37
|
editablePrintArea: null,
|
|
38
|
+
editablePrintAreas: [],
|
|
38
39
|
selectedPrintType: null,
|
|
40
|
+
selectedPrintTypes: {},
|
|
41
|
+
selectedPrintUnderbases: {},
|
|
39
42
|
selectedPrintUnderbase: false,
|
|
40
43
|
editModeSelectedLayer: false,
|
|
41
44
|
selectedPrintAreas: {},
|
|
@@ -109,8 +112,11 @@ export const getters = {
|
|
|
109
112
|
},
|
|
110
113
|
printsPricing: ({ product }) => getProductPrintsAreasPrices(product),
|
|
111
114
|
editablePrintArea: ({ editablePrintArea }) => editablePrintArea,
|
|
115
|
+
editablePrintAreas: ({ editablePrintAreas }) => editablePrintAreas,
|
|
112
116
|
selectedPrintType: ({ selectedPrintType }) => selectedPrintType,
|
|
117
|
+
selectedPrintTypes: ({ selectedPrintTypes }) => selectedPrintTypes,
|
|
113
118
|
selectedPrintUnderbase: ({ selectedPrintUnderbase }) => selectedPrintUnderbase,
|
|
119
|
+
selectedPrintUnderbases: ({ selectedPrintUnderbases }) => selectedPrintUnderbases,
|
|
114
120
|
availablePrintTypes: ({ availablePrintTypes }) => availablePrintTypes,
|
|
115
121
|
isPrintPricing: ({ isPrintPricing }) => isPrintPricing,
|
|
116
122
|
minimumOrderQuantity: ({ product, template }) => {
|
|
@@ -431,9 +437,45 @@ export const mutations = {
|
|
|
431
437
|
setEditablePrintArea(state, printArea) {
|
|
432
438
|
state.editablePrintArea = printArea;
|
|
433
439
|
},
|
|
440
|
+
addEditablePrintArea(state, printArea) {
|
|
441
|
+
state.editablePrintAreas = [
|
|
442
|
+
...state.editablePrintAreas.filter(pa => pa._id !== printArea._id),
|
|
443
|
+
printArea
|
|
444
|
+
];
|
|
445
|
+
},
|
|
446
|
+
toggleEditablePrintArea(state, printArea) {
|
|
447
|
+
const isExist = state.editablePrintAreas.some(pa => pa._id === printArea._id);
|
|
448
|
+
if (isExist) {
|
|
449
|
+
state.editablePrintAreas = state.editablePrintAreas.filter(pa => pa._id !== printArea._id);
|
|
450
|
+
} else {
|
|
451
|
+
state.editablePrintAreas = [
|
|
452
|
+
...state.editablePrintAreas,
|
|
453
|
+
printArea
|
|
454
|
+
];
|
|
455
|
+
}
|
|
456
|
+
},
|
|
434
457
|
setSelectedPrintType(state, printType) {
|
|
435
458
|
state.selectedPrintType = printType;
|
|
436
459
|
},
|
|
460
|
+
setSelectedPrintTypes(state, { printArea, type }) {
|
|
461
|
+
state.selectedPrintTypes = {
|
|
462
|
+
...state.selectedPrintTypes,
|
|
463
|
+
[printArea]: type
|
|
464
|
+
};
|
|
465
|
+
},
|
|
466
|
+
setSelectedPrintUnderbases(state, { printArea, underbase }) {
|
|
467
|
+
state.selectedPrintUnderbases = {
|
|
468
|
+
...state.selectedPrintUnderbases,
|
|
469
|
+
[printArea]: underbase
|
|
470
|
+
};
|
|
471
|
+
},
|
|
472
|
+
clearWizardData(state) {
|
|
473
|
+
state.editablePrintAreas = [];
|
|
474
|
+
state.selectedPrintTypes = {};
|
|
475
|
+
state.selectedPrintUnderbases = {};
|
|
476
|
+
state.selectedPrintAreas = {};
|
|
477
|
+
state.editablePrintAreas = [];
|
|
478
|
+
},
|
|
437
479
|
setSelectedPrintUnderbase(state, printUnderbase) {
|
|
438
480
|
state.selectedPrintUnderbase = printUnderbase;
|
|
439
481
|
},
|