@lancom/shared 0.0.280 → 0.0.282

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 (95) hide show
  1. package/assets/js/api/admin.js +3 -0
  2. package/assets/js/api/index.js +7 -4
  3. package/assets/js/models/print-area.js +8 -4
  4. package/assets/js/utils/colors.js +1 -1
  5. package/assets/js/utils/fabric-helper.js +5 -18
  6. package/assets/js/utils/filters.js +2 -2
  7. package/assets/js/utils/product.js +10 -1
  8. package/assets/scss/_common.scss +10 -0
  9. package/components/asides/contact_us/contact-us.vue +9 -2
  10. package/components/asides/menu/menu.vue +1 -25
  11. package/components/checkout/cart/cart.mixin.js +3 -3
  12. package/components/checkout/cart/cart.scss +8 -109
  13. package/components/checkout/cart/cart.vue +84 -46
  14. package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +7 -4
  15. package/components/checkout/cart/cart_price_info/cart-price-info.vue +4 -5
  16. package/components/checkout/cart/cart_pricing/cart-pricing.scss +34 -0
  17. package/components/checkout/cart/cart_pricing/cart-pricing.vue +112 -0
  18. package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
  19. package/components/checkout/order/address-form/address-form.scss +16 -0
  20. package/components/checkout/order/address-form/address-form.vue +199 -91
  21. package/components/checkout/order/order-billing-information/order-billing-information.scss +1 -1
  22. package/components/checkout/order/order-payment-information/order-payment-information.vue +15 -5
  23. package/components/checkout/order/order.vue +2 -1
  24. package/components/common/client_settings/client-settings.scss +6 -0
  25. package/components/common/client_settings/client-settings.vue +9 -1
  26. package/components/common/payment/payment_card/stripe/stripe.vue +1 -0
  27. package/components/common/payment/payment_success/payment-success.vue +8 -1
  28. package/components/common/postcode_select/postcode-select.vue +24 -12
  29. package/components/common/price.vue +1 -1
  30. package/components/common/pricing_table/pricing-table.vue +3 -2
  31. package/components/common/tabs.vue +17 -8
  32. package/components/editor/editor.scss +6 -0
  33. package/components/editor/editor.vue +9 -25
  34. package/components/editor/editor_layers/editor-layers.scss +18 -0
  35. package/components/editor/editor_layers/editor-layers.vue +76 -20
  36. package/components/editor/editor_layers/editor_layers_layer/editor-layers-layer.vue +11 -4
  37. package/components/editor/editor_print_area_options/editor-print-area-options.vue +6 -1
  38. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +2 -2
  39. package/components/editor/editor_product_details/editor-product-details.scss +8 -2
  40. package/components/editor/editor_product_details/editor-product-details.vue +22 -25
  41. package/components/editor/editor_wizard/editor-wizard.vue +2 -1
  42. package/components/editor/editor_workspace/editor-workspace.vue +7 -3
  43. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +17 -20
  44. package/components/editor/mobile_editor_product_details/mobile-editor-product-details.scss +2 -2
  45. package/components/modals/cart_modal/cart-modal.vue +1 -1
  46. package/components/modals/order_modal/order-modal.vue +6 -0
  47. package/components/modals/payment_modal/payment-modal.vue +4 -3
  48. package/components/order/order_payment/order-payment.vue +6 -6
  49. package/components/product/editor_pricing/editor-pricing.scss +75 -0
  50. package/components/product/editor_pricing/editor-pricing.vue +197 -0
  51. package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  52. package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  53. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  54. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +118 -0
  55. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  56. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +102 -0
  57. package/components/product/product.vue +1 -1
  58. package/components/product/product_colors_selector/product-colors-selector.scss +117 -0
  59. package/components/product/product_colors_selector/product-colors-selector.vue +188 -0
  60. package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +3 -1
  61. package/components/product/product_size_selector/product_size_selector_color/product_size_selector_color_cell/product-size-selector-color-cell.vue +4 -5
  62. package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.scss +58 -0
  63. package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.vue +128 -0
  64. package/components/product/products_size_selector_color/products-size-selector-color.scss +12 -0
  65. package/components/product/products_size_selector_color/products-size-selector-color.vue +43 -0
  66. package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +4 -34
  67. package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +2 -1
  68. package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.vue +22 -1
  69. package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +2 -1
  70. package/components/products/product_list/product-list.scss +2 -2
  71. package/components/products/product_list_product/product-list-product.scss +7 -11
  72. package/components/products/product_list_product/product-list-product.vue +7 -15
  73. package/components/the_aside/the-aside.vue +1 -0
  74. package/components/the_navbar/the-navbar.scss +1 -1
  75. package/feeds/google-shopping.js +5 -5
  76. package/layouts/error.vue +39 -0
  77. package/layouts/products.vue +386 -0
  78. package/mixins/add-to-cart.js +64 -0
  79. package/mixins/payment.js +2 -1
  80. package/mixins/print-layer.js +45 -0
  81. package/mixins/product-preview.js +1 -1
  82. package/mixins/product-view.js +313 -0
  83. package/nuxt.config.js +0 -5
  84. package/package.json +1 -1
  85. package/pages/checkout/cart.vue +40 -0
  86. package/pages/checkout/order.vue +72 -0
  87. package/pages/customer/create.vue +33 -0
  88. package/pages/customer/password/_token.vue +79 -0
  89. package/pages/customer/recovery.vue +33 -0
  90. package/pages/customer/settings.vue +33 -0
  91. package/pages/customer/signin.vue +33 -0
  92. package/routes/index.js +35 -0
  93. package/store/cart.js +15 -6
  94. package/store/order.js +2 -2
  95. package/store/product.js +5 -12
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <div class="PostcodeSelect form-row">
2
+ <div class="PostcodeSelect">
3
3
  <validation-provider
4
4
  v-slot="{ errors }"
5
5
  tag="div"
6
6
  :rules="required ? 'required' : ''"
7
7
  name="Postcode"
8
- class="form-group form-row">
8
+ class="form-group">
9
9
  <label
10
10
  v-if="labelless"
11
11
  class="form-label"
@@ -76,6 +76,7 @@
76
76
  </template>
77
77
 
78
78
  <script>
79
+ import { mapGetters } from 'vuex';
79
80
  import debounce from 'lodash.debounce';
80
81
  import Multiselect from 'vue-multiselect';
81
82
  import api from '@lancom/shared/assets/js/api';
@@ -88,7 +89,7 @@ export default {
88
89
  },
89
90
  filters: { highlight },
90
91
  props: {
91
- country: {
92
+ codeCountry: {
92
93
  type: Object
93
94
  },
94
95
  value: {
@@ -128,14 +129,13 @@ export default {
128
129
  };
129
130
  },
130
131
  computed: {
132
+ ...mapGetters(['shop']),
131
133
  model: {
132
134
  get() {
133
- return this.selected?.value ? this.selected : null;
135
+ return this.selected?._id ? this.selected : null;
134
136
  },
135
137
  set(option) {
136
- this.selected = option;
137
- this.$emit('input', option.value);
138
- this.$emit('select', this.suburbs.find(({ _id }) => _id === option._id));
138
+ this.updatePostcode(option);
139
139
  }
140
140
  }
141
141
  },
@@ -150,20 +150,32 @@ export default {
150
150
  async handleSearch(query) {
151
151
  if (query.length) {
152
152
  this.isLoading = true;
153
- const country = this.country ? (this.country.isoCode === 'GB' ? 'England' : (this.country.name || this.country)) : 'Australia';
154
- this.suburbs = await api.fetchSuburbs({ query, country });
153
+ const country = this.codeCountry || this.country;
154
+ const countryName = country ? (country.isoCode === 'GB' ? 'England' : (country.name || country)) : 'Australia';
155
+ this.suburbs = await api.fetchSuburbs({ query, country: countryName }, this.shop?._id);
155
156
  this.options = this.suburbs.map(this.createOptionFromSuburb);
156
157
  this.isLoading = false;
157
158
  } else {
158
159
  this.options = [];
159
160
  }
160
161
  },
161
- createOptionFromSuburb({ locality, state, postcode, city, _id }) {
162
+ createOptionFromSuburb({ locality, state, postcode, city, _id, address, id }) {
162
163
  return {
163
- label: [locality || city, state, postcode].filter(i => !!i).join(', '),
164
+ label: address || [locality || city, state, postcode].filter(i => !!i).join(', '),
164
165
  value: postcode,
165
- _id: _id
166
+ _id: id || _id
166
167
  };
168
+ },
169
+ async updatePostcode(option) {
170
+ this.selected = option;
171
+ if (!option.value) {
172
+ const suburb = await api.fetchAddressInfo(option._id, this.shop?._id);
173
+ this.$emit('input', suburb.postcode);
174
+ this.$emit('select', suburb);
175
+ } else {
176
+ this.$emit('input', option.value);
177
+ this.$emit('select', this.suburbs.find(({ _id }) => _id === option._id));
178
+ }
167
179
  }
168
180
  }
169
181
  };
@@ -19,7 +19,7 @@ export default {
19
19
  }
20
20
  },
21
21
  computed: {
22
- ...mapGetters(['pricingSettings'])
22
+ ...mapGetters(['pricingSettings', 'currency'])
23
23
  }
24
24
  };
25
25
  </script>
@@ -71,7 +71,8 @@ export default {
71
71
  },
72
72
  computed: {
73
73
  ...mapGetters([
74
- 'pricingSettings'
74
+ 'pricingSettings',
75
+ 'currency'
75
76
  ]),
76
77
  thList() {
77
78
  return this.items.map(item => get(item, this.nameAttr));
@@ -138,7 +139,7 @@ export default {
138
139
  const printType = this.items.find(item => printTypeName === get(item, this.nameAttr));
139
140
  const pricing = get(printType, this.pricingAttr);
140
141
  const item = pricing.find(({ min, max }) => (!min || range.min >= min) && (!max || range.min <= max));
141
- return item ? (this.withGst ? priceWithTax(item.price, this.pricingSettings) : price(item.price)) : '-';
142
+ return item ? (this.withGst ? priceWithTax(item.price, this.pricingSettings, this.currency) : price(item.price, this.currency)) : '-';
142
143
  }
143
144
  }
144
145
  };
@@ -10,7 +10,7 @@
10
10
  shadow: btnsShadow
11
11
  }"
12
12
  @click="select(tab)">
13
- <div class="lc_medium18 tab-label">
13
+ <div class="lc_medium16 tab-label">
14
14
  <i
15
15
  v-if="tab.icon"
16
16
  :class="[tab.icon, 'tab-icon']">
@@ -19,7 +19,7 @@
19
19
  </div>
20
20
  <div
21
21
  v-if="tab.description"
22
- class="lc_regular12 lc_grey1 mt-5">
22
+ class="tab-description lc_regular12 lc_grey1 mt-5">
23
23
  {{ tab.description }}
24
24
  </div>
25
25
  </div>
@@ -98,7 +98,7 @@ export default {
98
98
  @import "@/assets/scss/variables";
99
99
 
100
100
  .tab {
101
- flex-grow: .2;
101
+ flex-basis: 100%;
102
102
  display: flex;
103
103
  align-items: center;
104
104
  border-radius: 2px;
@@ -124,10 +124,10 @@ export default {
124
124
  transition: background-color .22s ease-in-out;
125
125
  }
126
126
  &s--large & {
127
- height: 80px;
127
+ height: 85px;
128
128
  flex-direction: column;
129
129
  padding: 10px;
130
- min-width: 190px;
130
+ min-width: 130px;
131
131
  white-space: normal;
132
132
  }
133
133
  &s--primary & {
@@ -153,9 +153,6 @@ export default {
153
153
  padding: 0 12px;
154
154
  position: relative;
155
155
  }
156
- &-icon {
157
- font-size: 26px;
158
- }
159
156
  &s--large &-label,
160
157
  &s--primary &-label,
161
158
  &s--secondary &-label {
@@ -180,6 +177,18 @@ export default {
180
177
  &.shadow {
181
178
  box-shadow: 1px 1px 2px rgb(214, 214, 214);
182
179
  }
180
+ @media (max-width: $bp-medium-max) {
181
+ .tab-label {
182
+ font-size: 14px !important;
183
+ line-height: 20px !important;
184
+ }
185
+ .tab-icon {
186
+ font-size: 14px !important;
187
+ }
188
+ .tab-description {
189
+ font-size: 11px !important;
190
+ }
191
+ }
183
192
  }
184
193
  .fullWidth .tab {
185
194
  flex-grow: 1;
@@ -6,6 +6,12 @@
6
6
  justify-content: flex-start;
7
7
  padding: 12px 0;
8
8
  }
9
+ &__workspace {
10
+ @media (min-width: $bp-medium-min) {
11
+ position: sticky;
12
+ top: calc(#{$navbar_height} + 20px);
13
+ }
14
+ }
9
15
  &__content {
10
16
  margin-top: -12px;
11
17
  }
@@ -4,7 +4,7 @@
4
4
  <breakpoint
5
5
  name="md"
6
6
  mode="up">
7
- <div class="col-md-5 col-12 Editor__col">
7
+ <div class="col-md-6 col-12 Editor__col">
8
8
  <tabs
9
9
  :tabs="tabs"
10
10
  :selected="selectedTab"
@@ -55,8 +55,10 @@
55
55
  </div>
56
56
  </div>
57
57
  </breakpoint>
58
- <div class="col-md-7 col-12 Editor__col">
59
- <editor-workspace />
58
+ <div class="col-md-6 col-12 Editor__col">
59
+ <client-only>
60
+ <editor-workspace class="Editor__workspace" />
61
+ </client-only>
60
62
  </div>
61
63
  </div>
62
64
  <breakpoint
@@ -84,6 +86,7 @@ import EditorProductDetails from './editor_product_details/editor-product-detail
84
86
  import MobileEditorProductDetails from './mobile_editor_product_details/mobile-editor-product-details';
85
87
  import EditorLayers from './editor_layers/editor-layers';
86
88
  import EditorWizard from './editor_wizard/editor-wizard';
89
+ import addToCartMixin from '@lancom/shared/mixins/add-to-cart';
87
90
 
88
91
  const MIN_SCREEN_AMOUNT = 125;
89
92
 
@@ -100,7 +103,8 @@ export default {
100
103
  },
101
104
  mixins: [
102
105
  modals,
103
- confirmModal
106
+ confirmModal,
107
+ addToCartMixin
104
108
  ],
105
109
  data() {
106
110
  return {
@@ -147,9 +151,6 @@ export default {
147
151
  productAvailableInCurrentCountry() {
148
152
  const { countries } = this.product;
149
153
  return !(countries || []).length || countries.includes(this.country._id);
150
- },
151
- addToCartDisabled() {
152
- return !this.usedSimpleProducts.length || (this.product.printOnly && !this.template.layers.length);
153
154
  }
154
155
  },
155
156
  watch: {
@@ -190,7 +191,7 @@ export default {
190
191
  this.setEditModeSelectedLayer(false);
191
192
  },
192
193
  async showResetAllConfirm() {
193
- const message = 'Are you sure? Confirmation will delete all layers, quantities and set a T-shirt to white one';
194
+ const message = 'This will reset the current design. Are you sure?';
194
195
  const reset = await this.showConfirmationModal(message);
195
196
 
196
197
  if (reset) {
@@ -198,23 +199,6 @@ export default {
198
199
  this.resetLayers();
199
200
  }
200
201
  },
201
- proceedToCard() {
202
- const entities = generateCartProducts(this.product, this.template.simpleProducts, this.template.layers, this.isPrintPricing, this.layerThumbnails);
203
- this.addToCart({ entities, shop: this.shop, pricing: this.productPricing, country: this.country, currency: this.currency });
204
- this.showCartModal(async () => {
205
- const message = 'Do you wish to continue with editing the current design or reset the editor?';
206
- const reset = await this.showConfirmationModal(message, {
207
- cancelLabel: 'Keep design',
208
- submitLabel: 'Reset editor'
209
- });
210
- if (reset) {
211
- this.clearTemplate();
212
- this.resetLayers();
213
- } else {
214
- this.clearTemplate(true);
215
- }
216
- });
217
- },
218
202
  goToDesignAndClosePopover() {
219
203
  this.selectTab('design');
220
204
  if (this.$refs.popover) {
@@ -19,4 +19,22 @@
19
19
  &__pricing {
20
20
  margin-top: 30px;
21
21
  }
22
+ }
23
+ .EditorLayersGroup {
24
+ &__wrapper {
25
+ margin: 5px 0;
26
+ }
27
+ &__header {
28
+ display: flex;
29
+ justify-content: space-between;
30
+ align-items: center;
31
+ padding: 10px;
32
+ background-color: $light_gray;
33
+ cursor: pointer;
34
+ }
35
+ &__arrow {
36
+ &.opened {
37
+ transform: rotateZ(-90deg);
38
+ }
39
+ }
22
40
  }
@@ -30,37 +30,56 @@
30
30
  <editor-layers-toolbar
31
31
  @layer-added="handleLayerAdded">
32
32
  </editor-layers-toolbar>
33
- <div
34
- v-if="editableLayers.length"
35
- class="EditorLayers__list-content">
36
- <div class="EditorLayers__list-header">
37
- <h5 class="lc_h5">
38
- Layers:
39
- </h5>
33
+ <div v-if="editableLayersGroups.length > 0">
34
+ <div
35
+ v-for="group in editableLayersGroups"
36
+ :key="group.printArea._id"
37
+ class="EditorLayersGroup__wrapper">
38
+ <div
39
+ @click="toggleOpenedGroup(group.printArea)"
40
+ class="EditorLayersGroup__header">
41
+ <div>
42
+ <h5 class="lc_h5">
43
+ {{ group.printArea.name }} ({{ group.layers.length }})
44
+ </h5>
45
+ <div class="lc_caption">{{ group.printArea.side }}</div>
46
+ </div>
47
+ <div
48
+ class="EditorLayersGroup__arrow"
49
+ :class="{ opened: openedGroup === group.printArea._id }">
50
+ <i class="icon-arrow-left"></i>
51
+ </div>
52
+ </div>
53
+ <div
54
+ class="EditorLayers__list-content"
55
+ v-if="openedGroup === group.printArea._id">
56
+ <editor-layers-layer
57
+ v-for="(layer, index) in group.layers"
58
+ :key="`${layer.createdAt}-${index}`"
59
+ :layer="layer"
60
+ :active="selectedLayer && selectedLayer.createdAt === layer.createdAt"
61
+ @select="setSelectedLayer(layer)"
62
+ @edit="editLayer(layer)"
63
+ @duplicate="duplicateLayer(layer)"
64
+ @remove="removeLayer(layer)">
65
+ </editor-layers-layer>
66
+ </div>
40
67
  </div>
41
- <editor-layers-layer
42
- v-for="(layer, index) in editableLayers"
43
- :key="`${layer.createdAt}-${index}`"
44
- :layer="layer"
45
- :active="selectedLayer && selectedLayer.createdAt === layer.createdAt"
46
- @select="setSelectedLayer(layer)"
47
- @edit="editLayer(layer)"
48
- @duplicate="duplicateLayer(layer)"
49
- @remove="removeLayer(layer)">
50
- </editor-layers-layer>
51
68
  </div>
52
69
  </div>
53
70
  </transition>
54
71
  <editor-pricing
55
72
  v-if="hasPricing"
56
- class="EditorLayers__pricing" />
73
+ class="EditorLayers__pricing"
74
+ :has-cart-btn="false" />
57
75
  </div>
58
76
  </template>
59
77
 
60
78
  <script>
61
79
  import { createNamespacedHelpers } from 'vuex';
62
- import EditorPricing from '@lancom/shared/components/editor/editor_pricing/editor-pricing';
80
+ import EditorPricing from '@lancom/shared/components/product/editor_pricing/editor-pricing';
63
81
  import { cloneLayerModel } from '@lancom/shared/assets/js/models/product-layers';
82
+ import { getAllPrintAreas } from '@lancom/shared/assets/js/utils/product';
64
83
  import EditorLayerForms from './editor_layer_forms';
65
84
  import EditorLayersLayer from './editor_layers_layer/editor-layers-layer';
66
85
  import EditorLayersToolbar from './editor_layers_toolbar/editor-layers-toolbar';
@@ -75,6 +94,11 @@ export default {
75
94
  EditorLayersToolbar,
76
95
  EditorPricing
77
96
  },
97
+ data() {
98
+ return {
99
+ openedGroup: null
100
+ };
101
+ },
78
102
  props: {
79
103
  hasPricing: {
80
104
  type: Boolean,
@@ -83,6 +107,7 @@ export default {
83
107
  },
84
108
  computed: {
85
109
  ...mapGetters([
110
+ 'product',
86
111
  'template',
87
112
  'editableLayers',
88
113
  'selectedLayer',
@@ -91,6 +116,20 @@ export default {
91
116
  ]),
92
117
  editableLayerType() {
93
118
  return this.selectedLayer ? `editor-layer-form-${this.selectedLayer.type}` : null;
119
+ },
120
+ editableLayersGroups() {
121
+ const printAreas = getAllPrintAreas(this.product);
122
+ const groups = new Map();
123
+ this.editableLayers.forEach(layer => {
124
+ const printArea = printAreas.find(pa => pa._id === layer.printArea);
125
+ if (printArea) {
126
+ const defaultGroup = { layers: [], printArea };
127
+ const group = groups.get(printArea._id) || defaultGroup;
128
+ group.layers.push(layer);
129
+ groups.set(printArea._id, group);
130
+ }
131
+ });
132
+ return Array.from(groups.values());
94
133
  }
95
134
  },
96
135
  watch: {
@@ -110,9 +149,26 @@ export default {
110
149
  'setSelectedLayerField',
111
150
  'addTemplateLayer',
112
151
  'removeTemplateLayer',
113
- 'updateTemplateLayer'
152
+ 'updateTemplateLayer',
153
+ 'setEditableSide',
154
+ 'setSelectedPrintArea',
155
+ 'setEditablePrintArea'
114
156
  ]),
115
157
  ...mapActions(['increaseLayersUpdatesCount']),
158
+ toggleOpenedGroup(printArea) {
159
+ this.openedGroup = printArea?._id === this.openedGroup ? null : printArea?._id;
160
+ if (printArea) {
161
+ if (this.editableSide.id !== printArea.side) {
162
+ this.setEditableSide({ id: printArea.side });
163
+ }
164
+ this.setEditablePrintArea(printArea);
165
+ this.setSelectedPrintArea({
166
+ sideId: printArea.side,
167
+ printArea: printArea._id,
168
+ size: printArea.printSize
169
+ });
170
+ }
171
+ },
116
172
  handleLayerAdded({ layer, toEditMode }) {
117
173
  if (toEditMode) {
118
174
  this.editLayer(layer);
@@ -17,6 +17,12 @@
17
17
  </div>
18
18
  </div>
19
19
  <div class="EditorLayersLayer__content">
20
+ <!-- <div>
21
+ <div v-if="layerPrintArea">layerPrintArea: {{ layerPrintArea.name }}</div>
22
+ <div v-if="layerPrintType">layerPrintType: {{ layerPrintType.name }}</div>
23
+ <div v-if="layerPrintSize">layerPrintSize: {{ layerPrintSize.name }}</div>
24
+ <div v-if="side">side: {{ side }}</div>
25
+ </div> -->
20
26
  <div class="EditorLayersLayer__info">
21
27
  <div class="EditorLayersLayer__info-row">
22
28
  <div class="EditorLayersLayer__badge">
@@ -62,16 +68,14 @@
62
68
  </template>
63
69
 
64
70
  <script>
71
+ import printLayerMixin from '@lancom/shared/mixins/print-layer';
65
72
  import { number } from '@lancom/shared/assets/js/utils/filters';
66
73
 
67
74
  export default {
68
75
  name: 'EditorLayersLayer',
76
+ mixins: [printLayerMixin],
69
77
  filters: { number },
70
78
  props: {
71
- layer: {
72
- type: Object,
73
- required: true
74
- },
75
79
  active: {
76
80
  type: Boolean,
77
81
  default: false
@@ -118,6 +122,9 @@ export default {
118
122
  value: `${quality} / ${this.layer.dpi} DPI`
119
123
  };
120
124
  }
125
+ },
126
+ mounted() {
127
+ console.log('layer: ', this.layer);
121
128
  }
122
129
  };
123
130
  </script>
@@ -70,6 +70,8 @@ export default {
70
70
  const productsOptions = this.getProductOptions();
71
71
  const options = productsOptions.filter(({ sides }) => sides.includes(this.side));
72
72
  this.options = this.allowNoPrint ? [...options, { label: 'No Print' }] : options;
73
+
74
+ this.select(this.options[0]);
73
75
  },
74
76
  select(option) {
75
77
  this.$emit('select', option);
@@ -80,7 +82,10 @@ export default {
80
82
  .map(printArea => ({
81
83
  ...groupItemToOption(printArea),
82
84
  sides: [printArea.side],
83
- suboptions: (printArea.sizes || []).map(i => ({ ...groupItemToOption(i), sides: [printArea.side] }))
85
+ suboptions: [
86
+ { ...groupItemToOption(printArea), sides: [printArea.side] },
87
+ ...(printArea.sizes || []).map(i => ({ ...groupItemToOption(i), sides: [printArea.side] }))
88
+ ]
84
89
  }));
85
90
  }
86
91
  }
@@ -100,7 +100,7 @@ export default {
100
100
  },
101
101
  methods: {
102
102
  handleClick() {
103
- if (this.option.suboptions && this.option.suboptions.length) {
103
+ if (this.option.suboptions && this.option.suboptions.length > 1) {
104
104
  this.showOptions = !this.showOptions;
105
105
  } else {
106
106
  this.$emit('select', this.option);
@@ -108,7 +108,7 @@ export default {
108
108
  },
109
109
  selectSuboption(option) {
110
110
  this.closeSuboptions();
111
- this.$emit('select', { ...option, printArea: { ...option.printArea, _id: this.option.printArea._id } });
111
+ this.$emit('select', option);
112
112
  },
113
113
  calcPrintPrice(option) {
114
114
  const amount = this.usedSimpleProducts.reduce((amount, product) => product.amount + amount, 0);
@@ -6,14 +6,20 @@
6
6
  &__header {
7
7
  display: flex;
8
8
  align-items: center;
9
+ margin-top: 5px;
10
+ &-logo {
11
+ img {
12
+ max-width: 75px;
13
+ max-height: 55px;
14
+ }
15
+ }
9
16
  &-info {
10
- margin-left: 19px;
17
+ margin-left: 10px;
11
18
  flex-grow: 1;
12
19
  }
13
20
  &-row {
14
21
  display: flex;
15
22
  align-items: center;
16
- justify-content: space-between;
17
23
  & + & {
18
24
  margin-top: 5px;
19
25
  }
@@ -1,14 +1,16 @@
1
1
  <template>
2
2
  <div class="EditorProductDetails__wrapper">
3
+ <h3 class="lc_h3 lc_black">
4
+ {{ product.name }}
5
+ </h3>
3
6
  <div class="EditorProductDetails__header">
4
- <div class="EditorProductDetails__header-logo">
7
+ <div
8
+ v-if="product.brand.logo"
9
+ class="EditorProductDetails__header-logo">
5
10
  <img :src="product.brand.logo | staticLink" />
6
11
  </div>
7
12
  <div class="EditorProductDetails__header-info">
8
13
  <div class="EditorProductDetails__header-row">
9
- <h3 class="lc_h3 lc_black">
10
- {{ product.name }}
11
- </h3>
12
14
  <span
13
15
  v-if="defaultSimpleProduct && defaultSimpleProduct.pricing[0]"
14
16
  class="lc_regular16 lc_grey1">
@@ -27,18 +29,7 @@
27
29
  </template>
28
30
  </v-popover>
29
31
  </span>
30
- </div>
31
- <div class="EditorProductDetails__header-row">
32
- <span class="EditorProductDetails__product-link">
33
- SKU:
34
- <a
35
- :href="productLink"
36
- target="_blank">
37
- {{ product.SKU }}
38
- <i class="icon-blank"></i>
39
- </a>
40
- </span>
41
- <span class="lc_regular16 lc_grey1">
32
+ <span class="lc_regular16 lc_grey1 ml-6">
42
33
  +
43
34
  <v-popover
44
35
  ref="popover"
@@ -59,6 +50,17 @@
59
50
  </v-popover>
60
51
  </span>
61
52
  </div>
53
+ <div class="EditorProductDetails__header-row">
54
+ <span class="EditorProductDetails__product-link">
55
+ SKU:
56
+ <a
57
+ :href="productLink"
58
+ target="_blank">
59
+ {{ product.SKU }}
60
+ <i class="icon-blank"></i>
61
+ </a>
62
+ </span>
63
+ </div>
62
64
  </div>
63
65
  </div>
64
66
  <div
@@ -69,13 +71,10 @@
69
71
  <fragment
70
72
  v-if="productDetailsLoaded && productAvailableInCurrentCountry">
71
73
  <div class="EditorProductDetails__section">
72
- <product-colors-selector />
73
- </div>
74
- <div class="EditorProductDetails__section">
75
- <editor-pricing />
74
+ <product-colors-selector :has-another-print-btn="false" />
76
75
  </div>
77
76
  <div class="EditorProductDetails__section">
78
- <product-size-selector />
77
+ <editor-pricing :has-cart-btn="false" />
79
78
  </div>
80
79
  </fragment>
81
80
  </div>
@@ -83,9 +82,8 @@
83
82
 
84
83
  <script>
85
84
  import { mapGetters } from 'vuex';
86
- import ProductColorsSelector from '@lancom/shared/components/product/layouts/product_colors_selector/product-colors-selector';
87
- import ProductSizeSelector from '@lancom/shared/components/product/product_size_selector/product-size-selector';
88
- import EditorPricing from '@lancom/shared/components/editor/editor_pricing/editor-pricing';
85
+ import ProductColorsSelector from '@lancom/shared/components/product/product_colors_selector/product-colors-selector';
86
+ import EditorPricing from '@lancom/shared/components/product/editor_pricing/editor-pricing';
89
87
  import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
90
88
  import modals from '@lancom/shared/mixins/modals';
91
89
  import { staticLink, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
@@ -96,7 +94,6 @@ export default {
96
94
  name: 'EditorProductDetails',
97
95
  components: {
98
96
  ProductColorsSelector,
99
- ProductSizeSelector,
100
97
  PricingDiscountsTable,
101
98
  EditorPricing,
102
99
  PricingTable
@@ -17,13 +17,14 @@
17
17
  </div>
18
18
  <editor-pricing
19
19
  v-if="hasPricing"
20
+ :has-cart-btn="false"
20
21
  class="EditorWizard__pricing" />
21
22
  </div>
22
23
  </template>
23
24
 
24
25
  <script>
25
26
  import { mapGetters, mapMutations } from 'vuex';
26
- import EditorPricing from '@lancom/shared/components/editor/editor_pricing/editor-pricing';
27
+ import EditorPricing from '@lancom/shared/components/product/editor_pricing/editor-pricing';
27
28
  import Wizard from '@lancom/shared/components/product/wizard/wizard';
28
29
 
29
30
  export default {