@lancom/shared 0.0.125 → 0.0.128
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 +12 -0
- package/assets/js/api/helpers.js +2 -2
- package/assets/js/utils/gtm.js +2 -14
- package/assets/js/utils/quote.js +9 -1
- package/components/checkout/order/order-checkout-method/order-checkout-method.scss +8 -0
- package/components/checkout/order/order-checkout-method/order-checkout-method.vue +7 -7
- package/components/common/postcode_select/postcode-select.vue +1 -1
- package/components/products/products_autocomplete/products-autocomplete.scss +11 -0
- package/components/products/products_autocomplete/products-autocomplete.vue +11 -1
- package/mixins/payment.js +4 -10
- package/package.json +1 -1
package/assets/js/api/admin.js
CHANGED
|
@@ -278,6 +278,18 @@ export default {
|
|
|
278
278
|
removeSupplier(id) {
|
|
279
279
|
return _delete(`admin/suppliers/${id}`);
|
|
280
280
|
},
|
|
281
|
+
async fetchDecorators(params) {
|
|
282
|
+
return sortByName(await _get('admin/decorators', params));
|
|
283
|
+
},
|
|
284
|
+
fetchDecoratorById(id) {
|
|
285
|
+
return _get(`admin/decorators/${id}`);
|
|
286
|
+
},
|
|
287
|
+
saveDecorator(decorator) {
|
|
288
|
+
return decorator._id ? _put(`admin/decorators/${decorator._id}`, decorator) : _post('admin/decorators', decorator);
|
|
289
|
+
},
|
|
290
|
+
removeDecorator(id) {
|
|
291
|
+
return _delete(`admin/decorators/${id}`);
|
|
292
|
+
},
|
|
281
293
|
async fetchWarehouses(params) {
|
|
282
294
|
return sortByName(await _get('admin/warehouse', params));
|
|
283
295
|
},
|
package/assets/js/api/helpers.js
CHANGED
|
@@ -27,6 +27,6 @@ export const prepareHeaders = method => {
|
|
|
27
27
|
|
|
28
28
|
export const _post = (url, data, config) => axiosApiInstance.post(buildPath(url), data, { ...config, headers: prepareHeaders() }).then(response => response.data);
|
|
29
29
|
export const _get = (url, params) => axiosApiInstance.get(buildPath(url), { params, headers: prepareHeaders('get') }).then(response => response.data);
|
|
30
|
-
export const _put = (url, data) => axiosApiInstance.put(buildPath(url), data, { headers: prepareHeaders() }).then(response => response.data);
|
|
31
|
-
export const _patch = (url, data) => axiosApiInstance.patch(buildPath(url), data, { headers: prepareHeaders() }).then(response => response.data);
|
|
30
|
+
export const _put = (url, data) => axiosApiInstance.put(buildPath(url), { ...data, __v: undefined }, { headers: prepareHeaders() }).then(response => response.data);
|
|
31
|
+
export const _patch = (url, data) => axiosApiInstance.patch(buildPath(url), { ...data, __v: undefined }, { headers: prepareHeaders() }).then(response => response.data);
|
|
32
32
|
export const _delete = (url, data) => axiosApiInstance.delete(buildPath(url), { data, headers: prepareHeaders() }).then(response => response.data);
|
package/assets/js/utils/gtm.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
const gtm = {
|
|
2
|
-
push({
|
|
3
|
-
id,
|
|
4
|
-
total,
|
|
5
|
-
tax,
|
|
6
|
-
shipping,
|
|
7
|
-
products
|
|
8
|
-
}) {
|
|
2
|
+
push(data) {
|
|
9
3
|
window.dataLayer = window.dataLayer || [];
|
|
10
|
-
window.dataLayer.push(
|
|
11
|
-
transactionId: id,
|
|
12
|
-
transactionTotal: total,
|
|
13
|
-
transactionTax: tax,
|
|
14
|
-
transactionShipping: shipping,
|
|
15
|
-
transactionProducts: products
|
|
16
|
-
});
|
|
4
|
+
window.dataLayer.push(data);
|
|
17
5
|
}
|
|
18
6
|
};
|
|
19
7
|
|
package/assets/js/utils/quote.js
CHANGED
|
@@ -14,7 +14,15 @@ export function convertQuoteToOrder(quote, option) {
|
|
|
14
14
|
printsTotal: option.printsTotal,
|
|
15
15
|
shippingTotal: option.shippingTotal,
|
|
16
16
|
adminShippingTotal: option.adminShippingTotal,
|
|
17
|
-
quote: quote._id
|
|
17
|
+
quote: quote._id,
|
|
18
|
+
resources: quote.file ? [{
|
|
19
|
+
status: 'pending approval',
|
|
20
|
+
prints: [],
|
|
21
|
+
revision: null,
|
|
22
|
+
note: null,
|
|
23
|
+
type: 'Artwork Files',
|
|
24
|
+
file: quote.file
|
|
25
|
+
}] : []
|
|
18
26
|
};
|
|
19
27
|
}
|
|
20
28
|
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
1
3
|
.OrderCheckoutMethod {
|
|
2
4
|
&__controls {
|
|
3
5
|
display: flex;
|
|
4
6
|
width: 100%;
|
|
7
|
+
@media (max-width: $bp-small-max) {
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
5
10
|
> div {
|
|
6
11
|
flex-grow: 1;
|
|
7
12
|
margin: 0 5px;
|
|
13
|
+
@media (max-width: $bp-small-max) {
|
|
14
|
+
margin: 0 5px 20px 5px;
|
|
15
|
+
}
|
|
8
16
|
}
|
|
9
17
|
}
|
|
10
18
|
}
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
:btn-block="true"
|
|
11
11
|
@onclick="isRegister = false" />
|
|
12
12
|
</div>
|
|
13
|
-
<div>
|
|
14
|
-
<btn
|
|
15
|
-
:btn-class="isRegister ? 'green' : 'white'"
|
|
16
|
-
btn-label="REGISTER"
|
|
17
|
-
:btn-block="true"
|
|
18
|
-
@onclick="isRegister = true" />
|
|
19
|
-
</div>
|
|
20
13
|
<div style="margin-top: -10px">
|
|
21
14
|
<progress-steps-controls
|
|
22
15
|
next-btn-class="white"
|
|
@@ -24,6 +17,13 @@
|
|
|
24
17
|
label-next="Checkout as Guest"
|
|
25
18
|
@next="$emit('next')" />
|
|
26
19
|
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<btn
|
|
22
|
+
:btn-class="isRegister ? 'green' : 'white'"
|
|
23
|
+
btn-label="REGISTER"
|
|
24
|
+
:btn-block="true"
|
|
25
|
+
@onclick="isRegister = true" />
|
|
26
|
+
</div>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
@@ -28,6 +28,17 @@
|
|
|
28
28
|
text-decoration: none;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
&-all {
|
|
32
|
+
padding: 10px;
|
|
33
|
+
text-align: center;
|
|
34
|
+
display: block;
|
|
35
|
+
background-color: $white;
|
|
36
|
+
border-bottom: 1px solid $gray_main;
|
|
37
|
+
&:hover {
|
|
38
|
+
background-color: $black;
|
|
39
|
+
color: $white;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
31
42
|
}
|
|
32
43
|
&__input {
|
|
33
44
|
input {
|
|
@@ -34,6 +34,13 @@
|
|
|
34
34
|
:product="product"
|
|
35
35
|
class="ProductsAutocomplete__result-item"
|
|
36
36
|
@select="$emit('select', product)" />
|
|
37
|
+
<div class="ProductsAutocomplete__result-item">
|
|
38
|
+
<nuxt-link
|
|
39
|
+
class="ProductsAutocomplete__result-item-all"
|
|
40
|
+
:to="fullSearchLink">
|
|
41
|
+
click to see all results
|
|
42
|
+
</nuxt-link>
|
|
43
|
+
</div>
|
|
37
44
|
</div>
|
|
38
45
|
</div>
|
|
39
46
|
</div>
|
|
@@ -70,11 +77,14 @@ export default {
|
|
|
70
77
|
...mapGetters(['shop']),
|
|
71
78
|
hasProducts() {
|
|
72
79
|
return this.products.length > 0;
|
|
80
|
+
},
|
|
81
|
+
fullSearchLink() {
|
|
82
|
+
return `/products?text=${this.text}`;
|
|
73
83
|
}
|
|
74
84
|
},
|
|
75
85
|
methods: {
|
|
76
86
|
goToSearch() {
|
|
77
|
-
this.$router.push(
|
|
87
|
+
this.$router.push(this.fullSearchLink);
|
|
78
88
|
},
|
|
79
89
|
showResults() {
|
|
80
90
|
clearTimeout(this.hideTimer);
|
package/mixins/payment.js
CHANGED
|
@@ -63,17 +63,11 @@ export default {
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
sendConversionData() {
|
|
66
|
-
if (process.env.
|
|
66
|
+
if (!process.env.IS_LOCAL) {
|
|
67
67
|
gtm.push({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
products: this.orderData.products.map(product => ({
|
|
72
|
-
sku: product.SKU,
|
|
73
|
-
name: product.name,
|
|
74
|
-
category: product.brand,
|
|
75
|
-
quantity: product.amount
|
|
76
|
-
}))
|
|
68
|
+
event: 'OrderCheckout',
|
|
69
|
+
code: this.orderData.code,
|
|
70
|
+
value: this.orderData.total
|
|
77
71
|
});
|
|
78
72
|
}
|
|
79
73
|
},
|