@lancom/shared 0.0.65 → 0.0.66

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.
@@ -1,5 +1,8 @@
1
1
  @import "@/assets/scss/variables";
2
2
  .lc {
3
+ &_bold {
4
+ font-weight: 800 !important;
5
+ }
3
6
  &_capitalize {
4
7
  text-transform: capitalize;
5
8
  }
@@ -190,7 +193,12 @@
190
193
  font-size: 10px;
191
194
  line-height: 110%;
192
195
  }
193
-
196
+ &_regular11 {
197
+ font-style: normal;
198
+ font-weight: normal;
199
+ font-size: 11px;
200
+ line-height: 110%;
201
+ }
194
202
  &_regular12 {
195
203
  font-style: normal;
196
204
  font-weight: normal;
@@ -5,7 +5,7 @@
5
5
  :key="color._id"
6
6
  v-tooltip="color.name"
7
7
  class="ProductColorsSelectorOptions__color"
8
- :class="{ selected: templateColors.includes(color._id) }"
8
+ :class="{ selected: editableColor === color }"
9
9
  @click="toggleSelection(color)">
10
10
  <product-color-image
11
11
  :color="color"
@@ -4,29 +4,51 @@
4
4
  <div
5
5
  v-if="product[minPriceAttr] === product[maxPriceAttr]"
6
6
  class="ProductPriceRange__price lc_h4">
7
- {{ prePriceText }} {{ product[minPriceAttr] | price }}
7
+ <div
8
+ v-if="withGst"
9
+ class="lc_h4">
10
+ {{ product[minPriceAttr] | tax(gstTax) | price }}
11
+ <span class="lc_regular11 lc_bold">inc. GST</span>
12
+ </div>
13
+ <div :class="withGst ? 'lc_regular11' : 'lc_h4'">
14
+ {{ prePriceText }} {{ product[minPriceAttr] | price }} + GST
15
+ </div>
8
16
  </div>
9
17
  <div
10
18
  v-else
11
- class="ProductPriceRange__price lc_h4">
12
- {{ prePriceText }} {{ product[minPriceAttr] | price }} {{ rangeDivider }} {{ product[maxPriceAttr] | price }}
19
+ class="ProductPriceRange__price">
20
+ <div
21
+ v-if="withGst"
22
+ class="lc_h4">
23
+ {{ product[minPriceAttr] | tax(gstTax) | price }} {{ rangeDivider }} {{ product[maxPriceAttr] | tax(gstTax) | price }}
24
+ <span class="lc_regular11 lc_bold"> inc. GST</span>
25
+ </div>
26
+ <div :class="withGst ? 'lc_regular11' : 'lc_h4'">
27
+ {{ prePriceText }} {{ product[minPriceAttr] | price }} {{ rangeDivider }} {{ product[maxPriceAttr] | price }} + GST
28
+ </div>
13
29
  </div>
14
30
  </div>
15
31
  </template>
16
32
 
17
33
  <script>
18
- import { price } from '@lancom/shared/assets/js/utils/filters';
34
+ import { mapGetters } from 'vuex';
35
+ import { price, tax } from '@lancom/shared/assets/js/utils/filters';
19
36
 
20
37
  export default {
21
38
  name: 'ProductPriceRange',
22
39
  filters: {
23
- price
40
+ price,
41
+ tax
24
42
  },
25
43
  props: {
26
44
  product: {
27
45
  type: Object,
28
46
  required: true
29
47
  },
48
+ withGst: {
49
+ type: Object,
50
+ required: true
51
+ },
30
52
  minPriceAttr: {
31
53
  type: String,
32
54
  default: 'minPrice'
@@ -43,6 +65,11 @@ export default {
43
65
  type: String,
44
66
  default: '-'
45
67
  }
68
+ },
69
+ computed: {
70
+ ...mapGetters([
71
+ 'gstTax'
72
+ ])
46
73
  }
47
74
  };
48
75
  </script>
package/nuxt.config.js CHANGED
@@ -86,8 +86,8 @@ module.exports = (config, axios) => ({
86
86
  item: data.map(item => {
87
87
  const spliceFirstImage = images => (images || []).splice(0, 1)[0];
88
88
  const getImages = images => (images || []).length > 0 ? images : null;
89
- const image = spliceFirstImage(item.colorImages) || spliceFirstImage(item.frontImages) || spliceFirstImage(item.backImages) || {};
90
- const images = getImages(item.colorImages) || getImages(item.frontImages) || getImages(item.backImages) || [];
89
+ const image = spliceFirstImage(item.frontImages) || spliceFirstImage(item.backImages) || {};
90
+ const images = getImages(item.backImages) || getImages(item.frontImages) || [];
91
91
  return {
92
92
  title: { _text: `${item.name} ${item.color}-${item.size}` },
93
93
  link: { _text: `https://${config.HOST_NAME}${item.link}` },
@@ -97,19 +97,20 @@ module.exports = (config, axios) => ({
97
97
  'g:size_system': 'AU',
98
98
  'g:size_type': 'regular',
99
99
  'g:gender': { _text: item.gender },
100
- 'g:material': { _text: item.naterial },
100
+ 'g:material': { _text: item.material },
101
101
  'g:brand': { _text: item.brand },
102
102
  'g:condition': { _text: item.condition },
103
103
  'g:mpn': { _text: item.mpn },
104
104
  'g:color': { _text: item.color },
105
- 'g:image_link': image.medium,
106
- 'g:additional_image_link': images.map(i => i.medium),
107
- // 'g:google_product_category': 'Business & Industrial>Work Safety Protective Equipment>High-Visibility Clothing',
108
- // 'g:product_type': 'WDP AU ROOT > Day Night Safety Vests',
109
- // 'g:availability': 'in stock',
110
- // 'g:price': '5.49AUD',
111
- // 'g:identifier_exists': true,
112
- // 'g:shipping_weight': { _text: item.weight }
105
+ 'g:image_link': { _text: image },
106
+ 'g:additional_image_link': images.map(i => ({ _text: i })),
107
+ 'g:price': { _text: `${(item.maxUnprintedPrice || 0).toFixed(2)}AUD` },
108
+ 'g:availability': { _text: item.availability },
109
+ 'g:google_product_category': { _text: 2047 },
110
+ 'g:product_type': { _text: item.productType },
111
+ 'g:is_bundle': { _text: item.bundle },
112
+ 'g:identifier_exists': 'no',
113
+ 'g:product_weight': { _text: item.weight }
113
114
  };
114
115
  })
115
116
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {