@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
@@ -9,7 +9,10 @@
9
9
  <div
10
10
  data-aos="aosFadeLeft"
11
11
  class="col-12 PricingPrint__col">
12
- <discounts-table :product="product" />
12
+ <product-screen-print-price-info
13
+ :product="product"
14
+ :bordered="true"
15
+ :tabs="true" />
13
16
  </div>
14
17
  </div>
15
18
  </div>
@@ -18,12 +21,12 @@
18
21
  </template>
19
22
 
20
23
  <script>
21
- import DiscountsTable from './discounts_table/discounts-table';
24
+ import ProductScreenPrintPriceInfo from '@lancom/shared/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info';
22
25
 
23
26
  export default {
24
27
  name: 'PricingScreenPrint',
25
28
  components: {
26
- DiscountsTable
29
+ ProductScreenPrintPriceInfo
27
30
  },
28
31
  props: {
29
32
  product: {
@@ -248,7 +248,7 @@ export default {
248
248
  },
249
249
  data() {
250
250
  return {
251
- product: null,
251
+ product: this.findProductByType(PRODUCT_TYPES.TEE),
252
252
  colorOptions: [{
253
253
  value: 0,
254
254
  label: 'Unprinted'
@@ -318,7 +318,6 @@ export default {
318
318
  },
319
319
  created() {
320
320
  this.screenPrint = true;
321
- this.product = this.findProductByType(PRODUCT_TYPES.TEE);
322
321
  },
323
322
  methods: {
324
323
  contactUs() {
@@ -0,0 +1,168 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ ::v-deep .slick-dots {
4
+ display: none !important;
5
+ }
6
+ ::v-deep .slick-arrow {
7
+ position: absolute;
8
+ top: 50%;
9
+ background-color: $black;
10
+ background-image: url(../../../static/icons/arrow-left.svg);
11
+ background-position: center;
12
+ background-repeat: no-repeat;
13
+ background-size: 25px 25px;
14
+ width: 51px;
15
+ height: 90px;
16
+ margin-top: -45px;
17
+ text-indent: -9999px;
18
+ border: none;
19
+ cursor: pointer;
20
+ z-index: 2;
21
+ @media (max-width: $bp-medium-max) {
22
+ width: 41px;
23
+ height: 67px;
24
+ }
25
+
26
+ &.slick-prev {
27
+ left: 0;
28
+ transform: rotate(180deg);
29
+ }
30
+ &.slick-next {
31
+ right: 0;
32
+ }
33
+ &:hover {
34
+ box-shadow: 0 0 3px $grey_2;
35
+ }
36
+ &:focus {
37
+ outline: none;
38
+ }
39
+ }
40
+ ::v-deep .slick-slider,
41
+ ::v-deep .slick-slide {
42
+ touch-action: auto;
43
+ -ms-touch-action: auto;
44
+ }
45
+ ::v-deep .Gallery__small .slick-arrow {
46
+ width: 31px;
47
+ height: 50px;
48
+ margin-top: -25px;
49
+ }
50
+
51
+ .Gallery {
52
+ &__big,
53
+ &__small {
54
+ overflow: hidden;
55
+ position: relative;
56
+ }
57
+ &__zoom {
58
+ position: absolute;
59
+ right: 20px;
60
+ bottom: 20px;
61
+ width: 30px;
62
+ height: 30px;
63
+ border-radius: 8px;
64
+ background: white;
65
+ opacity: 0.6;
66
+ align-items: center;
67
+ justify-content: center;
68
+ cursor: pointer;
69
+ display: flex;
70
+ border: 1px solid grey;
71
+ }
72
+ &__big-image,
73
+ &__small-image {
74
+ width: 100%;
75
+ position: relative;
76
+ background-repeat: no-repeat;
77
+ background-position: center center;
78
+ background-size: contain;
79
+ touch-action: auto !important;
80
+ -ms-touch-action: auto !important;
81
+ &::after {
82
+ content: ' ';
83
+ display: block;
84
+ padding-top: 100%;
85
+ }
86
+ }
87
+ &__big {
88
+ &-image {
89
+ max-height: 600px;
90
+ }
91
+ &-print {
92
+ background-color: $gray;
93
+ padding: 16px 20px;
94
+ position: absolute;
95
+ bottom: 60px;
96
+ left: 0px;
97
+ pointer-events: none;
98
+ &-name {
99
+ font-weight: 800;
100
+ font-size: 18px;
101
+ color: $black;
102
+ }
103
+ &-price {
104
+ font-weight: 600;
105
+ font-size: 18px;
106
+ color: $gray_main;
107
+ margin-top: 4px;
108
+ }
109
+ }
110
+ }
111
+ &__small {
112
+ &-image {
113
+ cursor: pointer;
114
+ margin-top: 30px;
115
+ border-bottom: 2px solid $white;
116
+ &--active {
117
+ border-bottom: 2px solid $black;
118
+ }
119
+ }
120
+ &-printed {
121
+ font-weight: bold;
122
+ font-size: 10px;
123
+ color: $black;
124
+ background: $gray;
125
+ padding: 6px;
126
+ text-align: center;
127
+ position: absolute;
128
+ bottom: 12px;
129
+ right: 20px;
130
+ left: 20px;
131
+ text-transform: uppercase;
132
+ @media (max-width: $bp-medium-max) {
133
+ bottom: 6px;
134
+ right: 3px;
135
+ left: 3px;
136
+ opacity: 0.7;
137
+ }
138
+ }
139
+ }
140
+ &__filters {
141
+ margin-top: 28px;
142
+ display: flex;
143
+ }
144
+ &__filter {
145
+ flex-grow: 1;
146
+ font-weight: 800;
147
+ font-size: 16px;
148
+ text-align: center;
149
+ color: $black;
150
+ padding: 19px 0;
151
+ background-color: $gray;
152
+ cursor: pointer;
153
+ margin-left: 7px;
154
+ &:first-child {
155
+ margin-left: 0;
156
+ }
157
+ &--active {
158
+ background-color: $black;
159
+ color: $gray;
160
+ }
161
+ }
162
+ &__divider {
163
+ height: 1px;
164
+ width: 100%;
165
+ background-color: $gray;
166
+ margin-top: 20px;
167
+ }
168
+ }
@@ -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: {