@lancom/shared 0.0.105 → 0.0.108

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 (123) hide show
  1. package/assets/js/models/print-area.js +17 -13
  2. package/assets/js/models/product-layers.js +6 -5
  3. package/assets/js/utils/cart.js +1 -0
  4. package/assets/js/utils/custom-validation-rules.js +7 -0
  5. package/assets/js/utils/fabric/wireframe.js +4 -4
  6. package/assets/js/utils/fabric-helper.js +7 -7
  7. package/assets/js/utils/filters.js +7 -1
  8. package/assets/js/utils/order.js +3 -3
  9. package/assets/js/utils/prints.js +15 -4
  10. package/assets/js/utils/product.js +7 -6
  11. package/assets/js/utils/products-grouping/by-colors.js +22 -18
  12. package/assets/scss/ui_kit/_table.scss +3 -0
  13. package/assets/scss/ui_kit/_typography.scss +6 -0
  14. package/components/asides/contact_us/contact-us.vue +3 -0
  15. package/components/asides/offer_screen_printing/offer-screen-printing.vue +22 -12
  16. package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.mixin.js +5 -3
  17. package/components/checkout/cart/cart_entity/cart_entity_prints/cart-entity-prints.vue +3 -0
  18. package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
  19. package/components/common/btn.vue +8 -1
  20. package/components/common/color-picker.vue +6 -1
  21. package/components/common/coupon_select/coupon-select.vue +41 -17
  22. package/components/common/file_uploader.vue +1 -1
  23. package/components/common/postcode_select/postcode-select.vue +6 -4
  24. package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
  25. package/components/common/pricing_table/pricing-table.scss +1 -3
  26. package/components/common/pricing_table/pricing-table.vue +13 -4
  27. package/components/common/product_side_with_print/product-side-with-print.vue +2 -2
  28. package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
  29. package/components/common/range/range.scss +23 -0
  30. package/components/common/range/range.vue +19 -0
  31. package/components/customer/signin_form/signin-form.vue +5 -2
  32. package/components/design/approve_design_tables/approve-design-tables.scss +3 -3
  33. package/components/design/approve_design_tables/approve-design-tables.vue +24 -13
  34. package/components/design/approve_design_tees/approve-design-tees.vue +18 -4
  35. package/components/editor/editor.vue +3 -2
  36. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
  37. package/components/editor/editor_pricing/editor-pricing.vue +3 -123
  38. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  39. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  40. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  41. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
  42. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  43. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
  44. package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
  45. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
  46. package/components/editor/editor_product_details/editor-product-details.scss +1 -1
  47. package/components/editor/editor_product_details/editor-product-details.vue +22 -10
  48. package/components/editor/editor_workspace/editor-workspace.vue +10 -5
  49. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +9 -5
  50. package/components/modals/cart_modal/cart-modal.vue +1 -1
  51. package/components/modals/order_modal/order-modal.vue +5 -7
  52. package/components/modals/payment_modal/payment-modal.vue +1 -1
  53. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
  54. package/components/pricing/pricing_example/pricing-example.scss +4 -1
  55. package/components/pricing/pricing_example/pricing-example.vue +106 -26
  56. package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
  57. package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
  58. package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
  59. package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
  60. package/components/pricing/pricing_print/pricing-print.scss +1 -1
  61. package/components/pricing/pricing_print/pricing-print.vue +19 -7
  62. package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
  63. package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
  64. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
  65. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
  66. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
  67. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
  68. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
  69. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
  70. package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
  71. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
  72. package/components/product/gallery/gallery.scss +168 -0
  73. package/components/product/gallery/gallery.vue +252 -0
  74. package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
  75. package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
  76. package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
  77. package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
  78. package/components/product/product.vue +16 -5
  79. package/components/product/product_price_range/product-price-range.vue +20 -4
  80. package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
  81. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
  82. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
  83. package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
  84. package/components/product/related_products/related-products.scss +34 -0
  85. package/components/product/related_products/related-products.vue +52 -0
  86. package/components/products/product_list/product-list.scss +2 -1
  87. package/components/products/product_list_product/product-list-product.scss +44 -20
  88. package/components/products/product_list_product/product-list-product.vue +6 -4
  89. package/components/products/products_aside/products-aside.vue +29 -4
  90. package/components/products/products_autocomplete/products-autocomplete.vue +4 -0
  91. package/components/products/products_brands/products-brands.vue +9 -2
  92. package/components/products/products_filters/products-filters.vue +12 -5
  93. package/components/products/products_tags/products-tags.vue +7 -0
  94. package/components/products/products_types/products-types.vue +6 -1
  95. package/components/subscribe/subscribe.vue +3 -0
  96. package/mixins/product-preview.js +7 -1
  97. package/package.json +1 -1
  98. package/plugins/vee-validate.js +2 -1
  99. package/plugins/vue-recaptcha.js +4 -1
  100. package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
  101. package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
  102. package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
  103. package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
  104. package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
  105. package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
  106. package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
  107. package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
  108. package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
  109. package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
  110. package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
  111. package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
  112. package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
  113. package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
  114. package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
  115. package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
  116. package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
  117. package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
  118. package/store/index.js +3 -1
  119. package/store/product.js +26 -15
  120. package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
  121. package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
  122. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
  123. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
@@ -0,0 +1,252 @@
1
+ <template>
2
+ <div
3
+ class="Gallery__wrapper">
4
+ <div class="Gallery__big">
5
+ <vue-slick-carousel
6
+ ref="bigCarousel"
7
+ :key="updateCarouselTime"
8
+ :arrows="true"
9
+ :dots="true"
10
+ :swipe="false"
11
+ :speed="800"
12
+ @beforeChange="onChange">
13
+ <div
14
+ v-for="image in filteredImages"
15
+ :key="image.large"
16
+ v-hammer:press="onPanstart"
17
+ v-hammer:pan="onPan"
18
+ v-hammer:pressup="onPanend"
19
+ v-hammer:panend="onPanend"
20
+ class="Gallery__big-image"
21
+ :style="{
22
+ 'background-image': `url('${staticLink(image.large)}')`,
23
+ 'background-size': backgroundSize,
24
+ 'background-position': backgroundPosition,
25
+ 'touch-action': zoomEnable ? 'none' : 'auto'
26
+ }"
27
+ @mousedown="onMouseDown"
28
+ @mouseenter="onMouseEnter"
29
+ @mouseleave="onMouseLeave"
30
+ @mousemove="onMouseMove">
31
+ <div
32
+ v-if="image.print"
33
+ class="Gallery__big-print">
34
+ <div class="Gallery__big-print-name">
35
+ {{ image.print.name }}
36
+ </div>
37
+ <div
38
+ v-if="image.print.pricing"
39
+ class="Gallery__big-print-price">
40
+ {{ image.print.pricing.price | price }} for ({{ image.print.pricing.min || 1 }}+)
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </vue-slick-carousel>
45
+ <div
46
+ v-if="!isTouch"
47
+ class="Gallery__zoom"
48
+ @click="onMouseDown($event)">
49
+ <i :class="zoomEnable ? 'icon-zoom-out' : 'icon-zoom-in'"></i>
50
+ </div>
51
+ </div>
52
+ <div class="Gallery__small">
53
+ <vue-slick-carousel
54
+ ref="smallCarousel"
55
+ :key="updateCarouselTime"
56
+ :slides-per-row="slidesPerRow"
57
+ :arrows="true"
58
+ :dots="true"
59
+ :speed="800">
60
+ <div
61
+ v-for="(image, index) in filteredImages"
62
+ :key="image.large"
63
+ class="Gallery__small-image"
64
+ :class="{
65
+ 'Gallery__small-image--active': index === activeIndex
66
+ }"
67
+ :style="{
68
+ 'background-image': `url('${staticLink(image.small)}')`
69
+ }"
70
+ @click="goToSlideAndChangeColor(index)">
71
+ <div class="Gallery__small-printed">
72
+ {{ image.printType ? 'Printed' : (product.prePrint ? product.prePrintText : 'Blank') }}
73
+ </div>
74
+ </div>
75
+ </vue-slick-carousel>
76
+ </div>
77
+ <div
78
+ v-if="hasValidFilters"
79
+ class="Gallery__filters">
80
+ <div
81
+ v-for="filter in validFilters"
82
+ :key="filter.name"
83
+ class="Gallery__filter"
84
+ :class="{
85
+ 'Gallery__filter--active': filter === filterType
86
+ }"
87
+ @click="toggleFilterType(filter)">
88
+ {{ filter.name }}
89
+ </div>
90
+ </div>
91
+ <div
92
+ v-else
93
+ class="Gallery__divider"></div>
94
+ </div>
95
+ </template>
96
+
97
+ <script>
98
+ import { mapGetters, mapActions } from 'vuex';
99
+ import VueSlickCarousel from 'vue-slick-carousel';
100
+ import 'vue-slick-carousel/dist/vue-slick-carousel.css';
101
+ import { staticLink, price } from '@lancom/shared/assets/js/utils/filters';
102
+ import { isValidImageTypes } from '@lancom/shared/assets/js/utils/colors';
103
+
104
+ export default {
105
+ name: 'Gallery',
106
+ filters: {
107
+ price
108
+ },
109
+ components: {
110
+ VueSlickCarousel
111
+ },
112
+ props: {
113
+ slidesPerRow: {
114
+ type: Number,
115
+ default: 6
116
+ }
117
+ },
118
+ data() {
119
+ return {
120
+ isTouch: ('ontouchstart' in window),
121
+ zoomEnable: false,
122
+ activeIndex: 0,
123
+ updateCarouselTime: Date.now(),
124
+ filters: [{
125
+ name: 'FRONT / BACK',
126
+ types: ['front', 'back']
127
+ }, {
128
+ name: 'MODEL',
129
+ types: ['model']
130
+ }, {
131
+ name: 'PRINTS',
132
+ filterBy: image => !!image.printType
133
+ }],
134
+ filterType: null,
135
+ galerySize: null,
136
+ backgroundSize: null,
137
+ backgroundPosition: null,
138
+ skipUpdateGallery: false
139
+ };
140
+ },
141
+ computed: {
142
+ ...mapGetters('product', ['product', 'images', 'editableColor']),
143
+ hasValidFilters() {
144
+ return this.validFilters.length > 1;
145
+ },
146
+ validFilters() {
147
+ return this.filters.filter(filter => (this.images || []).some(i => this.isValidImageByFilter(filter, i)));
148
+ },
149
+ filteredImages() {
150
+ const images = this.filterType ? this.images.filter(i => this.isValidImageByFilter(this.filterType, i)) : this.images;
151
+ return images.map(image => {
152
+ const printType = this.product?.printTypes.find(({ _id }) => _id === image.printType);
153
+ const { printCost } = printType?.printAreas.find(({ printSizes }) => (printSizes || []).some(({ _id }) => _id === image.printSize)) || printType?.printAreas[0] || { printCost: [] };
154
+ const pricing = printCost[printCost.length - 1];
155
+ const print = printType && {
156
+ name: printType.name,
157
+ pricing
158
+ };
159
+ return { ...image, print };
160
+ });
161
+ }
162
+ },
163
+ watch: {
164
+ editableColor() {
165
+ if (!this.skipUpdateGallery) {
166
+ const index = this.filteredImages.findIndex(i => i.color === this.editableColor?._id);
167
+ if (index > -1) {
168
+ this.goToSlide(index, true);
169
+ }
170
+ }
171
+ this.skipUpdateGallery = false;
172
+ }
173
+ },
174
+ methods: {
175
+ ...mapActions('product', ['selectColor']),
176
+ staticLink,
177
+ goToSlideAndChangeColor(index) {
178
+ this.skipUpdateGallery = true;
179
+ const { color } = this.filteredImages[index] || {};
180
+ this.goToSlide(index);
181
+ if (color) {
182
+ this.selectColor(color);
183
+ }
184
+ },
185
+ goToSlide(index, dontAnimate = false) {
186
+ this.$refs.bigCarousel.goTo(index, dontAnimate);
187
+ this.$emit('selected', this.filteredImages[index]);
188
+ },
189
+ onChange(prev, current) {
190
+ this.activeIndex = current;
191
+ const smallIndex = Number.parseInt(current / this.slidesPerRow);
192
+ this.$refs.smallCarousel.goTo(smallIndex);
193
+ },
194
+ isValidImageByFilter(filterType, image) {
195
+ return filterType.filterBy ? filterType.filterBy(image) : isValidImageTypes(image, filterType.types);
196
+ },
197
+ toggleFilterType(filterType) {
198
+ this.filterType = this.filterType === filterType ? null : filterType;
199
+ this.updateCarouselTime = Date.now();
200
+ this.activeIndex = 0;
201
+ },
202
+ onPanstart(e) {
203
+ if (this.isTouch) {
204
+ this.zoomEnable = true;
205
+ this.onMouseEnter(e.srcEvent);
206
+ }
207
+ },
208
+ onPan(e) {
209
+ if (this.isTouch) {
210
+ this.onMouseMove(e.srcEvent);
211
+ }
212
+ },
213
+ onPanend(e) {
214
+ if (this.isTouch) {
215
+ this.zoomEnable = false;
216
+ this.onMouseLeave(e.srcEvent);
217
+ }
218
+ },
219
+ onMouseDown(e) {
220
+ if (!this.isTouch) {
221
+ this.zoomEnable = !this.zoomEnable;
222
+ if (this.zoomEnable) {
223
+ this.onMouseEnter(e);
224
+ } else {
225
+ this.onMouseLeave();
226
+ }
227
+ }
228
+ },
229
+ onMouseEnter(e) {
230
+ if (this.zoomEnable) {
231
+ this.backgroundSize = '1000px';
232
+ this.galerySize = e.target.getBoundingClientRect();
233
+ }
234
+ },
235
+ onMouseLeave() {
236
+ this.backgroundSize = null;
237
+ this.backgroundPosition = null;
238
+ this.galerySize = null;
239
+ },
240
+ onMouseMove({ offsetX, offsetY }) {
241
+ if (this.galerySize) {
242
+ const { width, height } = this.galerySize;
243
+ this.backgroundPosition = `${offsetX / width * 100}% ${offsetY / height * 100}%`;
244
+ }
245
+ }
246
+ }
247
+ };
248
+ </script>
249
+
250
+ <style lang="scss" scoped>
251
+ @import 'gallery';
252
+ </style>
@@ -6,7 +6,9 @@
6
6
  </h5>
7
7
  </div>
8
8
  <div class="ProductFabricAndSizeInfo__content">
9
- <table class="lc_table bordered ProductFabricAndSizeInfo__table">
9
+ <table
10
+ v-if="product.sizeInfo"
11
+ class="lc_table bordered ProductFabricAndSizeInfo__table">
10
12
  <thead class="pull-left cell-padding">
11
13
  <tr>
12
14
  <th>
@@ -16,13 +18,13 @@
16
18
  </thead>
17
19
  <tbody class="centered">
18
20
  <tr>
19
- <td>
20
- {{ product.sizeInfo }}
21
- </td>
21
+ <td v-html="product.sizeInfo"></td>
22
22
  </tr>
23
23
  </tbody>
24
24
  </table>
25
- <table class="lc_table bordered ProductFabricAndSizeInfo__table">
25
+ <table
26
+ v-if="product.fabricInfo"
27
+ class="lc_table bordered ProductFabricAndSizeInfo__table">
26
28
  <thead class="pull-left cell-padding">
27
29
  <tr>
28
30
  <th>
@@ -32,7 +34,7 @@
32
34
  </thead>
33
35
  <tbody class="centered">
34
36
  <tr>
35
- <td>{{ product.fabricInfo }}</td>
37
+ <td v-html="product.fabricInfo"></td>
36
38
  </tr>
37
39
  </tbody>
38
40
  </table>
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <div class="ProductGallery__wrapper">
3
+ {{ color.name }}<br>
4
+ {{ thumbnails }}
3
5
  <transition
4
6
  appear
5
7
  name="fade">
6
8
  <div
7
- :key="currentIndex"
9
+ :key="current"
8
10
  class="ProductGallery__current"
9
11
  :style="{
10
12
  'background-color': color && color.rgb
@@ -15,7 +17,7 @@
15
17
  </transition>
16
18
  <div
17
19
  v-for="thumbnail in thumbnails"
18
- :key="thumbnail.index"
20
+ :key="thumbnail.url"
19
21
  class="ProductGallery__thumbnail ripple"
20
22
  :class="{ active: currentIndex === thumbnail.index }"
21
23
  :style="{
@@ -49,7 +51,7 @@ export default {
49
51
  },
50
52
  computed: {
51
53
  images() {
52
- return getProductColorImages(this.product, this.color);
54
+ return getProductColorImages(this.product, this.color, true);
53
55
  },
54
56
  current() {
55
57
  if (!this.images[this.currentIndex]) {
@@ -66,6 +68,11 @@ export default {
66
68
  .slice(0, 4);
67
69
  }
68
70
  },
71
+ watch: {
72
+ color() {
73
+ this.currentIndex = 0;
74
+ }
75
+ },
69
76
  methods: {
70
77
  select(index) {
71
78
  this.currentIndex = index;
@@ -1,58 +1,35 @@
1
1
  <template>
2
2
  <div class="ProductSizeTable__wrapper">
3
3
  <div class="ProductSizeTable__content">
4
- <table class="lc_table bordered ProductSizeTable__table">
5
- <thead>
6
- <tr class="stripped">
7
- <th class="pull-left cell-padding">
8
- Size
9
- </th>
10
- <th
11
- v-for="(size, index) of product.sizes"
12
- :key="`size${index}`">
13
- {{ size.size ? size.size.shortName : '' }}
14
- </th>
15
- </tr>
16
- </thead>
17
- <tbody class="centered">
18
- <tr>
19
- <td class="pull-left cell-padding">
20
- Length (cm)
21
- </td>
22
- <td
23
- v-for="(size, index) of product.sizes"
24
- :key="`length${index}`">
25
- {{ size.length }}
26
- </td>
27
- </tr>
28
- <tr>
29
- <td class="pull-left cell-padding">
30
- Width (cm)
31
- </td>
32
- <td
33
- v-for="(size, index) of product.sizes"
34
- :key="`width${index}`">
35
- {{ size.width }}
36
- </td>
37
- </tr>
4
+ <product-sizes-info
5
+ :product="product"
6
+ :striped="false">
7
+ <template #footer="{ colspan }">
38
8
  <tr v-if="sizeImage">
39
- <td :colspan="product.sizes.length + 1">
9
+ <td :colspan="colspan">
40
10
  <img
41
11
  :src="sizeImage"
42
12
  class="ProductSizeTable__icon" />
43
13
  </td>
44
14
  </tr>
45
- </tbody>
46
- </table>
15
+ </template>
16
+ </product-sizes-info>
17
+ <div>
18
+ </div>
47
19
  </div>
48
20
  </div>
49
21
  </template>
50
22
 
51
23
  <script>
52
24
  import { staticLink } from '@lancom/shared/assets/js/utils/filters';
25
+ import { getColorImage } from '@lancom/shared/assets/js/utils/colors';
26
+ import ProductSizesInfo from '@lancom/shared/components/product/product_sizes_info/product-sizes-info';
53
27
 
54
28
  export default {
55
29
  name: 'ProductSizeTable',
30
+ components: {
31
+ ProductSizesInfo
32
+ },
56
33
  props: {
57
34
  product: {
58
35
  type: Object,
@@ -61,8 +38,8 @@ export default {
61
38
  },
62
39
  computed: {
63
40
  sizeImage() {
64
- const image = (this.product.images || []).find(image => image.type === 'size');
65
- return image && staticLink(image.large);
41
+ const image = getColorImage(this.product, 'large', 'size');
42
+ return image && staticLink(image);
66
43
  }
67
44
  }
68
45
  };
@@ -1,3 +1,4 @@
1
+
1
2
  <template>
2
3
  <div class="ProductTierPrices__wrapper">
3
4
  <div class="ProductTierPrices__header">
@@ -53,12 +54,12 @@ export default {
53
54
  };
54
55
  },
55
56
  computed: {
56
- ...mapGetters(['pricingSettings']),
57
+ ...mapGetters('product', ['defaultSimpleProduct']),
57
58
  hasPrices() {
58
59
  return this.prices.length > 0;
59
60
  },
60
61
  prices() {
61
- return (this.product ? this.product.pricing : this.pricingSettings.defaultProductPrice) || [];
62
+ return this.defaultSimpleProduct?.pricing || [];
62
63
  }
63
64
  },
64
65
  methods: {
@@ -3,7 +3,9 @@
3
3
  <div class="row Product__section-row">
4
4
  <div class="col-sm-6 col-12 Product__col">
5
5
  <section class="Product__section">
6
- <product-gallery v-if="editableColor" :product="product" :color="editableColor" />
6
+ <client-only>
7
+ <gallery v-if="hasImages" />
8
+ </client-only>
7
9
  </section>
8
10
  <section class="Product__section">
9
11
  <product-model-measurements />
@@ -30,12 +32,15 @@
30
32
  </section>
31
33
  </div>
32
34
  </div>
35
+ <related-products
36
+ class="EditorPage__related"
37
+ :product="product"
38
+ :to-editor="false" />
33
39
  </div>
34
40
  </template>
35
41
 
36
42
  <script>
37
43
  import { mapGetters } from 'vuex';
38
- import ProductGallery from './layouts/product_gallery/product-gallery';
39
44
  import ProductMainInfo from './layouts/product_main_info/product-main-info';
40
45
  import ProductColorsSelector from './layouts/product_colors_selector/product-colors-selector';
41
46
  import ProductTierPrices from './layouts/product_tier_prices/product-tier-prices';
@@ -43,27 +48,33 @@ import ProductFabricAndSizeInfo from './layouts/product_fabric_and_size_info/pro
43
48
  import ProductPackaging from './layouts/product_packaging/product-packaging';
44
49
  import ProductModelMeasurements from './layouts/product_model_measurements/product-model-measurements';
45
50
  import ProductSizeTable from './layouts/product_size_table/product-size-table';
51
+
46
52
  // import ProductLabelsCustomization from './layouts/product_labels_customization/product-labels-customization';
47
53
 
48
54
  export default {
49
55
  name: 'Product',
50
56
  components: {
51
- ProductGallery,
52
57
  ProductMainInfo,
53
58
  ProductColorsSelector,
54
59
  ProductTierPrices,
55
60
  ProductFabricAndSizeInfo,
56
61
  ProductPackaging,
57
62
  ProductModelMeasurements,
58
- ProductSizeTable
63
+ ProductSizeTable,
64
+ RelatedProducts: () => import('@lancom/shared/components/product/related_products/related-products'),
65
+ Gallery: () => import('@lancom/shared/components/product/gallery/gallery'),
59
66
  // ProductLabelsCustomization
60
67
  },
61
68
  computed: {
62
69
  ...mapGetters('product', [
63
70
  'product',
71
+ 'images',
64
72
  'productDetails',
65
73
  'editableColor'
66
- ])
74
+ ]),
75
+ hasImages() {
76
+ return this.images.length > 0;
77
+ }
67
78
  }
68
79
  };
69
80
  </script>
@@ -8,9 +8,13 @@
8
8
  v-if="withGst"
9
9
  class="lc_h4">
10
10
  {{ product[minPriceAttr] | tax(gstTax) | price }}
11
- <span class="lc_regular11 lc_bold">inc. GST</span>
11
+ <span
12
+ v-if="visiblePriceInfo"
13
+ class="lc_regular11 lc_bold">inc. GST</span>
12
14
  </div>
13
- <div :class="withGst ? 'lc_regular11' : 'lc_h4'">
15
+ <div
16
+ v-if="withoutGst"
17
+ :class="withGst ? 'lc_regular11' : 'lc_h4'">
14
18
  {{ prePriceText }} {{ product[minPriceAttr] | price }} + GST
15
19
  </div>
16
20
  </div>
@@ -21,9 +25,13 @@
21
25
  v-if="withGst"
22
26
  class="lc_h4">
23
27
  {{ product[minPriceAttr] | tax(gstTax) | price }} {{ rangeDivider }} {{ product[maxPriceAttr] | tax(gstTax) | price }}
24
- <span class="lc_regular11 lc_bold"> inc. GST</span>
28
+ <span
29
+ v-if="visiblePriceInfo"
30
+ class="lc_regular11 lc_bold"> inc. GST</span>
25
31
  </div>
26
- <div :class="withGst ? 'lc_regular11' : 'lc_h4'">
32
+ <div
33
+ v-if="withoutGst"
34
+ :class="withGst ? 'lc_regular11' : 'lc_h4'">
27
35
  {{ prePriceText }} {{ product[minPriceAttr] | price }} {{ rangeDivider }} {{ product[maxPriceAttr] | price }} + GST
28
36
  </div>
29
37
  </div>
@@ -49,6 +57,10 @@ export default {
49
57
  type: Boolean,
50
58
  required: true
51
59
  },
60
+ withoutGst: {
61
+ type: Boolean,
62
+ default: true
63
+ },
52
64
  minPriceAttr: {
53
65
  type: String,
54
66
  default: 'minPrice'
@@ -64,6 +76,10 @@ export default {
64
76
  rangeDivider: {
65
77
  type: String,
66
78
  default: '-'
79
+ },
80
+ visiblePriceInfo: {
81
+ type: Boolean,
82
+ default: true
67
83
  }
68
84
  },
69
85
  computed: {
@@ -1,9 +1,13 @@
1
1
  <template>
2
2
  <div class="ProductPrintPriceInfoItem__wrapper">
3
- <div class="ProductPrintPriceInfoItem__table-name">
3
+ <div
4
+ v-if="visibleTableName"
5
+ class="ProductPrintPriceInfoItem__table-name">
4
6
  {{ print.name }}
5
7
  </div>
6
- <pricing-table :items="pricing" />
8
+ <pricing-table
9
+ :items="pricing"
10
+ :bordered="bordered" />
7
11
  <div
8
12
  v-if="print.setupCost > 0"
9
13
  class="mt-10 lc_h4">
@@ -33,6 +37,14 @@ export default {
33
37
  print: {
34
38
  type: Object,
35
39
  required: true
40
+ },
41
+ visibleTableName: {
42
+ type: Boolean,
43
+ default: true
44
+ },
45
+ bordered: {
46
+ type: Boolean,
47
+ default: false
36
48
  }
37
49
  },
38
50
  computed: {
@@ -7,4 +7,9 @@
7
7
  text-transform: uppercase;
8
8
  font-size: 13px;
9
9
  }
10
+ &__tabs {
11
+ display: flex;
12
+ justify-content: center;
13
+ margin-bottom: 20px;
14
+ }
10
15
  }
@@ -1,21 +1,49 @@
1
1
  <template>
2
2
  <div class="ProductScreenPrintPriceInfo__wrapper">
3
- <div class="ProductScreenPrintPriceInfo__table-name">
3
+ <div
4
+ v-if="tabs"
5
+ class="ProductScreenPrintPriceInfo__tabs">
6
+ <btn
7
+ :btn-class="activeWithUnderbase ? 'green' : 'white'"
8
+ btn-label="With Underbase"
9
+ @onclick="activeWithUnderbase = true">
10
+ </btn>
11
+ <btn
12
+ :btn-class="activeWithUnderbase ? 'white' : 'green'"
13
+ btn-label="Without Underbase"
14
+ @onclick="activeWithUnderbase = false">
15
+ </btn>
16
+ </div>
17
+ <div
18
+ v-if="!tabs"
19
+ class="ProductScreenPrintPriceInfo__table-name">
4
20
  With Underbase
5
21
  </div>
6
- <pricing-table :items="withUnderbasePricing" />
7
- <pricing-table
8
- :items="withUnderbaseSetupPricing"
9
- tr-label="Setup Cost"
10
- class="mt-10" />
11
- <div class="ProductScreenPrintPriceInfo__table-name">
22
+ <div v-if="!tabs || activeWithUnderbase">
23
+ <pricing-table
24
+ :items="withUnderbasePricing"
25
+ :bordered="bordered" />
26
+ <pricing-table
27
+ :items="withUnderbaseSetupPricing"
28
+ :bordered="bordered"
29
+ tr-label="Setup Cost"
30
+ class="mt-10" />
31
+ </div>
32
+ <div
33
+ v-if="!tabs"
34
+ class="ProductScreenPrintPriceInfo__table-name">
12
35
  Without Underbase
13
36
  </div>
14
- <pricing-table :items="withoutUnderbasePricing" />
15
- <pricing-table
16
- :items="withoutUnderbaseSetupPricing"
17
- tr-label="Setup Cost"
18
- class="mt-10" />
37
+ <div v-if="!tabs || !activeWithUnderbase">
38
+ <pricing-table
39
+ :items="withoutUnderbasePricing"
40
+ :bordered="bordered" />
41
+ <pricing-table
42
+ :items="withoutUnderbaseSetupPricing"
43
+ :bordered="bordered"
44
+ tr-label="Setup Cost"
45
+ class="mt-10" />
46
+ </div>
19
47
  </div>
20
48
  </template>
21
49
 
@@ -33,8 +61,21 @@ export default {
33
61
  product: {
34
62
  type: Object,
35
63
  required: true
64
+ },
65
+ bordered: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ tabs: {
70
+ type: Boolean,
71
+ default: false
36
72
  }
37
73
  },
74
+ data() {
75
+ return {
76
+ activeWithUnderbase: true
77
+ };
78
+ },
38
79
  computed: {
39
80
  screenPrints() {
40
81
  const types = (this.product.printTypes || []).filter(({ type }) => type === PRINT_TYPES.SCREEN);