@ecomplus/storefront-components 1.0.0-beta.17 → 1.0.0-beta.171
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 +1224 -131
- package/README.md +9 -4
- package/all.js +3 -1
- package/dist/1.storefront-components.min.js +2 -0
- package/dist/1.storefront-components.min.js.map +1 -0
- package/dist/2.storefront-components.min.js +5 -0
- package/dist/2.storefront-components.min.js.map +1 -0
- package/dist/3.storefront-components.min.js +5 -0
- package/dist/3.storefront-components.min.js.map +1 -0
- package/dist/storefront-components.min.js +33 -12
- package/dist/storefront-components.min.js.map +1 -1
- package/package.json +19 -14
- package/src/APagination.vue +2 -0
- package/src/AShare.vue +2 -0
- package/src/AccountAddresses.vue +3 -0
- package/src/AccountForm.vue +3 -0
- package/src/AccountPoints.vue +3 -0
- package/src/BuyTogether.vue +3 -0
- package/src/EarnPointsProgress.vue +3 -0
- package/src/ItemCustomizations.vue +2 -0
- package/src/KitProductVariations.vue +3 -0
- package/src/PointsApplier.vue +2 -0
- package/src/ProductQuickview.vue +3 -0
- package/src/QuantitySelector.vue +3 -0
- package/src/RecommendedItems.vue +3 -0
- package/src/ShippingLine.vue +1 -0
- package/src/TheCart.vue +3 -0
- package/src/html/APagination.html +90 -0
- package/src/html/APrices.html +24 -4
- package/src/html/AShare.html +31 -0
- package/src/html/AccountAddresses.html +90 -0
- package/src/html/AccountForm.html +269 -0
- package/src/html/AccountPoints.html +39 -0
- package/src/html/AddressForm.html +9 -7
- package/src/html/BuyTogether.html +60 -0
- package/src/html/CartItem.html +86 -38
- package/src/html/CartQuickview.html +28 -5
- package/src/html/DiscountApplier.html +2 -2
- package/src/html/EarnPointsProgress.html +28 -0
- package/src/html/InputDate.html +1 -1
- package/src/html/InputDocNumber.html +1 -0
- package/src/html/InputPhone.html +1 -1
- package/src/html/InstantSearch.html +3 -3
- package/src/html/ItemCustomizations.html +14 -0
- package/src/html/KitProductVariations.html +92 -0
- package/src/html/LoginBlock.html +34 -32
- package/src/html/LoginModal.html +9 -4
- package/src/html/PaymentOption.html +7 -5
- package/src/html/PointsApplier.html +26 -0
- package/src/html/ProductCard.html +56 -8
- package/src/html/ProductGallery.html +21 -3
- package/src/html/ProductQuickview.html +64 -0
- package/src/html/ProductVariations.html +30 -3
- package/src/html/QuantitySelector.html +85 -0
- package/src/html/RecommendedItems.html +48 -0
- package/src/html/SearchEngine.html +100 -24
- package/src/html/ShippingCalculator.html +53 -3
- package/src/html/ShippingLine.html +5 -2
- package/src/html/TheAccount.html +43 -9
- package/src/html/TheCart.html +156 -0
- package/src/html/TheProduct.html +416 -138
- package/src/js/APagination.js +74 -0
- package/src/js/APicture.js +27 -7
- package/src/js/APrices.js +80 -41
- package/src/js/AShare.js +83 -0
- package/src/js/AccountAddresses.js +192 -0
- package/src/js/AccountForm.js +312 -0
- package/src/js/AccountPoints.js +63 -0
- package/src/js/AddressForm.js +80 -35
- package/src/js/BuyTogether.js +246 -0
- package/src/js/CartItem.js +67 -14
- package/src/js/CartQuickview.js +21 -2
- package/src/js/DiscountApplier.js +132 -42
- package/src/js/EarnPointsProgress.js +77 -0
- package/src/js/InputDate.js +8 -8
- package/src/js/InputDocNumber.js +20 -0
- package/src/js/ItemCustomizations.js +10 -0
- package/src/js/KitProductVariations.js +218 -0
- package/src/js/LoginBlock.js +14 -2
- package/src/js/LoginModal.js +17 -4
- package/src/js/PaymentOption.js +28 -1
- package/src/js/PointsApplier.js +110 -0
- package/src/js/ProductCard.js +97 -11
- package/src/js/ProductGallery.js +32 -12
- package/src/js/ProductQuickview.js +72 -0
- package/src/js/ProductVariations.js +76 -19
- package/src/js/QuantitySelector.js +175 -0
- package/src/js/RecommendedItems.js +178 -0
- package/src/js/SearchEngine.js +185 -55
- package/src/js/ShippingCalculator.js +157 -33
- package/src/js/ShippingLine.js +21 -5
- package/src/js/TheAccount.js +87 -6
- package/src/js/TheCart.js +146 -0
- package/src/js/TheProduct.js +387 -43
- package/src/js/helpers/add-idle-callback.js +7 -0
- package/src/js/helpers/check-form-validity.js +3 -0
- package/src/js/helpers/favorite-products.js +24 -0
- package/src/js/helpers/scroll-to-element.js +10 -0
- package/src/js/helpers/sort-apps.js +14 -0
- package/src/js/helpers/wait-storefront-info.js +21 -0
- package/src/scss/APicture.scss +2 -0
- package/src/scss/APrices.scss +13 -1
- package/src/scss/AccountAddresses.scss +27 -0
- package/src/scss/AccountForm.scss +5 -0
- package/src/scss/AccountPoints.scss +17 -0
- package/src/scss/BuyTogether.scss +38 -0
- package/src/scss/CartItem.scss +17 -1
- package/src/scss/EarnPointsProgress.scss +6 -0
- package/src/scss/InstantSearch.scss +1 -0
- package/src/scss/KitProductVariations.scss +72 -0
- package/src/scss/LoginBlock.scss +5 -0
- package/src/scss/PaymentOption.scss +10 -1
- package/src/scss/ProductCard.scss +66 -28
- package/src/scss/ProductGallery.scss +4 -2
- package/src/scss/ProductQuickview.scss +36 -0
- package/src/scss/ProductVariations.scss +20 -4
- package/src/scss/QuantitySelector.scss +39 -0
- package/src/scss/RecommendedItems.scss +28 -0
- package/src/scss/SearchEngine.scss +9 -5
- package/src/scss/ShippingCalculator.scss +30 -1
- package/src/scss/ShippingLine.scss +20 -0
- package/src/scss/TheAccount.scss +4 -0
- package/src/scss/TheCart.scss +54 -0
- package/src/scss/TheProduct.scss +146 -1
- package/webpack.config.js +20 -6
package/src/html/TheProduct.html
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
<section
|
|
1
|
+
<section
|
|
2
|
+
class="product"
|
|
3
|
+
:data-product-id="body._id"
|
|
4
|
+
:data-sku="body.sku"
|
|
5
|
+
:data-selected-variation="selectedVariationId"
|
|
6
|
+
>
|
|
2
7
|
<a-alert
|
|
3
8
|
:can-show="hasLoadError"
|
|
4
9
|
variant="danger"
|
|
@@ -19,19 +24,33 @@
|
|
|
19
24
|
class="row"
|
|
20
25
|
>
|
|
21
26
|
<slot name="gallery-col">
|
|
22
|
-
<div class="
|
|
23
|
-
<
|
|
24
|
-
:
|
|
25
|
-
|
|
26
|
-
>
|
|
27
|
-
<slot name="
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
<div :class="galleryColClassName">
|
|
28
|
+
<component
|
|
29
|
+
:is="isSSR ? 'portal' : 'div'"
|
|
30
|
+
selector="#product-gallery"
|
|
31
|
+
>
|
|
32
|
+
<slot name="stamps"/>
|
|
33
|
+
<product-gallery
|
|
34
|
+
:product="body"
|
|
35
|
+
:can-add-to-cart="canAddToCart && body.available && isInStock"
|
|
36
|
+
:current-slide.sync="currentGalleyImg"
|
|
37
|
+
:is-s-s-r="isSSR"
|
|
38
|
+
>
|
|
39
|
+
<slot name="first-picture"/>
|
|
40
|
+
</product-gallery>
|
|
41
|
+
<slot name="gallery-footer"/>
|
|
42
|
+
</component>
|
|
30
43
|
</div>
|
|
31
44
|
</slot>
|
|
32
45
|
|
|
33
|
-
<div
|
|
34
|
-
|
|
46
|
+
<div
|
|
47
|
+
class="col"
|
|
48
|
+
ref="actions"
|
|
49
|
+
>
|
|
50
|
+
<slot
|
|
51
|
+
v-if="!isSSR"
|
|
52
|
+
name="heading"
|
|
53
|
+
>
|
|
35
54
|
<component
|
|
36
55
|
:is="headingTag"
|
|
37
56
|
class="product__name"
|
|
@@ -43,157 +62,378 @@
|
|
|
43
62
|
</p>
|
|
44
63
|
</slot>
|
|
45
64
|
|
|
46
|
-
<
|
|
65
|
+
<component
|
|
66
|
+
:is="isSSR ? 'portal' : 'div'"
|
|
67
|
+
selector="#product-actions"
|
|
68
|
+
>
|
|
69
|
+
<slot name="rating">
|
|
70
|
+
<div
|
|
71
|
+
v-once
|
|
72
|
+
class="product__rating"
|
|
73
|
+
:data-sku="body.sku"
|
|
74
|
+
></div>
|
|
75
|
+
</slot>
|
|
76
|
+
|
|
47
77
|
<div
|
|
48
|
-
v-
|
|
49
|
-
class="
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
78
|
+
v-if="!body.available"
|
|
79
|
+
class="product__unavailable"
|
|
80
|
+
>
|
|
81
|
+
<slot name="unavailable">
|
|
82
|
+
{{ i19unavailable }}
|
|
83
|
+
</slot>
|
|
84
|
+
</div>
|
|
53
85
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
86
|
+
<div
|
|
87
|
+
v-else-if="!isInStock"
|
|
88
|
+
class="product__out-of-stock"
|
|
89
|
+
>
|
|
90
|
+
<slot name="out-of-stock">
|
|
91
|
+
{{ i19outOfStock }}
|
|
92
|
+
</slot>
|
|
93
|
+
</div>
|
|
62
94
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
95
|
+
<div
|
|
96
|
+
v-else-if="isWithoutPrice"
|
|
97
|
+
class="product__without-price"
|
|
98
|
+
>
|
|
99
|
+
<slot name="without-price">
|
|
100
|
+
<a
|
|
101
|
+
v-if="quoteLink"
|
|
102
|
+
target="_blank"
|
|
103
|
+
rel="noopener"
|
|
104
|
+
:href="quoteLink"
|
|
105
|
+
>
|
|
106
|
+
{{ i19quoteProduct }}
|
|
107
|
+
</a>
|
|
108
|
+
</slot>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<template v-else>
|
|
112
|
+
<slot name="prices">
|
|
113
|
+
<p class="product__prices">
|
|
114
|
+
<a-prices
|
|
115
|
+
:product="ghostProductForPrices"
|
|
116
|
+
:is-literal="true"
|
|
117
|
+
:is-big="true"
|
|
118
|
+
@fix-price="price => fixedPrice = price"
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<slot
|
|
122
|
+
name="discount-tag"
|
|
123
|
+
v-bind="{ discount }"
|
|
124
|
+
>
|
|
125
|
+
<span
|
|
126
|
+
v-if="discount > 0"
|
|
127
|
+
class="product__discount"
|
|
128
|
+
>
|
|
129
|
+
{{ i19discountOf }}
|
|
130
|
+
<strong>{{ discount }}%</strong>
|
|
131
|
+
</span>
|
|
132
|
+
</slot>
|
|
133
|
+
</p>
|
|
134
|
+
</slot>
|
|
71
135
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
:
|
|
78
|
-
:
|
|
79
|
-
|
|
136
|
+
<slot
|
|
137
|
+
name="variations"
|
|
138
|
+
v-if="hasVariations"
|
|
139
|
+
>
|
|
140
|
+
<product-variations
|
|
141
|
+
:product="body"
|
|
142
|
+
:selected-id.sync="selectedVariationId"
|
|
143
|
+
:max-options-btns="maxVariationOptionsBtns"
|
|
144
|
+
@select-option="handleGridOption"
|
|
80
145
|
/>
|
|
146
|
+
<a-alert :can-show="hasClickedBuy && !selectedVariationId">
|
|
147
|
+
{{ i19selectVariationMsg }}
|
|
148
|
+
</a-alert>
|
|
149
|
+
|
|
150
|
+
<slot name="variations-info"/>
|
|
151
|
+
</slot>
|
|
152
|
+
|
|
153
|
+
<slot
|
|
154
|
+
name="customizations"
|
|
155
|
+
v-if="body.customizations"
|
|
156
|
+
>
|
|
157
|
+
<div
|
|
158
|
+
v-for="custom in body.customizations"
|
|
159
|
+
v-if="custom.custom_value"
|
|
160
|
+
:key="custom._id"
|
|
161
|
+
class="product__customization form-group"
|
|
162
|
+
:class="custom.grid_id ? `product__customization--${custom.grid_id}` : null"
|
|
163
|
+
>
|
|
164
|
+
<label :for="`c-${custom._id}`">
|
|
165
|
+
{{ custom.label }}
|
|
166
|
+
<span
|
|
167
|
+
v-if="custom.add_to_price"
|
|
168
|
+
class="badge badge-secondary"
|
|
169
|
+
>
|
|
170
|
+
{{ formatAdditionalPrice(custom.add_to_price) }}
|
|
171
|
+
</span>
|
|
172
|
+
</label>
|
|
173
|
+
|
|
174
|
+
<input
|
|
175
|
+
type="text"
|
|
176
|
+
class="form-control"
|
|
177
|
+
:id="`c-${custom._id}`"
|
|
178
|
+
@keyup="ev => setCustomizationOption(custom, ev.target.value)"
|
|
179
|
+
>
|
|
180
|
+
</div>
|
|
181
|
+
</slot>
|
|
81
182
|
|
|
183
|
+
<div
|
|
184
|
+
v-if="isKit"
|
|
185
|
+
class="product__kit"
|
|
186
|
+
>
|
|
82
187
|
<slot
|
|
83
|
-
name="
|
|
84
|
-
v-bind="{
|
|
188
|
+
name="kit"
|
|
189
|
+
v-bind="{ kitItems }"
|
|
85
190
|
>
|
|
191
|
+
<transition enter-active-class="animated fadeInUp">
|
|
192
|
+
<quantity-selector
|
|
193
|
+
v-if="kitItems.length && !isKitWithVariations"
|
|
194
|
+
:items="kitItems"
|
|
195
|
+
:min="body.min_quantity"
|
|
196
|
+
:max="body.quantity"
|
|
197
|
+
:slug="body.slug"
|
|
198
|
+
:kit-product-id="body._id"
|
|
199
|
+
:kit-name="name"
|
|
200
|
+
:kit-price="fixedPrice"
|
|
201
|
+
@buy="d => $emit('buy', d)"
|
|
202
|
+
>
|
|
203
|
+
<template #buy-button-content>
|
|
204
|
+
<slot name="buy-button-content"/>
|
|
205
|
+
</template>
|
|
206
|
+
</quantity-selector>
|
|
207
|
+
<kit-product-variations
|
|
208
|
+
v-if="kitItems.length && isKitWithVariations"
|
|
209
|
+
:items="kitItems"
|
|
210
|
+
:min="body.min_quantity"
|
|
211
|
+
:max="body.quantity"
|
|
212
|
+
:slug="body.slug"
|
|
213
|
+
:kit-product-id="body._id"
|
|
214
|
+
:kit-name="name"
|
|
215
|
+
:kit-price="fixedPrice"
|
|
216
|
+
:max-options-btns="maxVariationOptionsBtns"
|
|
217
|
+
>
|
|
218
|
+
<template #buy-button-content>
|
|
219
|
+
<slot name="buy-button-content"/>
|
|
220
|
+
</template>
|
|
221
|
+
</kit-product-variations>
|
|
222
|
+
</transition>
|
|
223
|
+
|
|
86
224
|
<span
|
|
87
|
-
v-if="
|
|
88
|
-
class="
|
|
225
|
+
v-if="!kitItems.length"
|
|
226
|
+
class="product__kit-loading spinner-border"
|
|
227
|
+
role="status"
|
|
89
228
|
>
|
|
90
|
-
|
|
91
|
-
<strong>{{ discount }}%</strong>
|
|
229
|
+
<span class="sr-only">Loading...</span>
|
|
92
230
|
</span>
|
|
93
231
|
</slot>
|
|
94
|
-
</
|
|
95
|
-
</slot>
|
|
96
|
-
|
|
97
|
-
<slot
|
|
98
|
-
name="variations"
|
|
99
|
-
v-if="hasVariations"
|
|
100
|
-
>
|
|
101
|
-
<product-variations
|
|
102
|
-
:product="body"
|
|
103
|
-
:selectedId.sync="selectedVariationId"
|
|
104
|
-
/>
|
|
105
|
-
<a-alert :can-show="hasClickedBuy && !selectedVariationId">
|
|
106
|
-
{{ i19selectVariation }}
|
|
107
|
-
</a-alert>
|
|
232
|
+
</div>
|
|
108
233
|
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
class="product__buy"
|
|
114
|
-
@click="buy"
|
|
115
|
-
>
|
|
116
|
-
<slot name="buy">
|
|
117
|
-
<button
|
|
118
|
-
type="button"
|
|
119
|
-
class="btn btn-lg btn-primary"
|
|
120
|
-
:disabled="hasClickedBuy"
|
|
234
|
+
<template v-else>
|
|
235
|
+
<div
|
|
236
|
+
v-if="!isVariationInStock"
|
|
237
|
+
class="product__out-of-stock"
|
|
121
238
|
>
|
|
122
|
-
<slot name="
|
|
123
|
-
|
|
124
|
-
{{ strBuy }}
|
|
239
|
+
<slot name="out-of-stock">
|
|
240
|
+
{{ i19outOfStock }}
|
|
125
241
|
</slot>
|
|
126
|
-
</
|
|
127
|
-
</slot>
|
|
128
|
-
</div>
|
|
242
|
+
</div>
|
|
129
243
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
244
|
+
<div
|
|
245
|
+
v-else-if="hasBuyButton"
|
|
246
|
+
class="product__buy"
|
|
247
|
+
ref="buy"
|
|
248
|
+
>
|
|
249
|
+
<component
|
|
250
|
+
:is="hasQuantitySelector ? 'quantity-selector' : 'div'"
|
|
251
|
+
:items="hasQuantitySelector ? [{ _id: body._id, quantity: body.min_quantity || 1 }] : null"
|
|
252
|
+
:min="body.min_quantity"
|
|
253
|
+
:max="body.quantity"
|
|
254
|
+
:has-buy-button="false"
|
|
255
|
+
@set-quantity="({ quantity }) => qntToBuy = quantity"
|
|
256
|
+
>
|
|
257
|
+
<span @click="buy">
|
|
258
|
+
<slot
|
|
259
|
+
name="buy"
|
|
260
|
+
v-bind="{ hasClickedBuy, isOnCart }"
|
|
261
|
+
>
|
|
262
|
+
<button
|
|
263
|
+
type="button"
|
|
264
|
+
class="btn btn-lg btn-primary"
|
|
265
|
+
:disabled="hasClickedBuy && !isOnCart"
|
|
266
|
+
>
|
|
267
|
+
<slot name="buy-button-content">
|
|
268
|
+
<i class="i-shopping-bag mr-1"></i>
|
|
269
|
+
{{ strBuy }}
|
|
270
|
+
</slot>
|
|
271
|
+
</button>
|
|
272
|
+
</slot>
|
|
273
|
+
</span>
|
|
274
|
+
</component>
|
|
275
|
+
</div>
|
|
139
276
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
277
|
+
<p
|
|
278
|
+
class="product__short-stock"
|
|
279
|
+
v-if="isLowQuantity"
|
|
280
|
+
>
|
|
281
|
+
<i class="i-forward mr-1"></i>
|
|
282
|
+
{{ i19only }}
|
|
283
|
+
<strong>{{ productQuantity }}</strong>
|
|
284
|
+
{{ i19unitsInStock }}
|
|
285
|
+
</p>
|
|
286
|
+
</template>
|
|
287
|
+
|
|
288
|
+
<slot name="sale-timer">
|
|
289
|
+
<div
|
|
290
|
+
v-if="isOnSale"
|
|
291
|
+
class="product__sale-timer mb-3"
|
|
292
|
+
>
|
|
293
|
+
<div>
|
|
294
|
+
{{ i19offer }}
|
|
295
|
+
<br><small>{{ i19endsIn }}</small>
|
|
296
|
+
</div>
|
|
147
297
|
<div
|
|
148
|
-
|
|
149
|
-
|
|
298
|
+
class="h1 ml-3 mb-0"
|
|
299
|
+
ref="timer"
|
|
150
300
|
>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
class="collapse"
|
|
167
|
-
aria-labelledby="product-payment-header"
|
|
301
|
+
00:00:00
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
</slot>
|
|
305
|
+
|
|
306
|
+
<slot name="favorite">
|
|
307
|
+
<div>
|
|
308
|
+
<a
|
|
309
|
+
class="btn btn-sm product__favorite"
|
|
310
|
+
@click="toggleFavorite"
|
|
311
|
+
:href="isLogged ? null : accountUrl"
|
|
312
|
+
>
|
|
313
|
+
<i
|
|
314
|
+
class="i-heart mr-1"
|
|
315
|
+
:class="isFavorite ? 'active' : null"
|
|
168
316
|
>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
317
|
+
</i>
|
|
318
|
+
<span>
|
|
319
|
+
{{ isFavorite ? i19removeFromFavorites : i19addToFavorites }}
|
|
320
|
+
</span>
|
|
321
|
+
</a>
|
|
322
|
+
</div>
|
|
323
|
+
</slot>
|
|
324
|
+
|
|
325
|
+
<slot name="share">
|
|
326
|
+
<a-share
|
|
327
|
+
v-if="body.slug"
|
|
328
|
+
class="mb-3"
|
|
329
|
+
:url="`/${body.slug}`"
|
|
330
|
+
:title="body.name"
|
|
331
|
+
:description="body.short_description"
|
|
332
|
+
/>
|
|
333
|
+
</slot>
|
|
334
|
+
|
|
335
|
+
<transition enter-active-class="animated fadeInUp">
|
|
336
|
+
<slot
|
|
337
|
+
name="payment-gateways"
|
|
338
|
+
v-bind="{ paymentOptions }"
|
|
339
|
+
v-if="!isQuickview && paymentOptions.length"
|
|
340
|
+
>
|
|
341
|
+
<article>
|
|
342
|
+
<div class="product__payment card mb-3">
|
|
343
|
+
<a
|
|
344
|
+
id="product-payment-header"
|
|
345
|
+
class="card-header"
|
|
346
|
+
role="button"
|
|
347
|
+
href="#product-payment"
|
|
348
|
+
data-toggle="collapse"
|
|
349
|
+
aria-expanded="false"
|
|
350
|
+
aria-controls="product-payment"
|
|
351
|
+
>
|
|
352
|
+
<span>{{ i19paymentOptions }}</span>
|
|
353
|
+
<i class="i-chevron-down"></i>
|
|
354
|
+
</a>
|
|
355
|
+
|
|
356
|
+
<div
|
|
357
|
+
id="product-payment"
|
|
358
|
+
class="collapse"
|
|
359
|
+
aria-labelledby="product-payment-header"
|
|
360
|
+
>
|
|
361
|
+
<div class="card-body pb-0">
|
|
362
|
+
<div
|
|
363
|
+
v-for="paymentOption in paymentOptions"
|
|
364
|
+
:key="paymentOption.app_id"
|
|
365
|
+
:id="`product-payment-${paymentOption.app_id}`"
|
|
366
|
+
class="mb-3"
|
|
367
|
+
>
|
|
368
|
+
<slot :name="`payment-${paymentOption.app_id}`">
|
|
369
|
+
<payment-option
|
|
370
|
+
v-for="(gateway, i) in paymentOption.payment_gateways"
|
|
371
|
+
:key="`${paymentOption.app_id}-${i}`"
|
|
372
|
+
:payment-gateway="gateway"
|
|
373
|
+
:installments-option="paymentOption.installments_option"
|
|
374
|
+
:price="fixedPrice"
|
|
375
|
+
/>
|
|
376
|
+
</slot>
|
|
377
|
+
</div>
|
|
378
|
+
</div>
|
|
176
379
|
</div>
|
|
177
380
|
</div>
|
|
178
|
-
</
|
|
179
|
-
</
|
|
381
|
+
</article>
|
|
382
|
+
</slot>
|
|
383
|
+
</transition>
|
|
384
|
+
|
|
385
|
+
<p
|
|
386
|
+
v-if="body.production_time && body.production_time.days"
|
|
387
|
+
class="product__production"
|
|
388
|
+
>
|
|
389
|
+
<i class="i-info-circle mr-1"></i>
|
|
390
|
+
{{ i19productionDeadline }}:
|
|
391
|
+
<strong>
|
|
392
|
+
{{ body.production_time.days }}
|
|
393
|
+
{{ body.production_time.working_days ? i19workingDays : i19days }}
|
|
394
|
+
<template v-if="body.production_time.cumulative">
|
|
395
|
+
{{ i19perUnit }}
|
|
396
|
+
</template>
|
|
397
|
+
</strong>
|
|
398
|
+
</p>
|
|
399
|
+
|
|
400
|
+
<slot
|
|
401
|
+
v-if="!isQuickview && (!isKit || kitItems.length)"
|
|
402
|
+
name="shipping"
|
|
403
|
+
>
|
|
404
|
+
<shipping-calculator
|
|
405
|
+
:shippedItems="isKit ? kitItems : [{
|
|
406
|
+
...body,
|
|
407
|
+
...selectedVariation,
|
|
408
|
+
product_id: body._id,
|
|
409
|
+
quantity: qntToBuy || body.min_quantity || 1
|
|
410
|
+
}]"
|
|
411
|
+
>
|
|
412
|
+
<template v-slot:free-from-value="{ amountSubtotal, freeFromValue }">
|
|
413
|
+
<div class="product__free-shipping-from">
|
|
414
|
+
{{ i19freeShippingFrom }}
|
|
415
|
+
<strong>
|
|
416
|
+
{{ Math.ceil(freeFromValue / amountSubtotal) }}
|
|
417
|
+
{{ i19units }}
|
|
418
|
+
</strong>
|
|
419
|
+
</div>
|
|
420
|
+
</template>
|
|
421
|
+
</shipping-calculator>
|
|
180
422
|
</slot>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
</slot>
|
|
192
|
-
</template>
|
|
423
|
+
|
|
424
|
+
<slot name="track-price">
|
|
425
|
+
<div
|
|
426
|
+
v-once
|
|
427
|
+
class="product__track-price"
|
|
428
|
+
:data-sku="body.sku"
|
|
429
|
+
></div>
|
|
430
|
+
</slot>
|
|
431
|
+
</template>
|
|
432
|
+
</component>
|
|
193
433
|
|
|
194
434
|
<slot
|
|
435
|
+
v-if="!isSSR && body.short_description"
|
|
195
436
|
name="short-description"
|
|
196
|
-
v-if="body.short_description"
|
|
197
437
|
>
|
|
198
438
|
<p class="product__info lead">
|
|
199
439
|
{{ body.short_description }}
|
|
@@ -203,7 +443,45 @@
|
|
|
203
443
|
</div>
|
|
204
444
|
</transition>
|
|
205
445
|
|
|
206
|
-
<template v-if="!body.
|
|
207
|
-
<
|
|
446
|
+
<template v-if="!isQuickview && hasStickyBuyButton && body.available && isInStock">
|
|
447
|
+
<transition
|
|
448
|
+
enter-active-class="animated fadeIn"
|
|
449
|
+
leave-active-class="animated fadeOut fast"
|
|
450
|
+
>
|
|
451
|
+
<div
|
|
452
|
+
v-show="isStickyBuyVisible"
|
|
453
|
+
ref="sticky"
|
|
454
|
+
class="product__sticky"
|
|
455
|
+
>
|
|
456
|
+
<div class="product__sticky-container container">
|
|
457
|
+
<div class="product__sticky-info">
|
|
458
|
+
<a-picture
|
|
459
|
+
:can-calc-height="false"
|
|
460
|
+
:src="thumbnail"
|
|
461
|
+
class="product__sticky-picture"
|
|
462
|
+
/>
|
|
463
|
+
<h5>{{ name }}</h5>
|
|
464
|
+
</div>
|
|
465
|
+
|
|
466
|
+
<div class="product__sticky-buy">
|
|
467
|
+
<a-prices
|
|
468
|
+
:product="ghostProductForPrices"
|
|
469
|
+
:is-literal="false"
|
|
470
|
+
:can-show-price-options="true"
|
|
471
|
+
/>
|
|
472
|
+
<a
|
|
473
|
+
class="btn btn-lg btn-primary"
|
|
474
|
+
href="#"
|
|
475
|
+
@click.prevent="buyOrScroll"
|
|
476
|
+
>
|
|
477
|
+
<i class="i-shopping-bag mr-1"></i>
|
|
478
|
+
{{ strBuy }}
|
|
479
|
+
</a>
|
|
480
|
+
</div>
|
|
481
|
+
</div>
|
|
482
|
+
</div>
|
|
483
|
+
</transition>
|
|
208
484
|
</template>
|
|
485
|
+
|
|
486
|
+
<slot v-if="!body._id"/>
|
|
209
487
|
</section>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
i19next,
|
|
3
|
+
i19previous
|
|
4
|
+
} from '@ecomplus/i18n'
|
|
5
|
+
|
|
6
|
+
import { i18n } from '@ecomplus/utils'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'APagination',
|
|
10
|
+
|
|
11
|
+
props: {
|
|
12
|
+
totalItems: {
|
|
13
|
+
type: Number,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
page: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 1
|
|
19
|
+
},
|
|
20
|
+
pageSize: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 24
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
computed: {
|
|
27
|
+
i19next: () => i18n(i19next),
|
|
28
|
+
i19previous: () => i18n(i19previous),
|
|
29
|
+
|
|
30
|
+
totalPages () {
|
|
31
|
+
return Math.ceil(this.totalItems / this.pageSize)
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
pageNums () {
|
|
35
|
+
const pages = []
|
|
36
|
+
if (this.totalPages > 0) {
|
|
37
|
+
let lastPage
|
|
38
|
+
for (let i = -2; i <= 2; i++) {
|
|
39
|
+
lastPage = this.page + i
|
|
40
|
+
if (lastPage >= 1) {
|
|
41
|
+
if (lastPage <= this.totalPages) {
|
|
42
|
+
pages.push(lastPage)
|
|
43
|
+
} else {
|
|
44
|
+
break
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (pages[0] === 3) {
|
|
49
|
+
pages.unshift(1, 2)
|
|
50
|
+
} else if (pages[0] === 2) {
|
|
51
|
+
pages.unshift(1)
|
|
52
|
+
}
|
|
53
|
+
if (lastPage === this.totalPages - 2) {
|
|
54
|
+
pages.push(lastPage + 1, lastPage + 2)
|
|
55
|
+
} else if (lastPage === this.totalPages - 1) {
|
|
56
|
+
pages.push(lastPage + 1)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return pages
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
lastPageNum () {
|
|
63
|
+
return this.pageNums[this.pageNums.length - 1]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
methods: {
|
|
68
|
+
go (page) {
|
|
69
|
+
if (page >= 1 && page <= this.totalPages) {
|
|
70
|
+
this.$emit('update:page', page)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|