@ecomplus/storefront-components 1.0.0-beta.189 → 1.0.0-beta.190
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.
- package/CHANGELOG.md +11 -0
- package/dist/1.storefront-components.min.js.map +1 -1
- package/dist/2.storefront-components.min.js.map +1 -1
- package/dist/3.storefront-components.min.js.map +1 -1
- package/dist/storefront-components.min.js +6 -6
- package/dist/storefront-components.min.js.map +1 -1
- package/package.json +1 -1
- package/src/html/ProductCard.html +13 -1
- package/src/js/ProductCard.js +19 -1
- package/src/js/ShippingLine.js +12 -3
package/package.json
CHANGED
|
@@ -21,7 +21,19 @@
|
|
|
21
21
|
<i class="i-arrow-down"></i> <b>{{ discount }}</b>%
|
|
22
22
|
</span>
|
|
23
23
|
</slot>
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
<slot name="stamps">
|
|
26
|
+
<div v-if="validStamps.length" class="product-card__stamps">
|
|
27
|
+
<span
|
|
28
|
+
v-for="(stamp, i) in validStamps"
|
|
29
|
+
:key="`s-${i}`"
|
|
30
|
+
:class="'product-card__stamps-' +
|
|
31
|
+
+ `${(stamp.id || '').toLowerCase().replace(/\s/g, '-')}`"
|
|
32
|
+
>
|
|
33
|
+
<img :src="stamp.img" :alt="stamp.id">
|
|
34
|
+
</span>
|
|
35
|
+
</div>
|
|
36
|
+
</slot>
|
|
25
37
|
|
|
26
38
|
<slot name="body">
|
|
27
39
|
<a-link
|
package/src/js/ProductCard.js
CHANGED
|
@@ -74,7 +74,13 @@ export default {
|
|
|
74
74
|
},
|
|
75
75
|
isLoaded: Boolean,
|
|
76
76
|
installmentsOption: Object,
|
|
77
|
-
discountOption: Object
|
|
77
|
+
discountOption: Object,
|
|
78
|
+
stamps: {
|
|
79
|
+
type: Array,
|
|
80
|
+
default () {
|
|
81
|
+
return window.productCardStamps || []
|
|
82
|
+
}
|
|
83
|
+
}
|
|
78
84
|
},
|
|
79
85
|
|
|
80
86
|
data () {
|
|
@@ -137,6 +143,18 @@ export default {
|
|
|
137
143
|
return checkOnPromotion(body)
|
|
138
144
|
? Math.round(((body.base_price - getPrice(body)) * 100) / body.base_price)
|
|
139
145
|
: 0
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
validStamps () {
|
|
149
|
+
if (!Array.isArray(this.stamps)) return []
|
|
150
|
+
return this.stamps.filter((stamp) => {
|
|
151
|
+
if (stamp && stamp.img) {
|
|
152
|
+
if (Array.isArray(stamp.skus) && stamp.skus.length) {
|
|
153
|
+
return stamp.skus.includes(this.body.sku)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return false
|
|
157
|
+
})
|
|
140
158
|
}
|
|
141
159
|
},
|
|
142
160
|
|
package/src/js/ShippingLine.js
CHANGED
|
@@ -35,6 +35,11 @@ export default {
|
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
computed: {
|
|
38
|
+
i19workingDay: () => i18n({
|
|
39
|
+
en_us: 'Working day',
|
|
40
|
+
pt_br: 'Dia útil'
|
|
41
|
+
}),
|
|
42
|
+
|
|
38
43
|
deadlineStr () {
|
|
39
44
|
const shipping = this.shippingLine
|
|
40
45
|
const isWorkingDays = (shipping.posting_deadline && shipping.posting_deadline.working_days) ||
|
|
@@ -56,9 +61,13 @@ export default {
|
|
|
56
61
|
return `${i18n(i19upTo)} ${days} ` +
|
|
57
62
|
i18n(isWorkingDays ? i19workingDays : i19days).toLowerCase()
|
|
58
63
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
if (days === 1) {
|
|
65
|
+
if (isWorkingDays) {
|
|
66
|
+
return `${i18n(i19upTo)} 1 ` + i18n(this.i19workingDay).toLowerCase()
|
|
67
|
+
}
|
|
68
|
+
return i19untilTomorrow
|
|
69
|
+
}
|
|
70
|
+
return shipping.pick_up ? i19pickUpToday : i19receiveToday
|
|
62
71
|
},
|
|
63
72
|
|
|
64
73
|
freightValueStr () {
|