@lancom/shared 0.0.304 → 0.0.306
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/index.js +2 -2
- package/assets/js/utils/layers.js +21 -0
- package/assets/js/utils/prints.js +3 -3
- package/components/checkout/cart/cart_entity/cart-entity.mixin.js +2 -1
- package/components/common/postcode_select/postcode-select.vue +1 -1
- package/components/editor/editor_product_details/editor-product-details.vue +3 -3
- package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +3 -3
- package/components/quotes/quote_request/quote-request.scss +2 -2
- package/components/quotes/quote_request/quote-request.vue +29 -12
- package/components/quotes/quote_request_modal/quote-request-modal.scss +11 -1
- package/package.json +1 -1
package/assets/js/api/index.js
CHANGED
|
@@ -95,9 +95,9 @@ const api = {
|
|
|
95
95
|
fetchOrderByToken(token, params) {
|
|
96
96
|
return _get(`order/token/${token}`, params);
|
|
97
97
|
},
|
|
98
|
-
getPaymentIntent(shop, { amount, currency, payment }) {
|
|
98
|
+
getPaymentIntent(shop, { amount, currency, payment, description }) {
|
|
99
99
|
const url = `shop/${shop}/payment-intent`;
|
|
100
|
-
return _post(url, { amount, currency, payment });
|
|
100
|
+
return _post(url, { amount, currency, payment, description });
|
|
101
101
|
},
|
|
102
102
|
createOrderPayment(id, { card, shop, country, currency, invoice, payment, recaptchaToken }) {
|
|
103
103
|
const url = invoice ? `shop/${shop}/order/${id}/invoice/${invoice}/payment` : `shop/${shop}/order/${id}/payment`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function generateLayersTemplate(template, printArea) {
|
|
2
|
+
return template.layers.map(layer => ({
|
|
3
|
+
type: layer.type,
|
|
4
|
+
properties: fitLayerToEditorSize(layer, template, printArea),
|
|
5
|
+
isEditMode: false,
|
|
6
|
+
preselect: false
|
|
7
|
+
}));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function fitLayerToEditorSize(layer, { size }, { width, height, top, left }) {
|
|
11
|
+
const scaleKoef = Math.min(width, height) / size.width;
|
|
12
|
+
layer.top = top + layer.top * scaleKoef;
|
|
13
|
+
layer.left = left + layer.left * scaleKoef;
|
|
14
|
+
['fontSize', 'scaleX', 'scaleY'].forEach(property => {
|
|
15
|
+
if (property in layer) {
|
|
16
|
+
layer[property] = layer[property] * scaleKoef;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
delete layer.sideId;
|
|
20
|
+
return layer;
|
|
21
|
+
}
|
|
@@ -26,10 +26,10 @@ export const generatePrintLayer = layer => {
|
|
|
26
26
|
text: layer.copy,
|
|
27
27
|
params: layer
|
|
28
28
|
};
|
|
29
|
-
if (layer.url) {
|
|
29
|
+
if (layer.url || layer.file?.origin) {
|
|
30
30
|
model.file = {
|
|
31
|
-
fileName: layer.fileName,
|
|
32
|
-
origin: layer.url
|
|
31
|
+
fileName: layer.fileName || layer.file?.fileName,
|
|
32
|
+
origin: layer.url || layer.file?.origin
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
return model
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
computed: {
|
|
13
|
+
...mapGetters(['SETTINGS']),
|
|
13
14
|
...mapGetters('cart', [
|
|
14
15
|
'cartPricing',
|
|
15
16
|
'cartProductsPricing'
|
|
@@ -18,7 +19,7 @@ export default {
|
|
|
18
19
|
return this.entity.product;
|
|
19
20
|
},
|
|
20
21
|
productLink() {
|
|
21
|
-
return generateProductLink(this.product);
|
|
22
|
+
return generateProductLink(this.product, null, !!this.SETTINGS.CART_PRODUCT_LINK_TO_EDITOR);
|
|
22
23
|
},
|
|
23
24
|
sumPrints() {
|
|
24
25
|
return (this.entity.prints || []).length;
|
|
@@ -157,7 +157,7 @@ export default {
|
|
|
157
157
|
if (query.trim().length > 1) {
|
|
158
158
|
this.isLoading = true;
|
|
159
159
|
const country = this.codeCountry || this.country;
|
|
160
|
-
const countryName = country ? (country.isoCode
|
|
160
|
+
const countryName = country ? (['GB','UK'].includes(country.isoCode) ? 'England' : (country.name || country)) : 'Australia';
|
|
161
161
|
const params = {
|
|
162
162
|
query: query.trim(),
|
|
163
163
|
country: countryName
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
</div>
|
|
84
|
-
<div
|
|
84
|
+
<!-- <div
|
|
85
85
|
v-if="!productAvailableInCurrentCountry"
|
|
86
86
|
class="EditorProductDetails__available-warning">
|
|
87
87
|
Product Not Available in {{ country.name }}
|
|
88
|
-
</div>
|
|
88
|
+
</div> -->
|
|
89
89
|
<div
|
|
90
90
|
v-if="product.description"
|
|
91
91
|
class="EditorProductDetails__description">
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
<div
|
|
110
|
-
v-if="productDetailsLoaded
|
|
110
|
+
v-if="productDetailsLoaded">
|
|
111
111
|
<div class="EditorProductDetails__section">
|
|
112
112
|
<product-colors-selector
|
|
113
113
|
:has-another-print-btn="false"
|
|
@@ -277,20 +277,37 @@
|
|
|
277
277
|
</div>
|
|
278
278
|
</div>
|
|
279
279
|
</div>
|
|
280
|
+
<div v-else>
|
|
281
|
+
<div v-if="submittedErrors.length > 0">
|
|
282
|
+
Please fill in all required fields
|
|
283
|
+
</div>
|
|
284
|
+
<div class="QuoteRequest__btn form-actions full">
|
|
285
|
+
<btn
|
|
286
|
+
btn-class="green"
|
|
287
|
+
:btn-disabled="processing"
|
|
288
|
+
:btn-processing="processing"
|
|
289
|
+
:btn-block="true"
|
|
290
|
+
btn-label="GET A QUOTE NOW"
|
|
291
|
+
@onclick="handleSubmit(submit)">
|
|
292
|
+
</btn>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
280
295
|
</div>
|
|
281
296
|
</div>
|
|
282
|
-
<div v-if="
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
<
|
|
287
|
-
btn
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
297
|
+
<div v-if="visibleProductTypes">
|
|
298
|
+
<div v-if="submittedErrors.length > 0">
|
|
299
|
+
Please fill in all required fields
|
|
300
|
+
</div>
|
|
301
|
+
<div class="QuoteRequest__btn form-actions full">
|
|
302
|
+
<btn
|
|
303
|
+
btn-class="green"
|
|
304
|
+
:btn-disabled="processing"
|
|
305
|
+
:btn-processing="processing"
|
|
306
|
+
:btn-block="true"
|
|
307
|
+
btn-label="GET A QUOTE NOW"
|
|
308
|
+
@onclick="handleSubmit(submit)">
|
|
309
|
+
</btn>
|
|
310
|
+
</div>
|
|
294
311
|
</div>
|
|
295
312
|
</validation-observer>
|
|
296
313
|
</div>
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
1
3
|
.QuoteRequestModal {
|
|
2
4
|
&__wrapper {
|
|
3
5
|
border-radius: 0px;
|
|
4
|
-
margin-bottom:
|
|
6
|
+
margin-bottom: 50px;
|
|
7
|
+
.lc_modal__content {
|
|
8
|
+
@media (min-width: $bp-extra-small-max) {
|
|
9
|
+
padding: 0 0 20px 0 !important;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
.icon-cancel {
|
|
13
|
+
z-index: 2;
|
|
14
|
+
}
|
|
5
15
|
}
|
|
6
16
|
}
|