@lancom/shared 0.0.280 → 0.0.281
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/assets/js/api/index.js +5 -2
- package/assets/js/models/print-area.js +5 -3
- package/assets/js/utils/colors.js +1 -1
- package/assets/js/utils/fabric-helper.js +1 -1
- package/assets/js/utils/filters.js +2 -2
- package/assets/scss/_common.scss +10 -0
- package/components/asides/contact_us/contact-us.vue +9 -2
- package/components/asides/menu/menu.vue +1 -25
- package/components/checkout/cart/cart.mixin.js +3 -3
- package/components/checkout/cart/cart.scss +8 -109
- package/components/checkout/cart/cart.vue +84 -46
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +7 -4
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +4 -5
- package/components/checkout/cart/cart_pricing/cart-pricing.scss +34 -0
- package/components/checkout/cart/cart_pricing/cart-pricing.vue +112 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
- package/components/checkout/order/address-form/address-form.scss +16 -0
- package/components/checkout/order/address-form/address-form.vue +199 -91
- package/components/checkout/order/order-billing-information/order-billing-information.scss +1 -1
- package/components/checkout/order/order-payment-information/order-payment-information.vue +15 -5
- package/components/checkout/order/order.vue +2 -1
- package/components/common/client_settings/client-settings.scss +6 -0
- package/components/common/client_settings/client-settings.vue +9 -1
- package/components/common/payment/payment_card/stripe/stripe.vue +1 -0
- package/components/common/payment/payment_success/payment-success.vue +8 -1
- package/components/common/postcode_select/postcode-select.vue +22 -12
- package/components/common/price.vue +1 -1
- package/components/common/pricing_table/pricing-table.vue +3 -2
- package/components/common/tabs.vue +17 -8
- package/components/editor/editor.scss +6 -0
- package/components/editor/editor.vue +22 -19
- package/components/editor/editor_layers/editor-layers.vue +3 -2
- package/components/editor/editor_print_area_options/editor-print-area-options.vue +2 -0
- package/components/editor/editor_product_details/editor-product-details.scss +8 -2
- package/components/editor/editor_product_details/editor-product-details.vue +22 -25
- package/components/editor/editor_wizard/editor-wizard.vue +2 -1
- package/components/editor/editor_workspace/editor-workspace.vue +3 -2
- package/components/modals/cart_modal/cart-modal.vue +1 -1
- package/components/modals/order_modal/order-modal.vue +6 -0
- package/components/modals/payment_modal/payment-modal.vue +4 -3
- package/components/order/order_payment/order-payment.vue +6 -6
- package/components/product/editor_pricing/editor-pricing.scss +75 -0
- package/components/product/editor_pricing/editor-pricing.vue +228 -0
- package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
- package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +118 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +102 -0
- package/components/product/product.vue +1 -1
- package/components/product/product_colors_selector/product-colors-selector.scss +117 -0
- package/components/product/product_colors_selector/product-colors-selector.vue +188 -0
- package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +3 -1
- package/components/product/product_size_selector/product_size_selector_color/product_size_selector_color_cell/product-size-selector-color-cell.vue +4 -5
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.scss +58 -0
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.vue +128 -0
- package/components/product/products_size_selector_color/products-size-selector-color.scss +12 -0
- package/components/product/products_size_selector_color/products-size-selector-color.vue +43 -0
- package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +2 -1
- package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +2 -1
- package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +2 -1
- package/components/products/product_list/product-list.scss +2 -2
- package/components/products/product_list_product/product-list-product.scss +7 -11
- package/components/products/product_list_product/product-list-product.vue +7 -15
- package/components/the_aside/the-aside.vue +1 -0
- package/feeds/google-shopping.js +4 -4
- package/layouts/error.vue +39 -0
- package/layouts/products.vue +386 -0
- package/mixins/payment.js +2 -1
- package/mixins/product-preview.js +1 -1
- package/mixins/product-view.js +313 -0
- package/nuxt.config.js +0 -5
- package/package.json +1 -1
- package/pages/checkout/cart.vue +40 -0
- package/pages/checkout/order.vue +72 -0
- package/pages/customer/create.vue +33 -0
- package/pages/customer/password/_token.vue +79 -0
- package/pages/customer/recovery.vue +33 -0
- package/pages/customer/settings.vue +33 -0
- package/pages/customer/signin.vue +33 -0
- package/routes/index.js +35 -0
- package/store/cart.js +11 -6
- package/store/order.js +2 -2
- package/store/product.js +0 -6
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorPricing__wrapper">
|
|
3
|
+
<div class="EditorPricing__main">
|
|
4
|
+
<div
|
|
5
|
+
v-if="isValidOrderQuantity && showDetails"
|
|
6
|
+
class="EditorPricing__details">
|
|
7
|
+
<editor-pricing-details />
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
v-if="addedToCart"
|
|
12
|
+
class="EditorPricing__main-alert">
|
|
13
|
+
<img src="/images/smile.svg" />
|
|
14
|
+
Products have been added to cart
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
v-else-if="!hasUsedSimpleProducts && (!layers.length && isPrintPricing)"
|
|
19
|
+
class="EditorPricing__main-alert">
|
|
20
|
+
<img src="/images/sad.svg" />
|
|
21
|
+
No products selected and no prints defined
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div
|
|
25
|
+
v-else-if="hasUsedSimpleProducts && (!layers.length && isPrintPricing)"
|
|
26
|
+
class="EditorPricing__main-alert">
|
|
27
|
+
<img src="/images/sad.svg" />
|
|
28
|
+
No prints defined
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
v-else-if="!hasUsedSimpleProducts && layers.length"
|
|
33
|
+
class="EditorPricing__main-alert">
|
|
34
|
+
<img src="/images/sad.svg" />
|
|
35
|
+
No products selected to view price
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div
|
|
39
|
+
v-else-if="!isValidMiltipackOrderQuantity"
|
|
40
|
+
class="EditorPricing__main-alert">
|
|
41
|
+
<img src="/images/sad.svg" />
|
|
42
|
+
bulk pack {{ multipack.qty }} - add more x {{ multipack.qty - usedSimpleProductsQuantity }}
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div
|
|
46
|
+
v-else-if="!isValidOrderQuantity && isValidBigSizeOrderQuantity && minimumOrderQuantity > 1"
|
|
47
|
+
class="EditorPricing__main-alert">
|
|
48
|
+
<img src="/images/sad.svg" />
|
|
49
|
+
Minimum order of these items must be {{ minimumOrderQuantity }} or more
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div
|
|
53
|
+
v-else-if="!isValidBigSizeOrderQuantity"
|
|
54
|
+
class="EditorPricing__main-alert">
|
|
55
|
+
<img src="/images/sad.svg" />
|
|
56
|
+
Minimum order of 5XL-7XL should be 50%
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div
|
|
60
|
+
v-else-if="isValidOrderQuantity"
|
|
61
|
+
class="EditorPricing__main-alert">
|
|
62
|
+
<img src="/images/smile.svg" />
|
|
63
|
+
All good to go!
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="EditorPricing__footer">
|
|
67
|
+
<div class="EditorPricing__footer-section">
|
|
68
|
+
<i class="icon-close-r"></i>
|
|
69
|
+
<div class="EditorPricing__total">
|
|
70
|
+
Pending:
|
|
71
|
+
<span v-if="isValidOrderQuantity && productPricing">
|
|
72
|
+
{{ totalPrice | price(currency) }}
|
|
73
|
+
</span>
|
|
74
|
+
<span v-else>
|
|
75
|
+
-
|
|
76
|
+
</span>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="EditorPricing__footer-section">
|
|
80
|
+
<div
|
|
81
|
+
v-if="isValidOrderQuantity"
|
|
82
|
+
class="lc_medium16 EditorPricing__toggle-details"
|
|
83
|
+
@click="toggleDetails">
|
|
84
|
+
{{ showDetails ? 'Hide' : 'Show' }} detail
|
|
85
|
+
</div>
|
|
86
|
+
<btn
|
|
87
|
+
v-if="hasCartBtn"
|
|
88
|
+
btn-class="green"
|
|
89
|
+
btn-label="Add to cart"
|
|
90
|
+
:btn-disabled="addToCartDisabled || !isValidOrderQuantity"
|
|
91
|
+
class="EditorPricing__add-to-cart-button"
|
|
92
|
+
@onclick="proceedToCard" />
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<script>
|
|
100
|
+
import { mapGetters, mapActions, mapMutations } from 'vuex';
|
|
101
|
+
import debounce from 'lodash.debounce';
|
|
102
|
+
import { generateCartProducts } from '@lancom/shared/assets/js/utils/product';
|
|
103
|
+
import { price, sizesRange, printsRange, tax } from '@lancom/shared/assets/js/utils/filters';
|
|
104
|
+
import EditorPricingDetails from '@lancom/shared/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details';
|
|
105
|
+
|
|
106
|
+
export default {
|
|
107
|
+
name: 'EditorPricing',
|
|
108
|
+
filters: {
|
|
109
|
+
price,
|
|
110
|
+
tax,
|
|
111
|
+
sizesRange,
|
|
112
|
+
printsRange
|
|
113
|
+
},
|
|
114
|
+
components: {
|
|
115
|
+
EditorPricingDetails
|
|
116
|
+
},
|
|
117
|
+
data() {
|
|
118
|
+
return {
|
|
119
|
+
price: null,
|
|
120
|
+
showDetails: false,
|
|
121
|
+
addedToCart: false,
|
|
122
|
+
calculatePriceWithDebounce: debounce(() => this.calculateProductPrice({ shop: this.shop, country: this.country }), 500)
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
props: {
|
|
126
|
+
hasCartBtn: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: true
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
computed: {
|
|
132
|
+
...mapGetters(['shop', 'country', 'currency']),
|
|
133
|
+
...mapGetters('product', [
|
|
134
|
+
'product',
|
|
135
|
+
'usedSimpleProducts',
|
|
136
|
+
'usedSimpleProductsQuantity',
|
|
137
|
+
'usedBigSizeSimpleProductsQuantity',
|
|
138
|
+
'productPricing',
|
|
139
|
+
'layers',
|
|
140
|
+
'selectedPrintAreas',
|
|
141
|
+
'printsPricing',
|
|
142
|
+
'template',
|
|
143
|
+
'editorSize',
|
|
144
|
+
'availablePrintTypes',
|
|
145
|
+
'isPrintPricing',
|
|
146
|
+
'minimumOrderQuantity',
|
|
147
|
+
'calculatingPrice',
|
|
148
|
+
'priceIncludeGST',
|
|
149
|
+
'multipack'
|
|
150
|
+
]),
|
|
151
|
+
isValidOrderQuantity() {
|
|
152
|
+
return this.isValidBigSizeOrderQuantity && this.isValidMiltipackOrderQuantity && (!this.minimumOrderQuantity || this.usedSimpleProductsQuantity >= this.minimumOrderQuantity);
|
|
153
|
+
},
|
|
154
|
+
isValidBigSizeOrderQuantity() {
|
|
155
|
+
return this.usedSimpleProductsQuantity ? ((this.usedBigSizeSimpleProductsQuantity / this.usedSimpleProductsQuantity * 100) <= 50) : true;
|
|
156
|
+
},
|
|
157
|
+
isValidMiltipackOrderQuantity() {
|
|
158
|
+
return !this.multipack || this.multipack.qty <= this.usedSimpleProductsQuantity;
|
|
159
|
+
},
|
|
160
|
+
addToCartDisabled() {
|
|
161
|
+
return !((this.template.layers.length || !this.isPrintPricing) && this.usedSimpleProducts.length) || this.calculatingPrice;
|
|
162
|
+
},
|
|
163
|
+
hasUsedSimpleProducts() {
|
|
164
|
+
return this.usedSimpleProducts.length > 0;
|
|
165
|
+
},
|
|
166
|
+
totalPrice() {
|
|
167
|
+
const { totalPriceWithoutTax, totalPrice } = this.productPricing;
|
|
168
|
+
return this.priceIncludeGST ? totalPrice : totalPriceWithoutTax;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
watch: {
|
|
172
|
+
layers() {
|
|
173
|
+
this.calculatePriceWithDebounce();
|
|
174
|
+
this.addedToCart = false;
|
|
175
|
+
if (!this.layers.length) {
|
|
176
|
+
this.showDetails = false;
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
usedSimpleProducts() {
|
|
180
|
+
this.calculatePriceWithDebounce();
|
|
181
|
+
this.addedToCart = false;
|
|
182
|
+
if (!this.hasUsedSimpleProducts) {
|
|
183
|
+
this.showDetails = false;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
selectedPrintAreas() {
|
|
187
|
+
this.calculatePriceWithDebounce();
|
|
188
|
+
},
|
|
189
|
+
availablePrintTypes() {
|
|
190
|
+
this.calculatePriceWithDebounce();
|
|
191
|
+
},
|
|
192
|
+
isPrintPricing() {
|
|
193
|
+
this.calculatePriceWithDebounce();
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
mounted() {
|
|
197
|
+
if (this.usedSimpleProducts.length > 0) {
|
|
198
|
+
this.calculatePriceWithDebounce();
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
methods: {
|
|
202
|
+
...mapActions('cart', ['addToCart']),
|
|
203
|
+
...mapActions('product', [
|
|
204
|
+
'calculateProductPrice'
|
|
205
|
+
]),
|
|
206
|
+
...mapMutations('product', ['clearTemplate', 'setIsPrintPricing']),
|
|
207
|
+
...mapMutations('layers', ['resetLayers']),
|
|
208
|
+
proceedToCard() {
|
|
209
|
+
const entities = generateCartProducts(this.product, this.template.simpleProducts, this.template.layers, this.isPrintPricing);
|
|
210
|
+
this.addToCart({ entities, shop: this.shop, pricing: this.productPricing, country: this.country, currency: this.currency });
|
|
211
|
+
this.$toastr.s('Products successfully added to cart');
|
|
212
|
+
this.clearTemplate(true);
|
|
213
|
+
// this.resetLayers();
|
|
214
|
+
// this.setIsPrintPricing(false);
|
|
215
|
+
setTimeout(() => {
|
|
216
|
+
this.addedToCart = true;
|
|
217
|
+
});
|
|
218
|
+
},
|
|
219
|
+
toggleDetails() {
|
|
220
|
+
this.showDetails = !this.showDetails;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
</script>
|
|
225
|
+
|
|
226
|
+
<style lang="scss" scoped>
|
|
227
|
+
@import 'editor-pricing';
|
|
228
|
+
</style>
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorPricingDetails__wrapper">
|
|
3
|
+
<editor-pricing-details-products />
|
|
4
|
+
<editor-pricing-details-prints v-if="isPrintPricing" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { mapGetters } from 'vuex';
|
|
10
|
+
import EditorPricingDetailsProducts from './editor_pricing_details_products/editor-pricing-details-products';
|
|
11
|
+
import EditorPricingDetailsPrints from './editor_pricing_details_prints/editor-pricing-details-prints';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'EditorPricingDetails',
|
|
15
|
+
components: {
|
|
16
|
+
EditorPricingDetailsProducts,
|
|
17
|
+
EditorPricingDetailsPrints
|
|
18
|
+
},
|
|
19
|
+
computed: {
|
|
20
|
+
...mapGetters('product', [
|
|
21
|
+
'isPrintPricing'
|
|
22
|
+
])
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
@import 'editor-pricing-details';
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.EditorPricingDetailsPrints {
|
|
4
|
+
&__wrapper td {
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
border: 1px solid $gray;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
line-height: 25px;
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
color: $black;
|
|
11
|
+
@media (max-width: $bp-extra-small-max) {
|
|
12
|
+
padding: 2px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
}
|
|
15
|
+
strong {
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
}
|
|
18
|
+
&.disabled {
|
|
19
|
+
color: $gray_main;
|
|
20
|
+
pointer-events: none !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&__th {
|
|
24
|
+
font-weight: bold !important;
|
|
25
|
+
background: $gray;
|
|
26
|
+
@media (max-width: $bp-extra-small-max) {
|
|
27
|
+
padding: 2px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
&__name {
|
|
32
|
+
width: 70px;
|
|
33
|
+
@media (max-width: $bp-extra-small-max) {
|
|
34
|
+
width: 30px;
|
|
35
|
+
}
|
|
36
|
+
span {
|
|
37
|
+
writing-mode: vertical-lr;
|
|
38
|
+
transform: rotate(180deg);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorPricingDetailsPrints__wrapper">
|
|
3
|
+
<table class="lc_table EditorPricingDetailsPrints__table">
|
|
4
|
+
<tbody class="centered">
|
|
5
|
+
<tr>
|
|
6
|
+
<td
|
|
7
|
+
class="EditorPricingDetailsPrints__name"
|
|
8
|
+
:rowspan="groupedProductsByPrintArea.length + (hasPrintSurcharge ? 3 : 2)">
|
|
9
|
+
<span>printing</span>
|
|
10
|
+
</td>
|
|
11
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
12
|
+
type of print
|
|
13
|
+
</td>
|
|
14
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
15
|
+
location
|
|
16
|
+
</td>
|
|
17
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
18
|
+
Setup cost
|
|
19
|
+
</td>
|
|
20
|
+
<td class="EditorPricingDetailsPrints__th">
|
|
21
|
+
Price
|
|
22
|
+
</td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr
|
|
25
|
+
v-for="([, group], index) in groupedProductsByPrintArea"
|
|
26
|
+
:key="index">
|
|
27
|
+
<td>
|
|
28
|
+
{{ group.printType.name }}
|
|
29
|
+
</td>
|
|
30
|
+
<td>
|
|
31
|
+
{{ group.printArea.name }}
|
|
32
|
+
</td>
|
|
33
|
+
<td>
|
|
34
|
+
<strong>
|
|
35
|
+
{{ group.setupPriceWithoutTax | price(currency) }}
|
|
36
|
+
</strong>
|
|
37
|
+
</td>
|
|
38
|
+
<td>
|
|
39
|
+
<span v-if="group.costType !== 'setup only'">
|
|
40
|
+
<strong>
|
|
41
|
+
{{ group.totalPriceWithoutTax | price(currency) }}
|
|
42
|
+
</strong>
|
|
43
|
+
= {{ group.amount }} x {{ group.priceWithoutTax | price(currency) }}
|
|
44
|
+
</span>
|
|
45
|
+
<strong v-else>
|
|
46
|
+
{{ group.totalPriceWithoutTax | price(currency) }}
|
|
47
|
+
</strong>
|
|
48
|
+
</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr v-if="hasPrintSurcharge">
|
|
51
|
+
<td colspan="4">
|
|
52
|
+
{{ printSurchargeNote }}
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="highlighted">
|
|
56
|
+
<td colspan="3">
|
|
57
|
+
Prints Subtotal:
|
|
58
|
+
</td>
|
|
59
|
+
<td>
|
|
60
|
+
<strong>
|
|
61
|
+
{{ productPricing.products.prints.totalPriceWithoutTax | price(currency) }}
|
|
62
|
+
</strong>
|
|
63
|
+
</td>
|
|
64
|
+
</tr>
|
|
65
|
+
</tbody>
|
|
66
|
+
</table>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script>
|
|
71
|
+
import { mapGetters } from 'vuex';
|
|
72
|
+
import { price, sizesRange } from '@lancom/shared/assets/js/utils/filters';
|
|
73
|
+
import { groupProductsPrintsByPrintArea } from '@lancom/shared/assets/js/utils/products-grouping';
|
|
74
|
+
|
|
75
|
+
export default {
|
|
76
|
+
name: 'EditorPricingDetailsPrints',
|
|
77
|
+
filters: {
|
|
78
|
+
price,
|
|
79
|
+
sizesRange
|
|
80
|
+
},
|
|
81
|
+
computed: {
|
|
82
|
+
...mapGetters(['currency']),
|
|
83
|
+
...mapGetters('product', [
|
|
84
|
+
'product',
|
|
85
|
+
'usedSimpleProducts',
|
|
86
|
+
'productPricing',
|
|
87
|
+
'mainProductPricing'
|
|
88
|
+
]),
|
|
89
|
+
hasPrintSurcharge() {
|
|
90
|
+
return this.product.printSurcharge > 0;
|
|
91
|
+
},
|
|
92
|
+
printSurchargeNote() {
|
|
93
|
+
const message = this.product.printSurchargeNote || 'surcharge of $x per print';
|
|
94
|
+
return message.replace(/\$x/, price(this.product.printSurcharge));
|
|
95
|
+
},
|
|
96
|
+
hasUsedSimpleProducts() {
|
|
97
|
+
return this.usedSimpleProducts.length > 0;
|
|
98
|
+
},
|
|
99
|
+
products() {
|
|
100
|
+
return this.hasUsedSimpleProducts
|
|
101
|
+
? this.usedSimpleProducts
|
|
102
|
+
: [];
|
|
103
|
+
},
|
|
104
|
+
groupedProductsByPrintArea() {
|
|
105
|
+
const groups = this.mainProductPricing
|
|
106
|
+
? groupProductsPrintsByPrintArea(
|
|
107
|
+
this.mainProductPricing
|
|
108
|
+
)
|
|
109
|
+
: [];
|
|
110
|
+
return groups;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<style lang="scss" scoped>
|
|
117
|
+
@import 'editor-pricing-details-prints';
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.EditorPricingDetailsProducts {
|
|
4
|
+
&__wrapper td {
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
border: 1px solid $gray;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
line-height: 25px;
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
color: $black;
|
|
11
|
+
@media (max-width: $bp-extra-small-max) {
|
|
12
|
+
padding: 2px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
}
|
|
15
|
+
strong {
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
}
|
|
18
|
+
&.disabled {
|
|
19
|
+
color: $gray_main;
|
|
20
|
+
pointer-events: none !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&__th {
|
|
24
|
+
font-weight: bold !important;
|
|
25
|
+
background: $gray;
|
|
26
|
+
@media (max-width: $bp-extra-small-max) {
|
|
27
|
+
padding: 2px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
&__name {
|
|
32
|
+
width: 70px;
|
|
33
|
+
@media (max-width: $bp-extra-small-max) {
|
|
34
|
+
width: 30px;
|
|
35
|
+
}
|
|
36
|
+
span {
|
|
37
|
+
writing-mode: vertical-lr;
|
|
38
|
+
transform: rotate(180deg);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="EditorPricingDetailsProducts__wrapper">
|
|
3
|
+
<table class="lc_table EditorPricingDetailsProducts__table">
|
|
4
|
+
<tbody class="centered">
|
|
5
|
+
<tr>
|
|
6
|
+
<td
|
|
7
|
+
class="EditorPricingDetailsProducts__name"
|
|
8
|
+
:rowspan="groupedProductsByPrice.length + 2">
|
|
9
|
+
<span>product</span>
|
|
10
|
+
</td>
|
|
11
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
12
|
+
Products
|
|
13
|
+
</td>
|
|
14
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
15
|
+
Sizes
|
|
16
|
+
</td>
|
|
17
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
18
|
+
Cost
|
|
19
|
+
</td>
|
|
20
|
+
<td class="EditorPricingDetailsProducts__th">
|
|
21
|
+
Total Cost
|
|
22
|
+
</td>
|
|
23
|
+
</tr>
|
|
24
|
+
<tr
|
|
25
|
+
v-for="([groupPrice, group], index) in groupedProductsByPrice"
|
|
26
|
+
:key="index">
|
|
27
|
+
<td>
|
|
28
|
+
{{ group.amount }}
|
|
29
|
+
</td>
|
|
30
|
+
<td>
|
|
31
|
+
{{ group.sizes | sizesRange }}
|
|
32
|
+
</td>
|
|
33
|
+
<td>
|
|
34
|
+
<span class="EditorPricingDetailsProducts__hoverable">
|
|
35
|
+
{{ groupPrice | price(currency) }}
|
|
36
|
+
</span>
|
|
37
|
+
</td>
|
|
38
|
+
<td>
|
|
39
|
+
<strong>
|
|
40
|
+
{{ group.totalPriceWithoutTax | price(currency) }}
|
|
41
|
+
</strong>
|
|
42
|
+
</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr class="highlighted">
|
|
45
|
+
<td colspan="3">
|
|
46
|
+
Products Subtotal:
|
|
47
|
+
</td>
|
|
48
|
+
<td>
|
|
49
|
+
<strong>
|
|
50
|
+
{{ productPricing.products.products.totalPriceWithoutTax | price(currency) }}
|
|
51
|
+
</strong>
|
|
52
|
+
</td>
|
|
53
|
+
</tr>
|
|
54
|
+
</tbody>
|
|
55
|
+
</table>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
import { mapGetters } from 'vuex';
|
|
61
|
+
import { price, sizesRange } from '@lancom/shared/assets/js/utils/filters';
|
|
62
|
+
import { groupProductsSizesByPrice } from '@lancom/shared/assets/js/utils/products-grouping';
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'EditorPricingDetailsProducts',
|
|
66
|
+
filters: {
|
|
67
|
+
price,
|
|
68
|
+
sizesRange
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
...mapGetters([
|
|
72
|
+
'currency'
|
|
73
|
+
]),
|
|
74
|
+
...mapGetters('product', [
|
|
75
|
+
'product',
|
|
76
|
+
'usedSimpleProducts',
|
|
77
|
+
'mainProductPricing',
|
|
78
|
+
'productPricing'
|
|
79
|
+
]),
|
|
80
|
+
hasUsedSimpleProducts() {
|
|
81
|
+
return this.usedSimpleProducts.length > 0;
|
|
82
|
+
},
|
|
83
|
+
products() {
|
|
84
|
+
return this.hasUsedSimpleProducts
|
|
85
|
+
? this.usedSimpleProducts
|
|
86
|
+
: [];
|
|
87
|
+
},
|
|
88
|
+
groupedProductsByPrice() {
|
|
89
|
+
return this.mainProductPricing
|
|
90
|
+
? groupProductsSizesByPrice(
|
|
91
|
+
this.products,
|
|
92
|
+
this.mainProductPricing
|
|
93
|
+
)
|
|
94
|
+
: [];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style lang="scss" scoped>
|
|
101
|
+
@import 'editor-pricing-details-products';
|
|
102
|
+
</style>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<script>
|
|
43
43
|
import { mapGetters } from 'vuex';
|
|
44
44
|
import ProductMainInfo from './layouts/product_main_info/product-main-info';
|
|
45
|
-
import ProductColorsSelector from './
|
|
45
|
+
import ProductColorsSelector from './product_colors_selector/product-colors-selector';
|
|
46
46
|
import ProductTierPrices from './layouts/product_tier_prices/product-tier-prices';
|
|
47
47
|
import ProductFabricAndSizeInfo from './layouts/product_fabric_and_size_info/product-fabric-and-size-info';
|
|
48
48
|
import ProductPackaging from './layouts/product_packaging/product-packaging';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.ProductColorsSelector {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
margin-top: 35px;
|
|
6
|
+
}
|
|
7
|
+
&__controls {
|
|
8
|
+
display: flex;
|
|
9
|
+
@media (max-width: $bp-extra-small-max) {
|
|
10
|
+
flex-direction: column-reverse;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
&__add-btn {
|
|
14
|
+
flex-grow: 1;
|
|
15
|
+
.Btn__wrapper {
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&__head {
|
|
20
|
+
height: 50px;
|
|
21
|
+
flex-grow: 2;
|
|
22
|
+
background: $gray;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
padding: 0 20px;
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
line-height: 22px;
|
|
30
|
+
text-transform: uppercase;
|
|
31
|
+
color: $black;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
|
|
34
|
+
i {
|
|
35
|
+
&:before {
|
|
36
|
+
transform: rotate(180deg);
|
|
37
|
+
transition: transform .22s ease-in-out;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
&--opened {
|
|
41
|
+
i {
|
|
42
|
+
&:before {
|
|
43
|
+
transform: rotate(0);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
&__section {
|
|
49
|
+
margin-top: 24px;
|
|
50
|
+
flex-grow: 1;
|
|
51
|
+
opacity: 1;
|
|
52
|
+
transition: opacity 500ms;
|
|
53
|
+
&--hidden {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
&__options {
|
|
58
|
+
display: flex;
|
|
59
|
+
width: 100%;
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
62
|
+
&__option {
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: space-between;
|
|
65
|
+
align-items: center;
|
|
66
|
+
&-preview {
|
|
67
|
+
width: 30px;
|
|
68
|
+
height: 30px;
|
|
69
|
+
margin-right: 10px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
&__toggle-gst {
|
|
73
|
+
margin-top: 20px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
::v-deep .ProductColorsSelectorOptions {
|
|
78
|
+
&__wrapper {
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-columns: repeat(auto-fill,42px);
|
|
81
|
+
grid-column-gap: 9px;
|
|
82
|
+
grid-row-gap: 9px;
|
|
83
|
+
padding-top: 0;
|
|
84
|
+
}
|
|
85
|
+
&__color {
|
|
86
|
+
width: 42px;
|
|
87
|
+
height: 42px;
|
|
88
|
+
&::before,
|
|
89
|
+
&-inner {
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
right: 0;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
left: 0;
|
|
95
|
+
border-radius: 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
::v-deep {
|
|
101
|
+
.multiselect__select {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
.multiselect__tags,
|
|
105
|
+
.multiselect__single,
|
|
106
|
+
.multiselect__input {
|
|
107
|
+
border: none;
|
|
108
|
+
background: transparent;
|
|
109
|
+
}
|
|
110
|
+
.multiselect__tags {
|
|
111
|
+
padding-top: 13px;
|
|
112
|
+
}
|
|
113
|
+
.multiselect__single,
|
|
114
|
+
.multiselect__input {
|
|
115
|
+
font-weight: bold;
|
|
116
|
+
}
|
|
117
|
+
}
|