@lancom/shared 0.0.105 → 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 (103) hide show
  1. package/assets/js/models/print-area.js +8 -6
  2. package/assets/js/models/product-layers.js +3 -3
  3. package/assets/js/utils/fabric-helper.js +2 -4
  4. package/assets/js/utils/filters.js +7 -1
  5. package/assets/js/utils/prints.js +15 -4
  6. package/assets/js/utils/product.js +4 -4
  7. package/assets/scss/ui_kit/_table.scss +3 -0
  8. package/assets/scss/ui_kit/_typography.scss +6 -0
  9. package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
  10. package/components/common/color-picker.vue +6 -1
  11. package/components/common/file_uploader.vue +1 -1
  12. package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
  13. package/components/common/pricing_table/pricing-table.scss +1 -3
  14. package/components/common/pricing_table/pricing-table.vue +13 -4
  15. package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
  16. package/components/common/range/range.scss +23 -0
  17. package/components/common/range/range.vue +19 -0
  18. package/components/editor/editor.vue +3 -2
  19. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
  20. package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +1 -0
  21. package/components/editor/editor_pricing/editor-pricing.vue +3 -123
  22. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  23. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  24. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  25. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
  26. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  27. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
  28. package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
  29. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
  30. package/components/editor/editor_product_details/editor-product-details.scss +1 -1
  31. package/components/editor/editor_product_details/editor-product-details.vue +22 -10
  32. package/components/editor/editor_workspace/editor-workspace.vue +10 -5
  33. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +8 -5
  34. package/components/modals/cart_modal/cart-modal.vue +1 -1
  35. package/components/modals/order_modal/order-modal.vue +5 -7
  36. package/components/modals/payment_modal/payment-modal.vue +1 -1
  37. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
  38. package/components/pricing/pricing_example/pricing-example.scss +4 -1
  39. package/components/pricing/pricing_example/pricing-example.vue +106 -26
  40. package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
  41. package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
  42. package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
  43. package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
  44. package/components/pricing/pricing_print/pricing-print.scss +1 -1
  45. package/components/pricing/pricing_print/pricing-print.vue +19 -7
  46. package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
  47. package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
  48. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
  49. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
  50. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
  51. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
  52. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
  53. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
  54. package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
  55. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
  56. package/components/product/gallery/gallery.scss +168 -0
  57. package/components/product/gallery/gallery.vue +252 -0
  58. package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
  59. package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
  60. package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
  61. package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
  62. package/components/product/product.vue +16 -5
  63. package/components/product/product_price_range/product-price-range.vue +20 -4
  64. package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
  65. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
  66. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
  67. package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
  68. package/components/product/related_products/related-products.scss +34 -0
  69. package/components/product/related_products/related-products.vue +52 -0
  70. package/components/products/product_list/product-list.scss +2 -1
  71. package/components/products/product_list_product/product-list-product.scss +44 -20
  72. package/components/products/product_list_product/product-list-product.vue +6 -4
  73. package/components/products/products_aside/products-aside.vue +29 -4
  74. package/components/products/products_brands/products-brands.vue +9 -2
  75. package/components/products/products_filters/products-filters.vue +10 -0
  76. package/components/products/products_tags/products-tags.vue +7 -0
  77. package/components/products/products_types/products-types.vue +6 -1
  78. package/mixins/product-preview.js +1 -1
  79. package/package.json +1 -1
  80. package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
  81. package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
  82. package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
  83. package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
  84. package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
  85. package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
  86. package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
  87. package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
  88. package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
  89. package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
  90. package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
  91. package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
  92. package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
  93. package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
  94. package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
  95. package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
  96. package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
  97. package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
  98. package/store/index.js +3 -1
  99. package/store/product.js +25 -14
  100. package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
  101. package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
  102. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
  103. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
@@ -1,6 +1,9 @@
1
1
  <template>
2
2
  <div class="ProductSizesInfo__wrapper">
3
- <table class="ProductSizeInfo__table lc_table striped">
3
+ <table
4
+ v-if="sizesTable.length > 0"
5
+ class="ProductSizeInfo__table lc_table"
6
+ :class="{ striped }">
4
7
  <thead class="centered">
5
8
  <tr class="ProductSizeInfo__main-info">
6
9
  <th>
@@ -34,7 +37,7 @@
34
37
  </tr>
35
38
  <tr>
36
39
  <td
37
- :colspan="product.sizes.length + 1"
40
+ :colspan="colspan"
38
41
  class="ProductSizeInfo__sub-info-wrapper">
39
42
  <div class="ProductSizeInfo__sub-info">
40
43
  <div class="ProductSizeInfo__sub-info-item">
@@ -46,6 +49,7 @@
46
49
  </div>
47
50
  </td>
48
51
  </tr>
52
+ <slot name="footer" v-bind="{ colspan }"></slot>
49
53
  </tbody>
50
54
  </table>
51
55
  </div>
@@ -60,9 +64,16 @@ export default {
60
64
  product: {
61
65
  type: Object,
62
66
  required: true
67
+ },
68
+ striped: {
69
+ type: Boolean,
70
+ default: true
63
71
  }
64
72
  },
65
73
  computed: {
74
+ colspan() {
75
+ return this.product.sizes.length + 1;
76
+ },
66
77
  sizesFields() {
67
78
  return getSizesFields(this.product.sizes);
68
79
  },
@@ -0,0 +1,34 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .RelatedProducts {
4
+ &__products {
5
+ display: flex;
6
+ margin: -32px 0 0 -32px;
7
+ width: calc(100% + 32px);
8
+ }
9
+ &__product {
10
+ margin: 32px 0 0 32px;
11
+ }
12
+ }
13
+ ::v-deep {
14
+ @media (max-width: $bp-large-max) {
15
+ .ProductList__item-wrapper:nth-child(6) {
16
+ display: none;
17
+ }
18
+ }
19
+ @media (max-width: $bp-medium-max) {
20
+ .ProductList__item-wrapper:nth-child(5) {
21
+ display: none;
22
+ }
23
+ }
24
+ @media (max-width: $bp-small-max) {
25
+ .ProductList__item-wrapper:nth-child(4) {
26
+ display: none;
27
+ }
28
+ }
29
+ @media (max-width: $bp-extra-small-max) {
30
+ .ProductList__item-wrapper:nth-child(3) {
31
+ display: none;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <div
3
+ v-if="hasProducts"
4
+ class="RelatedProducts__wrapper">
5
+ <div class="RelatedProducts__title lc_h2">
6
+ Related Products
7
+ </div>
8
+ <product-list :products="products" />
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ import { mapGetters } from 'vuex';
14
+ import api from '@lancom/shared/assets/js/api';
15
+ import ProductList from '@/components/products/product_list/product-list';
16
+
17
+ export default {
18
+ name: 'RelatedProducts',
19
+ components: {
20
+ ProductList
21
+ },
22
+ props: {
23
+ product: {
24
+ type: Object,
25
+ required: true
26
+ },
27
+ toEditor: {
28
+ type: Boolean,
29
+ default: true
30
+ }
31
+ },
32
+ data() {
33
+ return {
34
+ products: []
35
+ };
36
+ },
37
+ computed: {
38
+ ...mapGetters(['shop']),
39
+ hasProducts() {
40
+ return this.products.length > 0;
41
+ }
42
+ },
43
+ async mounted() {
44
+ const { products } = await api.fetchRelatedProducts(this.shop._id, this.product.alias);
45
+ this.products = products;
46
+ }
47
+ };
48
+ </script>
49
+
50
+ <style lang="scss" scoped>
51
+ @import 'related-products';
52
+ </style>
@@ -4,12 +4,13 @@
4
4
  &__wrapper {
5
5
  display: flex;
6
6
  flex-wrap: wrap;
7
+ margin-top: 20px;
7
8
  @media (max-width: $bp-small-max) {
8
9
  justify-content: center;
9
10
  }
10
11
  }
11
12
  &__item-wrapper {
12
- width: 340px;
13
+ width: 330px;
13
14
  height: 450px;
14
15
  margin: 0 0 25px 25px;
15
16
  position: relative;
@@ -36,39 +36,63 @@
36
36
  border: 2px solid $grey_1;
37
37
  }
38
38
  }
39
+ &__cover {
40
+ transition: opacity 0.35s ease-in-out;
41
+ opacity: 1;
42
+ position: absolute;
43
+ top: 30px;
44
+ }
45
+ &__cover-hover {
46
+ transition: opacity 0.45s ease-in-out;
47
+ z-index: 2;
48
+ opacity: 0;
49
+ position: absolute;
50
+ top: 30px;
51
+ }
39
52
  &__link {
40
53
  position: relative;
41
- display: block;
42
54
  transition: background-color 0.5s ease;
43
55
  background-color: white;
44
- height: 340px;
56
+ height: 330px;
45
57
  width: 340px;
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: center;
61
+ overflow: hidden;
62
+ &:hover {
63
+ .ProductListProduct {
64
+ &__cover {
65
+ opacity: 0;
66
+ }
67
+ &__cover-hover {
68
+ opacity: 1;
69
+ }
70
+ }
71
+ }
46
72
  }
47
73
  &__brand {
48
74
  width: 54px;
49
75
  top: 10px;
50
76
  left: 5px;
51
77
  position: absolute;
52
- z-index: 2;
78
+ z-index: 10;
53
79
  opacity: 0.7;
54
80
  }
55
- &__cover {
56
- width: 100%;
57
- object-fit: contain;
58
- position: relative;
59
- z-index: 1;
60
- }
61
- &__cover-hover {
62
- top: 0;
63
- left: 0;
64
- position: absolute;
65
- z-index: 1;
66
- display: none;
67
- width: 100%;
68
- &--visible {
69
- display: block;
70
- }
71
- }
81
+ // &__cover {
82
+ // object-fit: contain;
83
+ // position: relative;
84
+ // z-index: 1;
85
+ // }
86
+ // &__cover-hover {
87
+ // top: 0;
88
+ // left: 0;
89
+ // position: absolute;
90
+ // z-index: 1;
91
+ // display: none;
92
+ // &--visible {
93
+ // display: block;
94
+ // }
95
+ // }
72
96
  &__cover-color {
73
97
  top: 5px;
74
98
  left: 5px;
@@ -15,6 +15,7 @@
15
15
  v-if="productСover"
16
16
  class="ProductListProduct__cover"
17
17
  :src="productСover"
18
+ :style="productBackgroundСover"
18
19
  @load="productСoverLoaded = true" />
19
20
  <img
20
21
  v-if="productСoverLoaded && productСoverHover"
@@ -22,13 +23,14 @@
22
23
  :class="{
23
24
  'ProductListProduct__cover-hover--visible': full
24
25
  }"
26
+ :style="productBackgroundСover"
25
27
  :src="productСoverHover" />
26
- <div
28
+ <!-- <div
27
29
  class="ProductListProduct__cover-color"
28
30
  :class="{
29
31
  'ProductListProduct__cover-color--visible': productСoverLoaded
30
32
  }"
31
- :style="productBackgroundСover"></div>
33
+ :style="productBackgroundСover"></div> -->
32
34
  <img
33
35
  v-if="product.isTearAwayTag"
34
36
  class="ProductListProduct__tear-away-tag"
@@ -71,7 +73,7 @@
71
73
  <div
72
74
  v-if="full"
73
75
  class="ProductListProduct__info-item mt-9 lc_caption visible-full">
74
- {{ product.material }} | {{ product.weight }} gsm
76
+ {{ product.fabricInfoShort }} | {{ product.materialWeight }} gsm
75
77
  </div>
76
78
  <div
77
79
  v-if="full"
@@ -81,7 +83,7 @@
81
83
  :key="color._id"
82
84
  class="ProductListProduct__color"
83
85
  :class="{
84
- 'ProductListProduct__color--selected': color._id === currentColor._id
86
+ 'ProductListProduct__color--selected': currentColor && color._id === currentColor._id
85
87
  }"
86
88
  @click="currentColor = color">
87
89
  <product-color-image
@@ -11,9 +11,17 @@
11
11
  <span class="ProductsAside__info ProductsAside__info--small2"></span>
12
12
  </div>
13
13
  <div v-else>
14
+ <div
15
+ v-if="hasProductTypes"
16
+ class="ProductsAside__item">
17
+ <products-types
18
+ :has-selected-icon="hasSelectedIcon"
19
+ :selected-icon-circle="selectedIconCircle" />
20
+ </div>
14
21
  <div class="ProductsAside__item">
15
22
  <products-brands
16
- :has-selected-icon="hasSelectedIcon" />
23
+ :has-selected-icon="hasSelectedIcon"
24
+ :selected-icon-circle="selectedIconCircle" />
17
25
  </div>
18
26
  <div class="ProductsAside__item">
19
27
  <products-colors />
@@ -22,14 +30,15 @@
22
30
  <products-attributes
23
31
  :has-selected-icon="hasSelectedIcon" />
24
32
  <products-tags
25
- :has-selected-icon="hasSelectedIcon" />
33
+ :has-selected-icon="haAttributesSelectedIcon"
34
+ :has-remove-icon="hasRemoveIcon" />
26
35
  </div>
27
36
  </div>
28
37
  </div>
29
38
  </template>
30
39
 
31
40
  <script>
32
- // import ProductsTypes from '@lancom/shared/components/products/products_types/products-types';
41
+ import ProductsTypes from '@lancom/shared/components/products/products_types/products-types';
33
42
  import { mapGetters } from 'vuex';
34
43
  import ProductsBrands from '@lancom/shared/components/products/products_brands/products-brands';
35
44
  import ProductsTags from '@lancom/shared/components/products/products_tags/products-tags';
@@ -40,7 +49,7 @@ import { generateProductsLink } from '@lancom/shared/assets/js/utils/product';
40
49
  export default {
41
50
  name: 'ProductsAside',
42
51
  components: {
43
- // ProductsTypes,
52
+ ProductsTypes,
44
53
  ProductsBrands,
45
54
  ProductsTags,
46
55
  ProductsAttributes,
@@ -51,9 +60,25 @@ export default {
51
60
  type: Boolean,
52
61
  default: false
53
62
  },
63
+ hasRemoveIcon: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ selectedIconCircle: {
68
+ type: Boolean,
69
+ default: true
70
+ },
71
+ haAttributesSelectedIcon: {
72
+ type: Boolean,
73
+ default: false
74
+ },
54
75
  hasThumbs: {
55
76
  type: Boolean,
56
77
  default: true
78
+ },
79
+ hasProductTypes: {
80
+ type: Boolean,
81
+ default: false
57
82
  }
58
83
  },
59
84
  data() {
@@ -10,10 +10,13 @@
10
10
  :class="{
11
11
  'ProductsBrands__item--active': brand.alias === currentBrand
12
12
  }">
13
- <products-link :brand="brand.alias === currentBrand ? null : brand.alias">
13
+ <products-link
14
+ class="ProductsBrands__more"
15
+ :brand="brand.alias === currentBrand ? null : brand.alias">
14
16
  <checked-icon
15
17
  v-if="hasSelectedIcon"
16
- :checked="brand.alias === currentBrand" />
18
+ :checked="brand.alias === currentBrand"
19
+ :circle="selectedIconCircle" />
17
20
  {{ brand.name }}
18
21
  </products-link>
19
22
  </div>
@@ -38,6 +41,10 @@ export default {
38
41
  hasSelectedIcon: {
39
42
  type: Boolean,
40
43
  default: false
44
+ },
45
+ selectedIconCircle: {
46
+ type: Boolean,
47
+ default: false
41
48
  }
42
49
  },
43
50
  computed: {
@@ -11,6 +11,16 @@
11
11
  class="labelless">
12
12
  </multiselect>
13
13
  </div>
14
+ <div class="ProductsFilters__search hidden-sm-and-down">
15
+ <input
16
+ v-model="search"
17
+ name="search"
18
+ placeholder="Search"
19
+ type="text"
20
+ class="form-field no-label tiny-placeholder labelless"
21
+ @change="goToTextSearch" />
22
+ <i class="icon-search"></i>
23
+ </div>
14
24
  <div
15
25
  class="ProductsFilters__filter hidden-md-and-up"
16
26
  :class="{
@@ -15,6 +15,9 @@
15
15
  }">
16
16
  <products-link :tags="tag.alias">
17
17
  {{ tag.name }}
18
+ <i
19
+ v-if="hasRemoveIcon && selectedTags.includes(tag.alias)"
20
+ class="icon-cancel"></i>
18
21
  </products-link>
19
22
  </div>
20
23
  </div>
@@ -34,6 +37,10 @@ export default {
34
37
  hasSelectedIcon: {
35
38
  type: Boolean,
36
39
  default: false
40
+ },
41
+ hasRemoveIcon: {
42
+ type: Boolean,
43
+ default: false
37
44
  }
38
45
  },
39
46
  computed: {
@@ -13,7 +13,8 @@
13
13
  class="ProductsTypes__more">
14
14
  <checked-icon
15
15
  v-if="hasSelectedIcon"
16
- :checked="type.alias === currentType" />
16
+ :checked="type.alias === currentType"
17
+ :circle="selectedIconCircle" />
17
18
  <div
18
19
  v-if="hasThumbs && type.icon"
19
20
  class="ProductsTypes__item-icon"
@@ -46,6 +47,10 @@ export default {
46
47
  type: Boolean,
47
48
  default: false
48
49
  },
50
+ selectedIconCircle: {
51
+ type: Boolean,
52
+ default: false
53
+ },
49
54
  hasThumbs: {
50
55
  type: Boolean,
51
56
  default: true
@@ -67,7 +67,7 @@ const productPreview = {
67
67
  return getBgStyle(this.productСoverHover);
68
68
  },
69
69
  productBackgroundСover() {
70
- return getColorBackgroundStyle(this.currentColor);
70
+ return this.productСoverLoaded ? getColorBackgroundStyle(this.currentColor) : null;
71
71
  },
72
72
  productBrand() {
73
73
  const { brand } = this.product;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.105",
3
+ "version": "0.0.106",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/index.js CHANGED
@@ -25,6 +25,7 @@ export const getters = {
25
25
  pricingSettings: ({ pricing }) => pricing || {},
26
26
  orderSettings: ({ orderInfo }) => orderInfo || {},
27
27
  gstTax: ({ pricing }) => pricing?.gstTax || 0,
28
+ displayPricingWithTax: ({ pricing }) => !!pricing?.displayPricingWithTax,
28
29
  screenPrintsPrices: ({ pricing }) => pricing?.screenPrintsPrices || {},
29
30
  depositInfo: ({ depositInfo }) => depositInfo || {}
30
31
  };
@@ -46,13 +47,14 @@ export const actions = {
46
47
  }
47
48
  } catch (e) {}
48
49
  },
49
- async loadState({ commit, state: { shop, notificationBar } }) {
50
+ async loadState({ dispatch, commit, state: { shop, notificationBar } }) {
50
51
  const state = await loadState();
51
52
  if (state) {
52
53
  commit('setState', state);
53
54
  if (state.cart?.id) {
54
55
  const cart = await api.fetchCartById(shop._id, state.cart?.id);
55
56
  commit('cart/setCart', cart);
57
+ dispatch('cart/calculateCartPrice', { shop });
56
58
  }
57
59
  }
58
60
  const closedNotification = localStorage.getItem(CLOSED_NOTIFICATION);
package/store/product.js CHANGED
@@ -5,7 +5,7 @@ import { getLayerModel } from '@lancom/shared/assets/js/models/product-layers';
5
5
  import { getPrintAreaByName, getProductPrintsAreasPrices } from '@lancom/shared/assets/js/models/print-area';
6
6
  import { sortSizes } from '@lancom/shared/assets/js/utils/sizes';
7
7
  import { isValidImageTypes, getColorOfDefaultCatalogFrontImage } from '@lancom/shared/assets/js/utils/colors';
8
- import { getProductsForCalculatePricing } from '../assets/js/utils/product';
8
+ import { getProductsForCalculatePricing } from '@lancom/shared/assets/js/utils/product';
9
9
  import { sortByName } from '../assets/js/utils/filters';
10
10
 
11
11
  export const state = () => ({
@@ -36,7 +36,8 @@ export const state = () => ({
36
36
  selectedPrintAreas: {},
37
37
  productPricing: null,
38
38
  selectedTab: null,
39
- layersUpdatesCount: 0
39
+ layersUpdatesCount: 0,
40
+ editableSide: { id: 'front' }
40
41
  });
41
42
 
42
43
  export const getters = {
@@ -72,7 +73,7 @@ export const getters = {
72
73
  editableLayers: ({ template, editableColor, editablePrintArea }) => template.layers
73
74
  .filter(({ printArea }) => (
74
75
  // colorId === editableColor._id &&
75
- printArea === editablePrintArea.id
76
+ printArea === editablePrintArea?._id
76
77
  )),
77
78
  selectedLayer: ({ selectedLayer }) => selectedLayer,
78
79
  editModeSelectedLayer: ({ editModeSelectedLayer }) => editModeSelectedLayer,
@@ -90,10 +91,9 @@ export const getters = {
90
91
  },
91
92
  selectedTab: ({ selectedTab }) => selectedTab,
92
93
  layersUpdatesCount: ({ layersUpdatesCount }) => layersUpdatesCount,
93
- printArea: ({ editablePrintArea, selectedPrintAreas, editorSize: { width, height }, product }) => {
94
- const selectedPrintArea = (!!editablePrintArea && selectedPrintAreas[editablePrintArea._id]);
94
+ printArea: ({ editablePrintArea, editorSize: { width, height }, product }) => {
95
95
  return getPrintAreaByName({
96
- name: selectedPrintArea,
96
+ printArea: editablePrintArea?._id,
97
97
  editorWidth: width,
98
98
  editorHeight: height
99
99
  }, product);
@@ -122,16 +122,24 @@ export const getters = {
122
122
  imagesGroups.set(i.color, [...(imagesGroups.get(i.color) || []), i]);
123
123
  });
124
124
  return [...imagesGroups.values()].reduce((images, group) => [...images, ...group], []);
125
- }
125
+ },
126
+ editableSide: ({ editableSide }) => editableSide,
127
+ hasUnprintedPrice: ({ product }) => product.minUnprintedPrice || product.maxUnprintedPrice
126
128
  };
127
129
 
128
130
  export const actions = {
129
131
  async fetchProduct({ commit }, { shop, slug, print }) {
130
132
  try {
131
133
  commit('setLoadError', null);
132
- const response = await api.fetchProduct(shop, slug);
133
- commit('setProduct', response);
134
- commit('setPreSetPrint', (response.prints || []).find(({ _id }) => _id === print));
134
+ const product = await api.fetchProduct(shop, slug);
135
+ commit('setProduct', product);
136
+ commit('setPreSetPrint', (product.prints || []).find(({ _id }) => _id === print));
137
+
138
+ const [first] = (product.printAreas || []);
139
+ if (first) {
140
+ commit('setEditablePrintArea', first);
141
+ commit('setSelectedPrintArea', { printArea: first._id, size: first.printSize.alias });
142
+ }
135
143
  } catch (e) {
136
144
  const { status, data } = e?.response || {};
137
145
  const statusCode = status || 500;
@@ -179,7 +187,7 @@ export const actions = {
179
187
  const { selectedPrintArea } = getters;
180
188
  const layer = await getLayerModel({
181
189
  type,
182
- colorId: editableColor._id,
190
+ colorId: editableColor?._id,
183
191
  top,
184
192
  left,
185
193
  isEditMode,
@@ -187,9 +195,9 @@ export const actions = {
187
195
  originalSize: size,
188
196
  properties: {
189
197
  ...(properties || {}),
190
- printArea: editablePrintArea._id,
191
- printSize: selectedPrintArea._id,
192
- printType: selectedPrintType._id
198
+ printArea: editablePrintArea?._id,
199
+ printSize: selectedPrintArea?._id,
200
+ printType: selectedPrintType?._id
193
201
  }
194
202
  });
195
203
  if (preselect) {
@@ -383,6 +391,9 @@ export const mutations = {
383
391
  },
384
392
  setPreSetPrint(state, preSetPrint) {
385
393
  state.preSetPrint = preSetPrint;
394
+ },
395
+ setEditableSide(state, side) {
396
+ state.editableSide = side;
386
397
  }
387
398
  };
388
399
 
@@ -1,8 +0,0 @@
1
- @import "@/assets/scss/variables";
2
-
3
- .DiscountsTable {
4
- &__info {
5
- color: $green;
6
- cursor: pointer;
7
- }
8
- }