<!--pages/rechargeRecord/index.wxml-->
<navigator title="缴费记录" canBack="{{true}}" bind:back="back" />
<view class="chooseWrapper">
  <view class="yearPicker" bind:tap="clickYear">
    {{ year }}年
    <van-icon name="arrow-down" custom-class="down" />
  </view>
  <view class="tenementPicker" bind:tap="clickMeter">
    <view wx:if="{{meterCode}}" class="tenementName"> {{ meterCode }} </view>
    <view wx:else> 全部电表 </view>
    <van-icon name="arrow-down" custom-class="down" />
  </view>
  <view class="tenementPicker" bind:tap="clickType">
    <view wx:if="{{payType}}" class="tenementName"> {{ payType }} </view>
    <view wx:else> 全部类型 </view>
    <van-icon name="arrow-down" custom-class="down" />
  </view>
</view>
<view class="wrapper" wx:if="{{list.length}}"> 
  <view class="recordsWrapper">
    <view class="recordsItem border" wx:for="{{list}}" wx:key="index" bind:tap="jumpToDetail" data-id="{{item.id}}">
      <view class="type" wx:if="{{item.type === 1}}"> 冲正 </view>
      <view class="type" wx:elif="{{item.type === 2}}"> 退费 </view>
      <view class="type" wx:else> 充值 </view>
      <view class="codeTime">
        <view class="code"> {{ item.meter.address }} </view>
        <view class="time"> {{ item.time }} </view>
        <view class="way"> {{ way[item.paymentType] }} </view>
      </view>
      <view class="money"> {{ item.money }}元 </view>
      <van-icon name="arrow" />
      
      <view class="rechargeStatus rechargeWait" wx:if="{{item.orderStatus === 1}}"> 处理中 </view>
      <view class="rechargeStatus rechargeBack" wx:elif="{{item.orderStatus === 2}}"> 已退回 </view>
      <view class="rechargeStatus rechargeSuccess" wx:else> 充值成功 </view>
    </view>
    <view class="allMoney"> 总计<van-icon name="question-o" bind:click="showAnswer" style="font-size: 40rpx; margin-left: 8rpx;margin-right:8rpx;" />：{{amount}} </view>
    <van-divider
      contentPosition="center"
    >
      没有更多了
    </van-divider>
    <view style="height: 40rpx;"></view>
  </view>
</view>
<view wx:else>
  <empty bind:refresh="refreshEmpty" />
</view>
<custom-picker 
  title="{{title}}" 
  show="{{show}}" 
  valueKey="name" 
  columns="{{columns}}" 
  bind:ok="onOk" 
  bind:cancel="onCancel" 
  type="{{type}}" 
/>
<van-dialog id="van-dialog" />
