You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
2.3 KiB
49 lines
2.3 KiB
<view class="home">
|
|
<view wx:for="{{questionList}}"
|
|
wx:for-item="item"
|
|
wx:for-index="index"
|
|
wx:key="index"
|
|
class="list-item">
|
|
<view class="item-header">
|
|
<view class="question">
|
|
<text id="questionContent" style="font-weight: bold;" class="text {{item.collapse?'text-collapse':''}}">{{item.questionContent}}</text>
|
|
<text style="float:right" bindtap="changeCollapse" data-index="{{index}}" wx:if="{{item.showCollapse}}" class='coll-p'>{{item.collapse?'全文':'收起'}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="item-button">
|
|
<view class="time">{{item.questionTime}}</view>
|
|
<view class="reply" bindtap="openInput" data-index="{{index}}" wx:if="{{currentTab===1 || currentTab===0}}">
|
|
<image src="../../images/input.png" class="button-img"></image>
|
|
<view class="button-text">回复</view>
|
|
</view>
|
|
</view>
|
|
<view class="item-reply" wx:if="{{currentQuestion===tools.toString(index) && (currentTab===1 || currentTab===0)}}">
|
|
<textarea auto-height="{{true}}" class="textarea" maxlength="500" bindinput="handleInput"></textarea>
|
|
</view>
|
|
<view class="item-button" wx:if="{{currentQuestion===tools.toString(index)}}" style="margin-top:20rpx">
|
|
<text style="font-size:30rpx;color:#999;line-height:60rpx">{{tools.length(answerInput)|0}}/500</text>
|
|
<view class="reply-button" data-questionid="{{item.id}}" bindtap="submitAnswer">确定</view>
|
|
</view>
|
|
<view class="item-answer" style="" wx:for="{{item.answerList}}" wx:for-item="answer" wx:if="{{currentTab===2}}" wx:for-index="answerIndex">
|
|
<view class="answer-content">
|
|
<text id="answerContent" data-question="{{index}}" class="text {{answer.collapse?'text-collapse':''}}">{{answer.answerContent}}</text>
|
|
<text style="float:right" bindtap="changeCollapse" data-questionIndex="{{index}}" data-index="{{answerIndex}}" wx:if="{{answer.showCollapse}}" class='coll-p'>{{answer.collapse?'全文':'收起'}}</text>
|
|
</view>
|
|
<view class="item-header">
|
|
<view class="answer-footer">{{answer.psychologistName + ' | 心理咨询师 ' +answer.answerTime}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<wxs module='tools'>
|
|
function toString(a){
|
|
return a.toString();
|
|
}
|
|
function length(str){
|
|
return str.length;
|
|
}
|
|
module.exports = {
|
|
toString: toString,
|
|
length:length
|
|
}
|
|
</wxs>
|