Commit 526e6179 authored by 王宝峰's avatar 王宝峰

留言咨询页面可能多次提交问题修复

parent dacfe24f
......@@ -20,7 +20,7 @@
</view>
</uni-card>
<view class="newMedia-button-view">
<button style="background-color: #3B7CDE;" class="newMedia-button" @click="submitForm">提交</button>
<button style="background-color: #3B7CDE;" :disabled="disabledFag" class="newMedia-button" @click="submitForm">提交</button>
</view>
......@@ -50,8 +50,9 @@
export default {
data() {
return {
// 对输入的内容进行校验的标志
contentFlag: false,
disabledFag: false,//避免重复提交的校验标志
contentFlag: false,// 对输入的内容进行校验的标志
url: '',
personnel: {
consultType: '',
......@@ -139,7 +140,7 @@
methods: {
// 提交按钮
submitForm() {
console.log("咨询内容--->", this.personnel)
// this.disabledFag = true
if (this.personnel.consultContent && this.personnel.consultContent.length > 0) {
let reg = /^\s*$/
if (reg.test(this.personnel.consultContent)) {
......@@ -148,15 +149,14 @@
}
}
this.$refs.form.validate().then(res => {
console.log("留言咨询内容--->:", this.personnel)
submitConsultAxios(this.personnel).then(response => {
console.log("提交咨询:", response)
if (response.code == 200) {
// 打开弹窗
this.$refs.popup.open('center')
} else {
// this.disabledFag = false
uni.showToast({
title: '咨询提交失败,请您稍后在试',
duration: 1000,
......
......@@ -80,13 +80,6 @@
current: index,
urls: photoList
})
// wx.previewImage({
// urls: [imgUrl], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
// current: '', // 当前显示图片的http链接,默认是第一个
// success: function(res) {},
// fail: function(res) {},
// complete: function(res) {},
// })
},
setVote() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment