@lancom/shared 0.0.280 → 0.0.282
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 +7 -4
- package/assets/js/models/print-area.js +8 -4
- package/assets/js/utils/colors.js +1 -1
- package/assets/js/utils/fabric-helper.js +5 -18
- package/assets/js/utils/filters.js +2 -2
- package/assets/js/utils/product.js +10 -1
- 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 +24 -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 +9 -25
- package/components/editor/editor_layers/editor-layers.scss +18 -0
- package/components/editor/editor_layers/editor-layers.vue +76 -20
- package/components/editor/editor_layers/editor_layers_layer/editor-layers-layer.vue +11 -4
- package/components/editor/editor_print_area_options/editor-print-area-options.vue +6 -1
- package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +2 -2
- 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 +7 -3
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +17 -20
- package/components/editor/mobile_editor_product_details/mobile-editor-product-details.scss +2 -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 +197 -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 +4 -34
- 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_text_or_logo/wizard-print-text-or-logo.vue +22 -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/components/the_navbar/the-navbar.scss +1 -1
- package/feeds/google-shopping.js +5 -5
- package/layouts/error.vue +39 -0
- package/layouts/products.vue +386 -0
- package/mixins/add-to-cart.js +64 -0
- package/mixins/payment.js +2 -1
- package/mixins/print-layer.js +45 -0
- 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 +15 -6
- package/store/order.js +2 -2
- package/store/product.js +5 -12
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<product-colors-selector class="ProductColorsSelector__wrapper">
|
|
3
|
+
<div>
|
|
4
|
+
<div class="ProductColorsSelector__controls">
|
|
5
|
+
<div
|
|
6
|
+
class="ProductColorsSelector__head"
|
|
7
|
+
:class="{
|
|
8
|
+
'ProductColorsSelector__head--opened': opened
|
|
9
|
+
}">
|
|
10
|
+
<multiselect
|
|
11
|
+
v-model="selectedColor"
|
|
12
|
+
value="_id"
|
|
13
|
+
label="name"
|
|
14
|
+
track-by="_id"
|
|
15
|
+
placeholder="Select colour"
|
|
16
|
+
:options="availableColors"
|
|
17
|
+
:allow-empty="false"
|
|
18
|
+
:searchable="false"
|
|
19
|
+
:option-height="60">
|
|
20
|
+
<div
|
|
21
|
+
slot="option"
|
|
22
|
+
slot-scope="{ option }"
|
|
23
|
+
class="ProductColorsSelector__option">
|
|
24
|
+
<span
|
|
25
|
+
class="ProductColorsSelector__option-name">
|
|
26
|
+
{{ option.name }}
|
|
27
|
+
</span>
|
|
28
|
+
<product-color-image
|
|
29
|
+
class="ProductColorsSelector__option-preview"
|
|
30
|
+
:color="option" />
|
|
31
|
+
</div>
|
|
32
|
+
<div
|
|
33
|
+
slot="singleLabel"
|
|
34
|
+
slot-scope="{ option }"
|
|
35
|
+
class="ProductColorsSelector__option">
|
|
36
|
+
{{ option.name }}
|
|
37
|
+
</div>
|
|
38
|
+
</multiselect>
|
|
39
|
+
<i class="icon-angle-down"></i>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
v-if="hasAnotherPrintBtn && hasLayers && isPrintPricing"
|
|
43
|
+
class="ProductColorsSelector__add-btn">
|
|
44
|
+
<btn
|
|
45
|
+
btn-class="green"
|
|
46
|
+
btn-label="Add Another Print"
|
|
47
|
+
@onclick="addAnotherPrint()">
|
|
48
|
+
<i
|
|
49
|
+
slot="icon-before"
|
|
50
|
+
class="icon-plus"></i>
|
|
51
|
+
</btn>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<transition
|
|
55
|
+
name="fade"
|
|
56
|
+
appear>
|
|
57
|
+
<div
|
|
58
|
+
v-if="opened"
|
|
59
|
+
class="view-transition">
|
|
60
|
+
<div class="ProductColorsSelector__options">
|
|
61
|
+
<product-colors-selector-options
|
|
62
|
+
ref="colorsSelectorOptions"
|
|
63
|
+
:display-products-count="true"
|
|
64
|
+
class="ProductColorsSelector__section" />
|
|
65
|
+
<div class="ProductColorsSelector__toggle-gst">
|
|
66
|
+
<checkbox
|
|
67
|
+
v-model="inclGST"
|
|
68
|
+
:dark="true"
|
|
69
|
+
@change="onChangeInclGST">
|
|
70
|
+
<div class="ml-5">Inc. {{ taxName }}</div>
|
|
71
|
+
</checkbox>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<products-size-selector-color
|
|
75
|
+
:with-gst="inclGSTFinal"
|
|
76
|
+
class="ProductColorsSelector__section"
|
|
77
|
+
:class="{
|
|
78
|
+
'ProductColorsSelector__section--hidden': inclGSTSpinner
|
|
79
|
+
}" />
|
|
80
|
+
</div>
|
|
81
|
+
</transition>
|
|
82
|
+
</div>
|
|
83
|
+
</product-colors-selector>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script>
|
|
87
|
+
import Multiselect from 'vue-multiselect';
|
|
88
|
+
import { mapGetters, mapMutations } from 'vuex';
|
|
89
|
+
import ProductColorsSelector from '@lancom/shared/components/product/layouts/product_colors_selector/product-colors-selector';
|
|
90
|
+
import ProductColorsSelectorOptions from '@lancom/shared/components/product/layouts/product_colors_selector/product_colors_selector_options/product-colors-selector-options';
|
|
91
|
+
import ProductColorImage from '@lancom/shared/components/product/product_color_image/product-color-image';
|
|
92
|
+
import ProductsSizeSelectorColor from '@lancom/shared/components/product/products_size_selector_color/products-size-selector-color';
|
|
93
|
+
|
|
94
|
+
export default {
|
|
95
|
+
name: 'WorkdepotProductColorsSelector',
|
|
96
|
+
components: {
|
|
97
|
+
ProductColorsSelector,
|
|
98
|
+
ProductColorsSelectorOptions,
|
|
99
|
+
ProductsSizeSelectorColor,
|
|
100
|
+
ProductColorImage,
|
|
101
|
+
Multiselect
|
|
102
|
+
},
|
|
103
|
+
data() {
|
|
104
|
+
return {
|
|
105
|
+
inclGSTFinal: false,
|
|
106
|
+
inclGSTSpinner: false,
|
|
107
|
+
inclGSTSpinnerTimer: null,
|
|
108
|
+
opened: true
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
props: {
|
|
112
|
+
hasAnotherPrintBtn: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: true
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
computed: {
|
|
118
|
+
...mapGetters(['taxName']),
|
|
119
|
+
...mapGetters('product', ['editableColor', 'availableColors', 'visibleSteps', 'hasLayers', 'isPrintPricing', 'priceIncludeGST']),
|
|
120
|
+
selectedColor: {
|
|
121
|
+
get() {
|
|
122
|
+
return this.editableColor;
|
|
123
|
+
},
|
|
124
|
+
set(color) {
|
|
125
|
+
this.$refs.colorsSelectorOptions.toggleSelection(color);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
inclGST: {
|
|
129
|
+
get() {
|
|
130
|
+
return this.priceIncludeGST;
|
|
131
|
+
},
|
|
132
|
+
set(value) {
|
|
133
|
+
this.setPriceIncludeGST(value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
watch: {
|
|
138
|
+
inclGST() {
|
|
139
|
+
this.onChangeInclGST();
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
created() {
|
|
143
|
+
if (this.priceIncludeGST) {
|
|
144
|
+
this.inclGSTFinal = true;
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
destroyed() {
|
|
148
|
+
clearTimeout(this.inclGSTSpinnerTimer);
|
|
149
|
+
},
|
|
150
|
+
methods: {
|
|
151
|
+
...mapMutations('product', [
|
|
152
|
+
'setVisibleSteps',
|
|
153
|
+
'setEditableLayer',
|
|
154
|
+
'setEditablePrintArea',
|
|
155
|
+
'setSelectedPrintArea',
|
|
156
|
+
'setSelectedPrintType',
|
|
157
|
+
'setEditableColor',
|
|
158
|
+
'setPriceIncludeGST'
|
|
159
|
+
]),
|
|
160
|
+
...mapMutations('layers', [
|
|
161
|
+
'setEditableLayer'
|
|
162
|
+
]),
|
|
163
|
+
toggleContent() {
|
|
164
|
+
this.opened = !this.opened;
|
|
165
|
+
},
|
|
166
|
+
addAnotherPrint() {
|
|
167
|
+
this.setVisibleSteps(false);
|
|
168
|
+
this.$nextTick(() => {
|
|
169
|
+
this.setEditableLayer(null);
|
|
170
|
+
this.setEditablePrintArea(null);
|
|
171
|
+
this.setVisibleSteps(true);
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
onChangeInclGST() {
|
|
175
|
+
clearTimeout(this.inclGSTSpinnerTimer);
|
|
176
|
+
this.inclGSTSpinner = true;
|
|
177
|
+
this.inclGSTSpinnerTimer = setTimeout(() => {
|
|
178
|
+
this.inclGSTSpinner = false;
|
|
179
|
+
this.inclGSTFinal = this.inclGST;
|
|
180
|
+
}, 500);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<style lang="scss" scoped>
|
|
187
|
+
@import 'product-colors-selector.scss';
|
|
188
|
+
</style>
|
|
@@ -74,6 +74,7 @@ export default {
|
|
|
74
74
|
console.log('LancomProductMultipacks...')
|
|
75
75
|
},
|
|
76
76
|
computed: {
|
|
77
|
+
...mapGetters(['currency']),
|
|
77
78
|
...mapGetters('product', ['multipack']),
|
|
78
79
|
selectedMultipack: {
|
|
79
80
|
get() {
|
|
@@ -142,7 +143,8 @@ export default {
|
|
|
142
143
|
this.setSimpleProductAmount({
|
|
143
144
|
colorId: simpleProduct.color._id,
|
|
144
145
|
sizeId: simpleProduct.size._id,
|
|
145
|
-
amount
|
|
146
|
+
amount,
|
|
147
|
+
currency: this.currency
|
|
146
148
|
});
|
|
147
149
|
}
|
|
148
150
|
});
|
|
@@ -40,12 +40,10 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<script>
|
|
43
|
-
import {
|
|
43
|
+
import { mapGetters, mapMutations } from 'vuex';
|
|
44
44
|
import confirm from '@lancom/shared/mixins/confirm';
|
|
45
45
|
import { inRange } from '@lancom/shared/assets/js/utils/filters';
|
|
46
46
|
|
|
47
|
-
const { mapGetters, mapMutations } = createNamespacedHelpers('product');
|
|
48
|
-
|
|
49
47
|
export default {
|
|
50
48
|
name: 'ProductSizeSelectorColorCell',
|
|
51
49
|
mixins: [
|
|
@@ -88,7 +86,8 @@ export default {
|
|
|
88
86
|
};
|
|
89
87
|
},
|
|
90
88
|
computed: {
|
|
91
|
-
...mapGetters(['
|
|
89
|
+
...mapGetters(['currency']),
|
|
90
|
+
...mapGetters('product', ['usedSimpleProducts', 'product']),
|
|
92
91
|
disabled() {
|
|
93
92
|
const sizeWithoutColor = this.color.sizes && !this.color.sizes.find(({ alias }) => alias === this.size.alias);
|
|
94
93
|
return sizeWithoutColor || this.outStock;
|
|
@@ -117,7 +116,7 @@ export default {
|
|
|
117
116
|
}
|
|
118
117
|
},
|
|
119
118
|
methods: {
|
|
120
|
-
...mapMutations(['setSimpleProductAmount']),
|
|
119
|
+
...mapMutations('product', ['setSimpleProductAmount']),
|
|
121
120
|
onFocus() {
|
|
122
121
|
this.defaultValue = '';
|
|
123
122
|
},
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.ProductSizeSelectorColor {
|
|
4
|
+
&__wrapper td {
|
|
5
|
+
border: 1px solid $gray !important;
|
|
6
|
+
font-weight: 800;
|
|
7
|
+
font-size: 18px;
|
|
8
|
+
line-height: 25px;
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
color: $black;
|
|
11
|
+
&.disabled {
|
|
12
|
+
color: $gray_main;
|
|
13
|
+
pointer-events: none !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
&__color-name {
|
|
17
|
+
width: 70px;
|
|
18
|
+
span {
|
|
19
|
+
writing-mode: vertical-lr;
|
|
20
|
+
transform: rotate(180deg);
|
|
21
|
+
width: 100%;
|
|
22
|
+
display: block;
|
|
23
|
+
margin-left: -20px;
|
|
24
|
+
}
|
|
25
|
+
@media (max-width: $bp-extra-small-max) {
|
|
26
|
+
width: 40px;
|
|
27
|
+
span {
|
|
28
|
+
margin-left: -6px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
&__size {
|
|
33
|
+
width: 70px;
|
|
34
|
+
}
|
|
35
|
+
&__in-stock,
|
|
36
|
+
&__out-stock {
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
text-transform: none;
|
|
39
|
+
}
|
|
40
|
+
&__out-stock {
|
|
41
|
+
color: $gray_main;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
::v-deep .ProductSizeSelectorColorCell {
|
|
46
|
+
&__field {
|
|
47
|
+
line-height: 20px;
|
|
48
|
+
input {
|
|
49
|
+
height: 30px;
|
|
50
|
+
padding: 5px !important;
|
|
51
|
+
background-color: $gray;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
&__side-control {
|
|
55
|
+
background: $green;
|
|
56
|
+
width: 26px;
|
|
57
|
+
}
|
|
58
|
+
}
|