<!--pages/myPrescript/myPrescript.wxml-->
<nav navName="我的处方"></nav>
<view class="page">
  <scroll-view scroll-y="true" bindscrolltolower="lower" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}"	refresher-threshold="100"	refresher-enabled="true" class="data" wx:if="{{list.length>0}}" class="conbox">
    <view class="cell" wx:for="{{list}}" wx:key="order_prescription_id">
        <view class="title">
          <view class="date">{{item.created_at}}</view>
          <!-- 处方状态（1:待审核 2:待使用 3:已失效 4:已使用） -->
          <view class="status" wx:if="{{item.prescription_status==1}}">待审核</view>
          <view class="status outdate" wx:elif="{{item.prescription_status==2}}">待使用</view>
          <view class="status" wx:elif="{{item.prescription_status==3}}">已失效</view>
          <view class="status" wx:else>已使用</view>
        </view>
        <view class="form">
          <view class="row">
            <view class="name"><text>医</text><text>生</text></view>
            <view  class="dot">：</view>
            <view class="desc">{{item.doctor_name}} {{item.user_doctor.doctor_title}} </view>
          </view>
          <view class="row">
            <view class="name"><text>患</text><text>者</text></view>
            <view  class="dot">：</view>
            <view class="desc">{{item.patient_name}} （<text wx:if="{{item.patient_sex=='1'}}">男</text><text wx:elif="{{item.patient_sex=='2'}}">女</text><text wx:else>未知</text>，{{item.patient_age}}岁）</view>
          </view>
          <view class="row">
            <view class="name"><text>诊</text><text>断</text></view>
            <view  class="dot">：</view>
            <view class="desc">
              <text class="textdesc" wx:for="{{item.order_prescription_icd}}" wx:key="prescription_icd_id" wx:for-item="itemName">{{itemName.icd_name}}</text>
            </view>
          </view>
          <view class="row">
            <view class="name"><text>药</text><text>品</text></view>
            <view  class="dot">：</view>
            <view class="desc">
              <view class="single" wx:for="order_prescription_pr" wx:for="{{item.order_prescription_product}}"  wx:for-item="itemName" wx:key="prescription_product_id">
              {{itemName.product_name}}
                <font class="unit">  {{itemName.product_spec}}</font>
              </view>
            
            </view>
          </view>
          <view class="row">
            <view class="name">问诊记录</view>
            <view  class="dot">：</view>
            <view class="desc look" bindtap="goconsult" data-id="{{item.order_inquiry_id}}">点击查看 </view>
          </view>
           <view class="btnbox">
              <!-- <view class="btn del"  bindtap="handelDel" data-id="{{item.order_prescription_id}}" data-index="{{index}}">删除记录</view> -->
              <view class="btn fuzhen"  wx:if="{{item.prescription_status==4}}" bindtap="goExpert" data-doctor_id="{{item.doctor_id}}">复诊开方</view>
              <view class="btn lookdetail" bindtap="goprescriptDetail" data-id="{{item.order_prescription_id}}">查看详情</view>
              <view class="btn pay"  wx:if="{{item.prescription_status==2}}" bindtap="goPayInfo" data-id="{{item.order_prescription_id}}">去结算</view>
           </view>
        </view>

      </view>
 
  </scroll-view>
  <view class="nonedata conbox" wx:else>
    暂无数据！
  </view>
</view>
<dialog bind:confirm="confirm" showDialog="{{show}}" message="您确定是要删除该处方订单记录么？"></dialog>