<!--childPackage/pages/electricQuery/components/reading/index.wxml-->
<view style="margin-left: 30rpx;">
    <view class="timeChooseWrapper">
        <view> 选择时间 </view>
        <view class="time" bind:tap="clickReadingTime">
            <view class="timeText"> {{yearMonthDayReading}} </view>
            <van-icon name="arrow-down" />
        </view>
    </view>
</view>
<view style="margin: 30rpx;">
    <view wx:if="{{meterReadingList.length}}">
        <table 
          header="{{meterReadingHeader}}" 
          list="{{meterReadingList}}" 
          bind:onClick="showDetail"
        />
        <pagination 
            currentIndex="{{readingPage}}" 
            totalPage="{{totalPage}}" 
            bind:pagingChange="onChangePage"  
        />
    </view>
      
    <empty bind:refresh="getReadingList" wx:else />
</view>

<timePicker 
  type="day" 
  day="{{yearMonthDayReadingStamp}}" 
  show="{{readingVisible}}" 
  bind:cancel="onReadingTimeCancel" 
  bind:close="onReadingTimeClose" 
  bind:confirm="onReadingTimeConfirm" 
/>


<van-dialog
  use-slot
  title="抄表记录详情"
  show="{{ readingDetailShow }}"
  bind:close="onClose"
>
  <view style="margin-top: 10px;">
    <van-cell-group>
      <van-field
        value="{{ readingDetail.meter.address }}"
        border="{{ false }}"
        label="地址"
        readonly
      />
      <van-field
        value="{{ readingDetail.readAt }}"
        border="{{ false }}"
        label="时间"
        readonly
      />
      <van-field
        value="{{ readingDetail.ratio }}"
        border="{{ false }}"
        label="倍率"
        readonly
      />
      <van-field
        value="{{ readingDetail.number }}"
        border="{{ false }}"
        label="表字"
        readonly
        wx:if="{{parkInfo.category !== 1}}"
      />
     
      <van-field
        value="{{ readingDetail.critical }}"
        border="{{ false }}"
        label="表字（尖）"
        readonly
        wx:if="{{parkInfo.category === 1}}"
      />
      <van-field
        value="{{ readingDetail.peak }}"
        border="{{ false }}"
        label="表字（峰）"
        readonly
        wx:if="{{parkInfo.category === 1}}"
      />
      <van-field
        value="{{ readingDetail.flat }}"
        border="{{ false }}"
        label="表字（平）"
        readonly
        wx:if="{{parkInfo.category === 1}}"
      />
      <van-field
        value="{{ readingDetail.valley }}"
        border="{{ false }}"
        label="表字（谷）"
        readonly
        wx:if="{{parkInfo.category === 1}}"
      />
    </van-cell-group>
  </view>
</van-dialog>