|
@@ -11,7 +11,7 @@
|
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="contactForm" label-width="120px" label-position="top">
|
|
<el-form :model="form" :rules="rules" ref="contactForm" label-width="120px" label-position="top">
|
|
<el-form-item label="Name" prop="name">
|
|
<el-form-item label="Name" prop="name">
|
|
- <el-input v-model="form.name"></el-input>
|
|
|
|
|
|
+ <el-input v-model="form.name" prop="name" ></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="Business Name" prop="businessName">
|
|
<el-form-item label="Business Name" prop="businessName">
|
|
<el-input v-model="form.businessName"></el-input>
|
|
<el-input v-model="form.businessName"></el-input>
|
|
@@ -33,11 +33,11 @@
|
|
|
|
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="Your message" prop="message">
|
|
|
|
- <el-input type="textarea" v-model="form.message"></el-input>
|
|
|
|
|
|
+ <el-form-item label="Your message">
|
|
|
|
+ <el-input type="text" v-model="form.message"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" @click="submitForm('contactForm')" class="sbuBtn">Submit</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="submitForm('contactForm')" class="sbuBtn" :loading="isLoading">Submit</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
@@ -55,6 +55,7 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
showPanel: true,
|
|
showPanel: true,
|
|
|
|
+ isLoading:false,
|
|
form: {
|
|
form: {
|
|
name: '',
|
|
name: '',
|
|
businessName: '',
|
|
businessName: '',
|
|
@@ -89,11 +90,7 @@
|
|
validator: elIsEmail
|
|
validator: elIsEmail
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- message:[
|
|
|
|
- {
|
|
|
|
- required: true,
|
|
|
|
- message: 'Please enter'
|
|
|
|
- }],
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -102,26 +99,28 @@
|
|
this.$refs[formName].validate(async (valid) => {
|
|
this.$refs[formName].validate(async (valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
try {
|
|
try {
|
|
- const language = this.languages.find(
|
|
|
|
- (item) => item.value === this.form.language
|
|
|
|
- );
|
|
|
|
|
|
+ this.isLoading=true;
|
|
|
|
|
|
const data = await emailSend(
|
|
const data = await emailSend(
|
|
emailConfig.SERVICE_ID,
|
|
emailConfig.SERVICE_ID,
|
|
emailConfig.TEMPLATE_ID,
|
|
emailConfig.TEMPLATE_ID,
|
|
{
|
|
{
|
|
- from_name: "test",
|
|
|
|
name: this.form.name,
|
|
name: this.form.name,
|
|
businessName: this.form.businessName,
|
|
businessName: this.form.businessName,
|
|
mobile: this.form.mobile,
|
|
mobile: this.form.mobile,
|
|
email: this.form.email,
|
|
email: this.form.email,
|
|
- language: language.value,
|
|
|
|
|
|
+ languagePreference: this.form.language,
|
|
message: this.form.message,
|
|
message: this.form.message,
|
|
}
|
|
}
|
|
);
|
|
);
|
|
-
|
|
|
|
|
|
+ this.isLoading=false;
|
|
|
|
+
|
|
if (data.status === 200) {
|
|
if (data.status === 200) {
|
|
- window.alert("Form submitted successfully!");
|
|
|
|
|
|
+ this.$alert('Thank you for contacting us. We’ll get in touch with you in the next 24 hours', '', {
|
|
|
|
+ callback: action => {
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
window.alert("Form submitted failed!");
|
|
window.alert("Form submitted failed!");
|
|
}
|
|
}
|
|
@@ -129,6 +128,7 @@
|
|
console.log("Error submitting form!", error);
|
|
console.log("Error submitting form!", error);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ this.isLoading=false;
|
|
console.log("Error submitting form!");
|
|
console.log("Error submitting form!");
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|