Browse Source

空格判断

master
slj 3 years ago
parent
commit
53f17540a8
  1. 92
      pages/topics/reportDemand/index.js

92
pages/topics/reportDemand/index.js

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

Loading…
Cancel
Save