wxml:
<scroll-view style="height: {{windowHeight}}px; width: {{windowWidth}}px;" scroll-y="true" bindscrolltoupper="pullDownRefresh" bindscrolltolower="pullUpLoad" bindtap="click_blank">
<view wx:if="{{comment}}" class="comment-input"><input type="text" name="content" auto-focus placeholder-style="margin-top:-8rpx;" placeholder="{{comment_placeholder}}" bindchange="comment_input" /><button>发送</button></view>
js:
// 评论(点击空白处隐藏input,点击评论出现)
click_blank:function(e){
var flag = "";
var comment_placeholder ="";
if(e.target.dataset.comment==1){
flag = true;
comment_placeholder = e.target.dataset.username;
}else{
flag = false;
comment_placeholder = "";
}
this.setData({
comment:flag,
comment_placeholder:"评论"+comment_placeholder+"动态"
})
},