<!--pages/medinceOrder/medinceOrder.wxml-->
<view class="page">
  <view class="ui-navigatorbar" style="border-bottom: 1rpx solid #E3E4E5;background-color: #fff;">
    <image class="ui-navigatorbar-back" bindtap="goBack" src="{{img_host+'/back.png'}}" />
    <view class="ui-title">药品订单</view>
  </view>
  <view class="dropdown">
    <view class="bar"></view>
    <van-dropdown-menu active-color="#3CC7C0">
      <van-dropdown-item value="{{ order_product_status }}"  title-class="droptitle {{selectstatus?'active':''}}" options="{{ option1 }}" bind:change="changeStatus" />
      <van-dropdown-item value="{{ family_id }}" title-class="droptitle {{selectfamily?'active':''}}" options="{{ option2 }}" bind:change="changeFamily" />
    </van-dropdown-menu>
  </view>
  <scroll-view scroll-y="true" bindscrolltolower="lower" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}"	refresher-threshold="100"	refresher-enabled="true"  class="infobox" wx:if="{{orderList.length>0}}">
    <view class="unitbox"  wx:for="{{orderList}}" wx:key="order_product_id">
      <view class="title">
        <view>共{{item.order_product_item.length}}个药品</view>
        <!-- 订单状态（1:待支付 2:待发货 3:已发货 4:已签收 5:已取消） -->
        <view class="status wait" wx:if="{{item.order_product_status==1}}">待支付</view>
        <view class="status"  wx:elif="{{item.order_product_status==2}}">待发货</view>
        <view class="status"  wx:elif="{{item.order_product_status==3}}">已发货</view>
        <view class="status"  wx:elif="{{item.order_product_status==4}}">已收货</view>
        <view class="status"  wx:elif="{{item.order_product_status==5 && item.pay_status!=5}}">取消订单</view>
        <view class="status"  wx:elif="{{item.order_product_status==5 && item.pay_status==5}}">支付超时</view>
      </view>
      <view class="medincebox">
        <view class="cell" wx:for="{{item.order_product_item}}" wx:key="product_item_id"  wx:for-item="itemName">
          <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">{{itemName.product_name}}<text class="namenum">{{itemName.product_spec}}</text></view>
            <view class="own">
              <view class="company">{{itemName.manufacturer}}</view>
              <view class="num">数量：{{itemName.amount}}</view>
            </view>
          </view>
        </view>
        
        <view class="btnbox">
          <view class="btn express" bindtap="goExpress" data-id="{{item.order_product_id}}"  wx:if="{{item.order_product_status==4 || item.order_product_status==3 || (item.logistics_no && item.order_product_status==5)}}">查看物流</view>
          <view class="btn orderDetail" bindtap="goMedinceOrderDetail" data-id="{{item.order_product_id}}">订单详情</view>
        </view>
      </view>
    </view>
  </scroll-view>
  <view class="nodata" wx:else>
    <view class="nobox">
      <image src="{{img_host+'/nomedinceorder.png'}}"  class="nomedinceorder"></image>
      <view class="tip">暂时没有药品记录</view>
    </view>
     <view class="buymedince" bindtap="goBuyandConsult">
      问诊购药
    </view>
  </view>
</view>