This commit is contained in:
rakesh 2023-05-22 18:41:54 +05:30
parent b83eccf0ea
commit 95976f6006
2 changed files with 50 additions and 23 deletions

View File

@ -118,22 +118,24 @@
@update:modelValue="checkRegionName()"
:rules="[(v) => !!v || 'Please select the State']"
></v-select>
<vue-tel-input
type="number"
<v-text-field
label="Telephone"
ref="telephone"
:rules="phoneNumberRules"
v-model="telephone"
:defaultCountry="setCountryCode"
:class="
phoneNumberError
? 'phonenumber-input-error-border'
: 'phonenumber-custom-input'
"
@input="validateNumber"
ref="phoneNumber"
v-show="hideAndShowFields"
></vue-tel-input>
<span class="red--text caption ml-3" v-show="hideAndShowFields && phoneNumberError"
variant="outlined"
density="compact"
@input="acceptNumber"
class="shipping-address-form pt-2"
color="primary"
v-show="hideAndShowFields"
></v-text-field>
<span class="red--text caption ml-3" v-show="hideAndShowFields && phoneNumberError"
>This field is required</span
>
</v-col>
</v-row>
</v-form>
@ -143,7 +145,6 @@
//import { mapState } from "vuex";
import { createHelpers } from "vuex-map-fields";
import { fetchStates } from "@/services/util.service";
import { VueTelInput } from "vue3-tel-input";
const { mapFields } = createHelpers({
getterType: "accountOne/getField",
@ -181,7 +182,6 @@ export default {
],
}),
components: {
VueTelInput,
},
computed: {
...mapFields([
@ -230,6 +230,10 @@ export default {
},
},
methods: {
acceptNumber() {
let x = this.telephone.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\d{0,4})/);
this.telephone = !x[2] ? x[1] : '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3] : '');
},
verifyAddress() {
this.$emit("verifyAddress");
},

View File

@ -236,6 +236,7 @@
@click="
editLocalAddress(userLocalAddress, false)
"
color="primary"
>Edit</v-btn
>
</v-col>
@ -340,9 +341,12 @@
cols="12"
v-else-if="estimatedShippingMethods.length > 0"
>
<v-radio-group
mandatory
v-model="estimatedShipping"
:model-value="estimatedShipping"
>
<div
v-for="(
@ -355,6 +359,7 @@
<v-radio
:label="method.carrierTitle"
:value="method"
v-model="estimatedShipping"
class="text-black"
color="primary"
></v-radio>
@ -495,6 +500,7 @@
@click="editBillBook()"
depressed
tile
color="primary"
>Edit</v-btn
>
</v-col>
@ -539,7 +545,7 @@
return-object
color="primary"
class="billing-address-select"
@change="changeBillingAddress()"
@update:modelValue="changeBillingAddress()"
item-value="id"
>
<template v-slot:selection="{ item }">
@ -621,7 +627,7 @@
<v-col
cols="12"
class="d-flex justify-end pa-0 mb-6"
v-if="!sshowNewBillingForm"
v-if="!showNewBillingForm"
>
<v-btn
class="primary ma-3 text-uppercase"
@ -653,6 +659,7 @@
class="mt-0"
density="compact"
hide-details
color="success"
></v-checkbox>
</v-col>
</v-row>
@ -675,11 +682,13 @@
<v-btn
class="primary ma-3 text-uppercase"
@click="cancelBillingAddress"
color="primary"
>Cancel</v-btn
>
<v-btn
class="success ma-3 text-uppercase"
@click="newBillingAddress"
color="success"
>Update</v-btn
>
</v-col>
@ -1791,9 +1800,10 @@ export default {
);
}
},
newBillingAddress() {
async newBillingAddress() {
this.previousAddress = this.address;
if (this.$refs.billingForm.$refs.shippingAddressform.validate()) {
let validate = await this.$refs.billingForm.$refs.shippingAddressform.validate();
if (validate && validate.valid) {
if (this.saveInBillingAddressBook) {
this.$store.dispatch("accountOne/updateAddress");
localStorage.setItem(
@ -1900,6 +1910,9 @@ export default {
}
},
next: function () {
if(this.estimatedShipping)
{
this.tabs = "reviewTab";
if (this.userAuth) {
if (this.addressesList.length == 0) {
@ -2003,6 +2016,16 @@ export default {
window.scrollTo(0, 0);
}
}
}
else
{
this.snackbar = {
message: 'Please select shipping method.',
color: "error",
show: true,
timeout: 5000,
};
}
},
saveUserAddress() {
let phoneNumber = this.$refs.dialogShippingAddressForm.$refs.phoneNumber
@ -2077,8 +2100,8 @@ export default {
},
async placeOrderFree(e) {
try {
e.preventDefault();
if (this.$refs.poNumberForm.validate()) {
let validate = await this.$refs.poNumberForm.validate()
if (validate && validate.valid ) {
this.isPageLoader = true;
if (this.userAuth) {
try {