checkout page email validation

This commit is contained in:
Shubham Mehrotra 2020-04-08 18:55:20 +05:30
parent 67a4720af9
commit c2022a9b50
2 changed files with 16 additions and 17 deletions

View File

@ -286,26 +286,25 @@
return isManualValidationFail;
},
isCustomerExist: function () {
this.$validator.attach('email', 'required|email');
isCustomerExist: function() {
this.$validator.attach('address-form.billing[email]', 'required|email');
var this_this = this;
this.$validator.validate('address-form.billing[email]', this.address.billing.email)
.then(isValid => {
if (! isValid)
return;
this.$validator.validate('email', this.address.billing.email)
.then(function(isValid) {
if (! isValid)
return;
this_this.$http.post("{{ route('customer.checkout.exist') }}", {email: this_this.address.billing.email})
.then(function(response) {
this_this.is_customer_exist = response.data ? 1 : 0;
if (response.data)
document.body.style.cursor = 'default';
})
.catch(function (error) {})
this.$http.post("{{ route('customer.checkout.exist') }}", {email: this.address.billing.email})
.then(response => {
this.is_customer_exist = response.data ? 1 : 0;
console.log(this.is_customer_exist);
if (response.data)
document.body.style.cursor = 'default';
})
.catch(function (error) {})
})
.catch(error => {})
},
loginCustomer: function () {

View File

@ -8,7 +8,7 @@
name="password"
v-model="address.billing.password" />
<div class="forgot-password-link">
<div class="forgot-password-link mt-4 mb-4">
<a href="{{ route('customer.forgot-password.create') }}">{{ __('shop::app.customer.login-form.forgot_pass') }}</a>
<div class="mt-10">