<template>
  <div class="app-container">
    <van-nav-bar
      title="互动交流"
      left-arrow
      fixed
      placeholder
      @click-left="onClickLeft"
    />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      style="margin-top: 10px;"
      @load="getList()"
    >
      <van-cell v-for="(item,index) in interactionList" v-if="item.reply" :key="index">
        <template #title>
          <van-icon name="../../static/images/icon/questions.png" size="18" style="top: 5px;margin-right: 5px;"/>
          {{item.content}}
        </template>
        <template #label>
          <van-icon name="../../static/images/icon/answer.png" size="18" style="top: 5px;margin-right: 5px;"/>{{item.reply}}
          <p style="text-align: right;">发布时间：{{item.replyTime}}</p>
        </template>
      </van-cell>
    </van-list>
  </div>
</template>

<script>
import { interactionList } from "@/api/interaction/index";
export default {
  name: "interaction",
  data() {
    return {
      //是否显示加载
      loading: false,
      //是否滚动到底部
      finished: false,
      //查询参数
      queryParams: {
        deptId:100,
        pageNum:1,
        pageSize:10
      },
      //数据集合
      interactionList:[],
    };
  },
  created() {},
  methods: {
    //成交公告集合
    getList(){
      this.loading = true;
      interactionList(this.queryParams).then(response => {
        console.log(response)
        for (var i = 0; i < response.rows.length; i++) {
          this.interactionList.push(response.rows[i]);
        }
        if(this.interactionList.length >= response.total){
          this.finished = true;
          return;
        }
        this.queryParams.pageNum += 1 ;
        this.loading = false;
      });
    },
  },
};
</script>

<style scoped lang="scss">
.app-container {
}
  .titleClass{

  }
</style>
