@wikala/spmkt 2.31.1 → 3.0.0-beta.1
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/MIGRATION_GUIDE.md +310 -0
- package/api/product.js +1 -0
- package/api/request.js +12 -6
- package/api/user.js +1 -1
- package/components/Account/AccountDashboard.vue +101 -101
- package/components/Account/AccountStore.js +57 -31
- package/components/Account/AffiliateReport.vue +56 -60
- package/components/Account/{OrderDetail.vue → Orders/OrderDetail.vue} +44 -30
- package/components/Account/Orders/Orders.vue +124 -0
- package/components/Account/{AccountSettings.vue → Settings/AccountSettings.vue} +4 -4
- package/components/Account/Settings/ChangeEmail.vue +136 -0
- package/components/Account/Settings/ChangeName.vue +82 -0
- package/components/Account/Settings/ChangePassword.vue +91 -0
- package/components/Address/Address.vue +38 -57
- package/components/Address/AddressBook.vue +77 -57
- package/components/Address/AddressSelect.vue +94 -87
- package/components/Address/Edit.vue +253 -265
- package/components/Address/PostalCode.vue +22 -21
- package/components/AgeGate.vue +11 -5
- package/components/Auth/Login.vue +62 -44
- package/components/Auth/Register.vue +82 -60
- package/components/Auth/ResetPassword.vue +45 -30
- package/components/Cart/AgeVerification/AgeChecker.vue +3 -3
- package/components/Cart/CartBadge.vue +15 -4
- package/components/Cart/CartBox.vue +19 -11
- package/components/Cart/CartItem.vue +3 -3
- package/components/Cart/CartMode.vue +6 -5
- package/components/Cart/CartPreview.vue +24 -18
- package/components/Cart/CreditCard/Everyware.vue +10 -10
- package/components/Cart/CreditCard/ExtendedCreditCard.vue +5 -5
- package/components/Cart/CreditCard/SquarePay.vue +18 -16
- package/components/Cart/CreditCard/StandardCreditCard.vue +9 -9
- package/components/Cart/Delivery/Delivery.vue +16 -12
- package/components/Cart/Delivery/DeliveryAddress.vue +1 -1
- package/components/Cart/Delivery/DeliveryMethods.vue +1 -1
- package/components/Cart/Delivery/DeliveryOptions.vue +15 -9
- package/components/Cart/Delivery/DeliveryTypes.vue +8 -5
- package/components/Cart/Delivery/ReservationSlots.vue +14 -8
- package/components/Cart/Disclaimer.vue +1 -1
- package/components/Cart/OrderConfirmation.vue +1 -1
- package/components/Cart/Payment/Payment.vue +37 -33
- package/components/Cart/Payment/PaymentMethods.vue +6 -4
- package/components/Cart/ReviewAndSubmit.vue +9 -7
- package/components/Cart/ShoppingCart.vue +42 -31
- package/components/Cart/Store/actions.js +1 -1
- package/components/Cart/Store/getters.js +2 -1
- package/components/Cart/Store/index.js +1 -1
- package/components/Cart/Store/mutations.js +9 -7
- package/components/Cart/Store/state.js +2 -2
- package/components/Cart/UserIdentity.vue +1 -1
- package/components/Category/CategoryFilter.vue +128 -114
- package/components/Category/CategorySort.vue +44 -32
- package/components/Category/LoadMore.vue +39 -23
- package/components/DeliverTo.vue +10 -15
- package/components/DeliveryNotice.vue +72 -68
- package/components/DobInput.vue +24 -24
- package/components/Gmaps/GmapsAutocomplete.vue +139 -78
- package/components/Gmaps/GmapsLocations.vue +1 -1
- package/components/Gmaps/GmapsSingleLocation.vue +121 -87
- package/components/MobileMenu/icons/LeftArrowIcon.vue +1 -1
- package/components/MobileMenu/icons/MenuIcon.vue +1 -1
- package/components/MobileMenu/icons/RightArrowIcon.vue +1 -1
- package/components/ModalContainer/ModalContainer.vue +20 -13
- package/components/ModalContainer/index.js +62 -18
- package/components/Product/AddToCart.vue +237 -221
- package/components/Product/BoxAddToCart.vue +114 -86
- package/components/Product/Compare.vue +91 -49
- package/components/Product/CompareBox.vue +128 -123
- package/components/Product/Lookup.vue +92 -65
- package/components/Product/Photo.vue +105 -66
- package/components/Product/Price.vue +64 -43
- package/components/Product/ProductAutocomplete.vue +52 -57
- package/components/Product/ProductBox.vue +61 -38
- package/components/Product/ProductImages.vue +83 -86
- package/components/Product/Quantity.vue +115 -53
- package/components/Product/QuickView.vue +52 -45
- package/components/Product/RelatedProducts.vue +88 -23
- package/components/Product/SKU.vue +27 -8
- package/components/Product/Variants.vue +336 -342
- package/components/Product/reviews-questions/ProductQuestions.vue +226 -198
- package/components/Product/reviews-questions/ProductReviews.vue +122 -107
- package/components/Product/reviews-questions/Review.vue +54 -59
- package/components/Product/reviews-questions/ReviewForm.vue +222 -170
- package/components/Product/reviews-questions/ReviewImages.vue +197 -216
- package/components/Product/reviews-questions/Vote.vue +83 -57
- package/components/QuantityInput.vue +18 -8
- package/components/RangeInput.vue +15 -8
- package/components/Recaptcha.vue +8 -1
- package/components/SelectShippingCountry.vue +81 -62
- package/components/TimedOffer.vue +59 -74
- package/composables/globals.js +53 -0
- package/config.js +5 -2
- package/index.js +41 -10
- package/install.js +88 -0
- package/locales/en.json +2 -1
- package/locales/sr.json +2 -1
- package/package.json +49 -37
- package/utils/animate.css +50 -0
- package/utils/animate.js +1 -1
- package/utils/buefy.js +62 -0
- package/utils/directives.js +28 -45
- package/utils/event-bus.js +56 -0
- package/utils/filters.js +24 -7
- package/utils/format-date.js +17 -0
- package/utils/{gmaps.js → google/gmaps.js} +43 -10
- package/utils/{google-analytics-eec.js → google/google-analytics-eec.js} +7 -7
- package/utils/random-id.js +10 -0
- package/babel.config.js +0 -5
- package/components/Account/ChangeEmail.vue +0 -133
- package/components/Account/ChangeName.vue +0 -92
- package/components/Account/ChangePassword.vue +0 -94
- package/components/Account/CreditCards.vue +0 -18
- package/components/Account/Orders.vue +0 -110
- package/components/Account/Settings.vue +0 -18
- package/components/Cart/Delivery/DeliveryAddressGuest.spec.js +0 -128
- package/components/Cart/Delivery/DeliveryTypes.spec.js +0 -83
- package/components/Cart/PCIBadge/SecurityMetrics.vue +0 -11
- package/components/Instagram.vue +0 -49
- package/components/ProductImageModal.vue +0 -41
- package/jest.config.js +0 -16
- package/test/e2e/.babelrc.js +0 -8
- package/test/e2e/.eslintrc.js +0 -11
- package/test/e2e/accAuth.spec.js +0 -64
- package/test/e2e/ageGate.spec.js +0 -26
- package/test/e2e/checkout.spec.js +0 -106
- package/test/e2e/compare.spec.js +0 -52
- package/test/e2e/config/data.js +0 -21
- package/test/e2e/config/routes.js +0 -11
- package/test/e2e/region.spec.js +0 -46
- package/test/e2e/search.spec.js +0 -32
- package/tests/vueBuefy.js +0 -4
- package/tsconfig.json +0 -8
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<div>{{ formatMoney(item.price, { precision: 2 }) }}</div>
|
|
17
17
|
</div>
|
|
18
18
|
<div class="ci-qty">
|
|
19
|
-
<quantity-input :
|
|
19
|
+
<quantity-input :modelValue="itemQty" @update:modelValue="changeQty($event, item.id)"></quantity-input>
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
22
|
<div v-if="item.error" :class="{ 'ci-error-msg': item.error }">
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
import { mapState, mapMutations } from 'vuex'
|
|
30
30
|
|
|
31
31
|
import { formatMoney } from '../../utils/filters'
|
|
32
|
-
import GoogleAnalyticsEEC from '../../utils/google-analytics-eec.js'
|
|
32
|
+
import GoogleAnalyticsEEC from '../../utils/google/google-analytics-eec.js'
|
|
33
33
|
|
|
34
34
|
import { Cart } from '../../api'
|
|
35
35
|
import QuantityInput from '../../components/QuantityInput'
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
variant: this.item.variant
|
|
82
82
|
})
|
|
83
83
|
}
|
|
84
|
-
this.$bus
|
|
84
|
+
this.$bus.emit('updateTotalQty', response.data.sumQty)
|
|
85
85
|
cqLoading.close()
|
|
86
86
|
let responseItem = response.data.items.find(item => item.id === productId)
|
|
87
87
|
if(responseItem) {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
type="password"
|
|
48
48
|
v-model="userIdentity.password"
|
|
49
49
|
:placeholder="$t('auth.passwordInfo')"
|
|
50
|
-
@
|
|
50
|
+
@update:model-value="clearError('password')"
|
|
51
51
|
@focus="clearError('password')"
|
|
52
52
|
/>
|
|
53
53
|
</b-field>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
name="password_confirmation"
|
|
64
64
|
type="password"
|
|
65
65
|
v-model="userIdentity.password_confirmation"
|
|
66
|
-
@
|
|
66
|
+
@update:model-value="clearError('password_confirmation')"
|
|
67
67
|
@focus="clearError('password_confirmation')"
|
|
68
68
|
/>
|
|
69
69
|
</b-field>
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
|
-
<b-modal
|
|
81
|
+
<b-modal v-model="showLoginModal" custom-class="wkl-modal-container" :can-cancel="['escape', 'outside']">
|
|
82
82
|
<Login
|
|
83
83
|
:title="initialState.loginTitle"
|
|
84
84
|
:createAccountTitle="initialState.createAccountTitle"
|
|
@@ -97,10 +97,11 @@ import { mapMutations, mapState } from 'vuex'
|
|
|
97
97
|
import { request } from '../../api'
|
|
98
98
|
|
|
99
99
|
import UserIdentity from './UserIdentity'
|
|
100
|
+
import Login from '../Auth/Login'
|
|
100
101
|
|
|
101
102
|
export default {
|
|
102
103
|
name: 'CartMode',
|
|
103
|
-
components: { UserIdentity },
|
|
104
|
+
components: { UserIdentity, Login },
|
|
104
105
|
|
|
105
106
|
data() {
|
|
106
107
|
return {
|
|
@@ -166,7 +167,7 @@ export default {
|
|
|
166
167
|
let hasErrors = false
|
|
167
168
|
for(let field in fields) {
|
|
168
169
|
if (!this.userIdentity[field]) {
|
|
169
|
-
this
|
|
170
|
+
this.userIdentityErrors[field] = fields[field]
|
|
170
171
|
}
|
|
171
172
|
if(this.userIdentityErrors[field]) {
|
|
172
173
|
hasErrors = true
|
|
@@ -77,6 +77,20 @@ export default {
|
|
|
77
77
|
methods: {
|
|
78
78
|
...mapMutations(['setActiveStep', 'setCartStep', 'setGuestMode']),
|
|
79
79
|
|
|
80
|
+
onUpdateTotalQty(totalItems) {
|
|
81
|
+
totalItems < 1 ? (this.emptyCart = true) : (this.emptyCart = false)
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
onGuestMode(flag) {
|
|
85
|
+
if (flag === 'On') {
|
|
86
|
+
this.setGuestMode(true)
|
|
87
|
+
this.closeModal()
|
|
88
|
+
this.$bus.emit('setStep', this.steps.delivery)
|
|
89
|
+
} else {
|
|
90
|
+
this.setGuestMode(false)
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
|
|
80
94
|
loginSuccessful() {
|
|
81
95
|
window.location.href = '/shopping-cart?step=delivery'
|
|
82
96
|
},
|
|
@@ -90,7 +104,7 @@ export default {
|
|
|
90
104
|
})
|
|
91
105
|
return false
|
|
92
106
|
}
|
|
93
|
-
this.$bus
|
|
107
|
+
this.$bus.emit('nextStep')
|
|
94
108
|
/*if (!User.isLogged() && !this.guestMode) {
|
|
95
109
|
this.openModal('Login', {
|
|
96
110
|
title: this.$t('cart.proceedToCheckoutLoginTitle'),
|
|
@@ -101,9 +115,9 @@ export default {
|
|
|
101
115
|
} else {
|
|
102
116
|
if (User.isLogged()) {
|
|
103
117
|
this.setGuestMode(false)
|
|
104
|
-
this.$bus
|
|
118
|
+
this.$bus.emit('nextStep')
|
|
105
119
|
} else if (this.guestMode) {
|
|
106
|
-
this.$bus
|
|
120
|
+
this.$bus.emit('nextStep')
|
|
107
121
|
}
|
|
108
122
|
}*/
|
|
109
123
|
}
|
|
@@ -116,7 +130,7 @@ export default {
|
|
|
116
130
|
Cart.update({ id: productId, qty: 0 })
|
|
117
131
|
.then((response) => {
|
|
118
132
|
//vm.cart = response.data
|
|
119
|
-
//vm.$bus
|
|
133
|
+
//vm.$bus.emit('updateCart', response.data)
|
|
120
134
|
loading.close()
|
|
121
135
|
this.$store.commit('setCart', response.data)
|
|
122
136
|
window.location.reload()
|
|
@@ -138,23 +152,15 @@ export default {
|
|
|
138
152
|
},
|
|
139
153
|
|
|
140
154
|
mounted() {
|
|
141
|
-
let vm = this
|
|
142
|
-
|
|
143
155
|
this.initialState.cart.sumQty < 1 ? (this.emptyCart = true) : (this.emptyCart = false)
|
|
144
156
|
|
|
145
|
-
this.$bus
|
|
146
|
-
|
|
147
|
-
|
|
157
|
+
this.$bus.on('updateTotalQty', this.onUpdateTotalQty)
|
|
158
|
+
this.$bus.on('guestMode', this.onGuestMode)
|
|
159
|
+
},
|
|
148
160
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
vm.closeModal()
|
|
153
|
-
vm.$bus.$emit('setStep', this.steps.delivery)
|
|
154
|
-
} else {
|
|
155
|
-
vm.setGuestMode(false)
|
|
156
|
-
}
|
|
157
|
-
})
|
|
161
|
+
beforeUnmount() {
|
|
162
|
+
this.$bus.off('updateTotalQty', this.onUpdateTotalQty)
|
|
163
|
+
this.$bus.off('guestMode', this.onGuestMode)
|
|
158
164
|
}
|
|
159
165
|
}
|
|
160
166
|
</script>
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
type="tel"
|
|
15
15
|
v-model="cardNumber"
|
|
16
16
|
:maxlength="cardNumberMaxLength"
|
|
17
|
-
@
|
|
18
|
-
@paste
|
|
17
|
+
@update:model-value="changeCardNumber"
|
|
18
|
+
@paste="pasteCardNumber"
|
|
19
19
|
novalidate
|
|
20
20
|
></b-input>
|
|
21
21
|
</b-field>
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
ref="phone"
|
|
63
63
|
type="tel"
|
|
64
64
|
v-model="maskedPhoneNumber"
|
|
65
|
-
@
|
|
66
|
-
@paste
|
|
65
|
+
@update:model-value="changePhone"
|
|
66
|
+
@paste="changePhone"
|
|
67
67
|
maxlength="14"
|
|
68
68
|
:has-counter="false"
|
|
69
69
|
>
|
|
@@ -208,13 +208,13 @@ export default {
|
|
|
208
208
|
if (!this.cardData.card_number) {
|
|
209
209
|
console.log('no cc')
|
|
210
210
|
hasErrors = true
|
|
211
|
-
this
|
|
211
|
+
this.validationErrors['card_number'] = 'Enter your credit card number'
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
/*if(!this.isCardNumberValid()) {
|
|
215
215
|
console.log('invalid card', this.cardNumber)
|
|
216
216
|
hasErrors = true
|
|
217
|
-
this
|
|
217
|
+
this.validationErrors['card_number'] = 'Enter valid credit card number'
|
|
218
218
|
//this.validationErrors.card_number = 'Enter valid credit card number'
|
|
219
219
|
console.log(this.validationErrors)
|
|
220
220
|
}*/
|
|
@@ -222,25 +222,25 @@ export default {
|
|
|
222
222
|
if (!this.cardData.card_expiry_month) {
|
|
223
223
|
console.log('no expm')
|
|
224
224
|
hasErrors = true
|
|
225
|
-
this
|
|
225
|
+
this.validationErrors['card_expiry_month'] = 'Expiry month'
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
if (!this.cardData.card_expiry_year) {
|
|
229
229
|
console.log('no expy')
|
|
230
230
|
hasErrors = true
|
|
231
|
-
this
|
|
231
|
+
this.validationErrors['card_expiry_year'] = 'Expiry year'
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
if (!this.cardData.card_cvv) {
|
|
235
235
|
console.log('no cvv')
|
|
236
236
|
hasErrors = true
|
|
237
|
-
this
|
|
237
|
+
this.validationErrors['card_cvv'] = 'Enter your card verification number'
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
if (!this.cardData.cell_phone) {
|
|
241
241
|
console.log('no cellphone')
|
|
242
242
|
hasErrors = true
|
|
243
|
-
this
|
|
243
|
+
this.validationErrors['cell_phone'] = 'Enter your cell phone number'
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
if (hasErrors) {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
type="tel"
|
|
15
15
|
v-model="cardNumber"
|
|
16
16
|
:maxlength="cardNumberMaxLength"
|
|
17
|
-
@
|
|
18
|
-
@paste
|
|
17
|
+
@update:model-value="changeCardNumber"
|
|
18
|
+
@paste="pasteCardNumber"
|
|
19
19
|
novalidate
|
|
20
20
|
/>
|
|
21
21
|
</b-field>
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
maxlength="4"
|
|
60
60
|
:has-counter="false"
|
|
61
61
|
v-model="cardData.card_cvv"
|
|
62
|
-
@
|
|
62
|
+
@update:model-value="changeCVV"
|
|
63
63
|
></b-input>
|
|
64
64
|
</b-field>
|
|
65
65
|
<b-icon v-if="!errors.card_cvv" icon="lock-alt"></b-icon>
|
|
@@ -222,9 +222,9 @@ export default {
|
|
|
222
222
|
for(let field in fields) {
|
|
223
223
|
if(!this.cardData[field]) {
|
|
224
224
|
hasErrors = true
|
|
225
|
-
this
|
|
225
|
+
this.errors[field] = fields[field]
|
|
226
226
|
} else {
|
|
227
|
-
this
|
|
227
|
+
this.errors[field] = ''
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|
|
@@ -157,24 +157,20 @@ export default {
|
|
|
157
157
|
this.paymentForm.requestCardNonce()
|
|
158
158
|
},
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
this
|
|
162
|
-
|
|
163
|
-
this.paymentForm.setPostalCode(address.postcode)
|
|
164
|
-
}
|
|
165
|
-
})
|
|
160
|
+
onAddressChange(address) {
|
|
161
|
+
this.onPostalCodeChange(address.postcode)
|
|
162
|
+
},
|
|
166
163
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
onPostalCodeChange(postalCode) {
|
|
165
|
+
if (typeof this.paymentForm.setPostalCode === 'function' && this.squareLoading === false) {
|
|
166
|
+
this.paymentForm.setPostalCode(postalCode)
|
|
167
|
+
}
|
|
168
|
+
},
|
|
172
169
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
})
|
|
170
|
+
processEvents() {
|
|
171
|
+
this.$bus.on('shippingAddressChange', this.onAddressChange)
|
|
172
|
+
this.$bus.on('billingAddressChange', this.onAddressChange)
|
|
173
|
+
this.$bus.on('postalCodeChange', this.onPostalCodeChange)
|
|
178
174
|
},
|
|
179
175
|
|
|
180
176
|
checkPaymentFormTimeout() {
|
|
@@ -242,6 +238,12 @@ export default {
|
|
|
242
238
|
this.checkPaymentFormTimeout()
|
|
243
239
|
|
|
244
240
|
this.processEvents()
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
beforeUnmount() {
|
|
244
|
+
this.$bus.off('shippingAddressChange', this.onAddressChange)
|
|
245
|
+
this.$bus.off('billingAddressChange', this.onAddressChange)
|
|
246
|
+
this.$bus.off('postalCodeChange', this.onPostalCodeChange)
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
249
|
</script>
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
type="tel"
|
|
15
15
|
v-model="cardNumber"
|
|
16
16
|
:maxlength="cardNumberMaxLength"
|
|
17
|
-
@
|
|
18
|
-
@paste
|
|
17
|
+
@update:model-value="changeCardNumber"
|
|
18
|
+
@paste="pasteCardNumber"
|
|
19
19
|
novalidate
|
|
20
20
|
autocomplete="cc-number"
|
|
21
21
|
></b-input>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
maxlength="4"
|
|
59
59
|
:has-counter="false"
|
|
60
60
|
v-model="cardData.card_cvv"
|
|
61
|
-
@
|
|
61
|
+
@update:model-value="changeCVV"
|
|
62
62
|
autocomplete="cc-csc"
|
|
63
63
|
></b-input>
|
|
64
64
|
</b-field>
|
|
@@ -196,37 +196,37 @@ export default {
|
|
|
196
196
|
if (!this.cardData.card_number) {
|
|
197
197
|
console.log('no cc')
|
|
198
198
|
hasErrors = true
|
|
199
|
-
this
|
|
199
|
+
this.validationErrors['card_number'] = 'Enter your credit card number'
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
/*if(!this.isCardNumberValid()) {
|
|
203
203
|
console.log('invalid card')
|
|
204
204
|
hasErrors = true
|
|
205
|
-
this
|
|
205
|
+
this.validationErrors['card_number'] = 'Enter valid credit card number'
|
|
206
206
|
}*/
|
|
207
207
|
|
|
208
208
|
if (!this.cardData.card_expiry_month) {
|
|
209
209
|
console.log('no expm')
|
|
210
210
|
hasErrors = true
|
|
211
|
-
this
|
|
211
|
+
this.validationErrors['card_expiry_month'] = 'Expiry month'
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
if (!this.cardData.card_expiry_year) {
|
|
215
215
|
console.log('no expy')
|
|
216
216
|
hasErrors = true
|
|
217
|
-
this
|
|
217
|
+
this.validationErrors['card_expiry_year'] = 'Expiry year'
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
if (!this.cardData.card_cvv) {
|
|
221
221
|
console.log('no cvv')
|
|
222
222
|
hasErrors = true
|
|
223
|
-
this
|
|
223
|
+
this.validationErrors['card_cvv'] = 'Enter your card verification number'
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
if (!this.cardData.name_on_card) {
|
|
227
227
|
console.log('no name on card')
|
|
228
228
|
hasErrors = true
|
|
229
|
-
this
|
|
229
|
+
this.validationErrors['name_on_card'] = 'Enter name on card'
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
if (hasErrors) {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
<div v-if="['user', 'guest'].includes(cartMode)">
|
|
13
13
|
<DeliveryTypes
|
|
14
14
|
v-if="deliveryTypes.length > 0"
|
|
15
|
-
|
|
15
|
+
:modelValue="deliveryType"
|
|
16
16
|
:error="deliveryTypeError"
|
|
17
|
-
@
|
|
17
|
+
@update:modelValue="onDeliveryTypeInput"
|
|
18
18
|
/>
|
|
19
19
|
</div>
|
|
20
20
|
|
|
@@ -193,21 +193,25 @@ export default {
|
|
|
193
193
|
|
|
194
194
|
async onDeliveryTypeInput(pl) {
|
|
195
195
|
//console.log('onDeliveryTypeInput', pl, this.deliveryTypes)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
// DeliveryTypes re-emits the current type when this step remounts (e.g. moving
|
|
197
|
+
// back from payment); only a real change resets the entered delivery data
|
|
198
|
+
let typeChanged = this.deliveryType !== pl
|
|
199
|
+
if(typeChanged) {
|
|
200
|
+
this.resetDeliveryOptions()
|
|
201
|
+
this.deliveryType = pl
|
|
200
202
|
}
|
|
201
203
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
let deliveryType = _.findWhere(this.deliveryTypes, { type: pl })
|
|
205
|
+
if(deliveryType && deliveryType.methods.length > 0) {
|
|
206
|
+
//console.log('setDeliveryMethodId to', deliveryType.methods[0]['id'])
|
|
207
|
+
this.setDeliveryMethodId(deliveryType.methods[0]['id'])
|
|
204
208
|
}
|
|
205
209
|
|
|
206
|
-
this.resetDeliveryOptions()
|
|
207
|
-
|
|
208
210
|
if(pl === 'pickup') {
|
|
209
211
|
this.addressValid = true
|
|
210
|
-
|
|
212
|
+
if(typeChanged || this.reservationSlots.length === 0) {
|
|
213
|
+
await this.getReservationSlots()
|
|
214
|
+
}
|
|
211
215
|
}
|
|
212
216
|
},
|
|
213
217
|
|
|
@@ -298,7 +302,7 @@ export default {
|
|
|
298
302
|
await this.getPaymentMethods(pmreq)
|
|
299
303
|
this.continueButtonLoading = false
|
|
300
304
|
this.setActiveStep(this.steps.payment)
|
|
301
|
-
//this.$bus
|
|
305
|
+
//this.$bus.emit('nextStep')
|
|
302
306
|
},
|
|
303
307
|
|
|
304
308
|
continueToPayment() {
|
|
@@ -167,7 +167,7 @@ export default {
|
|
|
167
167
|
/*
|
|
168
168
|
checkSelectedDelivery() {
|
|
169
169
|
if (this.selectedAddressId || this.cart.free_delivery) {
|
|
170
|
-
this.$bus
|
|
170
|
+
this.$bus.emit('nextStep')
|
|
171
171
|
} else {
|
|
172
172
|
this.$buefy.dialog.alert({
|
|
173
173
|
title: this.$t('global.delivery'),
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<div class="delivery-method" v-for="(deliveryCost, smIndex) in locationMethods.delivery_costs" :key="smIndex">
|
|
10
10
|
<div class="sm-label">
|
|
11
11
|
<b-radio
|
|
12
|
-
@change.native="selectDeliveryOption(deliveryCost)"
|
|
13
12
|
v-model="selectedDeliveryCost"
|
|
13
|
+
@update:model-value="selectDeliveryOption(deliveryCost)"
|
|
14
14
|
:native-value="deliveryCost.id"
|
|
15
15
|
name="deliverymethod"
|
|
16
16
|
>
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
<div class="delivery-method" v-for="(deliveryMethod, smIndex) in sellerDeliveryMethod.delivery_methods" :key="smIndex">
|
|
28
28
|
<div class="sm-label">
|
|
29
29
|
<b-radio
|
|
30
|
-
@change.native="selectDeliveryOption(sellerDeliveryMethod.id, deliveryMethod)"
|
|
31
30
|
v-model="selectedDeliveryMethod[sellerDeliveryMethod.id]"
|
|
31
|
+
@update:model-value="selectDeliveryOption(sellerDeliveryMethod.id, deliveryMethod)"
|
|
32
32
|
:native-value="deliveryMethod.id"
|
|
33
33
|
>
|
|
34
34
|
{{ deliveryMethod.name }}
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
})
|
|
99
99
|
})
|
|
100
100
|
this.setDeliveryMethod(reqMethods)
|
|
101
|
-
this.$bus
|
|
101
|
+
this.$bus.emit('deliveryMethodSelected', reqMethods)
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
130
130
|
|
|
131
131
|
selectDeliveryOption(sellerId, deliveryMethod) {
|
|
132
132
|
if (deliveryMethod.delivery_estimate) {
|
|
133
|
-
this
|
|
133
|
+
this.estimatedDelivery[sellerId] = deliveryMethod.delivery_estimate.join(' - ')
|
|
134
134
|
}
|
|
135
135
|
if (!this.selectedDeliveryMethod[sellerId]) {
|
|
136
136
|
this.selectedDeliveryMethod[sellerId] = deliveryMethod.id
|
|
@@ -143,23 +143,29 @@ export default {
|
|
|
143
143
|
if (!this.selectedDeliveryMethod[sm.id] && sm.delivery_methods.length > 0) {
|
|
144
144
|
//console.log('preselecting', sm.id)
|
|
145
145
|
this.selectedDeliveryMethod[sm.id] = sm.delivery_methods[0]['id']
|
|
146
|
-
this
|
|
146
|
+
this.estimatedDelivery[sm.id] = sm.delivery_methods[0]['delivery_estimate'].join(' - ')
|
|
147
147
|
}
|
|
148
148
|
})
|
|
149
149
|
setTimeout(() => {
|
|
150
150
|
this.emitSelected()
|
|
151
151
|
}, 500)
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
onResetDeliveryOptions() {
|
|
155
|
+
this.selectedDeliveryMethod = {}
|
|
156
|
+
this.estimatedDelivery = {}
|
|
157
|
+
this.preselect()
|
|
152
158
|
}
|
|
153
159
|
},
|
|
154
160
|
|
|
155
161
|
mounted() {
|
|
156
162
|
this.preselect()
|
|
157
163
|
|
|
158
|
-
this.$bus
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
this.$bus.on('resetDeliveryOptions', this.onResetDeliveryOptions)
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
beforeUnmount() {
|
|
168
|
+
this.$bus.off('resetDeliveryOptions', this.onResetDeliveryOptions)
|
|
163
169
|
}
|
|
164
170
|
}
|
|
165
171
|
</script>
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<b-radio
|
|
6
6
|
v-for="(dm, index) in deliveryTypes"
|
|
7
7
|
:key="'_dm_' + index"
|
|
8
|
-
:value="
|
|
9
|
-
@
|
|
8
|
+
:model-value="modelValue"
|
|
9
|
+
@update:model-value="$emit('update:modelValue', $event)"
|
|
10
10
|
name="deliverytype"
|
|
11
11
|
:native-value="dm.type"
|
|
12
12
|
:style="{
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
borderBottom: '1px #ddd solid',
|
|
18
18
|
marginRight: 0
|
|
19
19
|
}"
|
|
20
|
-
:class="[{ 'dm-selected':
|
|
20
|
+
:class="[{ 'dm-selected': modelValue === dm.type }]"
|
|
21
21
|
>
|
|
22
22
|
<div>{{ dm.name }}</div>
|
|
23
23
|
<div style="font-size: 0.8rem">{{ dm.description }}</div>
|
|
@@ -34,7 +34,7 @@ import { mapState } from 'vuex'
|
|
|
34
34
|
export default {
|
|
35
35
|
name: 'DeliveryTypes',
|
|
36
36
|
props: {
|
|
37
|
-
|
|
37
|
+
modelValue: {
|
|
38
38
|
type: String
|
|
39
39
|
},
|
|
40
40
|
error: {
|
|
@@ -43,13 +43,16 @@ export default {
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
|
|
46
|
+
emits: ['update:modelValue'],
|
|
47
|
+
|
|
46
48
|
computed: {
|
|
47
49
|
...mapState(['deliveryTypes'])
|
|
48
50
|
},
|
|
49
51
|
|
|
50
52
|
mounted() {
|
|
51
53
|
if (this.deliveryTypes && this.deliveryTypes.length > 0) {
|
|
52
|
-
|
|
54
|
+
// Keep a type chosen earlier in the checkout, otherwise preselect the first one
|
|
55
|
+
this.$emit('update:modelValue', this.modelValue || this.deliveryTypes[0].type)
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<div class="is-flex">
|
|
4
4
|
<div class="mr-3">
|
|
5
5
|
<b-field :label="isMobileiOS ? '' : 'Select date'" label-position="inside">
|
|
6
|
-
<b-select v-model="selectedDate" @
|
|
6
|
+
<b-select v-model="selectedDate" @update:model-value="rsInput" placeholder="Select date" class="rs-date">
|
|
7
7
|
<option v-if="isMobileiOS" value="">Select date</option>
|
|
8
|
-
<option v-for="rcDay in
|
|
8
|
+
<option v-for="rcDay in availableSlots" :value="rcDay" :key="rcDay.id">
|
|
9
9
|
{{ rcDay.dayName }}
|
|
10
10
|
</option>
|
|
11
11
|
</b-select>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
<div>
|
|
15
15
|
<b-field :label="isMobileiOS ? '' : 'Select time'" label-position="inside" class="rs-time">
|
|
16
|
-
<b-select v-model="selectedTime" @
|
|
16
|
+
<b-select v-model="selectedTime" @update:model-value="rsInput" placeholder="Select time" reservation-slot>
|
|
17
17
|
<option v-if="isMobileiOS" value="">Select time</option>
|
|
18
18
|
<option v-for="ts in selectedDate.slots" :value="ts" :key="ts.start" :disabled="!ts.available">
|
|
19
19
|
{{ ts.label }}
|
|
@@ -33,7 +33,7 @@ import _ from 'underscore'
|
|
|
33
33
|
export default {
|
|
34
34
|
name: 'ReservationSlots',
|
|
35
35
|
props: {
|
|
36
|
-
|
|
36
|
+
modelValue: {
|
|
37
37
|
type: String,
|
|
38
38
|
default: ''
|
|
39
39
|
},
|
|
@@ -48,12 +48,18 @@ export default {
|
|
|
48
48
|
default: ''
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
+
emits: ['update:modelValue'],
|
|
51
52
|
data() {
|
|
52
53
|
return {
|
|
53
54
|
selectedDate: '',
|
|
54
55
|
selectedTime: ''
|
|
55
56
|
}
|
|
56
57
|
},
|
|
58
|
+
computed: {
|
|
59
|
+
availableSlots() {
|
|
60
|
+
return this.slots.filter((rcDay) => rcDay.slots.length > 0)
|
|
61
|
+
}
|
|
62
|
+
},
|
|
57
63
|
watch: {
|
|
58
64
|
slots: function(v) {
|
|
59
65
|
if(!this.slots || this.slots.length === 0) {
|
|
@@ -66,15 +72,15 @@ export default {
|
|
|
66
72
|
rsInput(val) {
|
|
67
73
|
if(this.selectedDate && this.selectedTime) {
|
|
68
74
|
//console.log('rs slots emitting', this.selectedDate.day+' '+this.selectedTime.start)
|
|
69
|
-
this.$emit('
|
|
75
|
+
this.$emit('update:modelValue', this.selectedDate.day+' '+this.selectedTime.start+':00')
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
78
|
},
|
|
73
79
|
mounted() {
|
|
74
|
-
if(this.
|
|
75
|
-
this.selectedDate = _.findWhere(this.slots, { day: this.
|
|
80
|
+
if(this.modelValue && this.slots) {
|
|
81
|
+
this.selectedDate = _.findWhere(this.slots, { day: this.modelValue.substr(0, this.modelValue.indexOf(' '))} )
|
|
76
82
|
if(this.selectedDate) {
|
|
77
|
-
this.selectedTime = _.findWhere(this.selectedDate.slots, { start: this.
|
|
83
|
+
this.selectedTime = _.findWhere(this.selectedDate.slots, { start: this.modelValue.substr(this.modelValue.indexOf(' ')+1, 5) })
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
86
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template
|
|
1
|
+
<template>
|
|
2
2
|
<div style="background: #fdfdfd; border: 1px #ddd solid; padding: 1rem; font-size: 0.95em; border-radius: 5px; margin-top: 3rem">
|
|
3
3
|
<p class="mb-2">You <strong>MUST</strong> show your ID and credit card used for the purchase at the time of Pick Up or Delivery.</p>
|
|
4
4
|
<p class="mb-2">Delivery orders (for applicable locations) must be placed by 6:00 pm for Same Day Delivery.</p>
|