<!--pages/medinceOrderDetail/medinceOrderDetail.wxml-->
<wxs src="../../../filters/filter.wxs" module="filter"></wxs>
<view class="ui-navigatorbar" style="border-bottom: 1rpx solid #E3E4E5;background:#fff;">
    <image class="ui-navigatorbar-back" bindtap="goBack" src="{{img_host+'/back.png'}}" />
    <view class="ui-title">药品订单详情</view>
  </view>
<view class="page">
<view class="outwraper {{order_product.order_product_status==1?'active':''}}">
  <view class="addressbox">
    <view class="left">
      <image src="{{img_host+'/addressicon.png'}}" class="icon"></image>
      <view class="info">
        <view class="name">{{order_product.consignee_name}} {{order_product.consignee_tel}}</view>
        <view class="address">{{order_product.province}}{{order_product.city}}{{order_product.county}}{{order_product.address}}</view>
      </view>
    </view>
  </view>
  <view class="rowbox">
    <view class="titlebox">
      <view class="name">订单信息</view>
      
      <!-- 订单状态（1:待支付 2:待发货 3:已发货 4:已签收 5:已取消） -->
      <!-- 支付状态（1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款） -->
      <view class="status" wx:if="{{order_product.order_product_status==1}}">
        <view class="waitpay">待支付</view>
        <view class="countdown">
          <van-count-down time="{{filter.countDown(order_product.created_at)}}" />
        </view>
      </view>
      <view class="status" wx:elif="{{order_product.order_product_status==2}}">待发货</view>
      <view class="status" wx:elif="{{order_product.order_product_status==3}}">已发货</view>
      <view class="status" wx:elif="{{order_product.order_product_status==4}}">已收货</view>
      <view class="status"  wx:elif="{{order_product.order_product_status==5 && order_product.pay_status!=5}}">取消订单</view>
      <view class="status"  wx:elif="{{order_product.order_product_status==5 && order_product.pay_status==5}}">支付超时</view>
    </view>
    <view class="row first">
      <view class="name">订单编号</view>
      <view  class="dot">：</view>
      <view class="desc">{{order_product.order_product_no}}</view>
      <view class="copy" bindtap="copy" data-text="{{order_product.order_product_no}}">复制</view>
    </view>
    <view class="row">
      <view class="name">下单时间</view>
      <view  class="dot">：</view>
      <view class="desc">{{order_product.created_at}}</view>
    </view>
    <view class="row" wx:if="{{order_product.delivery_time && order_product.order_product_status==4}}">
      <view class="name">完成时间</view>
      <view  class="dot">：</view>
      <view class="desc">{{order_product.delivery_time}}</view>
    </view>
    <!-- <view class="row">
      <view class="name">问诊类型：</view>
      <view class="desc">极速问诊/专家问诊/公益问诊/问诊购药；</view>
    </view> -->
    <view class="row">
      <view class="name">药品金额</view>
      <view  class="dot">：</view>
      <view class="desc  price">￥{{order_product.amount_total}}</view>
    </view>
    <view class="row">
        <view class="name"><view class="textyou"><view >优</view><view>惠</view><view>券</view></view></view>
        <view  class="dot">：</view>
        <view class="desc">
          <text wx:if="{{filter.formatMoney(order_product.coupon_amount_total)>0}}">- ￥{{filter.formatMoney(order_product.coupon_amount_total)}}</text>
          <text wx:else>无</text>
        </view>
      </view>
    <view class="row">
      <view class="name"><text>邮</text><text>费</text></view>
      <view  class="dot">：</view>
      <view class="desc  price">￥{{order_product.logistics_fee}}</view>
    </view>
    <view class="row">
      <view class="name">支付金额</view>
      <view  class="dot">：</view>
      <view class="desc  price">￥{{order_product.payment_amount_total}}</view>
    </view>
    <view class="row beizhu" wx:if="{{order_product.cancel_reason}}">
      <view class="name"><text>备</text><text>注</text></view>
      <view  class="dot">：</view>
      <!-- 1:主动取消 2:复核失败/库存不足 3:支付超时 4:客服取消 -->
      <view class="desc" wx:if="{{order_product.cancel_reason==1}}">主动取消 </view>
        <view class="desc" wx:elif="{{order_product.cancel_reason==2}}">复核失败/库存不足 </view>
        <view class="desc" wx:elif="{{order_product.cancel_reason==3}}">支付超时</view>
        <view class="desc" wx:elif="{{order_product.cancel_reason==4}}"> 客服取消</view>
    </view>
    <!-- 商品订单退款状态（0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭） -->
    <view class="row"  wx:if="{{order_product.order_product_status==5 && order_product.pay_status==2}}">
      <view class="name">退款进度</view>
      <view  class="dot">：</view>
      <view class="desc" wx:if="{{order_product.refund_status==0}}">
        无退款
      </view>
      <view class="desc" wx:elif="{{order_product.refund_status==1}}">
        申请退款
      </view>
      <view class="desc" wx:elif="{{order_product.refund_status==2}}">
        退款中
      </view>
      <view class="desc" wx:elif="{{order_product.refund_status==3}}">
        退款成功
      </view>
      <view class="desc" wx:elif="{{order_product.refund_status==4}}">
        拒绝退款
      </view>
      <view class="desc" wx:elif="{{order_product.refund_status==5}}">
        退款关闭
      </view>
    </view>
    <!-- <view class="orderrow" wx:if="{{order_product.order_product_status==4 || order_product.order_product_status==5}}">
      <view class="express" bindtap="confirmDelOrder" >删除订单</view>
    </view> -->
  </view>
  <view class="rowbox" wx:if="{{order_product.logistics_no}}">
    <view class="titlebox">
      <view class="name">物流信息</view>
      <view class="status">
        <view class="express" bindtap="goExpress" data-id="{{order_product.order_product_id}}">物流详情</view>
      </view>
    </view>
    <view class="row first" >
      <view class="name">物流编号</view>
      <view  class="dot">：</view>
      <view class="desc">{{order_product.logistics_no}}</view>
      <view class="copy" bindtap="copy" data-text="{{order_product.logistics_no}}">复制</view>
    </view>
    <view class="row wuliu">
      <image src="{{img_host+'/wuliucar.png'}}"   class="wuliucar"></image>
      <view class="desc">
        <view class="dizhi">{{order_product.province+order_product.city+order_product.county+order_product.address}}</view>
        <view class="date">{{order_product.updated_at}}</view>
      </view>
    </view>
  </view>
  <view class="infobox" >
    <view class="title">
      <view>共{{order_product_item.length}}个药品</view>
    </view>
    <view class="medincebox">
      <view class="cell" wx:for="{{order_product_item}}" wx:key="product_item_id">
        <view class="imgbox">
          <image src="{{img_host+'/nomedince.png'}}" class="yaoimg"></image>
          <view class="desc">
            <view class="tip">处方药品</view>
            <view class="tip">依据法规不展示包装</view>
          </view>
        </view>
        <view class="rightinfo">
          <view class="name">{{item.product_name}}<text class="namenum">{{item.product_spec}}</text></view>
          <view class="own">
            <view class="company">{{item.manufacturer}}</view>
            <view class="num">数量：{{item.amount}}</view>
          </view>
        </view>
      </view>
      <view class="btnbox">
        <view class="btn orderDetail" bindtap="goPrescriptionDetail" data-id="{{order_product.order_prescription_id}}">查看处方</view>
      </view>
    </view>

  </view>
  <view class="titlebox personinfo" wx:if="user_doctor && user_doctor.doctor_id">
    <view class="name">问诊医生</view>
  </view>
  <view class="personinfobox" bindtap="goExpert">

    <view class="namebox" style="justify-content: flex-start;">
      <image src="{{user_doctor.avatar}}" class="head" wx:if="{{user_doctor.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">{{user_doctor.user_name}}</view>
<!--       
            <view class="position" wx:elif="{{user_doctor.doctor_title==1}}">主任中医师</view>
            <view class="position" wx:elif="{{user_doctor.doctor_title==2}}">主任医师</view>
            <view class="position" wx:elif="{{user_doctor.doctor_title==3}}">副主任中医师</view>
            <view class="position" wx:elif="{{user_doctor.doctor_title==4}}">副主任医师</view>
            <view class="position" wx:elif="{{user_doctor.doctor_title==5}}">主治医师</view>
            <view class="position" wx:elif="{{user_doctor.doctor_title==6}}">住院医师</view> -->
            <view class="type" wx:if="{{user_doctor.hospital.hospital_level_name != '未知'&& item.hospital.hospital_level_name}}">{{user_doctor.hospital.hospital_level_name}}</view>
            <view class="type" wx:if="{{user_doctor.multi_point_status == 1 && user_doctor.multi_point_enable==1}}">可处方</view>
        </view>
        <view class="hospital">
          <!-- 1主任医师、2主任中医师、3副主任医师、4副主任中医师、5主治医师、8住院医师 -->
           
          <text class="doctor_title" wx:if="{{user_doctor.doctor_title==1}}">主任医师</text>
        <text class="doctor_title" wx:elif="{{user_doctor.doctor_title==2}}">主任中医师</text>
        <text class="doctor_title" wx:elif="{{user_doctor.doctor_title==3}}">副主任医师</text>
        <text class="doctor_title" wx:elif="{{user_doctor.doctor_title==4}}">副主任中医师</text>
        <text class="doctor_title" wx:elif="{{user_doctor.doctor_title==5}}">主治医师</text>
        <text class="doctor_title" wx:elif="{{user_doctor.doctor_title==6}}">住院医师</text>

        <text>{{user_doctor.department_custom_name}}</text>
        </view>
        <view class="hospital">{{user_doctor.hospital.hospital_name}}</view>
      </view>
      <!-- <view class="guanzhu" wx:if="{{!user_doctor.follow}}" catchtap="toggleFllow">
          <image src="{{img_host+'/star.png'}}" ></image>
          <text decode="true">&nbsp;&nbsp;关注</text>
        </view>
        <view class="guanzhu" wx:else catchtap="toggleFllow">
          <image  src="{{img_host+'/star_on.png'}}" ></image>
          <text decode="true">&nbsp;&nbsp;关注</text>
        </view> -->


    </view>
    <view class="borderbox">
      <view class="goodjob" style="margin-top: 30rpx;">
        擅长：{{user_doctor.be_good_at}}
      </view>
    </view>
  </view>
  
</view>
 
</view>
<view class="paybox" wx:if="{{order_product.order_product_status==1}}">
    <view class="left" bindtap="confirmCancelPay">取消支付</view>
    <view class="right" bindtap="goPay">立即支付：¥{{order_product.payment_amount_total}}</view>
  </view>
<dialog bind:confirm="confirm" showDialog="{{showDialog}}" message="{{message}}"></dialog>
<van-dialog id="van-dialog" confirm-button-color="#3CC7C0"  />