<wrapper>
  <view class="patient-detail" hidden="{{ !patient.name }}">
    <view class="patient-d-block">
      <view class="patient-d-flex">
        <view class="patient-d-flex">
          <text class="patient-d-name">{{ patient.name }}</text>
          <text class="patient-d-rela">{{ patient.relationShip }}</text>
        </view>
        <!-- <view class="patient-d-btn" onTap="onEdit">编辑</view> -->
      </view>
      <view>{{ patient.sex }}, {{ patient.age }}岁</view>
      <view>证件号码：{{ patient.idCardNo }}</view>
      <view>手机号码：{{ patient.phoneNumber }}</view>
    </view>

    <view a:if="{{ patient.medicCards.length > 1 }}" class="patient-card-num">就诊卡</view>
    <view class="patient-d-block" a:for="{{ patient.medicCards }}" key="{{ index }}">
      <view class="patient-d-wrap">
        <view  class="patient-d-title">
          <view>就诊卡
            <text class="patient-d-rela" a:if="{{ patient.medicCards.length > 1 && patient.bindCardNum === item.cardNum }}">默认</text>
          </view>
          <!-- <view>￥{{ item.balance }}</view> -->
        </view>
        <view class="patient-d-flex">
          <view>ID号：{{ item.hisPatientId || patient.hisPatientId || '' }}</view>
          <!-- 隐藏充值 -->
          <!-- <view class="patient-d-btn" onTap="onPayment" data-id="{{ patient.id }}" data-cardNum="{{ item.cardNum }}">充值</view> -->
        </view>
      </view>

      <collapse
        className="demo-collapse"
        collapseKey="collapse-{{ item.hisPatientId }}"
        activeKey="{{ item.expand ? 'item-' + item.hisPatientId : '' }}"
      >
        <collapse-item itemKey="item-{{ item.hisPatientId }}" collapseKey="collapse-{{ item.hisPatientId }}" showArrow="{{ false }}">
          <view slot="am-collapse-item-title" a:if="{{ patient.medicCards.length > 1 }}">
            <view class="patient-more">
              <image class="patient-more-img" mode="aspectFit" src="https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*ZiZ8Q7RKciEAAAAAAAAAAAAAARQnAQ" />
            </view>
          </view>
          <view class="item-content">
            <hj-bar-qr-code value="{{ item.hisPatientId }}" />
            <view class="patient-radio" a:if="{{ patient.medicCards.length > 1 }}">
              <label class="patient-label">
                <radio data-val="{{ item.cardNum }}" checked="{{ patient.bindCardNum === item.cardNum }}" color="#1677ff" onChange="onChange" />
                <text>默认就诊卡</text>
              </label>
            </view>
          </view>
        </collapse-item>
      </collapse>
    </view>

    <!-- <view class="patient-msg">
      <view>温馨提示：</view>
      如就诊卡已不再使用，您可以去医院窗口进行注销
    </view> -->

    <view class="patient-button" onTap="openModal">删除就诊人</view>
  </view>

  <modal
    show="{{ modalOpened }}"
    showClose="{{ false }}"
    onButtonClick="onButtonClick"
    buttons="{{ buttons }}"
    zIndex="10"
  >
    <view slot="header">是否删除就诊人</view>
  </modal>
</wrapper>
