@lancom/shared 0.0.102 → 0.0.106
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 +6 -0
- package/assets/js/models/print-area.js +8 -6
- package/assets/js/models/product-layers.js +3 -3
- package/assets/js/utils/fabric-helper.js +2 -4
- package/assets/js/utils/filters.js +7 -1
- package/assets/js/utils/prints.js +15 -4
- package/assets/js/utils/product.js +4 -4
- package/assets/scss/ui_kit/_table.scss +3 -0
- package/assets/scss/ui_kit/_typography.scss +6 -0
- package/components/checkout/order/address-form/address-form.vue +1 -0
- package/components/checkout/order/order-billing-information/order-billing-information.vue +7 -5
- package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
- package/components/common/color-picker.vue +6 -1
- package/components/common/file_uploader.vue +1 -1
- package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
- package/components/common/pricing_table/pricing-table.scss +1 -3
- package/components/common/pricing_table/pricing-table.vue +13 -4
- package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
- package/components/common/range/range.scss +23 -0
- package/components/common/range/range.vue +19 -0
- package/components/editor/editor.vue +3 -2
- package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
- package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +1 -0
- package/components/editor/editor_pricing/editor-pricing.vue +3 -123
- package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
- package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
- package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
- package/components/editor/editor_product_details/editor-product-details.scss +1 -1
- package/components/editor/editor_product_details/editor-product-details.vue +22 -10
- package/components/editor/editor_workspace/editor-workspace.vue +10 -5
- package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +8 -5
- package/components/modals/cart_modal/cart-modal.vue +1 -1
- package/components/modals/order_modal/order-modal.vue +5 -7
- package/components/modals/payment_modal/payment-modal.vue +1 -1
- package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
- package/components/pricing/pricing_example/pricing-example.scss +4 -1
- package/components/pricing/pricing_example/pricing-example.vue +106 -26
- package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
- package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
- package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
- package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
- package/components/pricing/pricing_print/pricing-print.scss +1 -1
- package/components/pricing/pricing_print/pricing-print.vue +19 -7
- package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
- package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
- package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
- package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
- package/components/product/gallery/gallery.scss +168 -0
- package/components/product/gallery/gallery.vue +252 -0
- package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
- package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
- package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
- package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
- package/components/product/product.vue +16 -5
- package/components/product/product_price_range/product-price-range.vue +20 -4
- package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
- package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
- package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
- package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
- package/components/product/related_products/related-products.scss +34 -0
- package/components/product/related_products/related-products.vue +52 -0
- package/components/products/product_list/product-list.scss +2 -1
- package/components/products/product_list_product/product-list-product.scss +44 -20
- package/components/products/product_list_product/product-list-product.vue +6 -4
- package/components/products/products_aside/products-aside.vue +29 -4
- package/components/products/products_brands/products-brands.vue +9 -2
- package/components/products/products_filters/products-filters.vue +10 -0
- package/components/products/products_tags/products-tags.vue +7 -0
- package/components/products/products_types/products-types.vue +6 -1
- package/mixins/product-preview.js +1 -1
- package/nuxt.config.js +13 -1
- package/package.json +1 -1
- package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
- package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
- package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
- package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
- package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
- package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
- package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
- package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
- package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
- package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
- package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
- package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
- package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
- package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
- package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
- package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
- package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
- package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
- package/store/index.js +3 -1
- package/store/product.js +25 -14
- package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
- package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
- package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
- package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
package/assets/js/api/admin.js
CHANGED
|
@@ -206,6 +206,9 @@ export default {
|
|
|
206
206
|
async fetchSuppliers(params) {
|
|
207
207
|
return sortByName(await _get('admin/suppliers', params));
|
|
208
208
|
},
|
|
209
|
+
validateSuppliers() {
|
|
210
|
+
return _get('admin/suppliers/validate');
|
|
211
|
+
},
|
|
209
212
|
fetchSupplierById(id) {
|
|
210
213
|
return _get(`admin/suppliers/${id}`);
|
|
211
214
|
},
|
|
@@ -412,5 +415,8 @@ export default {
|
|
|
412
415
|
},
|
|
413
416
|
sendToPrinter(job) {
|
|
414
417
|
return _post('admin/printers/job', job);
|
|
418
|
+
},
|
|
419
|
+
findResources(query) {
|
|
420
|
+
return _get(`admin/order/resources?search=${query || ''}`);
|
|
415
421
|
}
|
|
416
422
|
};
|
|
@@ -17,9 +17,9 @@ export const getProductPrintAreas = product => {
|
|
|
17
17
|
if (!product) {
|
|
18
18
|
return {};
|
|
19
19
|
}
|
|
20
|
-
const getSizesFromAreas = (areas, map) => (areas || []).reduce((list, { printSize, printAreaOffsets, sizes }) => {
|
|
21
|
-
if (printSize) {
|
|
22
|
-
list[
|
|
20
|
+
const getSizesFromAreas = (areas, map) => (areas || []).reduce((list, { printSize, printAreaOffsets, sizes, _id }) => {
|
|
21
|
+
if (_id && printSize) {
|
|
22
|
+
list[_id] = { printSize, printAreaOffsets };
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
if (sizes) {
|
|
@@ -32,10 +32,12 @@ export const getProductPrintAreas = product => {
|
|
|
32
32
|
return getSizesFromAreas(product.printAreas);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export const getProductPrintsAreasPrices = product => {
|
|
35
|
+
export const getProductPrintsAreasPrices = (product, printType) => {
|
|
36
36
|
const areas = getProductPrintAreas(product);
|
|
37
37
|
Object.keys(areas).forEach(key => {
|
|
38
|
-
|
|
38
|
+
const { printSize } = areas[key];
|
|
39
|
+
const { printCost } = (printType?.printAreas || []).find(pa => pa.printSizes.some(({ _id }) => _id === printSize._id)) || {};
|
|
40
|
+
areas[key] = printCost || [];
|
|
39
41
|
});
|
|
40
42
|
return areas;
|
|
41
43
|
};
|
|
@@ -43,7 +45,7 @@ export const getProductPrintsAreasPrices = product => {
|
|
|
43
45
|
export const getPrintAreaByName = ({ printArea, editorWidth, editorHeight }, product) => {
|
|
44
46
|
const printAreas = getProductPrintAreas(product);
|
|
45
47
|
const { printSize, printAreaOffsets } = printAreas[printArea] || DEFAULT_PRINT_AREA;
|
|
46
|
-
const pxPerCm = (editorWidth * product.productToImageRatio) / product.productWidthInCm;
|
|
48
|
+
const pxPerCm = (editorWidth * product.productToImageRatio) / (product.productWidthInCm || 60);
|
|
47
49
|
const widthCm = printSize ? printSize.width : DEFAULT_PRINT_SIZE_CM;
|
|
48
50
|
const heightCm = printSize ? printSize.height : DEFAULT_PRINT_SIZE_CM;
|
|
49
51
|
let width = widthCm * pxPerCm;
|
|
@@ -82,9 +82,9 @@ export const getLayerModel = async ({ type, colorId, top, left, isEditMode, url,
|
|
|
82
82
|
if (!type) {
|
|
83
83
|
throw new Error('When creating a new layer, you must specify its type');
|
|
84
84
|
}
|
|
85
|
-
if (!colorId) {
|
|
86
|
-
|
|
87
|
-
}
|
|
85
|
+
// if (!colorId) {
|
|
86
|
+
// throw new Error('When creating a new layer, you must specify coresponding colorId');
|
|
87
|
+
// }
|
|
88
88
|
let layer;
|
|
89
89
|
switch (type) {
|
|
90
90
|
case 'text':
|
|
@@ -64,7 +64,6 @@ class Background {
|
|
|
64
64
|
export default class FabricHelper {
|
|
65
65
|
editor = null;
|
|
66
66
|
background = null;
|
|
67
|
-
printAreaName = 'a3';
|
|
68
67
|
printAreaRect = null;
|
|
69
68
|
|
|
70
69
|
constructor({ editor, background, size }) {
|
|
@@ -135,10 +134,9 @@ export default class FabricHelper {
|
|
|
135
134
|
this.background.setImage(image);
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
setPrintArea(
|
|
139
|
-
this.printAreaName = name;
|
|
137
|
+
setPrintArea(printArea, size, product) {
|
|
140
138
|
this.printAreaRect = getPrintAreaByName({
|
|
141
|
-
|
|
139
|
+
printArea: printArea?._id,
|
|
142
140
|
editorWidth: size.width,
|
|
143
141
|
editorHeight: size.height
|
|
144
142
|
}, product);
|
|
@@ -18,6 +18,12 @@ export const number = (value, digits = 0) => {
|
|
|
18
18
|
|
|
19
19
|
export const decimal = (value, digits = 2) => number(value || 0, digits);
|
|
20
20
|
|
|
21
|
+
export const priceWithTax = (value, settings) => {
|
|
22
|
+
const { gstTax = 0, displayPricingWithTax = false } = settings || {};
|
|
23
|
+
const valueWithTask = displayPricingWithTax ? tax(value, gstTax) : value;
|
|
24
|
+
return price(valueWithTask);
|
|
25
|
+
};
|
|
26
|
+
|
|
21
27
|
export const price = (value = 0, currency = 'USD') => {
|
|
22
28
|
const amount = number(value, 2);
|
|
23
29
|
const cur = currencies.find(c => c.value.toUpperCase() === currency.toUpperCase());
|
|
@@ -78,7 +84,7 @@ export const shortDate = d => dayjs(d).format('DD/MM/YYYY');
|
|
|
78
84
|
|
|
79
85
|
export const sydneyTime = d => dayjs(d).utc().utcOffset(10).format('MMM D, YYYY h:mm A');
|
|
80
86
|
|
|
81
|
-
export const priceInRange = (prices, amount) => (prices.find(({ min, max }) => min <= amount && (!max || max >= amount)) || { price: 0 }).price;
|
|
87
|
+
export const priceInRange = (prices, amount) => ((prices || []).find(({ min, max }) => min <= amount && (!max || max >= amount)) || { price: 0 }).price;
|
|
82
88
|
|
|
83
89
|
export const staticLink = link => (link || '').startsWith('http') ? link : `${process.env.STATIC_URL}${link}`;
|
|
84
90
|
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
export function getPrintAreasSizes(printAreas, side) {
|
|
2
|
+
return printAreas
|
|
3
|
+
.filter(printArea => !side || printArea.side === side)
|
|
4
|
+
.reduce((sizes, printArea) => {
|
|
5
|
+
return [
|
|
6
|
+
...sizes,
|
|
7
|
+
...getPrintAreaSizes(printArea).filter(({ _id }) => !sizes.some(size => size._id === _id))
|
|
8
|
+
];
|
|
9
|
+
}, []);
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
export function getPrintAreaSizes({ printSize, sizes = [] }) {
|
|
2
13
|
return [
|
|
3
14
|
printSize,
|
|
@@ -22,7 +33,7 @@ export function getPrintsFromLayers(layers, product) {
|
|
|
22
33
|
if (!prints.has(printArea)) {
|
|
23
34
|
const layerPrintType = product.printTypes.find(({ _id }) => _id === printType);
|
|
24
35
|
const layerPrintArea = product.printAreas.find(({ _id }) => _id === printArea);
|
|
25
|
-
const sizes = getPrintAreaSizes(layerPrintArea);
|
|
36
|
+
const sizes = layerPrintArea ? getPrintAreaSizes(layerPrintArea) : [];
|
|
26
37
|
const layerPrintSize = sizes.find(({ _id }) => _id === printSize);
|
|
27
38
|
const { setupCost, printCost, freeSetupOver } = getPrintTypeSizePricing(layerPrintType, printSize) || {};
|
|
28
39
|
const getSimpleObj = i => i && ({ _id: i._id, name: i.name });
|
|
@@ -30,7 +41,7 @@ export function getPrintsFromLayers(layers, product) {
|
|
|
30
41
|
printArea: getSimpleObj(layerPrintArea),
|
|
31
42
|
printType: getSimpleObj(layerPrintType),
|
|
32
43
|
printSize: getSimpleObj(layerPrintSize),
|
|
33
|
-
costType: layerPrintType
|
|
44
|
+
costType: layerPrintType?.costType,
|
|
34
45
|
setupCost,
|
|
35
46
|
freeSetupOver,
|
|
36
47
|
printCost,
|
|
@@ -47,8 +58,8 @@ export function getPrintsFromLayers(layers, product) {
|
|
|
47
58
|
}
|
|
48
59
|
|
|
49
60
|
export function getPrintTypeSizePricing(printType, sizeId) {
|
|
50
|
-
return printType
|
|
61
|
+
return printType?.printAreas
|
|
51
62
|
.find(({ printSizes }) => {
|
|
52
63
|
return printSizes.map(size => size?._id || size).includes(sizeId);
|
|
53
|
-
}) || printType
|
|
64
|
+
}) || printType?.printAreas[0];
|
|
54
65
|
}
|
|
@@ -105,7 +105,7 @@ export function generateProductsLink($route, data) {
|
|
|
105
105
|
params.push(`page=${page}`);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
Object.keys({
|
|
108
|
+
Object.keys({ ...(($route && $route.query) || {}), ...data }).forEach(key => {
|
|
109
109
|
if (!['text', 'sort', 'page', 'type', 'brand'].includes(key)) {
|
|
110
110
|
let items = ($route && $route.query[key]) ? $route.query[key].split(',') : [];
|
|
111
111
|
items = (data[key] ? (items.includes(data[key]) ? items.filter(c => c !== data[key]) : [...items, data[key]]) : items).join(',');
|
|
@@ -126,11 +126,11 @@ export function generateProductLink(product, color, toEditor = false) {
|
|
|
126
126
|
return `${toEditor ? `${baseLink}/editor` : baseLink}${color ? `?color=${color.alias}` : ''}`;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
export function getProductColorImages(product, color) {
|
|
129
|
+
export function getProductColorImages(product, color, skipDefault = false) {
|
|
130
130
|
const types = [COLORS_IMAGES_TYPES.FRONT, COLORS_IMAGES_TYPES.BACK];
|
|
131
131
|
const images = types.map(type => {
|
|
132
132
|
const validImages = (product.images || []).filter(i => isValidImageType(i, type));
|
|
133
|
-
return (color && validImages.find(i => i.color === color._id)) || validImages[0];
|
|
133
|
+
return (color && validImages.find(i => i.color === color._id)) || (!skipDefault && validImages[0]);
|
|
134
134
|
});
|
|
135
135
|
return images.filter(i => !!i);
|
|
136
136
|
}
|
|
@@ -142,5 +142,5 @@ export function sortByOrder(items, itemProp) {
|
|
|
142
142
|
|
|
143
143
|
export function sortByOrderASC(items, itemProp) {
|
|
144
144
|
const getOrder = item => (itemProp ? +(item[itemProp] && item[itemProp].order) : item.order) || 0;
|
|
145
|
-
return (items || []).sort((a, b) => getOrder(a) - getOrder(b));
|
|
145
|
+
return [...(items || [])].sort((a, b) => getOrder(a) - getOrder(b));
|
|
146
146
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
</div>
|
|
6
6
|
<div class="OrderBillingInformation__form">
|
|
7
7
|
<validation-observer
|
|
8
|
+
v-slot="{ invalid }"
|
|
8
9
|
ref="form">
|
|
9
10
|
<div class="OrderBillingInformation__content">
|
|
10
11
|
<address-form
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
:without-additional-info="true" />
|
|
13
14
|
</div>
|
|
14
15
|
<progress-steps-controls
|
|
15
|
-
:disabled-next="
|
|
16
|
+
:disabled-next="isSubmit && invalid"
|
|
16
17
|
@prev="$emit('prev')"
|
|
17
18
|
@next="submit" />
|
|
18
19
|
</validation-observer>
|
|
@@ -23,7 +24,6 @@
|
|
|
23
24
|
<script>
|
|
24
25
|
import AddressForm from '@lancom/shared/components/checkout/order/address-form/address-form';
|
|
25
26
|
import ProgressStepsControls from '@lancom/shared/components/common/progress_steps/progress_steps_controls/progress-steps-controls';
|
|
26
|
-
import { ORDER_STEPS } from '@lancom/shared/assets/js/constants/order';
|
|
27
27
|
|
|
28
28
|
export default {
|
|
29
29
|
name: 'OrderBillingInformation',
|
|
@@ -40,13 +40,15 @@ export default {
|
|
|
40
40
|
data() {
|
|
41
41
|
return {
|
|
42
42
|
copyToShippingAddress: true,
|
|
43
|
-
|
|
43
|
+
isSubmit: false
|
|
44
44
|
};
|
|
45
45
|
},
|
|
46
46
|
methods: {
|
|
47
47
|
async submit() {
|
|
48
|
-
this.
|
|
49
|
-
|
|
48
|
+
this.isSubmit = true;
|
|
49
|
+
|
|
50
|
+
const isValid = await this.$refs.form.validate() && !!this.order.shippingAddress.postcode;
|
|
51
|
+
if (!isValid) {
|
|
50
52
|
return;
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
v-if="isOpen"
|
|
17
17
|
v-click-outside="close"
|
|
18
18
|
class="ColorPicker__dropdown">
|
|
19
|
-
<
|
|
19
|
+
<chrome
|
|
20
20
|
v-model="model"
|
|
21
21
|
:disable-alpha="true" />
|
|
22
22
|
</div>
|
|
@@ -24,8 +24,13 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
+
import { Chrome } from 'vue-color';
|
|
28
|
+
|
|
27
29
|
export default {
|
|
28
30
|
name: 'ColorPicker',
|
|
31
|
+
components: {
|
|
32
|
+
Chrome
|
|
33
|
+
},
|
|
29
34
|
props: {
|
|
30
35
|
value: {
|
|
31
36
|
type: String,
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
80
80
|
try {
|
|
81
81
|
const image = await api.uploadImage(this.file, this.onProgress, this.url);
|
|
82
82
|
this.onProgress(0);
|
|
83
|
-
const url = image && staticLink(image.thumb);
|
|
83
|
+
const url = image && staticLink(image.thumb || image.origin);
|
|
84
84
|
this.$emit('onuploaded', { ...image, url });
|
|
85
85
|
} catch (e) {
|
|
86
86
|
console.dir(e);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<table
|
|
2
|
+
<table
|
|
3
|
+
class="lc_table"
|
|
4
|
+
:class="{ bordered, striped }">
|
|
3
5
|
<thead class="centered">
|
|
4
6
|
<tr class="highlighted">
|
|
5
7
|
<th>Items</th>
|
|
@@ -14,7 +16,7 @@
|
|
|
14
16
|
active: amount >= range.min && ((range.max && amount <= range.max) || !range.max)
|
|
15
17
|
}">
|
|
16
18
|
<td>{{ (range.max >= 9999 || !range.max) ? `${range.min}+` : `${range.min}-${range.max}` }}</td>
|
|
17
|
-
<td>{{ range.price |
|
|
19
|
+
<td>{{ range.price | priceWithTax(pricingSettings) }}</td>
|
|
18
20
|
</tr>
|
|
19
21
|
</tbody>
|
|
20
22
|
</table>
|
|
@@ -22,13 +24,12 @@
|
|
|
22
24
|
|
|
23
25
|
<script>
|
|
24
26
|
import { mapGetters } from 'vuex';
|
|
25
|
-
import {
|
|
27
|
+
import { priceWithTax } from '@lancom/shared/assets/js/utils/filters';
|
|
26
28
|
|
|
27
29
|
export default {
|
|
28
30
|
name: 'PricingDiscountsTable',
|
|
29
31
|
filters: {
|
|
30
|
-
|
|
31
|
-
tax
|
|
32
|
+
priceWithTax
|
|
32
33
|
},
|
|
33
34
|
props: {
|
|
34
35
|
prices: {
|
|
@@ -38,6 +39,14 @@ export default {
|
|
|
38
39
|
amount: {
|
|
39
40
|
type: Number,
|
|
40
41
|
default: 0
|
|
42
|
+
},
|
|
43
|
+
bordered: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
striped: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
41
50
|
}
|
|
42
51
|
},
|
|
43
52
|
computed: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div class="PricingTable_wrapper">
|
|
3
3
|
<table
|
|
4
|
-
class="lc_table
|
|
4
|
+
class="lc_table"
|
|
5
|
+
:class="{ bordered, striped }">
|
|
5
6
|
<thead class="centered">
|
|
6
7
|
<tr
|
|
7
8
|
class="highlighted"
|
|
@@ -35,7 +36,8 @@
|
|
|
35
36
|
|
|
36
37
|
<script>
|
|
37
38
|
import get from 'lodash.get';
|
|
38
|
-
import {
|
|
39
|
+
import { mapGetters } from 'vuex';
|
|
40
|
+
import { priceWithTax } from '@lancom/shared/assets/js/utils/filters';
|
|
39
41
|
|
|
40
42
|
export default {
|
|
41
43
|
name: 'PricingTable',
|
|
@@ -55,11 +57,18 @@ export default {
|
|
|
55
57
|
bordered: {
|
|
56
58
|
type: Boolean
|
|
57
59
|
},
|
|
60
|
+
striped: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
58
64
|
trLabel: {
|
|
59
65
|
type: String
|
|
60
66
|
}
|
|
61
67
|
},
|
|
62
68
|
computed: {
|
|
69
|
+
...mapGetters([
|
|
70
|
+
'pricingSettings'
|
|
71
|
+
]),
|
|
63
72
|
thList() {
|
|
64
73
|
return this.items.map(item => get(item, this.nameAttr));
|
|
65
74
|
},
|
|
@@ -125,7 +134,7 @@ export default {
|
|
|
125
134
|
const printType = this.items.find(item => printTypeName === get(item, this.nameAttr));
|
|
126
135
|
const pricing = get(printType, this.pricingAttr);
|
|
127
136
|
const item = pricing.find(({ min, max }) => (!min || range.min >= min) && (!max || range.min <= max));
|
|
128
|
-
return item ?
|
|
137
|
+
return item ? priceWithTax(item.price, this.pricingSettings) : '-';
|
|
129
138
|
}
|
|
130
139
|
}
|
|
131
140
|
};
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
<script>
|
|
30
30
|
import { mapGetters } from 'vuex';
|
|
31
31
|
import api from '@lancom/shared/assets/js/api';
|
|
32
|
+
import { generateProductLink } from '@lancom/shared/assets/js/utils/product';
|
|
32
33
|
import ProductsListDropdownOption from './products_list_dropdown_option/products-list-dropdown-option';
|
|
33
34
|
|
|
34
35
|
export default {
|
|
@@ -49,7 +50,8 @@ export default {
|
|
|
49
50
|
},
|
|
50
51
|
methods: {
|
|
51
52
|
select(product) {
|
|
52
|
-
|
|
53
|
+
const link = generateProductLink(product, null, true);
|
|
54
|
+
this.$router.push(link);
|
|
53
55
|
},
|
|
54
56
|
async loadProducts(text) {
|
|
55
57
|
try {
|
|
@@ -48,4 +48,27 @@ $height: 8px;
|
|
|
48
48
|
cursor: pointer;
|
|
49
49
|
z-index: 51;
|
|
50
50
|
}
|
|
51
|
+
&__from,
|
|
52
|
+
&__to {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 20px;
|
|
55
|
+
font-size: 11px;
|
|
56
|
+
opacity: 0.7;
|
|
57
|
+
}
|
|
58
|
+
&__from {
|
|
59
|
+
left: -3px;
|
|
60
|
+
}
|
|
61
|
+
&__to {
|
|
62
|
+
right: -3px;
|
|
63
|
+
}
|
|
64
|
+
&__current-value {
|
|
65
|
+
bottom: -20px;
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
left: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
text-align: center;
|
|
71
|
+
position: absolute;
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
}
|
|
51
74
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="Range__wrapper no-select">
|
|
3
|
+
<div
|
|
4
|
+
v-if="visibleSteps"
|
|
5
|
+
class="Range__from">
|
|
6
|
+
{{ min }}
|
|
7
|
+
</div>
|
|
3
8
|
<div
|
|
4
9
|
ref="indicator"
|
|
5
10
|
class="Range__indicator">
|
|
@@ -17,6 +22,16 @@
|
|
|
17
22
|
class="Range__indicator-after"
|
|
18
23
|
:style="{ width: after }"
|
|
19
24
|
@click="handleClick"></div>
|
|
25
|
+
<div
|
|
26
|
+
v-if="visibleSteps"
|
|
27
|
+
class="Range__current-value">
|
|
28
|
+
{{ model }}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
v-if="visibleSteps"
|
|
33
|
+
class="Range__to">
|
|
34
|
+
{{ max }}
|
|
20
35
|
</div>
|
|
21
36
|
</div>
|
|
22
37
|
</template>
|
|
@@ -40,6 +55,10 @@ export default {
|
|
|
40
55
|
step: {
|
|
41
56
|
type: Number,
|
|
42
57
|
default: 1
|
|
58
|
+
},
|
|
59
|
+
visibleSteps: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
43
62
|
}
|
|
44
63
|
},
|
|
45
64
|
data() {
|
|
@@ -129,7 +129,8 @@ export default {
|
|
|
129
129
|
'editorSize',
|
|
130
130
|
'selectedTab',
|
|
131
131
|
'productPricing',
|
|
132
|
-
'printsPricing'
|
|
132
|
+
'printsPricing',
|
|
133
|
+
'isPrintPricing'
|
|
133
134
|
]),
|
|
134
135
|
...mapGetters('layers', [
|
|
135
136
|
'layerThumbnails'
|
|
@@ -175,7 +176,7 @@ export default {
|
|
|
175
176
|
}
|
|
176
177
|
},
|
|
177
178
|
proceedToCard() {
|
|
178
|
-
const entities = generateCartProducts(this.product, this.template.
|
|
179
|
+
const entities = generateCartProducts(this.product, this.template.simpleProducts, this.template.layers, this.isPrintPricing);
|
|
179
180
|
this.addToCart({ entities, shop: this.shop });
|
|
180
181
|
this.showCartModal(async () => {
|
|
181
182
|
const message = 'Do you wish to continue with editing the current design or reset the editor?';
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
<script>
|
|
152
152
|
import { inRange } from '@lancom/shared/assets/js/utils/filters';
|
|
153
153
|
import { availableFonts, loadFont } from '@lancom/shared/assets/js/utils/fonts-helper';
|
|
154
|
+
import ColorPicker from '@lancom/shared/components/common/color-picker';
|
|
154
155
|
import EditorLayerCommonFields from '../editor_layer_common_fields/editor-layer-common-fields';
|
|
155
156
|
import FontFamilySelect from './font-family_select/font-family-select';
|
|
156
157
|
|
|
@@ -169,7 +170,8 @@ export default {
|
|
|
169
170
|
name: 'EditorLayerFormText',
|
|
170
171
|
components: {
|
|
171
172
|
EditorLayerCommonFields,
|
|
172
|
-
FontFamilySelect
|
|
173
|
+
FontFamilySelect,
|
|
174
|
+
ColorPicker
|
|
173
175
|
},
|
|
174
176
|
props: {
|
|
175
177
|
layer: {
|
|
@@ -104,6 +104,7 @@ export default {
|
|
|
104
104
|
this.$emit('layer-added', { layer, toEditMode: true });
|
|
105
105
|
},
|
|
106
106
|
async handleUploaded({ url, size }) {
|
|
107
|
+
debugger
|
|
107
108
|
const layer = await this.createLayer({ type: 'art', url, size });
|
|
108
109
|
this.$emit('layer-added', { layer, toEditMode: false });
|
|
109
110
|
}
|