Browse Source

5454小程序,人才吹哨输入内容提交后,点击知道了,文本内容没有清空

master
chenteng 5 years ago
parent
commit
bf8ce2e056
  1. 11
      pages/topics/talents/index.js
  2. 2
      pages/topics/talents/index.wxml

11
pages/topics/talents/index.js

@ -28,6 +28,7 @@ Component({
results:[],
//选择后获取的街道的I,
streetID:'',
textareaValue:''
},
// lifetimes: {
// attached: function () {
@ -71,7 +72,6 @@ Component({
})
},
methods: {
// 以下为修改
bindPickerStreetsChange: function(e) {
// console.log("1"+e.detail.value)
this.setData({
@ -83,7 +83,6 @@ Component({
})
// console.log(this.data.streetID)
},
//以上为修改
bindTextInput(e) {
this.setData({
messageTitle: e.detail.value
@ -144,6 +143,7 @@ Component({
},
submit() {
let th =this;
if (this.data.messageDetail.length >200){
wx.showModal({
title: '提示',
@ -184,14 +184,13 @@ Component({
confirmText:'查看进度',
success (res) {
if (res.confirm) {
// wx.navigateTo({
// url: `/pages/article/index?id=${id}`,
// })
wx.redirectTo({
// url: '../../user/myWhistle/whistleDetail/index?id=${id}',
url: '/pages/user/myWhistle/whistleDetail/index?id='+id,
})
} else if (res.cancel) {
setTimeout(function(){ th.setData({
textareaValue:''
}) }, 500);
console.log('用户点击知道了')
}
}

2
pages/topics/talents/index.wxml

@ -6,7 +6,7 @@
<view class="question-image">
<!-- 文本框 -->
<view class="item">
<textarea class="textArea" maxlength="210" bindinput="bindTextAreaInput" placeholder="请描述您的问题(200字内)" />
<textarea class="textArea" maxlength="210" bindinput="bindTextAreaInput" placeholder="请描述您的问题(200字内)" value="{{textareaValue}}" />
</view>
<!-- 添加图片 -->
<view style="z-index:10">

Loading…
Cancel
Save