From 2432c15b66cdf78f993c96d5e5d32617f2fc3d01 Mon Sep 17 00:00:00 2001 From: chenteng <17864191895@163.com> Date: Fri, 7 Aug 2020 15:20:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E6=89=8D=E5=90=B9=E5=93=A8=E8=B6=85?= =?UTF-8?q?=E8=BF=87=E5=AD=97=E6=95=B0=E7=A1=AE=E4=BB=BB=E4=B8=8D=E6=B8=85?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/topics/talents/index.js | 38 ++++++++++++++------------------- pages/topics/talents/index.wxml | 2 +- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/pages/topics/talents/index.js b/pages/topics/talents/index.js index a8e06ec..39fcc57 100644 --- a/pages/topics/talents/index.js +++ b/pages/topics/talents/index.js @@ -18,6 +18,7 @@ Component({ data: { messageTitle:"", messageDetail:"", + messageTemp:"", files: [], // 所在街道 streets: [], @@ -89,16 +90,16 @@ Component({ }) }, bindTextAreaInput(e) { - if(this.data.messageDetail.length <= 200){ - this.setData({ - messageDetail: e.detail.value - }) - }else{ + console.log("bindTextAreaInput"); + this.setData({ + messageDetail: e.detail.value, + }) + if(e.detail.value.length>200){ wx.showToast({ title: '超过字数', - icon: 'none', duration: 2000, - }) + icon: 'none' + }) } }, uplaodFile(files) { @@ -143,29 +144,22 @@ Component({ }, submit() { - if (this.data.messageDetail === ''){ + if (this.data.messageDetail.length >200){ wx.showModal({ title: '提示', - content: '请输入正文内容', - showCancel:false + content: '问题超过字数,请重新输入', + showCancel:false, }) return - } - if (this.data.messageDetail.length >200){ - let th = this + } + if (this.data.messageDetail === ''){ wx.showModal({ title: '提示', - content: '问题超过字数,请重新输入', - showCancel:false, - success: function (res) { - console.log(res); - setTimeout(function(){th.setData({ - messageDetail: '' - })},500) - }, + content: '请输入正文内容', + showCancel:false }) return - } + } //判断是否选择街道 if (this.data.streetID === ''){ wx.showModal({ diff --git a/pages/topics/talents/index.wxml b/pages/topics/talents/index.wxml index bed296e..ebb9a15 100644 --- a/pages/topics/talents/index.wxml +++ b/pages/topics/talents/index.wxml @@ -6,7 +6,7 @@ -