<!--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.meter.sn }}（SN）"
        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
      />

      <van-field
        value="{{ readingDetail.overall }}"
        border="{{ false }}"
        label="总用电量"
        readonly
      />
     
      <van-field
        value="{{ readingDetail.sharp }}"
        border="{{ false }}"
        label="当前表字(尖)"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />
      <van-field
        value="{{ readingDetail.sharpAmount }}"
        border="{{ false }}"
        label="尖用电量"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />

      <van-field
        value="{{ readingDetail.peak }}"
        border="{{ false }}"
        label="当前表字(峰)"
        readonly
        wx:if="{{park.meter04kvType === 1 || park.meter04kvType === 2}}"
      />
      <van-field
        value="{{ readingDetail.peakAmount }}"
        border="{{ false }}"
        label="峰用电量"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />

      <van-field
        value="{{ readingDetail.flat }}"
        border="{{ false }}"
        label="当前表字(平)"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />
      <van-field
        value="{{ readingDetail.flatAmount }}"
        border="{{ false }}"
        label="平用电量"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />

      <van-field
        value="{{ readingDetail.valley }}"
        border="{{ false }}"
        label="当前表字(谷)"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />
      <van-field
        value="{{ readingDetail.deepValley }}"
        border="{{ false }}"
        label="当前表字(深谷)"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />
      <van-field
        value="{{ readingDetail.valleyAmount }}"
        border="{{ false }}"
        label="谷用电量"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />
      <van-field
        value="{{ readingDetail.deepValleyAmount }}"
        border="{{ false }}"
        label="深谷用电量"
        readonly
        wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
      />
      <view class="text">上次抄表记录起,至现在时间内的用电量</view>
    </van-cell-group>
  
  </view>
</van-dialog>