<!--pages/consulting/consulting.wxml-->
<view class="TopBar">
<view class="ill_record_box" style="margin-top:8px;">
<multipe disabled="{{disabled}}" style="width:100%" bind:getModel="confirmIlltype" title="{{illnessList.title}}" placeholder="{{illnessList.placeholder}}" riderCommentList="{{illnessList.data}}" modal="{{illness}}"></multipe>
</view>
<view class="ill_record_box">
<view class="symptom_view display_flex">
<view class='symptom_before_text'>症状描述</view>
<input class="describe_input" disabled="{{disabled}}" data-modal="symptomStr" value="{{symptomStr}}" type="text" bindinput="handleInputChange" placeholder="请输入症状描述"/>
</view>
</view>
<view class="ill_record_box">
<view class="symptom_view display_flex">
<view class='symptom_before_text'>用药情况</view>
<input class="describe_input" disabled="{{disabled}}" data-modal="drugsStr" value="{{drugsStr}}" bindinput="handleInputChange" placeholder="请输入用药情况"/>
</view>
</view>
<view class="buttonGroup" wx:if="{{!disabled}}" >
<view class="btn" bindtap="startConsulting">开始咨询</view>
</view>
</view>
<view scroll-y="true" class="scroll_view">
<!-- 聊天内容框 -->
<view class="message" wx:for="{{ chatMsg }}" wx:key="mid" id="{{ item.mid }}">
<!-- <view class="time">
<text class="time-text">{{ item.time }}</text>
</view> -->
<view class="main" class="{{ item.style }}">
<view class="user">
<!-- yourname:就是消息的 from -->
<text class="user-text">{{item.time}}</text>
</view>
<image wx:if="{{item.style == 'self'}}" class="avatar" src="https://img1.healthbaby.com.cn/FpMYI-aoXUyTONfNN5IGw3Jr-n_z?imageView2/0/w/200"/>
<image wx:if="{{item.style == ''}}" class="avatar" src="../../source/default_doctor_icon.png"/>
<view class="msg">
<image
class="err {{(item.style == 'self' && item.isFail) ? 'show' : 'hide'}}"
src="../../source/images/msgerr.png"/>
<image wx:if="{{item.style == 'self'}}" src="../../source/images/poprightarrow@2x.png" class="msg_poprightarrow"/>
<image wx:if="{{item.style == ''}}" src="../../source/images/popleftarrow@2x.png" class="msg_popleftarrow"/>
<view wx:if="{{ item.msg.type == 'img' || item.msg.type == 'video' }}">
<template is="{{ item.msg.type }}" data="{{ item }}"/>
</view>
<view wx:elif="{{ item.msg.type == 'txt' || item.msg.type == 'emoji' }}">
<view class="template" wx:for="{{ item.msg.data }}" wx:key="item">
<template is="{{ item.type }}" data="{{ item }}"/>
</view>
</view>
<audio-msg
wx:if="{{ item.msg.type == 'audio' }}"
msg="{{ item }}"></audio-msg>
</view>
</view>
</view>
<template name="txt">
<text style="float: left;margin-top: 2px;font-size: 16px;">{{ item.data }}</text>
</template>
<template name="emoji">
<image class="avatar" src="{{'../../source/imageSource/faces/' + item.data }}"
style="width: 25px;height: 25px;margin: 0 0 2px 0;float: left;"/>
</template>
<template name="img">
<image class="avatar" src="{{ item.msg.url }}" style="width:90px;height: 120px;margin: 2px auto;"
mode="aspectFit" bindtap="previewImage" data-url="{{ item.msg.url }}"/>
</template>
<template name="audio">
<audio src="{{ item.msg.url }}" controls autoplay />
</template>
<!-- 聊天内容框 -->
</view>
<view class="room_bar" wx-if="{{type == 1}}">
<form bindreset="cleanInput">
<view class="f-row">
<view class="btn_bar_left">
<button class="send_image" bindtap="showRecordingBtn">
<image wx:if="{{!isShowRecordingBtn}}" src="../../source/images/iconVoice@2x.png" class="send_image" style="height: 55%;"/>
<image wx:if="{{isShowRecordingBtn}}" src="../../source/images/iconKeyboard@2x.png" class="send_image" style="height: 55%;"/>
</button>
</view>
<view class="fl input_bar">
<input wx:if="{{!isShowRecordingBtn}}" class="f news" type="text" value="{{ inputMessage }}"
placeholder-style="color:#CFCFCF;" bindinput="bindMessage"
/>
<button style="width: 100%;" class="recording_btn" wx:if="{{isShowRecordingBtn}}"
catchtouchstart="handleRecording"
catchtouchmove="handleRecordingMove"
catchtouchend="handleRecordingCancel"
catchtouchcancel="handleRecordingCancel">
按住说话
</button>
</view>
<view class="btn_bar_right">
<button wx:if="{{!bubbles}}" bindtap="sendImage" formType="reset" class="send_image">
<image src="../../source/iconImage@2x.png" class="send_image"/>
</button>
<button wx:if="{{!bubbles}}" bindtap="openCamera" class="send_image" formType="reset">
<image src="../../source/images/iconCamera@2x.png" class="send_image"/>
</button>
<button wx:if="{{bubbles}}" class="send_btn" bindtap="sendMessage" formType="reset">发送</button>
</view>
</view>
</form>
</view>
<view wx:if="{{recordStatus != RecordStatus.HIDE}}" class="modal modal-record">
<view class="modal-body" catch:tap="toggleWithoutAction">
<view class='sound-waves'>
<view wx:for="{{radomheight}}" wx:key="item" style='height:{{item}}rpx;margin-top:-{{item/2}}rpx'></view>
<view style='clear:both;width:0;height:0;'></view>
</view>
<text class="desc">{{ RecordDesc[recordStatus] }}</text>
</view>
</view>