@lancom/shared 0.0.296 → 0.0.298

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 (24) hide show
  1. package/assets/scss/ui_kit/_table.scss +1 -1
  2. package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -1
  3. package/components/common/price.vue +10 -3
  4. package/components/editor/editor.vue +14 -3
  5. package/components/editor/editor_layers/editor_layers_layer/editor-layers-layer.vue +4 -3
  6. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.scss +8 -0
  7. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +10 -5
  8. package/components/editor/editor_product_details/editor-product-details.scss +22 -0
  9. package/components/editor/editor_product_details/editor-product-details.vue +50 -9
  10. package/components/editor/editor_workspace/editor-workspace.scss +3 -3
  11. package/components/editor/editor_workspace/editor-workspace.vue +0 -5
  12. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.scss +12 -0
  13. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +35 -4
  14. package/components/editor/mobile_editor_product_details/mobile-editor-product-details.scss +2 -2
  15. package/components/editor/mobile_editor_product_details/mobile-editor-product-details.vue +4 -6
  16. package/components/order/order_product_prints_preview/order-product-prints-preview.scss +9 -0
  17. package/components/order/order_product_prints_preview/order-product-prints-preview.vue +44 -0
  18. package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.mixin.js +12 -0
  19. package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.scss +12 -1
  20. package/components/order/order_view/order_product_color_simple_products/order-product-color-simple-products.vue +30 -3
  21. package/components/order/order_view/order_view_product/order-view-product.vue +23 -2
  22. package/components/product/gallery/gallery.vue +5 -2
  23. package/components/product/product_colors_selector/product-colors-selector.vue +7 -1
  24. package/package.json +1 -1
@@ -18,7 +18,7 @@
18
18
  th {
19
19
  font-size: 16px;
20
20
  line-height: 170%;
21
- color: $gray;
21
+ color: $dark_blue;
22
22
  vertical-align: middle;
23
23
  }
24
24
  &:not(.tight-rows) tr {
@@ -94,7 +94,8 @@ export default {
94
94
  'removeSupplier'
95
95
  ]),
96
96
  async removeSupplierConfirm(supplier) {
97
- const message = `Will be removed all products related to brands: ${commaArray(supplier.brands.map(b => b.name))}. Are you sure?`;
97
+
98
+ const message = `All products from ${commaArray(supplier.brands.map(b => b.name))} will be removed from the cart. Click OK to proceed`;
98
99
  const reset = await this.showConfirmationModal(message);
99
100
 
100
101
  if (reset) {
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <span>
3
- {{ price | priceWithTax(pricingSettings, currency) }}
3
+ {{ displayPrice }}
4
4
  </span>
5
5
  </template>
6
6
 
7
7
  <script>
8
- import { priceWithTax } from '@lancom/shared/assets/js/utils/filters';
8
+ import { priceWithTax, price } from '@lancom/shared/assets/js/utils/filters';
9
9
  import { mapGetters } from 'vuex';
10
10
 
11
11
  export default {
@@ -16,10 +16,17 @@ export default {
16
16
  props: {
17
17
  price: {
18
18
  type: Number
19
+ },
20
+ withGst: {
21
+ type: Boolean,
22
+ default: true
19
23
  }
20
24
  },
21
25
  computed: {
22
- ...mapGetters(['pricingSettings', 'currency'])
26
+ ...mapGetters(['pricingSettings', 'currency']),
27
+ displayPrice() {
28
+ return this.withGst ? priceWithTax(this.price, this.pricingSettings, this.currency) : price(this.price, this.currency);
29
+ }
23
30
  }
24
31
  };
25
32
  </script>
@@ -56,9 +56,20 @@
56
56
  </div>
57
57
  </breakpoint>
58
58
  <div class="col-md-6 col-12 Editor__col">
59
- <client-only>
60
- <editor-workspace class="Editor__workspace" />
61
- </client-only>
59
+ <breakpoint
60
+ name="sm"
61
+ mode="down">
62
+ <client-only>
63
+ <editor-product-details />
64
+ </client-only>
65
+ </breakpoint>
66
+ <breakpoint
67
+ name="sm"
68
+ mode="up">
69
+ <client-only>
70
+ <editor-workspace class="Editor__workspace" />
71
+ </client-only>
72
+ </breakpoint>
62
73
  </div>
63
74
  </div>
64
75
  <breakpoint
@@ -43,7 +43,7 @@
43
43
  <div
44
44
  class="EditorLayersLayer__quality-value"
45
45
  :class="artQuality.class">
46
- {{ artQuality.value }}
46
+ {{ artQuality.value || artQuality.class }}
47
47
  </div>
48
48
  </div>
49
49
  </div>
@@ -105,6 +105,7 @@ export default {
105
105
  if (this.layer.type !== 'art') {
106
106
  return null;
107
107
  }
108
+ const isVector = /\.(ai|pdf|svg|eps)$/.test((this.layer.url || '').toLowerCase());
108
109
  let quality;
109
110
  switch (true) {
110
111
  case this.layer.dpi < 75:
@@ -113,13 +114,13 @@ export default {
113
114
  case this.layer.dpi >= 75 && this.layer.dpi < 100:
114
115
  quality = 'low quality';
115
116
  break;
116
- case this.layer.dpi >= 100:
117
+ case this.layer.dpi >= 100 || isVector:
117
118
  quality = 'good quality';
118
119
  break;
119
120
  }
120
121
  return {
121
122
  class: quality ? quality.replace(' ', '_') : null,
122
- value: `${quality} / ${this.layer.dpi} DPI`
123
+ value: isVector ? null : `${quality} / ${this.layer.dpi} DPI`
123
124
  };
124
125
  }
125
126
  },
@@ -18,6 +18,14 @@
18
18
  background-color: $green;
19
19
  }
20
20
  }
21
+ &__info {
22
+ text-align: center;
23
+ display: flex;
24
+ flex-direction: column;
25
+ justify-content: center;
26
+ align-items: center;
27
+ min-width: 50px;
28
+ }
21
29
  &__suboptions {
22
30
  position: absolute;
23
31
  bottom: 100%;
@@ -15,14 +15,14 @@
15
15
  [productType]: true
16
16
  }">
17
17
  </div>
18
- <div>
18
+ <div class="EditorPrintAreaOption__info">
19
19
  <div class="lc_caption">
20
20
  {{ option.label }}
21
21
  </div>
22
22
  <div class="lc_regular10">
23
- <span v-if="option.printArea && calcPrintPrice(option) > 0">
24
- {{ calcPrintPrice(option) | priceWithTax(pricingSettings, currency) }}
25
- </span>
23
+ <price
24
+ :price="calcPrintPrice(option)"
25
+ :with-gst="priceIncludeGST" />
26
26
  </div>
27
27
  </div>
28
28
  </div>
@@ -58,9 +58,13 @@
58
58
  import { mapGetters } from 'vuex';
59
59
  import { priceWithTax, priceInRange } from '@lancom/shared/assets/js/utils/filters';
60
60
  import { getProductPrintsAreasPrices } from '@lancom/shared/assets/js/models/print-area';
61
+ import Price from '@lancom/shared/components/common/price';
61
62
 
62
63
  export default {
63
64
  name: 'EditorPrintAreaOption',
65
+ components: {
66
+ Price
67
+ },
64
68
  filters: {
65
69
  priceWithTax
66
70
  },
@@ -92,7 +96,8 @@ export default {
92
96
  ]),
93
97
  ...mapGetters('product', [
94
98
  'usedSimpleProducts',
95
- 'selectedPrintType'
99
+ 'selectedPrintType',
100
+ 'priceIncludeGST'
96
101
  ]),
97
102
  printsPricing() {
98
103
  return getProductPrintsAreasPrices(this.product, this.selectedPrintType);
@@ -1,4 +1,5 @@
1
1
  @import "@/assets/scss/variables";
2
+
2
3
  .EditorProductDetails {
3
4
  &__wrapper {
4
5
  padding-top: 36px;
@@ -7,6 +8,11 @@
7
8
  display: flex;
8
9
  align-items: center;
9
10
  margin-top: 5px;
11
+ @media (max-width: $bp-extra-small-max) {
12
+ flex-direction: column;
13
+ align-items: start;
14
+ margin-top: 10px;
15
+ }
10
16
  &-logo {
11
17
  img {
12
18
  max-width: 75px;
@@ -16,6 +22,9 @@
16
22
  &-info {
17
23
  margin-left: 10px;
18
24
  flex-grow: 1;
25
+ @media (max-width: $bp-extra-small-max) {
26
+ margin-left: 0px;
27
+ }
19
28
  }
20
29
  &-row {
21
30
  display: flex;
@@ -59,4 +68,17 @@
59
68
  padding: 10px;
60
69
  margin-top: 10px;
61
70
  }
71
+ &__product-image {
72
+ width: 100%;
73
+ text-align: center;
74
+ margin: 15px 0;
75
+ display: none;
76
+ @media (max-width: $bp-extra-small-max) {
77
+ margin-left: block;
78
+ }
79
+ img {
80
+ width: 100%;
81
+ max-width: 330px;
82
+ }
83
+ }
62
84
  }
@@ -21,11 +21,14 @@
21
21
  :delay="{ show: 200, hide: 400 }"
22
22
  popover-class="tooltip popover white"
23
23
  class="EditorProductDetails__discounts-table">
24
- <span class="lc_semibold22 lc_black EditorProductDetails__dashed-underline">
25
- {{ defaultSimpleProductPricing[0].price | priceWithTax(pricingSettings, currency) }}
26
- </span>
24
+ <price
25
+ class="lc_semibold22 lc_black EditorProductDetails__dashed-underline"
26
+ :price="defaultSimpleProductPricing[0].price"
27
+ :with-gst="inclGST" />
27
28
  <template slot="popover">
28
- <pricing-discounts-table :prices="defaultSimpleProductPricing" />
29
+ <pricing-discounts-table
30
+ :prices="defaultSimpleProductPricing"
31
+ :with-gst="inclGST" />
29
32
  </template>
30
33
  </v-popover>
31
34
  </span>
@@ -45,10 +48,18 @@
45
48
  :items="printTypePrices"
46
49
  :bordered="true"
47
50
  :striped="false"
51
+ :with-gst="inclGST"
48
52
  class="EditorProductDetails__prints-table" />
49
53
  </template>
50
54
  </v-popover>
51
55
  </span>
56
+ <span class="ml-10">
57
+ <checkbox
58
+ v-model="inclGST"
59
+ :dark="true">
60
+ <div class="ml-5">Inc. {{ taxName }}</div>
61
+ </checkbox>
62
+ </span>
52
63
  </div>
53
64
  <div class="EditorProductDetails__header-row">
54
65
  <span class="EditorProductDetails__product-link">
@@ -68,20 +79,27 @@
68
79
  class="EditorProductDetails__available-warning">
69
80
  Product Not Available in {{ country.name }}
70
81
  </div>
71
- <fragment
82
+ <div
83
+ v-if="mainProductImageSrc"
84
+ class="EditorProductDetails__product-image">
85
+ <img :src="mainProductImageSrc" />
86
+ </div>
87
+ <div
72
88
  v-if="productDetailsLoaded && productAvailableInCurrentCountry">
73
89
  <div class="EditorProductDetails__section">
74
- <product-colors-selector :has-another-print-btn="false" />
90
+ <product-colors-selector
91
+ :has-another-print-btn="false"
92
+ :has-toggle-gst="false" />
75
93
  </div>
76
94
  <div class="EditorProductDetails__section">
77
95
  <editor-pricing :has-cart-btn="false" />
78
96
  </div>
79
- </fragment>
97
+ </div>
80
98
  </div>
81
99
  </template>
82
100
 
83
101
  <script>
84
- import { mapGetters } from 'vuex';
102
+ import { mapGetters, mapMutations } from 'vuex';
85
103
  import ProductColorsSelector from '@lancom/shared/components/product/product_colors_selector/product-colors-selector';
86
104
  import EditorPricing from '@lancom/shared/components/product/editor_pricing/editor-pricing';
87
105
  import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
@@ -89,6 +107,7 @@ import modals from '@lancom/shared/mixins/modals';
89
107
  import { staticLink, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
90
108
  import PricingTable from '@lancom/shared/components/common/pricing_table/pricing-table';
91
109
  import { generateProductLink } from '@lancom/shared/assets/js/utils/product';
110
+ import Price from '@lancom/shared/components/common/price';
92
111
 
93
112
  export default {
94
113
  name: 'EditorProductDetails',
@@ -96,7 +115,8 @@ export default {
96
115
  ProductColorsSelector,
97
116
  PricingDiscountsTable,
98
117
  EditorPricing,
99
- PricingTable
118
+ PricingTable,
119
+ Price
100
120
  },
101
121
  filters: {
102
122
  priceWithTax,
@@ -104,8 +124,12 @@ export default {
104
124
  },
105
125
  mixins: [modals],
106
126
  computed: {
127
+ ...mapGetters(['taxName']),
107
128
  ...mapGetters('product', [
108
129
  'product',
130
+ 'editableColor',
131
+ 'images',
132
+ 'priceIncludeGST',
109
133
  'productDetailsLoaded',
110
134
  'defaultSimpleProduct',
111
135
  'selectedPrintType',
@@ -118,6 +142,14 @@ export default {
118
142
  'pricingSettings',
119
143
  'country'
120
144
  ]),
145
+ inclGST: {
146
+ get() {
147
+ return this.priceIncludeGST;
148
+ },
149
+ set(value) {
150
+ this.setPriceIncludeGST(value);
151
+ }
152
+ },
121
153
  defaultSimpleProductPricing() {
122
154
  return (this.isPrintPricing ? this.defaultSimpleProduct?.pricing : this.defaultSimpleProduct?.unprintedPricing);
123
155
  },
@@ -138,7 +170,16 @@ export default {
138
170
  });
139
171
  return sizes;
140
172
  }, new Map()).values()];
173
+ },
174
+ mainProductImage() {
175
+ return this.images.find(i => i.color === this.editableColor?._id) || this.images[0];
176
+ },
177
+ mainProductImageSrc() {
178
+ return this.mainProductImage && this.mainProductImage.large;
141
179
  }
180
+ },
181
+ methods: {
182
+ ...mapMutations('product', ['setPriceIncludeGST']),
142
183
  }
143
184
  };
144
185
  </script>
@@ -9,8 +9,8 @@
9
9
  &-container {
10
10
  position: relative;
11
11
  margin: 0 auto;
12
- width: 296px;
13
- height: 296px;
12
+ width: 310px;
13
+ height: 370px;
14
14
  max-width: 100%;
15
15
  @media (min-width: $bp-small-min) {
16
16
  width: 580px;
@@ -35,7 +35,7 @@
35
35
  top: -90px;
36
36
  left: calc((-720px + 100vw) / 2);
37
37
  max-width: none;
38
- z-index: 9999;
38
+ z-index: 1003;
39
39
  }
40
40
  }
41
41
  &-toggle {
@@ -100,11 +100,6 @@
100
100
  @option-mouseleave="toogleBoundBox(false, $event)">
101
101
  </editor-print-area-options>
102
102
  </div>
103
- <breakpoint
104
- name="md"
105
- mode="down">
106
- <editor-pricing v-if="productDetailsLoaded" />
107
- </breakpoint>
108
103
  </div>
109
104
  </template>
110
105
 
@@ -6,6 +6,18 @@
6
6
  transition: background-color 0.5s ease;
7
7
  background-color: white;
8
8
  }
9
+ &__toggle-wireframe {
10
+ position: absolute;
11
+ z-index: 1001;
12
+ background: gainsboro;
13
+ padding: 6px;
14
+ top: 5px;
15
+ font-size: 14px;
16
+ cursor: pointer;
17
+ &--active {
18
+ background: rgb(196, 226, 236);
19
+ }
20
+ }
9
21
  &__delete-object {
10
22
  position: absolute;
11
23
  z-index: 2;
@@ -9,6 +9,15 @@
9
9
  }"
10
10
  @mouseover="toogleBoundBox(true)"
11
11
  @mouseleave="toogleBoundBox(false)">
12
+ <div
13
+ v-if="hasWireframeImage"
14
+ class="EditorWorkspaceSide__toggle-wireframe"
15
+ :class="{
16
+ 'EditorWorkspaceSide__toggle-wireframe--active': visibleWireframe
17
+ }"
18
+ @click.stop.prevent="toggleWireframeImage">
19
+ {{ visibleWireframe ? 'Hide Wireframe' : 'Show Wireframe' }}
20
+ </div>
12
21
  <div
13
22
  v-if="deleteButtonPos"
14
23
  :style="deleteButtonPosition"
@@ -98,6 +107,7 @@ export default {
98
107
  },
99
108
  data() {
100
109
  return {
110
+ visibleWireframe: false,
101
111
  fabricHelper: null,
102
112
  redrawWithThrottle: throttle(this.redraw, 100, { trailing: false }),
103
113
  saveLayersAsImageWithDebounce: debounce(this.saveLayersAsImage, 100),
@@ -115,12 +125,22 @@ export default {
115
125
  ...mapGetters('product', [
116
126
  'product',
117
127
  'layers',
128
+ 'images',
118
129
  'editableColor',
119
130
  'editableLayers',
120
131
  'selectedLayer',
121
132
  'editorSize',
122
133
  'editModeSelectedLayer'
123
134
  ]),
135
+ hasWireframeImage() {
136
+ return !!this.wireframeImage;
137
+ },
138
+ wireframeImage() {
139
+ return this.images.find(i => i.types?.includes('designer') && i.types?.includes(this.side));
140
+ },
141
+ sideEditableLayers() {
142
+ return this.editableLayers.filter(l => l.sideId === this.side);
143
+ },
124
144
  printAreaLayers() {
125
145
  return this.editableLayers.filter(l => !this.printArea || l.printArea === this.printArea._id);
126
146
  },
@@ -171,6 +191,9 @@ export default {
171
191
  editableColor() {
172
192
  this.updateBackgroundImage();
173
193
  },
194
+ visibleWireframe() {
195
+ this.updateBackgroundImage();
196
+ },
174
197
  layers() {
175
198
  this.redrawWithThrottle();
176
199
  },
@@ -186,6 +209,7 @@ export default {
186
209
  }
187
210
  },
188
211
  mounted() {
212
+ this.checkVisibleWireframe();
189
213
  this.initEventsListeners();
190
214
  this.initCanvas();
191
215
  this.handleWorkspaceSize();
@@ -207,6 +231,12 @@ export default {
207
231
  ...mapMutations('layers', [
208
232
  'setLayersThumbnail'
209
233
  ]),
234
+ checkVisibleWireframe() {
235
+ this.visibleWireframe = this.sideEditableLayers.length > 0;
236
+ },
237
+ toggleWireframeImage() {
238
+ this.visibleWireframe = !this.visibleWireframe;
239
+ },
210
240
  adjustSelectedArtDPI() {
211
241
  const measure = this.fabricHelper.getEditorDPI();
212
242
  const scale = measure / 75;
@@ -217,7 +247,7 @@ export default {
217
247
  },
218
248
  calcWorkspaceSize() {
219
249
  const sizes = {
220
- xs: 296,
250
+ xs: 330,
221
251
  sm: 580,
222
252
  md: 430,
223
253
  lg: 600,
@@ -287,8 +317,7 @@ export default {
287
317
  this.saveLayersAsImageWithDebounce();
288
318
  },
289
319
  async addLayersToCanvas() {
290
- const layers = this.editableLayers.filter(l => l.sideId === this.side);
291
- for (const layer of layers) {
320
+ for (const layer of this.sideEditableLayers) {
292
321
  const params = {
293
322
  layer,
294
323
  active: this.isLayerSelected(layer)
@@ -301,7 +330,8 @@ export default {
301
330
  },
302
331
  updateBackgroundImage() {
303
332
  const type = this.side === 'front' ? COLORS_IMAGES_TYPES.FRONT : COLORS_IMAGES_TYPES.BACK;
304
- const imageUrl = getLargeColorImage(this.product, type, this.editableColor);
333
+ const wireframeImageUrl = this.visibleWireframe && this.wireframeImage?.large;
334
+ const imageUrl = wireframeImageUrl || getLargeColorImage(this.product, type, this.editableColor);
305
335
  if (this.backgroundImage && this.backgroundImageUrl === imageUrl) {
306
336
  return this.fabricHelper.setBackgroundImage(this.backgroundImage);
307
337
  }
@@ -325,6 +355,7 @@ export default {
325
355
  createTextLayer() {
326
356
  window.scrollTo(0, 0);
327
357
  this.createLayer({ type: 'text', isEditMode: true });
358
+ this.visibleWireframe = true;
328
359
  },
329
360
  setDeleteButtonPosition(pos) {
330
361
  this.deleteButtonPos = pos;
@@ -5,10 +5,10 @@
5
5
  &__menu {
6
6
  position: fixed;
7
7
  right: 0;
8
- bottom: 0;
8
+ top: calc(100vh - 78px);
9
9
  left: 0;
10
10
  height: 78px;
11
- z-index: 10000;
11
+ z-index: 999999;
12
12
  display: grid;
13
13
  grid-template-columns: repeat(3, 1fr);
14
14
  background-color: $white_high_emphasis;
@@ -7,7 +7,7 @@
7
7
  @click="show('details')">
8
8
  <i class="icon-product MobileEditorProductDetails__menu-action-icon"></i>
9
9
  <span class="MobileEditorProductDetails__menu-action-label">
10
- Product
10
+ Editor
11
11
  </span>
12
12
  </div>
13
13
  <div
@@ -60,7 +60,7 @@
60
60
  @click="hide"></i>
61
61
  </div>
62
62
  <div class="MobileEditorProductDetails__content custom-scrollbar-container">
63
- <editor-product-details v-if="currentTab === 'details'" />
63
+ <editor-workspace v-if="currentTab === 'details'" />
64
64
  <editor-layers v-if="currentTab === 'layers'" />
65
65
  </div>
66
66
  </div>
@@ -71,19 +71,17 @@
71
71
  <script>
72
72
  import { createNamespacedHelpers } from 'vuex';
73
73
  import { EventBus } from '@lancom/shared/assets/js/utils/event-bus';
74
- import EditorProductDetails from '../editor_product_details/editor-product-details';
74
+ import EditorWorkspace from '../editor_workspace/editor-workspace';
75
75
  import EditorLayers from '../editor_layers/editor-layers';
76
76
 
77
77
  const { mapMutations } = createNamespacedHelpers('product');
78
78
 
79
79
  export default {
80
80
  name: 'MobileEditorProductDetails',
81
-
82
81
  components: {
83
- EditorProductDetails,
82
+ EditorWorkspace,
84
83
  EditorLayers
85
84
  },
86
-
87
85
  props: {
88
86
  addToCartDisabled: {
89
87
  type: Boolean,
@@ -0,0 +1,9 @@
1
+ .ProductPrintsPreview {
2
+ &__wrapper {
3
+ text-align: center;
4
+ }
5
+ &__preview {
6
+ height: 350px;
7
+ width: 350px;
8
+ }
9
+ }
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div class="ProductPrintsPreview__wrapper d-flex justify-content-center">
3
+ <div
4
+ v-for="(side, index) of sides"
5
+ :key="index">
6
+ <div class="ProductPrintsPreview__preview">
7
+ <product-side-with-print
8
+ :product="product"
9
+ :side="side"
10
+ size="medium" />
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import ProductSideWithPrint from '@lancom/shared/components/common/product_side_with_print/product-side-with-print';
18
+
19
+ export default {
20
+ name: 'ProductPrintsPreview',
21
+ components: {
22
+ ProductSideWithPrint
23
+ },
24
+ props: {
25
+ order: {
26
+ type: Object,
27
+ required: true
28
+ },
29
+ product: {
30
+ type: Object,
31
+ required: true
32
+ }
33
+ },
34
+ computed: {
35
+ sides() {
36
+ return Object.keys(this.product.printsThumbnails || {});
37
+ }
38
+ }
39
+ };
40
+ </script>
41
+
42
+ <style lang="scss" scoped>
43
+ @import 'order-product-prints-preview.scss';
44
+ </style>
@@ -17,6 +17,18 @@ export default {
17
17
  defaultPreview: {
18
18
  type: Boolean,
19
19
  default: true
20
+ },
21
+ withBigImage: {
22
+ type: Boolean,
23
+ default: false
24
+ },
25
+ withImage: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ withTotals: {
30
+ type: Boolean,
31
+ default: true
20
32
  }
21
33
  },
22
34
  computed: {
@@ -8,17 +8,24 @@
8
8
  flex-direction: column;
9
9
  align-items: center;
10
10
  }
11
+ &--column {
12
+ flex-direction: column;
13
+ }
11
14
  }
12
15
  &__image-wrapper {
13
16
  width: 70px;
17
+ margin-right: 20px;
14
18
  @media (max-width: $bp-extra-small-max) {
15
19
  width: 200px;
16
20
  margin-top: 20px;
17
21
  }
22
+ &--large {
23
+ width: 900px;
24
+ display: flex;
25
+ }
18
26
  }
19
27
  &__info {
20
28
  flex-grow: 1;
21
- margin-left: 20px;
22
29
  @media (max-width: $bp-medium-max) {
23
30
  margin-left: 5px;
24
31
  }
@@ -35,6 +42,10 @@
35
42
  width: 200px;
36
43
  height: 200px;
37
44
  }
45
+ &--large {
46
+ width: 400px;
47
+ height: 400px;
48
+ }
38
49
  }
39
50
 
40
51
  &__features {
@@ -1,8 +1,20 @@
1
1
  <template>
2
- <div class="OrderProductColorSimpleProducts__wrapper">
3
- <div class="OrderProductColorSimpleProducts__image-wrapper">
2
+ <div
3
+ class="OrderProductColorSimpleProducts__wrapper"
4
+ :class="{
5
+ 'OrderProductColorSimpleProducts__wrapper--column': withBigImage
6
+ }">
7
+ <div
8
+ v-if="withImage"
9
+ class="OrderProductColorSimpleProducts__image-wrapper"
10
+ :class="{
11
+ 'OrderProductColorSimpleProducts__image-wrapper--large': withBigImage
12
+ }">
4
13
  <div
5
14
  class="OrderProductColorSimpleProducts__image"
15
+ :class="{
16
+ 'OrderProductColorSimpleProducts__image--large': withBigImage
17
+ }"
6
18
  @click="showImage(images, 0)">
7
19
  <product-side-with-print
8
20
  :product="group"
@@ -10,6 +22,19 @@
10
22
  side="front"
11
23
  size="medium" />
12
24
  </div>
25
+ <div
26
+ v-if="entity && entity.printsThumbnails && entity.printsThumbnails.back"
27
+ class="OrderProductColorSimpleProducts__image"
28
+ :class="{
29
+ 'OrderProductColorSimpleProducts__image--large': withBigImage
30
+ }"
31
+ @click="showImage(images, 1)">
32
+ <product-side-with-print
33
+ :product="group"
34
+ :default-preview="defaultPreview"
35
+ side="back"
36
+ size="medium" />
37
+ </div>
13
38
  </div>
14
39
  <div class="OrderProductColorSimpleProducts__info">
15
40
  <div class="OrderProductColorSimpleProducts__features">
@@ -48,7 +73,9 @@
48
73
  {{ group.amount }}
49
74
  </div>
50
75
  </div>
51
- <div class="OrderProductColorSimpleProducts__total mt-6">
76
+ <div
77
+ v-if="withTotals"
78
+ class="OrderProductColorSimpleProducts__total mt-6">
52
79
  <div class="lc_title-small">
53
80
  Total price:
54
81
  </div>
@@ -33,18 +33,23 @@
33
33
  :order="order"
34
34
  :entity="product"
35
35
  :group="group"
36
+ :with-image="withImage"
37
+ :with-big-image="withBigImage"
38
+ :with-totals="withTotals"
36
39
  :default-preview="groupedProducts.size === 1"
37
40
  class="OrderViewProduct__item" />
38
41
  </div>
39
42
  <div
40
- v-if="hasPrints"
43
+ v-if="withPrints && hasPrints"
41
44
  class="OrderViewProduct__decorations">
42
45
  <order-product-prints
43
46
  :order="order"
44
47
  :entity="product"
45
48
  :responsive="responsive" />
46
49
  </div>
47
- <div class="OrderViewProduct__subtotal lc_title">
50
+ <div
51
+ v-if="withTotals"
52
+ class="OrderViewProduct__subtotal lc_title">
48
53
  Subtotal: {{ totalPrice | price(order.currency) }}
49
54
  </div>
50
55
  </div>
@@ -87,6 +92,22 @@ export default {
87
92
  responsive: {
88
93
  type: Boolean,
89
94
  default: true
95
+ },
96
+ withImage: {
97
+ type: Boolean,
98
+ default: true
99
+ },
100
+ withBigImage: {
101
+ type: Boolean,
102
+ default: false
103
+ },
104
+ withPrints: {
105
+ type: Boolean,
106
+ default: true
107
+ },
108
+ withTotals: {
109
+ type: Boolean,
110
+ default: true
90
111
  }
91
112
  },
92
113
  computed: {
@@ -148,8 +148,11 @@ export default {
148
148
  hasValidFilters() {
149
149
  return this.validFilters.length > 1;
150
150
  },
151
+ galleryImages() {
152
+ return this.images.filter(i => !(i.types || []).includes('designer'));
153
+ },
151
154
  validFilters() {
152
- return this.filters.filter(filter => (this.images || []).some(i => this.isValidImageByFilter(filter, i)));
155
+ return this.filters.filter(filter => (this.galleryImages || []).some(i => this.isValidImageByFilter(filter, i)));
153
156
  },
154
157
  currentImage() {
155
158
  return this.filteredImages[this.activeIndex];
@@ -164,7 +167,7 @@ export default {
164
167
  return this.filteredImages.length > this.slidesPerRow;
165
168
  },
166
169
  filteredImages() {
167
- const images = this.filterType ? this.images.filter(i => this.isValidImageByFilter(this.filterType, i)) : this.images;
170
+ const images = this.filterType ? this.galleryImages.filter(i => this.isValidImageByFilter(this.filterType, i)) : this.galleryImages;
168
171
  return images.map(image => {
169
172
  const printType = this.product?.printTypes.find(({ _id }) => _id === image.printType);
170
173
  const printArea = printType?.printAreas.find(({ printSizes }) => (printSizes || []).some(({ _id }) => _id === image.printSize)) || printType?.printAreas[0] || { printCost: [] };
@@ -62,7 +62,9 @@
62
62
  ref="colorsSelectorOptions"
63
63
  :display-products-count="true"
64
64
  class="ProductColorsSelector__section" />
65
- <div class="ProductColorsSelector__toggle-gst">
65
+ <div
66
+ class="ProductColorsSelector__toggle-gst"
67
+ v-if="hasToggleGst">
66
68
  <checkbox
67
69
  v-model="inclGST"
68
70
  :dark="true"
@@ -112,6 +114,10 @@ export default {
112
114
  hasAnotherPrintBtn: {
113
115
  type: Boolean,
114
116
  default: true
117
+ },
118
+ hasToggleGst: {
119
+ type: Boolean,
120
+ default: true
115
121
  }
116
122
  },
117
123
  computed: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.296",
3
+ "version": "0.0.298",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {