
<template>
  <div class="meetingList">
    <searchBox class="searchBox"></searchBox>
      <scrollBox class="announcementBox">
        <cardItem v-for="(item,index) in list" :key="index" :params="item" class="cardItem"></cardItem>
      </scrollBox>
  </div>
</template>

<script>
import searchBox from "@/components/searchBox";
import cardItem from "@/views/Home/module/cardItem";
import scrollBox from "@/components/scrollBox";
export default {
  name: "announcementList",
  components:{
    searchBox,
    cardItem,
    scrollBox
  },
  data(){
    return {
      list:[],
      page:1,
      hasNext:true,
      loading:false,
    }
  },
  mounted() {
    this.getVote_activities()
  },
  methods:{
    touchBottom(){
      this.page ++
      this.getNotices()
    },
    getVote_activities(){
      if(!this.hasNext) return
      this.loading = true
      let params = {
        pageNum:this.page,
        pageCapacity:10,
        key:'',
      }
      this.$api.getVote_activities(params).then(res=>{
        this.loading = false
        if(res.content.voteActivityViewDtos.length<10){
          this.hasNext = false
        }
        this.list = [...this.list,...res.content.voteActivityViewDtos]
      })
    }
  }
}
</script>

<style scoped lang="less">
.meetingList{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  .searchBox{
    margin: 30px 0;
  }
  .cardItem{
    margin-bottom: 15px;
  }
  .announcementBox{
    height: calc(100% - 78px);
    overflow-y: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

</style>