@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.
Files changed (107) hide show
  1. package/assets/js/api/admin.js +6 -0
  2. package/assets/js/models/print-area.js +8 -6
  3. package/assets/js/models/product-layers.js +3 -3
  4. package/assets/js/utils/fabric-helper.js +2 -4
  5. package/assets/js/utils/filters.js +7 -1
  6. package/assets/js/utils/prints.js +15 -4
  7. package/assets/js/utils/product.js +4 -4
  8. package/assets/scss/ui_kit/_table.scss +3 -0
  9. package/assets/scss/ui_kit/_typography.scss +6 -0
  10. package/components/checkout/order/address-form/address-form.vue +1 -0
  11. package/components/checkout/order/order-billing-information/order-billing-information.vue +7 -5
  12. package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
  13. package/components/common/color-picker.vue +6 -1
  14. package/components/common/file_uploader.vue +1 -1
  15. package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
  16. package/components/common/pricing_table/pricing-table.scss +1 -3
  17. package/components/common/pricing_table/pricing-table.vue +13 -4
  18. package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
  19. package/components/common/range/range.scss +23 -0
  20. package/components/common/range/range.vue +19 -0
  21. package/components/editor/editor.vue +3 -2
  22. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
  23. package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +1 -0
  24. package/components/editor/editor_pricing/editor-pricing.vue +3 -123
  25. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  26. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  27. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  28. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
  29. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  30. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
  31. package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
  32. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
  33. package/components/editor/editor_product_details/editor-product-details.scss +1 -1
  34. package/components/editor/editor_product_details/editor-product-details.vue +22 -10
  35. package/components/editor/editor_workspace/editor-workspace.vue +10 -5
  36. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +8 -5
  37. package/components/modals/cart_modal/cart-modal.vue +1 -1
  38. package/components/modals/order_modal/order-modal.vue +5 -7
  39. package/components/modals/payment_modal/payment-modal.vue +1 -1
  40. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
  41. package/components/pricing/pricing_example/pricing-example.scss +4 -1
  42. package/components/pricing/pricing_example/pricing-example.vue +106 -26
  43. package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
  44. package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
  45. package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
  46. package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
  47. package/components/pricing/pricing_print/pricing-print.scss +1 -1
  48. package/components/pricing/pricing_print/pricing-print.vue +19 -7
  49. package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
  50. package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
  51. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
  52. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
  53. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
  54. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
  55. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
  56. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
  57. package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
  58. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
  59. package/components/product/gallery/gallery.scss +168 -0
  60. package/components/product/gallery/gallery.vue +252 -0
  61. package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
  62. package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
  63. package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
  64. package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
  65. package/components/product/product.vue +16 -5
  66. package/components/product/product_price_range/product-price-range.vue +20 -4
  67. package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
  68. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
  69. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
  70. package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
  71. package/components/product/related_products/related-products.scss +34 -0
  72. package/components/product/related_products/related-products.vue +52 -0
  73. package/components/products/product_list/product-list.scss +2 -1
  74. package/components/products/product_list_product/product-list-product.scss +44 -20
  75. package/components/products/product_list_product/product-list-product.vue +6 -4
  76. package/components/products/products_aside/products-aside.vue +29 -4
  77. package/components/products/products_brands/products-brands.vue +9 -2
  78. package/components/products/products_filters/products-filters.vue +10 -0
  79. package/components/products/products_tags/products-tags.vue +7 -0
  80. package/components/products/products_types/products-types.vue +6 -1
  81. package/mixins/product-preview.js +1 -1
  82. package/nuxt.config.js +13 -1
  83. package/package.json +1 -1
  84. package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
  85. package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
  86. package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
  87. package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
  88. package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
  89. package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
  90. package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
  91. package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
  92. package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
  93. package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
  94. package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
  95. package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
  96. package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
  97. package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
  98. package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
  99. package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
  100. package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
  101. package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
  102. package/store/index.js +3 -1
  103. package/store/product.js +25 -14
  104. package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
  105. package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
  106. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
  107. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
@@ -20,7 +20,7 @@
20
20
  popover-class="tooltip popover white"
21
21
  class="EditorProductDetails__discounts-table">
22
22
  <span class="lc_semibold22 lc_black EditorProductDetails__dashed-underline">
23
- {{ defaultSimpleProduct.pricing[0].price | tax(pricingSettings.gstTax) | price }}
23
+ {{ defaultSimpleProduct.pricing[0].price | priceWithTax(pricingSettings) }}
24
24
  </span>
25
25
  <template slot="popover">
26
26
  <pricing-discounts-table :prices="defaultSimpleProduct.pricing" />
@@ -50,9 +50,10 @@
50
50
  Printing
51
51
  </span>
52
52
  <template slot="popover">
53
- <discounts-table
54
- :visible-sleeve="false"
55
- :striped="true"
53
+ <pricing-table
54
+ :items="printTypePrices"
55
+ :bordered="true"
56
+ :striped="false"
56
57
  class="EditorProductDetails__prints-table" />
57
58
  </template>
58
59
  </v-popover>
@@ -80,10 +81,10 @@ import { mapGetters } from 'vuex';
80
81
  import ProductColorsSelector from '@lancom/shared/components/product/layouts/product_colors_selector/product-colors-selector';
81
82
  import ProductSizeSelector from '@lancom/shared/components/product/product_size_selector/product-size-selector';
82
83
  import EditorPricing from '@lancom/shared/components/editor/editor_pricing/editor-pricing';
83
- import DiscountsTable from '@lancom/shared/components/pricing/pricing_print/discounts_table/discounts-table.vue';
84
84
  import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
85
85
  import modals from '@lancom/shared/mixins/modals';
86
- import { price, tax, staticLink } from '@lancom/shared/assets/js/utils/filters';
86
+ import { staticLink, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
87
+ import PricingTable from '@lancom/shared/components/common/pricing_table/pricing-table';
87
88
 
88
89
  export default {
89
90
  name: 'EditorProductDetails',
@@ -92,11 +93,10 @@ export default {
92
93
  ProductSizeSelector,
93
94
  PricingDiscountsTable,
94
95
  EditorPricing,
95
- DiscountsTable
96
+ PricingTable
96
97
  },
97
98
  filters: {
98
- price,
99
- tax,
99
+ priceWithTax,
100
100
  staticLink
101
101
  },
102
102
  mixins: [modals],
@@ -104,7 +104,8 @@ export default {
104
104
  ...mapGetters('product', [
105
105
  'product',
106
106
  'productDetailsLoaded',
107
- 'defaultSimpleProduct'
107
+ 'defaultSimpleProduct',
108
+ 'selectedPrintType'
108
109
  ]),
109
110
  ...mapGetters('layers', [
110
111
  'layerThumbnails'
@@ -114,6 +115,17 @@ export default {
114
115
  ]),
115
116
  productLink() {
116
117
  return `/${this.product.SKU}/${this.product.alias}`;
118
+ },
119
+ printTypePrices() {
120
+ return [...(this.selectedPrintType?.printAreas || []).reduce((sizes, area) => {
121
+ (area.printSizes || []).forEach(size => {
122
+ sizes.set(size._id, {
123
+ name: size.name,
124
+ pricing: area.printCost
125
+ });
126
+ });
127
+ return sizes;
128
+ }, new Map()).values()];
117
129
  }
118
130
  }
119
131
  };
@@ -24,7 +24,8 @@
24
24
  ref="editor"
25
25
  :key="side"
26
26
  :side="side"
27
- :print-area="selectedPrintArea"
27
+ :print-area="editablePrintArea"
28
+ :print-area-size="selectedPrintArea"
28
29
  :class="side"
29
30
  class="EditorWorkspace__side rotate-y-element">
30
31
  </editor-workspace-side>
@@ -56,7 +57,8 @@
56
57
  ref="editor"
57
58
  :key="editableSide.id"
58
59
  :side="editableSide.id"
59
- :print-area="selectedPrintArea"
60
+ :print-area="editablePrintArea"
61
+ :print-area-size="selectedPrintArea"
60
62
  :class="editableSide.id"
61
63
  :zoom-size="zoomSize"
62
64
  class="EditorWorkspace__side rotate-y-element"
@@ -139,6 +141,7 @@ export default {
139
141
  'product',
140
142
  'productDetailsLoaded',
141
143
  'selectedPrintArea',
144
+ 'editablePrintArea',
142
145
  'editableSide',
143
146
  'editableColor'
144
147
  ]),
@@ -149,7 +152,8 @@ export default {
149
152
  methods: {
150
153
  ...mapMutations([
151
154
  'setEditableSide',
152
- 'setSelectedPrintArea'
155
+ 'setSelectedPrintArea',
156
+ 'setEditablePrintArea'
153
157
  ]),
154
158
  selectTab(value) {
155
159
  this.setEditableSide({ id: value }); // todo improve later by adding real sides
@@ -159,8 +163,9 @@ export default {
159
163
  id: this.editableSide.id === 'front' ? 'back' : 'front'
160
164
  });
161
165
  },
162
- selectPrintArea(printArea) {
163
- this.setSelectedPrintArea({ sideId: this.editableSide.id, printArea });
166
+ selectPrintArea({ printArea, size }) {
167
+ this.setEditablePrintArea(printArea);
168
+ this.setSelectedPrintArea({ sideId: this.editableSide.id, printArea: printArea._id, size });
164
169
  },
165
170
  toogleBoundBox(state, printAreaOption) {
166
171
  if (this.$refs.editor) {
@@ -86,6 +86,9 @@ export default {
86
86
  default: null
87
87
  },
88
88
  printArea: {
89
+ type: Object
90
+ },
91
+ printAreaSize: {
89
92
  type: String,
90
93
  required: true
91
94
  },
@@ -147,10 +150,10 @@ export default {
147
150
  );
148
151
  },
149
152
  printAreaIsSmall() {
150
- return ['rect10_l', 'rect10_r'].includes(this.printArea);
153
+ return this.printAreaSize === 'rect10';
151
154
  },
152
155
  backgroundColor() {
153
- return this.backgroundImageLoaded && this.editableColor.rgb;
156
+ return this.backgroundImageLoaded && this.editableColor?.rgb;
154
157
  },
155
158
  isZoomed() {
156
159
  return !!this.zoomSize;
@@ -320,13 +323,13 @@ export default {
320
323
  setOffsetWarningVisibility(visible) {
321
324
  // this.offsetWarningVisible = visible;
322
325
  },
323
- toogleBoundBox(state, printArea) {
326
+ toogleBoundBox(state, option) {
324
327
  if (!this.fabricHelper || this.breakpoints.is === 'xs') {
325
328
  return;
326
329
  }
327
330
 
328
- if (printArea) {
329
- const area = state ? printArea.value : this.printArea;
331
+ if (option) {
332
+ const area = state ? option.printArea : this.printArea;
330
333
  this.fabricHelper.setPrintArea(area, this.editorSize, this.product);
331
334
  }
332
335
 
@@ -31,7 +31,7 @@
31
31
 
32
32
  <script>
33
33
  import { mapGetters } from 'vuex';
34
- import Cart from '@lancom/shared/components/checkout/cart/cart';
34
+ import Cart from '@/components/checkout/cart/cart';
35
35
 
36
36
  export default {
37
37
  name: 'CartModal',
@@ -295,13 +295,10 @@ export default {
295
295
  ...mapGetters(['shop']),
296
296
  ...mapGetters('order', ['orderData']),
297
297
  ...mapGetters('cart', [
298
- 'notEmptySimpleProducts',
298
+ 'entities',
299
299
  'cartPricing',
300
300
  'suburb'
301
- ]),
302
- numberOfProducts() {
303
- return this.notEmptySimpleProducts.length;
304
- }
301
+ ])
305
302
  },
306
303
  mounted() {
307
304
  if (this.orderData) {
@@ -340,8 +337,9 @@ export default {
340
337
  try {
341
338
  this.processing = true;
342
339
  await this.createOrder({
343
- ...this.form,
344
- products: this.notEmptySimpleProducts,
340
+ billingAddress: this.form,
341
+ shippingAddress: this.form,
342
+ products: this.entities,
345
343
  pricing: this.cartPricing,
346
344
  shop: this.shop._id
347
345
  });
@@ -155,7 +155,7 @@ export default {
155
155
  },
156
156
  isSuccessOrderCharge() {
157
157
  const { charge, test } = this.orderData;
158
- return true || (charge && charge.success) || test;
158
+ return (charge && charge.success) || test;
159
159
  },
160
160
  isFailedOrderCharge() {
161
161
  const { charge } = this.orderData;
@@ -250,7 +250,7 @@ export default {
250
250
  },
251
251
  data() {
252
252
  return {
253
- product: null
253
+ product: this.products.find(p => p.productType.alias === PRODUCT_TYPES.TEE)
254
254
  };
255
255
  },
256
256
  computed: {
@@ -271,9 +271,6 @@ export default {
271
271
  return productType?.alias;
272
272
  }
273
273
  },
274
- created() {
275
- this.product = this.findProductByType(PRODUCT_TYPES.TEE);
276
- },
277
274
  methods: {
278
275
  contactUs() {
279
276
  this.$aside.show(ContactUs);
@@ -1,6 +1,9 @@
1
1
  @import "@/assets/scss/variables";
2
2
 
3
3
  .PricingExample {
4
+ &__tabs {
5
+ margin-bottom: 30px;
6
+ }
4
7
  &__description {
5
8
  line-height: 170%;
6
9
  color: $gray;
@@ -59,7 +62,7 @@
59
62
  }
60
63
  &-total-price {
61
64
  font-weight: bold;
62
- font-size: 40px;
65
+ font-size: 30px;
63
66
  line-height: 120%;
64
67
  letter-spacing: 0.02em;
65
68
  color: $green;
@@ -5,6 +5,18 @@
5
5
  <div
6
6
  data-aos="aosFadeLeft"
7
7
  class="col-sm-5 col-12 PricingExample__col">
8
+ <div class="PricingExample__tabs">
9
+ <btn
10
+ :btn-class="availablePrintType === 'full colour print' ? 'green' : 'white'"
11
+ btn-label="Digital printing"
12
+ @onclick="changeAvailablePrintType('full colour print')">
13
+ </btn>
14
+ <btn
15
+ :btn-class="availablePrintType === 'screen print' ? 'green' : 'white'"
16
+ btn-label="Screen printing"
17
+ @onclick="changeAvailablePrintType('screen print')">
18
+ </btn>
19
+ </div>
8
20
  <h2 class="lc_h2">
9
21
  Example of price calculation
10
22
  </h2>
@@ -36,29 +48,41 @@
36
48
  <div class="PricingExample__example-formula-table">
37
49
  <table
38
50
  v-if="productPricing"
39
- class="lc_table col-2-highlighted tight-rows">
51
+ class="lc_table col-2-highlighted tight-rows layout-auto">
40
52
  <tbody>
41
53
  <tr>
42
- <td>Tees [AS Colour Staple Tee]:</td>
43
- <td>{{ productPricing.amount }} x {{ productPricing.products.products.price | price }} = {{ productPricing.products.products.totalPrice | price }}</td>
44
- <td>Total cost:</td>
45
- </tr>
46
- <tr>
47
- <td>Front Print [Half-A4]:</td>
48
- <td>{{ productPricing.amount }} x {{ printsPricing.front.price | price }} = {{ printsPricing.front.totalPrice | price }}</td>
49
- <td>
54
+ <td class="lc_regular13">
55
+ Tees [AS Colour Staple Tee]:
56
+ </td>
57
+ <td class="lc_regular13 lc_bold">
58
+ {{ productPricing.amount }} x {{ productPricing.products.products.price | price }} = {{ productPricing.products.products.totalPrice | price }}
59
+ </td>
60
+ <td :rowspan="1 + printsPricing.length">
61
+ Total cost:
50
62
  <div class="PricingExample__example-total-price">
51
63
  {{ productPricing.totalPrice | price }}
52
64
  </div>
53
65
  <div class="PricingExample__example-tax">
54
66
  Inclusive of GST: {{ productPricing.tax.totalPrice | price }}
55
67
  </div>
68
+ <div class="mt-10">
69
+ + Delivery
70
+ </div>
56
71
  </td>
57
72
  </tr>
58
- <tr>
59
- <td>Back Print [A3]:</td>
60
- <td>{{ productPricing.amount }} x {{ printsPricing.back.price | price }} = {{ printsPricing.back.totalPrice | price }}</td>
61
- <td>+ Delivery</td>
73
+ <tr
74
+ v-for="(print, index) in printsPricing"
75
+ :key="index">
76
+ <td class="lc_regular13">
77
+ {{ print.printArea.name }} [{{ print.printSize.name }}]:
78
+ </td>
79
+ <td class="lc_regular13 lc_bold">
80
+ {{ productPricing.amount }} x {{ print.price | price }}
81
+ <span v-if="print.setupPrice > 0">
82
+ + {{ print.setupPrice| price }}
83
+ </span>
84
+ = {{ print.totalPrice | price }}
85
+ </td>
62
86
  </tr>
63
87
  </tbody>
64
88
  </table>
@@ -71,30 +95,86 @@
71
95
  </template>
72
96
 
73
97
  <script>
74
- import productsPrice from '@lancom/shared/mixins/products-price';
75
- import { PRODUCT_TYPES } from '@lancom/shared/assets/js/constants/product';
98
+ import api from '@lancom/shared/assets/js/api';
99
+ import { getPrintAreasSizes, getPrintAreaSizes } from '@lancom/shared/assets/js/utils/prints';
100
+ import { getProductsForCalculatePricing, generateProductLink } from '@lancom/shared/assets/js/utils/product';
101
+ import { price } from '@lancom/shared/assets/js/utils/filters';
102
+ import { mapGetters } from 'vuex';
76
103
 
77
104
  export default {
78
105
  name: 'PricingExample',
79
- mixins: [
80
- productsPrice
81
- ],
106
+ filters: {
107
+ price
108
+ },
82
109
  props: {
83
- products: {
84
- type: Array,
110
+ product: {
111
+ type: Object,
85
112
  required: true
86
113
  }
87
114
  },
88
115
  data() {
116
+ const simpleProduct = [...this.product.simpleProducts].sort((a, b) => a.maxPrice - b.maxPrice)[0];
89
117
  return {
90
- amount: 20,
91
- front: { printArea: 'half_a4_h' },
92
- back: { printArea: 'a3' },
93
- product: null
118
+ simpleProduct: { ...simpleProduct, amount: 55 },
119
+ labels: {
120
+ 'screen print': 'Screen Print',
121
+ 'full colour print': 'Digital Print'
122
+ },
123
+ productPricing: null,
124
+ availablePrintType: 'full colour print',
125
+ postcode: null,
126
+ sides: [{
127
+ type: 'front',
128
+ printSize: 'rect10',
129
+ printSizes: getPrintAreasSizes(this.product.printAreas, 'front'),
130
+ colorsQuantity: 1,
131
+ hasUnderbase: false
132
+ }, {
133
+ type: 'back',
134
+ printSize: 'a4',
135
+ printSizes: getPrintAreasSizes(this.product.printAreas, 'back'),
136
+ colorsQuantity: 1,
137
+ hasUnderbase: false
138
+ }]
94
139
  };
95
140
  },
96
- created() {
97
- this.product = this.products.find(p => p.productType.alias === PRODUCT_TYPES.TEE);
141
+ computed: {
142
+ ...mapGetters(['shop']),
143
+ printsPricing() {
144
+ return this.productPricing?.products[this.product._id]?.prints.prints || [];
145
+ }
146
+ },
147
+ mounted() {
148
+ this.calculatePricing();
149
+ },
150
+ methods: {
151
+ async calculatePricing() {
152
+ const prints = this.generateSidesPrints();
153
+ const layers = prints.map(({ printType, printSize, printArea }) => ({ printType: printType?._id, printSize: printSize?._id, printArea: printArea?._id }));
154
+ const entities = getProductsForCalculatePricing(this.product, [this.simpleProduct], layers, true, true);
155
+ this.productPricing = await api.calculateProductPrice({ entities }, this.shop._id);
156
+ },
157
+ generateSidesPrints() {
158
+ return this.sides
159
+ .filter(({ printSize }) => printSize)
160
+ .map(side => {
161
+ const printType = this.getSidePrintType(side, this.availablePrintType) || {};
162
+ const printSize = side.printSizes.find(({ alias }) => alias === side.printSize);
163
+ const printArea = this.product.printAreas.find(printArea => getPrintAreaSizes(printArea).some(({ _id }) => _id === printSize?._id));
164
+ return { printType, printSize, printArea };
165
+ });
166
+ },
167
+ getSidePrintType(side, type) {
168
+ return this.product.printTypes.find(printType => type === printType.type && (type === 'full colour print' || (printType.colorsQuantity === side.colorsQuantity && !!printType.hasUnderbase === !!side.hasUnderbase)));
169
+ },
170
+ goToEditor() {
171
+ const link = generateProductLink(this.product, null, true);
172
+ this.$router.push(link);
173
+ },
174
+ changeAvailablePrintType(type) {
175
+ this.availablePrintType = type;
176
+ this.calculatePricing();
177
+ }
98
178
  }
99
179
  };
100
180
  </script>
@@ -20,41 +20,54 @@ $product_types: tee, hoodie, polo;
20
20
  grid-column-gap: 8px;
21
21
  }
22
22
  &-type {
23
- border-radius: 5px;
24
- padding: 78px 25px 16px 25px;
25
- text-align: center;
26
- font-size: 14px;
27
- line-height: 21px;
28
- color: $gray;
29
- background-color: #FFFFFF;
30
23
  position: relative;
31
- cursor: pointer;
32
- transition: background-color .22s ease-in-out;
33
- &:before {
34
- content: '';
35
- position: absolute;
36
- top: 16px;
37
- left: 0;
38
- height: 50px;
39
- width: 100%;
40
- background-repeat: no-repeat;
41
- background-size: contain;
42
- background-position: center;
43
- }
44
- &.active {
45
- background-color: $light_gray;
46
- }
47
- &.disabled {
48
- opacity: .2;
49
- pointer-events: none;
50
- }
51
-
52
- @each $type in $product_types {
53
- &.#{$type}:before {
54
- background-image: url(../../../static/icons/product_#{$type}.svg);
24
+ &-info {
25
+ border-radius: 5px;
26
+ padding: 78px 25px 16px 25px;
27
+ text-align: center;
28
+ font-size: 14px;
29
+ line-height: 21px;
30
+ color: $gray;
31
+ background-color: #FFFFFF;
32
+ position: relative;
33
+ cursor: pointer;
34
+ transition: background-color .22s ease-in-out;
35
+ &:before {
36
+ content: '';
37
+ position: absolute;
38
+ top: 16px;
39
+ left: 0;
40
+ height: 50px;
41
+ width: 100%;
42
+ background-repeat: no-repeat;
43
+ background-size: contain;
44
+ background-position: center;
45
+ }
46
+ &.active {
47
+ background-color: $light_gray;
48
+ }
49
+ &.disabled {
50
+ opacity: .2;
51
+ pointer-events: none;
52
+ }
53
+ @each $type in $product_types {
54
+ &.#{$type}:before {
55
+ background-image: url(../../../static/icons/product_#{$type}.svg);
56
+ }
55
57
  }
56
58
  }
57
59
  }
60
+ &-placeholder {
61
+ font-size: 14px;
62
+ line-height: 150%;
63
+ text-align: center;
64
+ color: $black;
65
+ position: absolute;
66
+ text-align: center;
67
+ top: 20px;
68
+ left: 0;
69
+ right: 0;
70
+ }
58
71
  }
59
72
  &__table-container {
60
73
  margin-top: 20px;
@@ -12,20 +12,31 @@
12
12
  <div
13
13
  v-for="item in productTypes"
14
14
  :key="item.type"
15
- class="PricingGarment__product-type"
16
- :class="{
17
- [item.type]: true,
18
- active: item.product === product,
19
- disabled: !item.product
20
- }"
21
- @click="product = item.product">
22
- {{ item.label }}
15
+ class="PricingGarment__product-type">
16
+ <div
17
+ class="PricingGarment__product-type-info"
18
+ :class="{
19
+ disabled: !item.product,
20
+ [item.type]: true,
21
+ active: item.product === product
22
+ }"
23
+ @click="product = item.product">
24
+ {{ item.label }}
25
+ </div>
26
+ <div
27
+ v-if="!item.product"
28
+ class="PricingGarment__product-placeholder">
29
+ Pricing <br /> coming soon
30
+ </div>
23
31
  </div>
24
32
  </div>
25
33
  <div
26
34
  v-if="product"
27
35
  class="PricingGarment__table-container">
28
- <pricing-discounts-table :prices="product.pricing" />
36
+ <pricing-discounts-table
37
+ :prices="simpleProduct.pricing"
38
+ :bordered="false"
39
+ :striped="true" />
29
40
  </div>
30
41
  </div>
31
42
  <div
@@ -72,8 +83,11 @@ export default {
72
83
  }));
73
84
  },
74
85
  imageBackground() {
75
- const image = getColorImage(this.product, 'large', 'pricing') || getColorImage(this.product, 'large', 'front');
86
+ const image = getColorImage(this.product, 'large', 'pricing', null, true) || getColorImage(this.product, 'large', 'front', null, true);
76
87
  return image && `url('${image}')`;
88
+ },
89
+ simpleProduct() {
90
+ return [...this.product.simpleProducts].sort((a, b) => a.maxPrice - b.maxPrice)[0];
77
91
  }
78
92
  },
79
93
  mounted() {
@@ -26,7 +26,6 @@
26
26
  &__content {
27
27
  box-shadow: 10px 10px 30px rgba(75, 75, 75, 0.05);
28
28
  border-radius: 5px;
29
- overflow: hidden;
30
29
  margin-top: -200px;
31
30
  padding: 0 0 0 0;
32
31
  z-index: 1;
@@ -16,19 +16,10 @@
16
16
  <div class="PricingMainSection__content col-sm-12 col-12 mr-auto ml-auto">
17
17
  <div class="PricingMainSection__content-col row">
18
18
  <div class="col-12">
19
- <div class="row">
20
- <div class="col-12">
21
- <div class="lc_h3 lc_text-centered">
22
- Compare Printing Quotes
23
- </div>
24
- </div>
25
- </div>
26
- </div>
27
- <div class="col-12 col-sm-6">
28
- <pricing-digital-printing :products="products" />
29
- </div>
30
- <div class="col-12 col-sm-6">
31
- <pricing-screen-printing :products="products" />
19
+ <pricing-products-calculator
20
+ v-if="products.length > 0"
21
+ class="Pricing__section"
22
+ :products="products" />
32
23
  </div>
33
24
  </div>
34
25
  </div>
@@ -38,14 +29,12 @@
38
29
  </template>
39
30
 
40
31
  <script>
41
- import PricingDigitalPrinting from '@lancom/shared/components/pricing/pricing_digital_printing/pricing-digital-printing';
42
- import PricingScreenPrinting from '@lancom/shared/components/pricing/pricing_screen_printing/pricing-screen-printing';
32
+ import PricingProductsCalculator from '@lancom/shared/components/pricing/pricing_products_calculator/pricing-products-calculator';
43
33
 
44
34
  export default {
45
35
  name: 'PricingMainSection',
46
36
  components: {
47
- PricingScreenPrinting,
48
- PricingDigitalPrinting
37
+ PricingProductsCalculator
49
38
  },
50
39
  props: {
51
40
  products: {
@@ -17,7 +17,7 @@
17
17
  &__table-container {
18
18
  margin-top: 20px;
19
19
  padding: 32px 36px;
20
- border: 2px solid $light_gray;
20
+ // border: 2px solid $light_gray;
21
21
  border-radius: 5px;
22
22
  @media (max-width: $bp-extra-small-max) {
23
23
  ::v-deep tr, ::v-deep th, ::v-deep td {