@lancom/shared 0.0.133 → 0.0.134
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/index.js +6 -0
- package/assets/js/utils/quote.js +4 -3
- package/components/checkout/cart/cart_entity/cart-entity.mixin.js +19 -3
- package/components/checkout/cart/cart_entity/cart-entity.vue +6 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.mixin.js +4 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.vue +9 -1
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.scss +8 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +25 -2
- package/components/news/news_list/news-list.scss +44 -0
- package/components/news/news_list/news-list.vue +51 -15
- package/components/order/order_view/order-view.vue +4 -1
- package/components/quotes/quote_request/quote-request.vue +11 -11
- package/package.json +1 -1
package/assets/js/api/admin.js
CHANGED
|
@@ -16,6 +16,18 @@ export default {
|
|
|
16
16
|
removeNews(id) {
|
|
17
17
|
return _delete(`admin/news/${id}`);
|
|
18
18
|
},
|
|
19
|
+
fetchNewsTags() {
|
|
20
|
+
return _get('admin/news-tag');
|
|
21
|
+
},
|
|
22
|
+
fetchNewsTagById(id) {
|
|
23
|
+
return _get(`admin/news-tag/${id}`);
|
|
24
|
+
},
|
|
25
|
+
saveNewsTag(newsTag) {
|
|
26
|
+
return newsTag._id ? _put(`admin/news-tag/${newsTag._id}`, newsTag) : _post('admin/news-tag', newsTag);
|
|
27
|
+
},
|
|
28
|
+
removeNewsTag(id) {
|
|
29
|
+
return _delete(`admin/news-tag/${id}`);
|
|
30
|
+
},
|
|
19
31
|
fetchShops() {
|
|
20
32
|
return _get('admin/shops');
|
|
21
33
|
},
|
package/assets/js/api/index.js
CHANGED
|
@@ -63,6 +63,12 @@ const api = {
|
|
|
63
63
|
fetchSingleNews(shop, alias, preview = false) {
|
|
64
64
|
return _get(`shop/${shop}/news/${alias}?preview=${preview}`);
|
|
65
65
|
},
|
|
66
|
+
fetchNewsTags(shop, params) {
|
|
67
|
+
return _get(`shop/${shop}/news-tag`, params);
|
|
68
|
+
},
|
|
69
|
+
fetchNewsTag(shop, alias) {
|
|
70
|
+
return _get(`shop/${shop}/news-tag/${alias}`);
|
|
71
|
+
},
|
|
66
72
|
fetchProductDetails(shop, alias) {
|
|
67
73
|
return _get(`shop/${shop}/products/${alias}/simple-products`);
|
|
68
74
|
},
|
package/assets/js/utils/quote.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export function convertQuoteToOrder(quote, option) {
|
|
2
|
+
const files = [quote.file, ...(quote.files || [])].filter(f => !!f);
|
|
2
3
|
return {
|
|
3
4
|
paymentMethod: option.paymentMethod || 'deposit',
|
|
4
5
|
billingAddress: quote.address,
|
|
@@ -15,14 +16,14 @@ export function convertQuoteToOrder(quote, option) {
|
|
|
15
16
|
shippingTotal: option.shippingTotal,
|
|
16
17
|
adminShippingTotal: option.adminShippingTotal,
|
|
17
18
|
quote: quote._id,
|
|
18
|
-
resources:
|
|
19
|
+
resources: files.map(f => ({
|
|
19
20
|
status: 'pending approval',
|
|
20
21
|
prints: [],
|
|
21
22
|
revision: null,
|
|
22
23
|
note: null,
|
|
23
24
|
type: 'Artwork Files',
|
|
24
|
-
file:
|
|
25
|
-
}
|
|
25
|
+
file: f.file
|
|
26
|
+
}))
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -26,16 +26,19 @@ export default {
|
|
|
26
26
|
hasPrints() {
|
|
27
27
|
return this.sumPrints > 0;
|
|
28
28
|
},
|
|
29
|
+
cartEntityPricing() {
|
|
30
|
+
return this.cartProductsPricing[this.entity.guid] || {};
|
|
31
|
+
},
|
|
29
32
|
totalPrice() {
|
|
30
|
-
const { totalPriceWithoutTax = 0 } = this.
|
|
33
|
+
const { totalPriceWithoutTax = 0 } = this.cartEntityPricing;
|
|
31
34
|
return totalPriceWithoutTax;
|
|
32
35
|
},
|
|
33
36
|
printsTotalPrice() {
|
|
34
|
-
const { prints = {} } = this.
|
|
37
|
+
const { prints = {} } = this.cartEntityPricing;
|
|
35
38
|
return prints.totalPriceWithoutTax || 0;
|
|
36
39
|
},
|
|
37
40
|
productsTotalPrice() {
|
|
38
|
-
const { product = {} } = this.
|
|
41
|
+
const { product = {} } = this.cartEntityPricing;
|
|
39
42
|
return product.totalPriceWithoutTax || 0;
|
|
40
43
|
},
|
|
41
44
|
simpleProductsWithAmount() {
|
|
@@ -46,6 +49,19 @@ export default {
|
|
|
46
49
|
},
|
|
47
50
|
groupedSimpleProducts() {
|
|
48
51
|
return groupSimpleProducts(this.entity, true, true);
|
|
52
|
+
},
|
|
53
|
+
isSameUnitPrices() {
|
|
54
|
+
const { products } = this.cartEntityPricing;
|
|
55
|
+
const uniquePrices = (products?.products || []).reduce((prices, product) => {
|
|
56
|
+
prices.add(product.priceWithoutTax);
|
|
57
|
+
return prices;
|
|
58
|
+
}, new Set());
|
|
59
|
+
return uniquePrices.size === 1;
|
|
60
|
+
},
|
|
61
|
+
unitPrice() {
|
|
62
|
+
const { products } = this.cartEntityPricing;
|
|
63
|
+
const product = (products?.products || [])[0];
|
|
64
|
+
return product ? product.priceWithoutTax : null;
|
|
49
65
|
}
|
|
50
66
|
},
|
|
51
67
|
methods: {
|
|
@@ -33,9 +33,15 @@
|
|
|
33
33
|
:entity="entity"
|
|
34
34
|
:group="group"
|
|
35
35
|
:default-preview="false"
|
|
36
|
+
:display-unit-price="!isSameUnitPrices"
|
|
36
37
|
class="CartEntity__item"
|
|
37
38
|
@remove="removeSimpleProducts" />
|
|
38
39
|
</div>
|
|
40
|
+
<div
|
|
41
|
+
v-if="isSameUnitPrices"
|
|
42
|
+
class="lc_title-small mt-8">
|
|
43
|
+
Price Per Unit: {{ unitPrice | price }}
|
|
44
|
+
</div>
|
|
39
45
|
<div
|
|
40
46
|
v-if="hasPrints"
|
|
41
47
|
class="CartEntity__decorations">
|
|
@@ -34,11 +34,19 @@
|
|
|
34
34
|
<div class="lc_title-small mt-8">
|
|
35
35
|
Qty:
|
|
36
36
|
</div>
|
|
37
|
+
<div
|
|
38
|
+
v-if="displayUnitPrice && cartProductsPricing"
|
|
39
|
+
class="lc_title-small mt-8">
|
|
40
|
+
|
|
41
|
+
</div>
|
|
42
|
+
|
|
37
43
|
</div>
|
|
38
44
|
<cart-entity-color-simple-product
|
|
39
45
|
v-for="simpleProduct in group.simpleProducts"
|
|
40
46
|
:key="simpleProduct._id"
|
|
41
|
-
:simple-product="simpleProduct"
|
|
47
|
+
:simple-product="simpleProduct"
|
|
48
|
+
:entity="entity"
|
|
49
|
+
:display-unit-price="displayUnitPrice" />
|
|
42
50
|
</div>
|
|
43
51
|
<div class="CartEntityColorSimpleProducts__totals">
|
|
44
52
|
<div class="CartEntityColorSimpleProducts__total">
|
|
@@ -38,6 +38,13 @@
|
|
|
38
38
|
class="centered CartColorSimpleProduct__field">
|
|
39
39
|
{{ model }}
|
|
40
40
|
</div>
|
|
41
|
+
<div
|
|
42
|
+
v-if="displayUnitPrice"
|
|
43
|
+
class="centered CartColorSimpleProduct__price">
|
|
44
|
+
<span v-if="model > 0">
|
|
45
|
+
{{ unitPrice | price }}
|
|
46
|
+
</span>
|
|
47
|
+
</div>
|
|
41
48
|
</div>
|
|
42
49
|
</template>
|
|
43
50
|
|
|
@@ -45,12 +52,19 @@
|
|
|
45
52
|
import debounce from 'lodash.debounce';
|
|
46
53
|
import { mapGetters, mapActions } from 'vuex';
|
|
47
54
|
import confirm from '@lancom/shared/mixins/confirm';
|
|
48
|
-
import { inRange } from '@lancom/shared/assets/js/utils/filters';
|
|
55
|
+
import { inRange, price } from '@lancom/shared/assets/js/utils/filters';
|
|
49
56
|
|
|
50
57
|
export default {
|
|
51
58
|
name: 'CartColorSimpleProduct',
|
|
52
59
|
mixins: [confirm],
|
|
60
|
+
filters: {
|
|
61
|
+
price
|
|
62
|
+
},
|
|
53
63
|
props: {
|
|
64
|
+
entity: {
|
|
65
|
+
type: Object,
|
|
66
|
+
required: true
|
|
67
|
+
},
|
|
54
68
|
simpleProduct: {
|
|
55
69
|
type: Object,
|
|
56
70
|
required: true
|
|
@@ -62,6 +76,10 @@ export default {
|
|
|
62
76
|
editable: {
|
|
63
77
|
type: Boolean,
|
|
64
78
|
default: true
|
|
79
|
+
},
|
|
80
|
+
displayUnitPrice: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false
|
|
65
83
|
}
|
|
66
84
|
},
|
|
67
85
|
data() {
|
|
@@ -72,7 +90,7 @@ export default {
|
|
|
72
90
|
},
|
|
73
91
|
computed: {
|
|
74
92
|
...mapGetters(['shop']),
|
|
75
|
-
...mapGetters('cart', ['simpleProducts']),
|
|
93
|
+
...mapGetters('cart', ['simpleProducts', 'cartProductsPricing']),
|
|
76
94
|
model: {
|
|
77
95
|
get() {
|
|
78
96
|
return (this.simpleProducts.find(sp => sp.guid === this.simpleProduct.guid) || {}).amount || this.defaultValue;
|
|
@@ -88,6 +106,11 @@ export default {
|
|
|
88
106
|
shop: this.shop
|
|
89
107
|
});
|
|
90
108
|
}
|
|
109
|
+
},
|
|
110
|
+
unitPrice() {
|
|
111
|
+
const { products } = this.cartProductsPricing[this.entity.guid] || {};
|
|
112
|
+
const product = (products || {})[this.simpleProduct.guid];
|
|
113
|
+
return product ? product.priceWithoutTax : null;
|
|
91
114
|
}
|
|
92
115
|
},
|
|
93
116
|
methods: {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
&__wrapper {
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-wrap: wrap;
|
|
7
|
+
margin-bottom: 20px;
|
|
7
8
|
}
|
|
8
9
|
&__item {
|
|
9
10
|
width: calc(50% - 30px);
|
|
@@ -21,4 +22,47 @@
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
.VuePagination {
|
|
29
|
+
&__pagination {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
&-item {
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
line-height: 170%;
|
|
35
|
+
color: $black;
|
|
36
|
+
width: 50px;
|
|
37
|
+
height: 50px;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
border: 1px solid $grey_3;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
margin: 0 3px;
|
|
44
|
+
a {
|
|
45
|
+
display: block;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
text-align: center;
|
|
49
|
+
padding-top: 11px;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: $grey_3;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
&.active {
|
|
56
|
+
background-color: $black;
|
|
57
|
+
color: white;
|
|
58
|
+
}
|
|
59
|
+
&.disabled {
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
opacity: .5;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
&__count {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
24
68
|
}
|
|
@@ -1,38 +1,74 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<div
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<div class="NewsList__wrapper">
|
|
4
|
+
<div
|
|
5
|
+
v-for="(item, index) in news"
|
|
6
|
+
:key="item._id"
|
|
7
|
+
:class="{
|
|
8
|
+
'NewsList__item--large': (index + 1) % 3 === 0
|
|
9
|
+
}"
|
|
10
|
+
class="NewsList__item">
|
|
11
|
+
<transition
|
|
12
|
+
:name="(index + 1) % 3 ? 'from-right-to-left' : 'from-left-to-right'"
|
|
13
|
+
appear>
|
|
14
|
+
<news-list-item :item="item" class="elevation2" />
|
|
15
|
+
</transition>
|
|
16
|
+
</div>
|
|
15
17
|
</div>
|
|
18
|
+
<pagination
|
|
19
|
+
v-if="perPage > 0"
|
|
20
|
+
v-model="currentPage"
|
|
21
|
+
:records="count"
|
|
22
|
+
:per-page="perPage"
|
|
23
|
+
:options="{ chunk: 3 }" />
|
|
16
24
|
</div>
|
|
17
25
|
</template>
|
|
18
26
|
|
|
19
27
|
<script>
|
|
28
|
+
import Pagination from 'vue-pagination-2';
|
|
20
29
|
import NewsListItem from '../news_list_item/news-list-item';
|
|
21
30
|
|
|
22
31
|
export default {
|
|
23
32
|
name: 'NewsList',
|
|
24
33
|
components: {
|
|
25
|
-
NewsListItem
|
|
34
|
+
NewsListItem,
|
|
35
|
+
Pagination
|
|
26
36
|
},
|
|
27
37
|
props: {
|
|
28
38
|
news: {
|
|
29
39
|
type: Array,
|
|
30
40
|
required: true
|
|
41
|
+
},
|
|
42
|
+
count: {
|
|
43
|
+
type: Number
|
|
44
|
+
},
|
|
45
|
+
perPage: {
|
|
46
|
+
type: Number
|
|
47
|
+
},
|
|
48
|
+
page: {
|
|
49
|
+
type: Number
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
computed: {
|
|
53
|
+
currentPage: {
|
|
54
|
+
get() {
|
|
55
|
+
return this.page;
|
|
56
|
+
},
|
|
57
|
+
set(page) {
|
|
58
|
+
const params = [];
|
|
59
|
+
if (page > 1) {
|
|
60
|
+
params.push(`page=${page}`);
|
|
61
|
+
}
|
|
62
|
+
const link = `${this.$route.path}${params.length ? `?${params.join('&')}` : ''}`;
|
|
63
|
+
window.location = link;
|
|
64
|
+
// this.$router.push(link);
|
|
65
|
+
// window.scrollTo(0, 0);
|
|
66
|
+
}
|
|
31
67
|
}
|
|
32
68
|
}
|
|
33
69
|
};
|
|
34
70
|
</script>
|
|
35
71
|
|
|
36
|
-
<style lang="scss"
|
|
72
|
+
<style lang="scss">
|
|
37
73
|
@import 'news-list';
|
|
38
74
|
</style>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</h4>
|
|
18
18
|
</div>
|
|
19
19
|
<h1 class="text-secondary lc_h1">
|
|
20
|
-
|
|
20
|
+
Tax invoice
|
|
21
21
|
</h1>
|
|
22
22
|
</div>
|
|
23
23
|
<div class="OrderView__info">
|
|
@@ -144,6 +144,9 @@
|
|
|
144
144
|
<div class="lc_regular16">
|
|
145
145
|
Total inc GST: <b>{{ model.totalGST | price }}</b>
|
|
146
146
|
</div>
|
|
147
|
+
<div class="lc_regular16">
|
|
148
|
+
Pending Payment: <b>{{ model.totalGST | price }}</b>
|
|
149
|
+
</div>
|
|
147
150
|
</div>
|
|
148
151
|
</div>
|
|
149
152
|
</div>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
Upload your logo/artwork
|
|
95
95
|
</div>
|
|
96
96
|
<file-uploader
|
|
97
|
-
:multiple="
|
|
97
|
+
:multiple="true"
|
|
98
98
|
:url="`image/editor/${shop._id}/undefined`"
|
|
99
99
|
:has-conversion-error-modal="false"
|
|
100
100
|
:show-error-message="false"
|
|
@@ -135,14 +135,14 @@
|
|
|
135
135
|
{{ uploadError }}
|
|
136
136
|
</div>
|
|
137
137
|
<div
|
|
138
|
-
v-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
v-for="file in quote.files"
|
|
139
|
+
:key="file._id"
|
|
140
|
+
class="QuoteRequest__upload-file mt-5">
|
|
141
|
+
<span @click="quote.files.splice(quote.files.indexOf(file), 1)">x</span>
|
|
142
142
|
<a
|
|
143
|
-
:href="
|
|
143
|
+
:href="file.origin"
|
|
144
144
|
target="_blank">
|
|
145
|
-
{{
|
|
145
|
+
{{ file.fileName }}
|
|
146
146
|
</a>
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
@@ -357,7 +357,7 @@ export default {
|
|
|
357
357
|
quoteTypes: [],
|
|
358
358
|
needToPrint: null,
|
|
359
359
|
needItBy: null,
|
|
360
|
-
|
|
360
|
+
files: []
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
363
|
},
|
|
@@ -366,15 +366,15 @@ export default {
|
|
|
366
366
|
},
|
|
367
367
|
methods: {
|
|
368
368
|
handleUploaded(file) {
|
|
369
|
-
this.quote.file
|
|
369
|
+
this.quote.files.push(file);
|
|
370
370
|
},
|
|
371
371
|
handleUploadError(e) {
|
|
372
372
|
const { error, data } = e?.response?.data || {};
|
|
373
373
|
if (data) {
|
|
374
|
-
this.quote.
|
|
374
|
+
this.quote.files.push({
|
|
375
375
|
fileName: data.fileName,
|
|
376
376
|
origin: data.source
|
|
377
|
-
};
|
|
377
|
+
});
|
|
378
378
|
} else {
|
|
379
379
|
this.uploadError = error;
|
|
380
380
|
}
|