<!--pages/medinceList/medinceList.wxml-->
<!-- <view class="ui-navigatorbar" style="background: #FFFFFF;border-bottom: 1rpx solid #E3E4E5;">
    <image class="ui-navigatorbar-back" bindtap="goBack" src="../../assets/images/back.png" />
    <view class="ui-title">药品清单</view>
  </view> -->
  <nav navName="药品清单"></nav>
<view class="page">
  <view class="medincebox">
   <view class="bbox" wx:if="{{list.length>0}}">
    <van-swipe-cell right-width="{{ 50 }}" class="swipecell"  wx:for="{{list}}" wx:key="product_id"   >
    <van-cell-group style="flex:1">
      <view class="cell">
        <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="yaodian">{{item.manufacturer}}</view>
          <view class="own">
            <view class="company">
            <text  wx:if="{{pageData.length==0}}">¥{{item.product_price}}</text>
            </view>
            <view class="num" wx:if="{{pageData.length==0}}">
              <view class="minus" bindtap="minusGoods" data-id="{{index}}">-</view>
              <view class="currentnum">{{item.shopping_cart_num}}</view>
              <view class="add {{item.shopping_cart_num>=5?'disabled':''}}" bindtap="addGoods" data-id="{{index}}">+</view>
            </view>
            <view class="num" wx:else><text decode="true">数量&nbsp;</text>{{item.amount}}</view>
          </view>
        </view>
      </view>
    </van-cell-group>
    <view slot="right" class="delslot" data-id="{{index}}" catchtap="onCloseDel">删除</view>
  </van-swipe-cell>
  </view>
  <view class="nonedata" wx:else="">
    购物车为空！
  </view>

  <view class="btnbox">
     <button class="btn" bindtap="goPatientList"  plain="true" disabled="{{false}}">选择患者</button>
    </view>
</view>
</view>
<van-popup show="{{ show }}" bind:close="onClose"  closeable
  position="bottom"  round
  custom-style="min-height: 60%">
   <view class="titlepop">选择用药人</view>
   <view class="personbox">
      <view class="row" wx:for-item="itemName" wx:for="{{family}}" wx:key="*this">
        <view class="cell" wx:for-item="item" wx:for="{{itemName}}" wx:key="family_id">
          <view class="cellinner" wx:if="{{!item.type}}" bindtap="selectPatient" data-familyId="{{item.family_id}}" data-sex="{{item.sex}}">
            <view class="person">
              <view class="name">{{item.card_name}}</view>
              <view class="tag" wx:if="{{item.relation==1}}">本人</view>
              <view class="tag" wx:elif="{{item.relation==2}}">父母</view>
              <view class="tag" wx:elif="{{item.relation==3}}">爱人</view>
              <view class="tag" wx:elif="{{item.relation==4}}">子女</view>
              <view class="tag" wx:elif="{{item.relation==5}}">亲戚</view>
              <view class="tag" wx:elif="{{item.relation==6}}">其他</view>
            </view>
            <view class="desc">
              <view class="sex" wx:if="{{item.sex===0}}">性别未知</view>
              <view class="sex" wx:elif="{{item.sex==1}}">男</view>
              <view class="sex" wx:else>女</view>
              <view class="age">{{item.age}}岁</view>
            </view>
            <image src="{{img_host+'/gou.png'}}"  class="gou" wx:if="{{item.family_id==currentFamilyId}}"></image>
          </view>
          <view class="celladd" bindtap="addPatient" wx:elif="{{item.type}}">
            +新建患者
          </view>
        </view>
      </view>
     
    </view>
    <view class="btnbox">
      <button class="btn" plain="true" disabled="{{currentFamilyId?false:true}}" bindtap="goNext">下一步</button>
    </view>
</van-popup>
<van-popup show="{{showAdd}}" round closeable z-index="999" position="bottom" custom-style="height:{{height}}rpx" bind:close="onCloseAdd">
    <view class="infobox">
      <view class="title">新建患者</view>
      <view class="info">
        <view class="name">真实姓名<text>*</text></view>
        <input  value="{{realName}}" type="text" bindinput="inputChange" placeholder="请输入真实姓名" data-id="realName"/>
      </view>
      <view class="info">
        <view class="name">身份证号<text>*</text></view>
        <input value="{{idCard}}" type="idcard" bindinput="inputChange" placeholder="请输入真实身份证号" data-id="idCard"/>
      </view>
      <view class="info">
        <view class="name">联系电话</view>
        <input  value="{{phoneNumber}}" type="number" 	bindblur="onblur"	bindfocus="onfocus" 	cursor-spacing="100" bindinput="inputChange" bindinput="inputChange" placeholder="请输入联系电话" data-id="phoneNumber"/>
      </view>
      <view class="info" bindtap="openPicker">
        <view class="name">患者关系</view>
        <input type="text" value="{{relation}}" placeholder="请选择与患者的关系" disabled="true" />
      </view>
      <view class="tip">
        <view class="warntitle">温馨提示：</view>
        <view class="warn">
          <view>1、根据国家卫健委要求,就医实行实名制，请如实填写患者信息。</view>
          <view>2、信息受隐私保护，仅接诊医生可见。
          </view>
          <view>3、6岁以下儿童不支持线上问诊，请到线下就诊。
          </view>
        </view>
      </view>
      <view class="next" bindtap="goSick">
       确定
   </view>
    </view>
  </van-popup>
  <van-popup show="{{ showPicker }}" round position="bottom" z-index="99999" custom-style="height:auto" bind:close="closePicker">
    <van-picker show-toolbar title="选择与患者之间的关系"  columns="{{ columns }}" bind:cancel="closePicker" bind:confirm="onConfirmPicker" />
  </van-popup>
  <dialog bind:confirm="confirm" showDialog="{{showDialog}}" message="是否在购物车中删除该商品？"></dialog>