@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
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<tabs
|
|
7
7
|
v-if="productDetailsLoaded"
|
|
8
8
|
:tabs="productSides"
|
|
9
|
+
:selected="editableSide.id"
|
|
9
10
|
:full-width="false"
|
|
10
11
|
@select="selectTab">
|
|
11
12
|
<template
|
|
@@ -90,8 +91,9 @@
|
|
|
90
91
|
}">
|
|
91
92
|
<editor-print-area-options
|
|
92
93
|
v-if="productDetailsLoaded"
|
|
94
|
+
ref="areaOptions"
|
|
93
95
|
:product="product"
|
|
94
|
-
:selected="selectedPrintArea._id"
|
|
96
|
+
:selected="selectedPrintArea && selectedPrintArea._id"
|
|
95
97
|
:side="editableSide.id"
|
|
96
98
|
@select="selectPrintArea"
|
|
97
99
|
@option-mouseover="toogleBoundBox(true, $event)"
|
|
@@ -109,7 +111,7 @@
|
|
|
109
111
|
<script>
|
|
110
112
|
import { createNamespacedHelpers } from 'vuex';
|
|
111
113
|
import EditorPrintAreaOptions from '@lancom/shared/components/editor/editor_print_area_options/editor-print-area-options';
|
|
112
|
-
import EditorPricing from '@lancom/shared/components/
|
|
114
|
+
import EditorPricing from '@lancom/shared/components/product/editor_pricing/editor-pricing';
|
|
113
115
|
import Tabs from '@lancom/shared/components/common/tabs';
|
|
114
116
|
import EditorWorkspaceSide from './editor_workspace_side/editor-workspace-side';
|
|
115
117
|
|
|
@@ -156,7 +158,9 @@ export default {
|
|
|
156
158
|
'setEditablePrintArea'
|
|
157
159
|
]),
|
|
158
160
|
selectTab(value) {
|
|
159
|
-
this.
|
|
161
|
+
if (this.editableSide.id !== value) {
|
|
162
|
+
this.setEditableSide({ id: value });
|
|
163
|
+
}
|
|
160
164
|
},
|
|
161
165
|
toggleSide() {
|
|
162
166
|
this.setEditableSide({
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
<div
|
|
28
|
-
v-if="!
|
|
28
|
+
v-if="!printAreaLayers.length && fabricHelper"
|
|
29
29
|
class="EditorWorkspaceSide__placeholder"
|
|
30
30
|
:class="{ tighten: printAreaIsSmall }"
|
|
31
31
|
ignore-document-click
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
89
89
|
type: Object
|
|
90
90
|
},
|
|
91
91
|
printAreaSize: {
|
|
92
|
-
type: Object,
|
|
92
|
+
type: String | Object,
|
|
93
93
|
required: true
|
|
94
94
|
},
|
|
95
95
|
zoomSize: {
|
|
@@ -121,6 +121,9 @@ export default {
|
|
|
121
121
|
'editorSize',
|
|
122
122
|
'editModeSelectedLayer'
|
|
123
123
|
]),
|
|
124
|
+
printAreaLayers() {
|
|
125
|
+
return this.editableLayers.filter(l => l.printArea === this.printArea._id);
|
|
126
|
+
},
|
|
124
127
|
deleteButtonPosition() {
|
|
125
128
|
return this.deleteButtonPos ? {
|
|
126
129
|
top: `${this.deleteButtonPos.y}px`,
|
|
@@ -151,7 +154,8 @@ export default {
|
|
|
151
154
|
);
|
|
152
155
|
},
|
|
153
156
|
printAreaIsSmall() {
|
|
154
|
-
|
|
157
|
+
const code = this.printAreaSize?.alias || this.printAreaSize;
|
|
158
|
+
return code === 'rect10';
|
|
155
159
|
},
|
|
156
160
|
backgroundColor() {
|
|
157
161
|
return this.backgroundImageLoaded && this.editableColor?.rgb;
|
|
@@ -174,7 +178,6 @@ export default {
|
|
|
174
178
|
this.redrawWithThrottle();
|
|
175
179
|
},
|
|
176
180
|
printArea(value) {
|
|
177
|
-
console.log(value);
|
|
178
181
|
this.fabricHelper.setPrintArea(value, this.editorSize, this.product);
|
|
179
182
|
this.redraw();
|
|
180
183
|
},
|
|
@@ -281,23 +284,16 @@ export default {
|
|
|
281
284
|
await this.addLayersToCanvas();
|
|
282
285
|
this.drawingInProcess = false;
|
|
283
286
|
this.saveLayersAsImageWithDebounce();
|
|
284
|
-
this.checkBoundingIntersection();
|
|
285
|
-
},
|
|
286
|
-
addLayersToCanvas() {
|
|
287
|
-
return this.editableLayers.reduce(async (promise, layer) => {
|
|
288
|
-
await promise;
|
|
289
|
-
return new Promise(resolve => {
|
|
290
|
-
this.fabricHelper.createObject({
|
|
291
|
-
layer,
|
|
292
|
-
active: this.isLayerSelected(layer)
|
|
293
|
-
}).then(obj => {
|
|
294
|
-
resolve();
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
}, Promise.resolve());
|
|
298
287
|
},
|
|
299
|
-
|
|
300
|
-
this.
|
|
288
|
+
async addLayersToCanvas() {
|
|
289
|
+
const layers = this.editableLayers.filter(l => l.sideId === this.side);
|
|
290
|
+
for (const layer of layers) {
|
|
291
|
+
const params = {
|
|
292
|
+
layer,
|
|
293
|
+
active: this.isLayerSelected(layer)
|
|
294
|
+
};
|
|
295
|
+
await this.fabricHelper.createObject(params);
|
|
296
|
+
}
|
|
301
297
|
},
|
|
302
298
|
isLayerSelected(layer) {
|
|
303
299
|
return this.selectedLayer && this.selectedLayer.createdAt === layer.createdAt;
|
|
@@ -326,6 +322,7 @@ export default {
|
|
|
326
322
|
this.setLayersThumbnail({ side: this.side, value: image });
|
|
327
323
|
},
|
|
328
324
|
createTextLayer() {
|
|
325
|
+
window.scrollTo(0, 0);
|
|
329
326
|
this.createLayer({ type: 'text', isEditMode: true });
|
|
330
327
|
},
|
|
331
328
|
setDeleteButtonPosition(pos) {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
background: #FFF;
|
|
65
65
|
box-shadow: $elevation2;
|
|
66
66
|
overflow: hidden;
|
|
67
|
-
z-index:
|
|
67
|
+
z-index: 99999;
|
|
68
68
|
padding-bottom: 78px;
|
|
69
69
|
transition: transform .4s cubic-bezier(0.23, 1, 0.32, 1);
|
|
70
70
|
}
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
bottom: 0;
|
|
76
76
|
left: 0;
|
|
77
77
|
background-color: rgba(0, 0, 0, .3);
|
|
78
|
-
z-index:
|
|
78
|
+
z-index: 99998;
|
|
79
79
|
transition: opacity .4s cubic-bezier(0.23, 1, 0.32, 1);
|
|
80
80
|
}
|
|
81
81
|
&__close {
|
|
@@ -335,6 +335,12 @@ export default {
|
|
|
335
335
|
this.$set(this.form, 'postcode', suburb.postcode);
|
|
336
336
|
this.$set(this.form, 'city', suburb.locality);
|
|
337
337
|
this.$set(this.form, 'country', suburb.country);
|
|
338
|
+
if (suburb.addressLine1) {
|
|
339
|
+
this.$set(this.address, 'addressLine1', suburb.addressLine1);
|
|
340
|
+
}
|
|
341
|
+
if (suburb.addressLine2) {
|
|
342
|
+
this.$set(this.address, 'addressLine2', suburb.addressLine2);
|
|
343
|
+
}
|
|
338
344
|
}
|
|
339
345
|
},
|
|
340
346
|
handleSuburbChange(suburb) {
|
|
@@ -104,7 +104,7 @@ export default {
|
|
|
104
104
|
data() {
|
|
105
105
|
return {
|
|
106
106
|
processing: false,
|
|
107
|
-
loadingCard:
|
|
107
|
+
loadingCard: true,
|
|
108
108
|
form: {},
|
|
109
109
|
fields: null,
|
|
110
110
|
agreeTermsAndCondition: false,
|
|
@@ -113,7 +113,7 @@ export default {
|
|
|
113
113
|
};
|
|
114
114
|
},
|
|
115
115
|
computed: {
|
|
116
|
-
...mapGetters(['shop', 'country', 'payment']),
|
|
116
|
+
...mapGetters(['shop', 'country', 'payment', 'currency']),
|
|
117
117
|
...mapGetters('order', ['orderData']),
|
|
118
118
|
isVisibleChargeMessage() {
|
|
119
119
|
return this.isSuccessOrderCharge || this.isFailedOrderCharge;
|
|
@@ -152,7 +152,7 @@ export default {
|
|
|
152
152
|
...mapMutations('product', ['clearTemplate']),
|
|
153
153
|
...mapMutations('layers', ['resetLayers']),
|
|
154
154
|
initedCard() {
|
|
155
|
-
this.loadingCard =
|
|
155
|
+
this.loadingCard = false;
|
|
156
156
|
},
|
|
157
157
|
handleErrors(err) {
|
|
158
158
|
// err.messages.forEach(({ message }) => this.$toastr.e(message));
|
|
@@ -165,6 +165,7 @@ export default {
|
|
|
165
165
|
card,
|
|
166
166
|
shop: this.shop._id,
|
|
167
167
|
country: this.country?._id,
|
|
168
|
+
currency: this.currency?.isoCode,
|
|
168
169
|
payment: this.payment,
|
|
169
170
|
recaptchaToken: await this.getRecaptcha('order_payment')
|
|
170
171
|
};
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
<div class="OrderPrice__content">
|
|
26
26
|
<div>
|
|
27
|
-
<payment-
|
|
27
|
+
<payment-card
|
|
28
28
|
ref="paymentCart"
|
|
29
29
|
:amount="model.totalGST"
|
|
30
30
|
:has-spinner="false"
|
|
31
31
|
:payment-data="order.shippingAddress">
|
|
32
|
-
</payment-
|
|
32
|
+
</payment-card>
|
|
33
33
|
<div
|
|
34
34
|
v-if="errorMessage"
|
|
35
35
|
class="OrderPayment__error">
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
<script>
|
|
52
52
|
import { mapGetters } from 'vuex';
|
|
53
53
|
import api from '@lancom/shared/assets/js/api';
|
|
54
|
-
import
|
|
54
|
+
import PaymentCard from '@lancom/shared/components/common/payment/payment_card/payment-card';
|
|
55
55
|
import PaymentSuccess from '@lancom/shared/components/common/payment/payment_success/payment-success';
|
|
56
56
|
|
|
57
57
|
export default {
|
|
58
58
|
name: 'OrderPayment',
|
|
59
59
|
components: {
|
|
60
|
-
|
|
60
|
+
PaymentCard,
|
|
61
61
|
PaymentSuccess
|
|
62
62
|
},
|
|
63
63
|
props: {
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
77
77
|
};
|
|
78
78
|
},
|
|
79
79
|
computed: {
|
|
80
|
-
...mapGetters(['shop', 'country', 'payment']),
|
|
80
|
+
...mapGetters(['shop', 'country', 'currency', 'payment']),
|
|
81
81
|
model() {
|
|
82
82
|
return this.invoice || this.order;
|
|
83
83
|
}
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
if (card) {
|
|
97
97
|
const { _id: invoice } = this.invoice || {};
|
|
98
98
|
const recaptchaToken = await this.getRecaptcha('order_payment');
|
|
99
|
-
const payload = { invoice, card, shop: this.shop._id, country: this.country?._id, payment: this.payment, recaptchaToken };
|
|
99
|
+
const payload = { invoice, card, shop: this.shop._id, country: this.country?._id, payment: this.payment, currency: this.currency?.isoCode, recaptchaToken };
|
|
100
100
|
const { paid } = await api.createOrderPayment(this.order._id, payload);
|
|
101
101
|
this.model.paid = paid;
|
|
102
102
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
.EditorPricing {
|
|
3
|
+
&__main {
|
|
4
|
+
&-alert {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
height: 50px;
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
font-size: 20px;
|
|
11
|
+
line-height: 27px;
|
|
12
|
+
background-color: $gray;
|
|
13
|
+
color: $gray_main;
|
|
14
|
+
@media (max-width: $bp-extra-small-max) {
|
|
15
|
+
height: 63px;
|
|
16
|
+
padding: 15px;
|
|
17
|
+
font-size: 16px;
|
|
18
|
+
}
|
|
19
|
+
img {
|
|
20
|
+
margin-right: 10px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
&__footer {
|
|
25
|
+
background: $green;
|
|
26
|
+
height: 76px;
|
|
27
|
+
padding: 0 14px;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
@media (max-width: $bp-extra-small-max) {
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
height: auto;
|
|
35
|
+
min-height: 110px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-section {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
&__total {
|
|
44
|
+
margin-left: 38px;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
font-size: 22px;
|
|
47
|
+
line-height: 30px;
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
color: $black;
|
|
50
|
+
span {
|
|
51
|
+
font-weight: bold;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
&__toggle-details {
|
|
55
|
+
font-weight: 800;
|
|
56
|
+
font-size: 16px;
|
|
57
|
+
line-height: 22px;
|
|
58
|
+
text-decoration: underline;
|
|
59
|
+
text-transform: uppercase;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
@media (max-width: $bp-extra-small-max) {
|
|
62
|
+
text-align: center;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
&__add-to-cart-button {
|
|
66
|
+
margin-left: 30px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
::v-deep .btn-green {
|
|
70
|
+
background-color: white;
|
|
71
|
+
color: $black;
|
|
72
|
+
&.disabled {
|
|
73
|
+
background-color: $gray;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
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"
|
|
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 } from 'vuex';
|
|
101
|
+
import debounce from 'lodash.debounce';
|
|
102
|
+
import { price, sizesRange, printsRange, tax } from '@lancom/shared/assets/js/utils/filters';
|
|
103
|
+
import EditorPricingDetails from '@lancom/shared/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details';
|
|
104
|
+
import addToCartMixin from '@lancom/shared/mixins/add-to-cart';
|
|
105
|
+
|
|
106
|
+
export default {
|
|
107
|
+
name: 'EditorPricing',
|
|
108
|
+
mixins: [addToCartMixin],
|
|
109
|
+
filters: {
|
|
110
|
+
price,
|
|
111
|
+
tax,
|
|
112
|
+
sizesRange,
|
|
113
|
+
printsRange
|
|
114
|
+
},
|
|
115
|
+
components: {
|
|
116
|
+
EditorPricingDetails
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
return {
|
|
120
|
+
price: null,
|
|
121
|
+
showDetails: 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
|
+
'productPricing',
|
|
138
|
+
'layers',
|
|
139
|
+
'selectedPrintAreas',
|
|
140
|
+
'availablePrintTypes',
|
|
141
|
+
'isPrintPricing',
|
|
142
|
+
'minimumOrderQuantity',
|
|
143
|
+
'priceIncludeGST',
|
|
144
|
+
'multipack'
|
|
145
|
+
]),
|
|
146
|
+
hasUsedSimpleProducts() {
|
|
147
|
+
return this.usedSimpleProducts.length > 0;
|
|
148
|
+
},
|
|
149
|
+
totalPrice() {
|
|
150
|
+
const { totalPriceWithoutTax, totalPrice } = this.productPricing;
|
|
151
|
+
return this.priceIncludeGST ? totalPrice : totalPriceWithoutTax;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
watch: {
|
|
155
|
+
layers() {
|
|
156
|
+
this.calculatePriceWithDebounce();
|
|
157
|
+
this.addedToCart = false;
|
|
158
|
+
if (!this.layers.length) {
|
|
159
|
+
this.showDetails = false;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
usedSimpleProducts() {
|
|
163
|
+
this.calculatePriceWithDebounce();
|
|
164
|
+
this.addedToCart = false;
|
|
165
|
+
if (!this.hasUsedSimpleProducts) {
|
|
166
|
+
this.showDetails = false;
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
selectedPrintAreas() {
|
|
170
|
+
this.calculatePriceWithDebounce();
|
|
171
|
+
},
|
|
172
|
+
availablePrintTypes() {
|
|
173
|
+
this.calculatePriceWithDebounce();
|
|
174
|
+
},
|
|
175
|
+
isPrintPricing() {
|
|
176
|
+
this.calculatePriceWithDebounce();
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
mounted() {
|
|
180
|
+
if (this.usedSimpleProducts.length > 0) {
|
|
181
|
+
this.calculatePriceWithDebounce();
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
methods: {
|
|
185
|
+
...mapActions('product', [
|
|
186
|
+
'calculateProductPrice'
|
|
187
|
+
]),
|
|
188
|
+
toggleDetails() {
|
|
189
|
+
this.showDetails = !this.showDetails;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
</script>
|
|
194
|
+
|
|
195
|
+
<style lang="scss" scoped>
|
|
196
|
+
@import 'editor-pricing';
|
|
197
|
+
</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
|
+
}
|