<wrapper class="doctor-pay-root">
  <view class="order-pay">
    <view class="order-block">
      <template a:if="{{ checkedPatient && checkedPatient.name }}" is="patient" data="{{ ...checkedPatient }}" />

      <view a:else class="order-patient" onTap="choosePatient">
        <view class="order-p-left choose">请选择就诊人</view>
        <image class="order-p-right" mode="aspectFit" src="https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*ZiZ8Q7RKciEAAAAAAAAAAAAAARQnAQ" />
      </view>
    </view>

    <view class="order-block">
      <view class="order-block-title">预约信息</view>
      <view a:for="{{ orderList }}" key="{{ index }}" class="order-form-item">
        <view class="order-form-label">{{ item.label }}</view>
        <view class="order-form-val" a:if="{{ item.key === 'timeRange' }}">{{ order.date }}</view>

        <view class="order-form-val" a:elif="{{ item.key === 'startTime' }}">
          <text a:if="{{ order.time }}">
            {{ order.startTimeNew }} ~ {{ order.endTime }}
          </text>
        </view>

        <view class="order-form-val" a:elif="{{ item.key === 'doctorName' }}">{{ order.doctorName }}</view>

        <view class="order-form-val" a:elif="{{ item.key === 'districtName' }}">{{ order.districtName }}</view>

        <view class="order-form-val" a:elif="{{ item.key === 'yuanqu' }}">{{ order.yuanqu }}</view>

        <view class="order-form-val" a:elif="{{ item.key === 'deptName' }}">{{ order.deptName || order.depName }}</view>

        <view class="order-form-val" a:else>{{ order[item.key] }}</view>
      </view>
      <view class="order-form-item sign" a:if="{{ !onlinePay }}">
        <view class="order-form-label">挂号费用</view>
        <view class="order-form-val">￥{{ order.amount }}</view>
      </view>
    </view>

    <view a:if="{{ onlinePay }}" class="order-button-wrap">
      <view class="order-pay-tip">暂不支持医保支付，如有需要请去人工窗口/自助机缴费</view>

      <view class="order-button-f">
        <view>挂号费<text class="coder-pay-price">￥{{ order.amount }}</text></view>
        <button type="primary" class="button" loading="{{ inProgress }}" onTap="onSubmit">预约并支付</button>
      </view>
    </view>
    <view a:else class="order-button-wrap">
      <view class="order-button-f">
        <button type="primary" class="button full" loading="{{ inProgress }}" onTap="onSubmit">确认预约</button>
      </view>
    </view>
  </view>

  <patient-selector show="{{ showPatient }}" onClose="onClose" onChange="onChange" />

  <subscribe-msg ref="saveRef" />
</wrapper>

<!-- 就诊人模板 -->
<template name="patient">
  <view class="order-patient-t">
    <view class="flex-full">
      <view class="order-patient">
        <view class="order-p-left">
          <view class="order-p-name">{{ name }}</view>
          <view class="order-p-tip" a:if="{{ bindCardNum }}">已绑定就诊卡</view>
          <view class="order-p-tip gray" a:else>未绑定就诊卡</view>

          <view class="order-p-tip">{{ relationShip }}</view>
        </view>
        <image class="order-p-right" onTap="choosePatient" mode="aspectFit" src="https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*ZiZ8Q7RKciEAAAAAAAAAAAAAARQnAQ" />
      </view>

      <view class="order-patient">{{ sex }}，{{ age }}岁，{{ phoneNumber }}</view>
    </view>
  </view>
</template>
