<!--TUIKit-WChat/Chat/index.wxml-->


<view class="container">
 <view class="tui-navigatorbar">
    <image class="tui-navigatorbar-back" bindtap="goBack" src="../../static/assets/back.png" />
    <view class="conversation-title">{{doctorDetail.user_name}}医生</view>
  </view> 


  <view class="headbox" hidden="{{showHead}}" bindtap="goExpertDetail">
    <image src="{{doctorDetail.avatar}}" class="headicon" wx:if="{{doctorDetail.avatar}}" mode="aspectFill"></image>
    <image src="{{img_host+'/doctor_avatar.png'}}" class="headicon" wx:else></image>
    <image src="../../static/images/close.png" class="close" catchtap="closeHead"></image>
    <view class="guanzhu" wx:if="{{doctorChatData.follow}}" catchtap="toggleFllow">已关注</view>
    <view class="guanzhu" wx:else catchtap="toggleFllow">关注</view>
  </view>
  <view class="list-box {{ showTips && 'list-box-notips'}} || {{ showGroupTips && 'list-box-group'}}  || {{ showAll && 'list-box-group-notips' }}  {{(doctorChatData.inquiry_status==5 || doctorChatData.inquiry_status==6)?'nobottom':''}} ">
    <view wx:if="{{showTips}}" class="safetytips-box">
      <view class="safetytips">
        <text>【安全提示】本 APP 仅用于体验腾讯云即时通信 IM 产品功能，不可用于业务洽谈与拓展。请勿轻信汇款、中奖等涉及钱款等信息，勿轻易拨打陌生电话，谨防上当受骗。</text>
        <span class="report" bindtap="handleReport">点此投诉</span>
      </view>
    </view>

    <scroll-view class="message-list" bindtap="triggerClose">
      <view class="statusbox" wx:if="{{doctorChatData.inquiry_status==3}}">
        <view class="status">
          <view class="circle"></view>
          <view>等待接诊中</view>
          <image src="../../static/images/help.png" class="help" bindtap="openHelp"></image>
        </view>
        <view class="statusdesc">医生将在空闲时尽快接诊，请耐心等待</view>
      </view>
      <view class="statusbox" wx:elif="{{doctorChatData.inquiry_status==4}}">
        <view class="status">
          <view class="circle"></view>
          <view>问诊中</view>
          <view class="bar" wx:if="{{doctorChatData.rest_time!==0 && !isEnd}}">|</view>
          <view class="desc" wx:if="{{doctorChatData.rest_time!==0 && !isEnd}}">
            <view class="desc"wx:if="{{doctorChatData.rest_time==-2}}">不限时间</view>
            <view class="desc" wx:elif="{{doctorChatData.rest_time>0}}">
              剩余<van-count-down use-slot time="{{doctorChatData.rest_time}}" bind:change="onChangeTime" format="HH:mm:ss">
                <!-- <text class="item" hidden="{{doctorChatData.timeData.days==0}}">{{doctorChatData.timeData.days }}天</text> -->
                <text class="item" hidden="{{doctorChatData.timeData.hours== 0 && doctorChatData.timeData.days==0}}">{{(doctorChatData.timeData.days*24)+doctorChatData.timeData.hours }}小时</text>
                <text class="item" wx:if="{{doctorChatData.timeData.hours==0}}">{{ doctorChatData.timeData.minutes }}分</text>
                <text class="item" wx:if="{{doctorChatData.timeData.hours==0}}">{{ doctorChatData.timeData.seconds }}秒</text>
              </van-count-down>
            </view>
            <text class="red" decode="true" wx:if="{{doctorChatData.times_number==-1}}">&nbsp;不限</text>
            <text class="red" decode="true" wx:else>&nbsp;{{rest_rounds>=0?rest_rounds:0}}</text>
            <text>个沟通回合</text>
          </view>
        </view>
      </view>
      <view class="statusbox" wx:elif="{{doctorChatData.inquiry_status==7}}">
        <view class="status">
          <view class="circle"></view>
          <view>问诊已取消</view>
        </view>
        <view class="orderDetail" bindtap="goOrderDetail">订单详情</view>
      </view>
      <view class="statusbox" wx:elif="{{doctorChatData.inquiry_status== 5}}">
        <view class="status">
          <view class="circle"></view>
          <view>问诊完成</view>
        </view>
        <view class="orderDetail" bindtap="goOrderDetail">订单详情</view>
      </view>
      <view class="statusbox" wx:elif="{{doctorChatData.inquiry_status== 6}}">
        <view class="status">
          <view class="circle"></view>
          <view>问诊结束</view>
        </view>
        <view class="orderDetail" bindtap="goOrderDetail">订单详情</view>
      </view>
      <MessageList id="MessageList" bind:popComment="handleServiceEvaluation" class="mylist" conversation="{{conversation}}" unreadCount="{{unreadCount}}"  bind:freshChatStatus="freshChatStatus" order_inquiry_id="{{order_inquiry_id}}"  comment_id="{{comment_id}}"  bind:changeMemberCount="changeMemberCount"   bind:resendMessage="resendMessage" bind:getMessageRounds="getMessageRounds"  bind:typing="typing"></MessageList>
    </scroll-view>
  </view>
  <view class="group-profile">

    <TUIGroup id="TUIGroup" wx:if="{{isShow}}" conversation="{{conversation}}" bind:groupCall="groupCall" bind:showConversationList="showConversationList"></TUIGroup>
  </view>
  <view class="input-area" wx:if="{{doctorChatData.inquiry_status==3 || doctorChatData.inquiry_status==4}}">
    <view class="message-input" style="{{viewData.style}}" wx:if="{{showChat}}">
      <MessageInput id="MessageInput" duration="{{doctorChatData.duration}}" rest_time="{{doctorChatData.rest_time}}" times_number="{{doctorChatData.times_number}}"   msgData="{{msgData}}" order_inquiry_id="{{order_inquiry_id}}"  inquiry_type="{{inquiry_type}}" conversation="{{conversation}}" patient_family_data="{{patient_family_data}}" hasCallKit="{{hasCallKit}}" bind:sendMessage="sendMessage"  bind:freshChatStatus="freshChatStatus" 
      bind:changeTimeStatus="changeTimeStatus"
      bind:downKeysBoards="downKeysBoards" bind:pullKeysBoards="pullKeysBoards" bind:showMessageErrorImage="showMessageErrorImage" bind:handleCall="handleCall" bind:getMessageRounds="getMessageRounds"></MessageInput>
    </view>
  </view>

</view>
<ServiceEvaluation display="{{displayServiceEvaluation}}" doctor_info="{{doctorDetail}}"   bind:close="$handleCloseCards" bind:handleServiceEvaluation="handleServiceEvaluation" commentDetail="{{commentDetail}}" bind:freshRate="freshRate"></ServiceEvaluation>
<!-- show="{{doctorChatData.inquiry_status==5 || doctorChatData.inquiry_status==6}}" -->
<van-popup class="mypop" id="mypop" show="{{doctorChatData.inquiry_status==5 || doctorChatData.inquiry_status==6}}" position="bottom" overlay="{{blockHeight=='1130rpx'?true:false}}" duration="500" z-index="9999" custom-style=" border-radius:8rpx;transition: height 0.5s;height:{{blockHeight}}" bind:close="onClose">
  <view class="popwrper" id="popwrper"  bindtouchstart="touchstart" bindtouchend="touchend" style="height:{{blockHeight}}"  >
    <view class="top">
      <image src="../../static/images/up.png" class="up {{blockHeight=='1130rpx'?'active':''}}"></image>
    </view>
    <view class="popname">
      再次咨询
    </view>
    <view class="infobox" style="margin-top: 32rpx;margin-bottom: 0rpx;padding-bottom: 0;">
      <view class="namebox" style="justify-content: flex-start;">
        <image src="{{doctorDetail.avatar}}" class="head" wx:if="{{doctorDetail.avatar}}" mode="aspectFill"></image>
        <image src="{{img_host+'/doctor_avatar.png'}}" class="head" wx:else></image>
        <view class="namewraper">
          <view class="row">
            <view class="name">{{doctorDetail.user_name}}</view>
            <!-- <view class="position">{{doctorDetail.doctor_title_name}}</view> -->
            <view class="type" wx:if="{{doctorDetail.hospital.hospital_level_name!='未知' && doctorDetail.hospital.hospital_level_name}}">{{doctorDetail.hospital.hospital_level_name}}</view>
            <view class="type" wx:if="{{doctorDetail.multi_point_status==1 && doctorDetail.multi_point_enable==1}}">可处方</view>
          </view>
          <view class="hospital"><text wx:if="{{doctorDetail.doctor_title_name}}" class="doctor_title">{{doctorDetail.doctor_title_name}}</text><text>{{doctorDetail.department_custom_name}}</text></view>
          <view class="hospital">{{doctorDetail.hospital.hospital_name}}</view>
        </view>
      </view>
      <view class="borderbox">
        <view class="goodjob" style="margin-top: 30rpx;">
          擅长：{{doctorDetail.be_good_at}}
        </view>
        <view class="consultbox">
          <view class="leftname" wx:if="{{current_inquiry_config.inquiry_price}}">图文问诊：<text class="price" decode>&nbsp;¥{{current_inquiry_config.inquiry_price}}</text></view>
          <view class="btn" bindtap="goExpertDetail">再次咨询</view>
        </view>
      </view>
      <view class="remommendbox">
        <consult-list> </consult-list>
      </view>
    </view>

  </view>
</van-popup>
<dialog showDialog="{{showDialog}}" cancelBtn="{{false}}" confirmtext="知道了" message="{{message}}"></dialog>

