@wikala/spmkt 2.31.0 → 3.0.0-beta.0
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 +261 -0
- package/api/product.js +1 -0
- package/api/request.js +9 -4
- 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/Coupon.vue +4 -5
- 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 +7 -5
- 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 +23 -23
- package/components/Gmaps/GmapsAutocomplete.vue +139 -78
- package/components/Gmaps/GmapsLocations.vue +1 -1
- package/components/Gmaps/GmapsSingleLocation.vue +121 -87
- package/components/ModalContainer/ModalContainer.vue +12 -9
- package/components/ModalContainer/index.js +61 -18
- package/components/Product/AddToCart.vue +237 -221
- package/components/Product/BoxAddToCart.vue +114 -86
- package/components/Product/Compare.vue +68 -48
- 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 +335 -341
- 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 +75 -0
- package/locales/en.json +2 -1
- package/locales/sr.json +2 -1
- package/package.json +43 -30
- package/utils/directives.js +28 -45
- package/utils/event-bus.js +56 -0
- package/utils/filters.js +24 -7
- package/utils/{gmaps.js → google/gmaps.js} +43 -10
- package/utils/{google-analytics-eec.js → google/google-analytics-eec.js} +7 -7
- 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
package/components/AgeGate.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<b-modal :can-cancel="false"
|
|
2
|
+
<b-modal :can-cancel="false" v-model="showModal">
|
|
3
3
|
<div class="wkl-agate-main">
|
|
4
4
|
<div class="agate-title">Please confirm your age</div>
|
|
5
5
|
<p class="wkl-agate-age">
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
32
|
import Cookie from 'js-cookie'
|
|
33
|
+
import { eventBus } from '../utils/event-bus'
|
|
33
34
|
|
|
34
35
|
export default {
|
|
35
36
|
name: 'AgeGate',
|
|
@@ -74,6 +75,11 @@ export default {
|
|
|
74
75
|
|
|
75
76
|
agreject() {
|
|
76
77
|
window.location.href = 'https://www.google.com/'
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
handleShowAgeGate() {
|
|
81
|
+
console.log('receiving sag')
|
|
82
|
+
this.showModal = true
|
|
77
83
|
}
|
|
78
84
|
},
|
|
79
85
|
|
|
@@ -93,11 +99,11 @@ export default {
|
|
|
93
99
|
this.showModal = true
|
|
94
100
|
}
|
|
95
101
|
}, 100)
|
|
102
|
+
eventBus.on('showAgeGate', this.handleShowAgeGate)
|
|
103
|
+
},
|
|
96
104
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.showModal = true
|
|
100
|
-
})
|
|
105
|
+
beforeUnmount() {
|
|
106
|
+
eventBus.off('showAgeGate', this.handleShowAgeGate)
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
109
|
</script>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<section class="modal-card-body">
|
|
10
10
|
<div v-if="showContinueAsGuest" class="continue-as-guest">
|
|
11
11
|
<div>
|
|
12
|
-
<button name="continue_as_guest" type="button" class="button is-fullwidth has-text-weight-bold" @click.prevent="
|
|
12
|
+
<button name="continue_as_guest" type="button" class="button is-fullwidth has-text-weight-bold" @click.prevent="bus.emit('guestMode', 'On')">
|
|
13
13
|
{{ $t('auth.continueAsGuest') }}
|
|
14
14
|
</button>
|
|
15
15
|
</div>
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
</footer>
|
|
68
68
|
</form>
|
|
69
69
|
|
|
70
|
-
<b-modal
|
|
70
|
+
<b-modal v-model="showResetPasswordDialog" custom-class="wkl-modal-container" :can-cancel="['escape', 'outside']">
|
|
71
71
|
<ResetPassword @close="showResetPasswordDialog = false" />
|
|
72
72
|
</b-modal>
|
|
73
73
|
|
|
74
|
-
<b-modal
|
|
74
|
+
<b-modal v-model="showCreateAccountDialog" custom-class="wkl-modal-container" :can-cancel="['escape', 'outside']">
|
|
75
75
|
<Register :title="createAccountTitle" :get-source="getSource" @close="showCreateAccountDialog = false" />
|
|
76
76
|
</b-modal>
|
|
77
77
|
|
|
@@ -79,11 +79,13 @@
|
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
81
|
<script>
|
|
82
|
-
|
|
82
|
+
import { ref, onMounted } from 'vue'
|
|
83
|
+
import config from '../../config'
|
|
83
84
|
import { request } from '../../api'
|
|
85
|
+
import { useBus, useMq } from '../../composables/globals'
|
|
84
86
|
|
|
85
|
-
import ResetPassword from './ResetPassword'
|
|
86
|
-
import Register from './Register'
|
|
87
|
+
import ResetPassword from './ResetPassword.vue'
|
|
88
|
+
import Register from './Register.vue'
|
|
87
89
|
|
|
88
90
|
export default {
|
|
89
91
|
name: 'Login',
|
|
@@ -109,64 +111,80 @@ export default {
|
|
|
109
111
|
default: 'Create Account'
|
|
110
112
|
}
|
|
111
113
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
emits: ['close'],
|
|
115
|
+
setup(props, { emit }) {
|
|
116
|
+
const bus = useBus()
|
|
117
|
+
const mq = useMq()
|
|
118
|
+
|
|
119
|
+
// Reactive state
|
|
120
|
+
const loading = ref(false)
|
|
121
|
+
const errors = ref({})
|
|
122
|
+
const email = ref('')
|
|
123
|
+
const password = ref('')
|
|
124
|
+
const showResetPasswordDialog = ref(false)
|
|
125
|
+
const showCreateAccountDialog = ref(false)
|
|
126
|
+
const loginEmail = ref(null)
|
|
127
|
+
|
|
128
|
+
// Methods
|
|
129
|
+
const doLogin = async () => {
|
|
130
|
+
loading.value = true
|
|
126
131
|
try {
|
|
127
132
|
let response = await request({
|
|
128
|
-
baseURL:
|
|
133
|
+
baseURL: config.BASE_URL,
|
|
129
134
|
url: '/login',
|
|
130
135
|
method: 'post',
|
|
131
|
-
data: { email:
|
|
136
|
+
data: { email: email.value, password: password.value, scope: 'customer' }
|
|
132
137
|
})
|
|
133
|
-
|
|
138
|
+
loading.value = false
|
|
134
139
|
if (response.status === 200) {
|
|
135
|
-
if (
|
|
136
|
-
|
|
140
|
+
if (props.redirectHandler) {
|
|
141
|
+
props.redirectHandler()
|
|
137
142
|
} else {
|
|
138
143
|
window.location.href = '/account'
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
146
|
} catch (error) {
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
loading.value = false
|
|
148
|
+
errors.value = error.errors || {}
|
|
144
149
|
}
|
|
145
|
-
}
|
|
150
|
+
}
|
|
146
151
|
|
|
147
|
-
clearError(field) {
|
|
148
|
-
if (
|
|
149
|
-
|
|
152
|
+
const clearError = (field) => {
|
|
153
|
+
if (errors.value[field]) {
|
|
154
|
+
errors.value[field] = ''
|
|
150
155
|
}
|
|
151
156
|
}
|
|
152
|
-
},
|
|
153
157
|
|
|
154
|
-
|
|
158
|
+
// Lifecycle hooks
|
|
159
|
+
onMounted(() => {
|
|
160
|
+
let loginUrl = new URL(window.location.href)
|
|
155
161
|
|
|
156
|
-
|
|
162
|
+
let showLostPassword = loginUrl.searchParams.get('lost-password')
|
|
163
|
+
if(showLostPassword === '') {
|
|
164
|
+
showResetPasswordDialog.value = true
|
|
165
|
+
}
|
|
157
166
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
167
|
+
let showCreateAccount = loginUrl.searchParams.get('create-account')
|
|
168
|
+
if(showCreateAccount === '') {
|
|
169
|
+
showCreateAccountDialog.value = true
|
|
170
|
+
}
|
|
162
171
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
172
|
+
if (mq.value !== 'mobile') {
|
|
173
|
+
loginEmail.value?.focus()
|
|
174
|
+
}
|
|
175
|
+
})
|
|
167
176
|
|
|
168
|
-
|
|
169
|
-
|
|
177
|
+
return {
|
|
178
|
+
loading,
|
|
179
|
+
errors,
|
|
180
|
+
email,
|
|
181
|
+
password,
|
|
182
|
+
showResetPasswordDialog,
|
|
183
|
+
showCreateAccountDialog,
|
|
184
|
+
loginEmail,
|
|
185
|
+
doLogin,
|
|
186
|
+
clearError,
|
|
187
|
+
bus
|
|
170
188
|
}
|
|
171
189
|
}
|
|
172
190
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="modal-card">
|
|
3
3
|
<form @submit.prevent="register" method="post" action="/account/create" novalidate>
|
|
4
|
-
<header v-if="showHeader" class="modal-card-head">
|
|
5
|
-
<
|
|
6
|
-
<
|
|
4
|
+
<header v-if="showHeader" class="modal-card-head is-flex">
|
|
5
|
+
<div class="modal-card-title">{{ title }} </div>
|
|
6
|
+
<div class="is-position-relative">
|
|
7
|
+
<button @click="$emit('close')" type="button" class="modal-close is-large" style=""></button>
|
|
8
|
+
</div>
|
|
7
9
|
</header>
|
|
8
10
|
|
|
9
11
|
<section class="modal-card-body">
|
|
@@ -15,9 +17,9 @@
|
|
|
15
17
|
name="first_name"
|
|
16
18
|
data-test="register-first-name"
|
|
17
19
|
ref="first_name"
|
|
18
|
-
@input="clearError('first_name')"
|
|
19
|
-
@focus="clearError('first_name')"
|
|
20
20
|
v-model="registrationData.first_name"
|
|
21
|
+
@focus="clearError('first_name')"
|
|
22
|
+
@update:model-value="clearError('first_name')"
|
|
21
23
|
type="text"
|
|
22
24
|
/>
|
|
23
25
|
</b-field>
|
|
@@ -28,9 +30,9 @@
|
|
|
28
30
|
native-value="inside"
|
|
29
31
|
name="last_name"
|
|
30
32
|
data-test="register-last-name"
|
|
31
|
-
@input="clearError('last_name')"
|
|
32
|
-
@focus="clearError('last_name')"
|
|
33
33
|
v-model="registrationData.last_name"
|
|
34
|
+
@focus="clearError('last_name')"
|
|
35
|
+
@update:model-value="clearError('last_name')"
|
|
34
36
|
type="text"
|
|
35
37
|
/>
|
|
36
38
|
</b-field>
|
|
@@ -38,11 +40,15 @@
|
|
|
38
40
|
</div>
|
|
39
41
|
|
|
40
42
|
<div v-if="parseInt(initialState.age_verification.enabled)">
|
|
41
|
-
<dob-input
|
|
43
|
+
<dob-input
|
|
44
|
+
v-model="registrationData.date_of_birth"
|
|
45
|
+
:error="errors.date_of_birth"
|
|
46
|
+
@update:modelValue="onDobInput"
|
|
47
|
+
></dob-input>
|
|
42
48
|
</div>
|
|
43
49
|
|
|
44
50
|
<b-field :label="$t('global.email')" label-position="inside" :type="{ 'is-danger': errors.email }" :message="errors.email">
|
|
45
|
-
<b-input native-value="inside" name="email" data-test="register-email"
|
|
51
|
+
<b-input native-value="inside" name="email" data-test="register-email" v-model="registrationData.email" @focus="clearError('email')" @update:model-value="clearError('email')"></b-input>
|
|
46
52
|
</b-field>
|
|
47
53
|
|
|
48
54
|
<b-field :label="$t('auth.password')" label-position="inside" :type="{ 'is-danger': errors.password }" :message="errors.password">
|
|
@@ -50,10 +56,10 @@
|
|
|
50
56
|
native-value="inside"
|
|
51
57
|
name="password"
|
|
52
58
|
data-test="register-password"
|
|
53
|
-
|
|
59
|
+
v-model="registrationData.password"
|
|
54
60
|
@focus="clearError('password')"
|
|
55
61
|
type="password"
|
|
56
|
-
|
|
62
|
+
@update:model-value="clearError('password')"
|
|
57
63
|
:placeholder="$t('auth.passwordInfo')"
|
|
58
64
|
/>
|
|
59
65
|
</b-field>
|
|
@@ -68,10 +74,10 @@
|
|
|
68
74
|
native-value="inside"
|
|
69
75
|
name="password_confirmation"
|
|
70
76
|
data-test="register-password-confirm"
|
|
71
|
-
|
|
77
|
+
v-model="registrationData.password_confirmation"
|
|
72
78
|
@focus="clearError('password_confirmation')"
|
|
73
79
|
type="password"
|
|
74
|
-
|
|
80
|
+
@update:model-value="clearError('password_confirmation')"
|
|
75
81
|
/>
|
|
76
82
|
</b-field>
|
|
77
83
|
|
|
@@ -95,11 +101,14 @@
|
|
|
95
101
|
</template>
|
|
96
102
|
|
|
97
103
|
<script>
|
|
104
|
+
import { ref, onMounted } from 'vue'
|
|
105
|
+
import config from '../../config'
|
|
98
106
|
import { request } from '../../api'
|
|
107
|
+
import { useBuefy, useInitialState, useMq, useT } from '../../composables/globals'
|
|
99
108
|
|
|
100
|
-
import GoogleAnalyticsEEC from '../../utils/google-analytics-eec.js'
|
|
109
|
+
import GoogleAnalyticsEEC from '../../utils/google/google-analytics-eec.js'
|
|
101
110
|
|
|
102
|
-
import DobInput from '../../components/DobInput'
|
|
111
|
+
import DobInput from '../../components/DobInput.vue'
|
|
103
112
|
|
|
104
113
|
const registrationDataSchema = {
|
|
105
114
|
scope: 'customer',
|
|
@@ -127,55 +136,56 @@ export default {
|
|
|
127
136
|
},
|
|
128
137
|
title: {
|
|
129
138
|
type: String,
|
|
130
|
-
default:
|
|
131
|
-
return this.$t('auth.createAnAccount', [this.initialState.site_name])
|
|
132
|
-
}
|
|
139
|
+
default: 'Create an Account'
|
|
133
140
|
}
|
|
134
141
|
},
|
|
135
142
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
emits: ['close'],
|
|
144
|
+
|
|
145
|
+
setup(props, { emit }) {
|
|
146
|
+
const mq = useMq()
|
|
147
|
+
const { t: $t } = useT()
|
|
148
|
+
const $buefy = useBuefy()
|
|
149
|
+
const initialState = useInitialState()
|
|
150
|
+
|
|
151
|
+
// Reactive state
|
|
152
|
+
const loading = ref(false)
|
|
153
|
+
const errors = ref({})
|
|
154
|
+
const registrationData = ref({ ...registrationDataSchema })
|
|
155
|
+
const first_name = ref(null)
|
|
143
156
|
|
|
144
|
-
|
|
145
|
-
onDobInput(
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
console.log('onDobInput', e.toString())
|
|
157
|
+
// Methods
|
|
158
|
+
const onDobInput = (value) => {
|
|
159
|
+
if (value) {
|
|
160
|
+
errors.value.date_of_birth = ''
|
|
149
161
|
}
|
|
150
|
-
|
|
151
|
-
},
|
|
162
|
+
}
|
|
152
163
|
|
|
153
|
-
async
|
|
154
|
-
|
|
164
|
+
const register = async () => {
|
|
165
|
+
loading.value = true
|
|
155
166
|
try {
|
|
156
167
|
let response = await request({
|
|
157
|
-
baseURL:
|
|
168
|
+
baseURL: config.BASE_URL,
|
|
158
169
|
url: '/register',
|
|
159
170
|
method: 'post',
|
|
160
|
-
data:
|
|
171
|
+
data: registrationData.value
|
|
161
172
|
})
|
|
162
|
-
|
|
173
|
+
loading.value = false
|
|
163
174
|
let signupSource = 'standard'
|
|
164
|
-
if(
|
|
165
|
-
signupSource =
|
|
175
|
+
if (props.getSource) {
|
|
176
|
+
signupSource = props.getSource()
|
|
166
177
|
}
|
|
167
178
|
GoogleAnalyticsEEC.signUp(signupSource)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
message: '<div data-test="account-created-message">' + this.$t('auth.createAccountNotification') + '</div>',
|
|
179
|
+
errors.value = {}
|
|
180
|
+
registrationData.value = { ...registrationDataSchema }
|
|
181
|
+
$buefy.dialog.alert({
|
|
182
|
+
title: $t('auth.createAnAccount', ['']),
|
|
183
|
+
message: '<div data-test="account-created-message">' + $t('auth.createAccountNotification') + '</div>',
|
|
174
184
|
confirmText: 'OK',
|
|
175
185
|
type: 'is-primary',
|
|
176
186
|
onConfirm: () => {
|
|
177
|
-
if (
|
|
178
|
-
|
|
187
|
+
if (props.redirectHandler) {
|
|
188
|
+
props.redirectHandler()
|
|
179
189
|
} else {
|
|
180
190
|
window.location.reload()
|
|
181
191
|
}
|
|
@@ -183,16 +193,16 @@ export default {
|
|
|
183
193
|
})
|
|
184
194
|
} catch (error) {
|
|
185
195
|
console.log('Error ', error)
|
|
186
|
-
|
|
196
|
+
loading.value = false
|
|
187
197
|
if (error.errors !== undefined) {
|
|
188
|
-
|
|
198
|
+
errors.value = error.errors
|
|
189
199
|
} else {
|
|
190
200
|
let msg = 'Something went wrong. Please try again later.'
|
|
191
|
-
if(error.message) {
|
|
201
|
+
if (error.message) {
|
|
192
202
|
msg = error.message
|
|
193
203
|
}
|
|
194
|
-
|
|
195
|
-
title:
|
|
204
|
+
$buefy.dialog.alert({
|
|
205
|
+
title: $t('auth.createAnAccount', ['']),
|
|
196
206
|
message: msg,
|
|
197
207
|
confirmText: 'OK',
|
|
198
208
|
type: 'is-danger'
|
|
@@ -200,18 +210,30 @@ export default {
|
|
|
200
210
|
}
|
|
201
211
|
}
|
|
202
212
|
return false
|
|
203
|
-
}
|
|
213
|
+
}
|
|
204
214
|
|
|
205
|
-
clearError(field) {
|
|
206
|
-
if (
|
|
207
|
-
|
|
215
|
+
const clearError = (field) => {
|
|
216
|
+
if (errors.value[field]) {
|
|
217
|
+
errors.value[field] = ''
|
|
208
218
|
}
|
|
209
219
|
}
|
|
210
|
-
},
|
|
211
220
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
221
|
+
// Lifecycle hooks
|
|
222
|
+
onMounted(() => {
|
|
223
|
+
if (mq.value !== 'mobile') {
|
|
224
|
+
first_name.value?.focus()
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
return {
|
|
229
|
+
loading,
|
|
230
|
+
errors,
|
|
231
|
+
registrationData,
|
|
232
|
+
first_name,
|
|
233
|
+
initialState,
|
|
234
|
+
onDobInput,
|
|
235
|
+
register,
|
|
236
|
+
clearError
|
|
215
237
|
}
|
|
216
238
|
}
|
|
217
239
|
}
|
|
@@ -29,65 +29,80 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
|
+
import { ref, onMounted } from 'vue'
|
|
33
|
+
import config from '../../config'
|
|
32
34
|
import { request } from '../../api'
|
|
35
|
+
import { useBuefy, useT } from '../../composables/globals'
|
|
33
36
|
|
|
34
37
|
export default {
|
|
35
38
|
name: 'ResetPassword',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
errors: {}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
39
|
+
emits: ['close'],
|
|
40
|
+
setup(props, { emit }) {
|
|
41
|
+
const $buefy = useBuefy()
|
|
42
|
+
const { t: $t } = useT()
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
// Reactive state
|
|
45
|
+
const loading = ref(false)
|
|
46
|
+
const email = ref('')
|
|
47
|
+
const errors = ref({})
|
|
48
|
+
const loginEmail = ref(null)
|
|
49
|
+
|
|
50
|
+
// Methods
|
|
51
|
+
const resetPassword = async () => {
|
|
52
|
+
loading.value = true
|
|
47
53
|
|
|
48
54
|
try {
|
|
49
55
|
let response = await request({
|
|
50
|
-
baseURL:
|
|
56
|
+
baseURL: config.BASE_URL,
|
|
51
57
|
url: '/password/email',
|
|
52
58
|
method: 'post',
|
|
53
|
-
data: { email:
|
|
59
|
+
data: { email: email.value }
|
|
54
60
|
})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
title:
|
|
61
|
+
loading.value = false
|
|
62
|
+
|
|
63
|
+
$buefy.dialog.alert({
|
|
64
|
+
title: $t('auth.resetPasswordSuccessTitle'),
|
|
59
65
|
message: response.data.status,
|
|
60
66
|
confirmText: 'OK',
|
|
61
|
-
onConfirm: () =>
|
|
67
|
+
onConfirm: () => emit('close')
|
|
62
68
|
})
|
|
63
69
|
} catch (error) {
|
|
64
|
-
|
|
65
|
-
if(error.errors) {
|
|
66
|
-
|
|
70
|
+
loading.value = false
|
|
71
|
+
if (error.errors) {
|
|
72
|
+
errors.value = error.errors
|
|
67
73
|
} else {
|
|
68
74
|
let msg = 'Something went wrong. Please try again later.'
|
|
69
|
-
if(error.message) {
|
|
75
|
+
if (error.message) {
|
|
70
76
|
msg = error.message
|
|
71
77
|
}
|
|
72
|
-
|
|
73
|
-
title:
|
|
78
|
+
$buefy.dialog.alert({
|
|
79
|
+
title: $t('auth.resetPassword'),
|
|
74
80
|
message: msg,
|
|
75
81
|
confirmText: 'OK',
|
|
76
82
|
type: 'is-danger'
|
|
77
83
|
})
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
|
-
}
|
|
86
|
+
}
|
|
81
87
|
|
|
82
|
-
clearError(field) {
|
|
83
|
-
if (
|
|
84
|
-
|
|
88
|
+
const clearError = (field) => {
|
|
89
|
+
if (errors.value[field]) {
|
|
90
|
+
errors.value[field] = ''
|
|
85
91
|
}
|
|
86
92
|
}
|
|
87
|
-
},
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
onMounted(() => {
|
|
95
|
+
loginEmail.value?.focus()
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
loading,
|
|
100
|
+
email,
|
|
101
|
+
errors,
|
|
102
|
+
loginEmail,
|
|
103
|
+
resetPassword,
|
|
104
|
+
clearError
|
|
105
|
+
}
|
|
91
106
|
}
|
|
92
107
|
}
|
|
93
108
|
</script>
|
|
@@ -53,7 +53,7 @@ export default {
|
|
|
53
53
|
return false
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const avloading = this.$buefy.loading.open()
|
|
56
|
+
const avloading = this.$buefy.loading.open({})
|
|
57
57
|
try {
|
|
58
58
|
let avresp = await Cart.ageVerification({
|
|
59
59
|
date_of_birth: date_of_birth,
|
|
@@ -109,13 +109,13 @@ export default {
|
|
|
109
109
|
return true
|
|
110
110
|
},
|
|
111
111
|
onclosed: function () {
|
|
112
|
-
vm.$bus
|
|
112
|
+
vm.$bus.emit('ageCheckerVerified')
|
|
113
113
|
Cookie.set('ac_custom_verified', true)
|
|
114
114
|
return true
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
//const ac_script_loading = this.$buefy.loading.open()
|
|
118
|
+
//const ac_script_loading = this.$buefy.loading.open({})
|
|
119
119
|
|
|
120
120
|
let agecheckerScript = document.createElement('script')
|
|
121
121
|
agecheckerScript.setAttribute('id', 'age-checker-script')
|
|
@@ -39,6 +39,14 @@ export default {
|
|
|
39
39
|
methods: {
|
|
40
40
|
qtyClick() {
|
|
41
41
|
window.location.href = '/shopping-cart'
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
onUpdateCart(cart) {
|
|
45
|
+
this.sumQty = cart.sumQty
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
onUpdateTotalQty(totalQty) {
|
|
49
|
+
this.sumQty = totalQty
|
|
42
50
|
}
|
|
43
51
|
},
|
|
44
52
|
|
|
@@ -48,10 +56,13 @@ export default {
|
|
|
48
56
|
} else {
|
|
49
57
|
this.sumQty = 0
|
|
50
58
|
}
|
|
51
|
-
this.$bus
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
this.$bus.on('updateCart', this.onUpdateCart)
|
|
60
|
+
this.$bus.on('updateTotalQty', this.onUpdateTotalQty)
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
beforeUnmount() {
|
|
64
|
+
this.$bus.off('updateCart', this.onUpdateCart)
|
|
65
|
+
this.$bus.off('updateTotalQty', this.onUpdateTotalQty)
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
68
|
</script>
|
|
@@ -77,14 +77,9 @@ export default {
|
|
|
77
77
|
|
|
78
78
|
goToCart() {
|
|
79
79
|
window.location.href = '/shopping-cart'
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
mounted() {
|
|
80
|
+
},
|
|
84
81
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.$bus.$on('addToCart', (product) => {
|
|
82
|
+
onAddToCart(product) {
|
|
88
83
|
this.product = product
|
|
89
84
|
this.isActive = true
|
|
90
85
|
|
|
@@ -116,16 +111,29 @@ export default {
|
|
|
116
111
|
console.log('atcb', this.addToCartButton)
|
|
117
112
|
if (this.addToCartButton) {
|
|
118
113
|
this.addToCartButton.classList.add('is-hidden')
|
|
119
|
-
}
|
|
114
|
+
}
|
|
120
115
|
})
|
|
121
116
|
}
|
|
122
|
-
}
|
|
117
|
+
},
|
|
123
118
|
|
|
124
|
-
|
|
119
|
+
onUpdateCart(cart) {
|
|
125
120
|
//console.log('received updateCart: ', cart)
|
|
126
121
|
this.cartTotal = cart.subtotal
|
|
127
122
|
this.sumQty = cart.sumQty
|
|
128
|
-
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
mounted() {
|
|
127
|
+
|
|
128
|
+
this.addToCartButton = document.querySelector('.add-to-cart')
|
|
129
|
+
|
|
130
|
+
this.$bus.on('addToCart', this.onAddToCart)
|
|
131
|
+
this.$bus.on('updateCart', this.onUpdateCart)
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
beforeUnmount() {
|
|
135
|
+
this.$bus.off('addToCart', this.onAddToCart)
|
|
136
|
+
this.$bus.off('updateCart', this.onUpdateCart)
|
|
129
137
|
}
|
|
130
138
|
}
|
|
131
139
|
</script>
|