diff --git a/pages/topics/reportDemand/index.js b/pages/topics/reportDemand/index.js index eb890b9..20e5c71 100644 --- a/pages/topics/reportDemand/index.js +++ b/pages/topics/reportDemand/index.js @@ -240,7 +240,7 @@ Page({ }) return } - if (this.data.messageDetail === '') { + if (this.data.messageDetail === '' || this.data.messageDetail.trim() === '') { wx.showModal({ title: '提示', content: '请输入正文内容', @@ -248,7 +248,7 @@ Page({ }) return } - if (this.data.username === '') { + if (this.data.username === '' || this.data.username.trim() === '') { wx.showModal({ title: '提示', content: '请输入姓名', @@ -264,7 +264,7 @@ Page({ }) return } - if (this.data.company === '') { + if (this.data.company === '' || this.data.company.trim() === '') { wx.showModal({ title: '提示', content: '请输入工作单位', @@ -313,49 +313,49 @@ Page({ workplace: this.data.company, name: this.data.username } - console.log('报需求-->',data) - topicModel.addTalents(data, res => { - const id = res.result; - if (res.code === 200) { - this.setData({ - messageDetail: '', - streetID: '', - typeCode: '', - files: [], - }, () => { - wx.showModal({ - title: '提交成功', - content: '问题已收到!', - cancelText: '知道了', - confirmText: '查看进度', - success(res) { - if (res.confirm) { - wx.redirectTo({ - url: '/pages/user/myWhistle/whistleDetail/index?id=' + id, - }) - } else if (res.cancel) { // 点击知道了 - if (th.properties.type == '') { - setTimeout(function () { - th.setData({ - textareaValue: '' - }) - }, 500); - } else { - console.log(1212); - wx.navigateBack({ - delta: 1 - }) - } - } - } - }) - }) - } - }) - this.setData({ - streetsIndex: 0, - typeListIndex: 0, - }) + console.log('报需求-->',data) + // topicModel.addTalents(data, res => { + // const id = res.result; + // if (res.code === 200) { + // this.setData({ + // messageDetail: '', + // streetID: '', + // typeCode: '', + // files: [], + // }, () => { + // wx.showModal({ + // title: '提交成功', + // content: '问题已收到!', + // cancelText: '知道了', + // confirmText: '查看进度', + // success(res) { + // if (res.confirm) { + // wx.redirectTo({ + // url: '/pages/user/myWhistle/whistleDetail/index?id=' + id, + // }) + // } else if (res.cancel) { // 点击知道了 + // if (th.properties.type == '') { + // setTimeout(function () { + // th.setData({ + // textareaValue: '' + // }) + // }, 500); + // } else { + // console.log(1212); + // wx.navigateBack({ + // delta: 1 + // }) + // } + // } + // } + // }) + // }) + // } + // }) + // this.setData({ + // streetsIndex: 0, + // typeListIndex: 0, + // }) }, company: function (e) { var company = e.detail.value;