<wrapper>
  <view class="payment-detail">

    <view class="payment-h">
      <block a:if="{{ order.status === 0 }}">待支付</block>
      <block a:elif="{{ order.status === 1 }}">已支付</block>
    </view>

    <view class="payment-block">
      <view a:for="{{ order.orderItems }}" key="{{ index }}" class="payment-order">
        <text number-of-lines="1" class="payment-order-name">{{ item.itemName }}</text>
        <view class="payment-order-num">x{{ item.itemNum }}</view>
        <view class="payment-order-price">￥{{ item.amount }}</view>
      </view>

      <view class="payment-order-total">
        <view>总计 ￥</view>
        <view class="price">
          <text>{{ order.amount }}</text>
          <view a:if="{{ order.status === 1 }}" onTap="medicareExpand" class="payment-order-right {{ medicareExpand ? 'open' : '' }}">
            <am-icon type="left" size="18" color="#333" />
          </view>
        </view>
      </view>

      <view a:if="{{ order.status === 1 }}" hidden="{{ !medicareExpand }}" class="payment-medicare">
        <view class="payment-medicare-flex">
          <view>医保支付总金额</view>
          <view>￥{{ medicare.total }}</view>
        </view>
        <view class="payment-medicare-d" a:if="{{ medicare.total > 0 }}">
          <view class="payment-medicare-flex" a:for="{{ medicare.detail }}">
            <view>{{ index }}</view>
            <view>￥{{ item }}</view>
          </view>
        </view>
        <view class="payment-medicare-flex">
          <view>自费支付金额</view>
          <view>￥{{ order.amount }}</view>
        </view>
      </view>
    </view>

    <view class="payment-block">
      <view class="payment-block-title">订单信息</view>

      <view class="payment-form" a:for="{{ fromItem.slice(0, 5) }}" key="{{ index }}">
        <view class="payment-form-label">{{ item.label }}</view>
        <view class="payment-form-val" a:if="{{ item.key === 'name' }}">
          {{ order.userName }}
          <block a:if="{{ order.sex }}">，{{ order.sex }}</block>
          <block a:if="{{ order.age }}">，{{ order.age }}岁</block>
        </view>

        <view class="payment-form-val" a:else>{{ order[item.key] || '暂无' }}</view>
      </view>

      <block a:if="{{ expand }}">
        <view class="payment-form" hidden="{{ order.status === 0 && item.key === 'payTime' }}" a:for="{{ fromItem.slice(5) }}" key="{{ index }}">
          <view class="payment-form-label">{{ item.label }}</view>
          <view class="payment-form-val">{{ order[item.key] || '暂无' }}</view>
        </view>
      </block>

      <view a:if="{{ fromItem.length > 5 }}" class="payment-block-more">
        <view onTap="openForm" class="wrap {{ expand ? 'open' : '' }}">
          <text a:if="{{ expand }}">收起</text>
          <text a:else>查看更多</text>
          <view class="icon">
            <am-icon type="left" size="12" color="#999" />
          </view>
        </view>
      </view>
    </view>

    <block a:if="{{ order.status === 99 }}">
      <view class="payment-block" a:for="{{ checkRemind }}">
        <view class="payment-block-title">
          <view>{{ index }}</view>
        </view>

        <view>{{ item }}</view>
        <view class="payment-block-btn">
          <text class="payment-block-t" data-url="https://hospitalupgrade-dev.alipay-eco.com/page/hospital-navigation.html" onTap="toH5">到这去</text>
        </view>
      </view>

      <view class="payment-block">
        <view class="payment-block-title">
          <view>取药</view>
        </view>

        <view>{{ order.medicineRemind }}</view>
        <view class="payment-block-btn">
          <text class="payment-block-t" data-url="https://hospitalupgrade-dev.alipay-eco.com/page/hospital-navigation.html" onTap="toH5">查看路线</text>
          <text class="payment-block-t" a:if="{{ order.medicareBinded }}" onTap="hrefTo">刷医保</text>
        </view>
      </view>

      <view class="payment-block">
        <view class="payment-block-title">
          <view>报告查询</view>
        </view>

        <view>{{ order.reportRemind }}</view>
        <view class="payment-block-btn">
          <text class="payment-block-t" data-url="https://hospitalupgrade-dev.alipay-eco.com/page/hospital-navigation.html" onTap="toH5">查看电子版</text>
        </view>
      </view>

      <view class="payment-block">
        <view class="payment-block-title">
          <view>如何退费</view>
        </view>

        <view>{{ order.refundRemind }}</view>
        <view class="payment-block-btn">
          <text class="payment-block-t" data-url="https://hospitalupgrade-dev.alipay-eco.com/page/hospital-navigation.html" onTap="toH5">查看详情</text>
        </view>
      </view>

      <view class="payment-block block-last">
        <view class="payment-block-title">
          <view>如何开发票</view>
        </view>

        <view>{{ order.receiptRemind }}</view>
        <view class="payment-block-btn">
          <text class="payment-block-t" data-url="https://hospitalupgrade-dev.alipay-eco.com/page/hospital-navigation.html" onTap="toH5">查看详情</text>
        </view>
      </view>
    </block>

    <block a:if="{{ order.status === 0 && order.amount > 0 }}">
      <view class="payment-fixed" a:if="{{ prder.type === 3 && order.medicareBinded }}">
        <view class="patient-fixed-bottom">
          <view class="patient-fixed-btn white" onTap="onPay">自费支付</view>
          <view class="patient-fixed-btn" onTap="onPay" data-medicareBinded="{{ true }}">医保支付</view>
        </view>
      </view>

      <view class="payment-fixed" a:else>
        <view>暂不支持医保支付，如有需要请去人工窗口/自助机挂号</view>
        <view class="patient-fixed-bottom">
          <view class="patient-fixed-btn space" onTap="onPay">付款</view>
        </view>
      </view>
    </block>
  </view>
</wrapper>
<subscribe-msg ref="saveSubscribe" />
