<template>
  <sail-page type="loading-view" title="全部账单">
    <div slot="content">
      <van-nav-bar
          title="全部账单"
          left-arrow
          @click-left="back"
        />
      <div class="bill-details">
        <div class="bill-details_header">
          未支付
        </div> 
        <div class="van-cell-title" v-for="(allBill, index) in allBillListInfo" :key="'a'+index" v-if="allBill.actualGetMoney == null">
         
            <van-cell class="bill_style" :title="allBill.billStartTime+'~'+allBill.billEndTime" is-link :value="allBill.actualGetMoney==null?0+'元':allBill.actualGetMoney+'元'" :to="`/billDetails/${allBill.id}`" clickable/>
             
        </div>
        <div class="bill-details_header">
           已支付
        </div>
        <div class="van-cell-title" v-for="(allBill, index) in allBillListInfo" :key="'b'+index" v-if="allBill.actualGetMoney != null">
         
            <van-cell class="bill_style" :title="allBill.billStartTime+'~'+allBill.billEndTime" is-link :value="allBill.actualGetMoney==null?0+'元':allBill.actualGetMoney+'元'" :to="`/billDetails/${allBill.id}`" clickable/>
             
        </div>

       
        
      </div>
    </div>
  </sail-page>
</template>

<script>

import sailPage from "@/components/sail-page.vue";
import {mapState} from "vuex";
export default {
  components: {
    sailPage
  },
  computed:{
    ...mapState({
      allBillListInfo:state => state.myBillModule.allBillListInfo,
      // billList:state => state.myBillModule.billList
    })
  },
  data: function(){
    return {

    }; 
  },
  asyncData({store,route}) {
    return store.dispatch("myBillModule/findAllBill").then(res => {
          
    });
  },
  methods: {
    back() {
      this.$router.push("/fullBill");
    }
  }
};
</script>
<style lang="less">
  .bill_style {
     //border:1px solid @nice-red;
     .van-cell__title {
        text-align: left;
        text-indent: 20px;
        flex: none;
        span {
          
       }
        
     }                         
  }
</style>
<style lang="less" scoped>
.bill-details{
  .bill-details_header {
    text-align: left;
    margin:10px;
    text-indent: 20px;
  }
  .van-cell-title {
    background: #fff;
    border-bottom: 1px solid #F4F4F4;
    padding-top: 5px;
    display: flex;
    justify-content: space-between;
    .bill-details-main-icon_right {
      display: flex;
    }
    .bill-details-main-icon_left {
      display: flex;
    }
  }
  .bill-details-main_content {
    margin-left: 10px;
    height: 30px;
    line-height: 30px;
    color: #222222;
    font-size: 14px;
  }
  .nav-right_icon {
    font-size: 14px;
    color: #AFAFAF;
    line-height: 30px;
    height: 30px;
    margin-right: 10px;
  }
  .bill-details-main-right_words {
    font-size: 14px;
    height: 30px;
    line-height: 30px;
    color: #ccc;
  } 
  }
</style>