<template>
  <div class="suggest flex flexc">
    <Header>
      <div slot="title" class="title">意见建议</div>
    </Header>
    <div class="main flex1 flex flexc">
      <PageTop>
        <div slot="count" class="count flex">
          <p class="mr30">建议：<span class="data-count">142</span></p>
          <p class="mr30">今日建议：<span class="data-count">142</span></p>
          <p class="mr30">回复：<span class="data-count">142</span></p>
          <p>今日回复：<span class="data-count">142</span></p>
        </div>
        <el-button
          slot="search-right"
          class="search-btn"
          @click="handleSuggest"
        >
          我要建议
        </el-button>
      </PageTop>
      <!-- 指南列表 -->
      <div class="suggest-box flex1">
        <div class="suggest-list flex flexwrap jcb" v-if="list.length">
          <div
            class="suggest-item flex jcb"
            v-for="(v, i) in list"
            :key="i"
            @click="handleCheck(v)"
          >
            <div class="flex flex1 aic">
              <div class="icon"></div>
              <p class="text flex1">
                {{ v }}
              </p>
            </div>
            <div class="time flex aic">2022-12-12 12:00:00</div>
          </div>
        </div>
        <el-empty :image-size="200" v-else></el-empty>
        <!-- 分页 -->
        <div class="tac">
          <el-pagination
            prev-text="上一页"
            next-text="下一页"
            layout="prev,next"
            hide-on-single-page
            :total="total"
            :current-page="current"
            :page-size="size"
            @current-change="changePage"
          >
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Header from "@/components/Header.vue";
import PageTop from "@/components/PageTop.vue";
export default {
  components: {
    Header,
    PageTop,
  },
  data() {
    return {
      searchVal: "",
      list: [
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
        "翻建建造大修自住住房提取",
      ],
      total: 0,
      size: 12,
      current: 1,
    };
  },
  methods: {
    handleCheck(row) {
      console.log(row);
      this.$router.push("/suggestdetails");
    },
    handleSuggest() {
      this.$router.push("/propound");
      console.log(11);
    },
    changePage(cur) {
      this.current = cur;
    },
  },
};
</script>

<style lang="less" scoped>
.suggest {
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
}
.search-btn {
  width: 193px;
  height: 72px;
  background: linear-gradient(
    -90deg,
    var(--main-assist-color1),
    var(--main-theme-color1)
  );
  border-radius: 8px;
  font-size: 24px;
  font-family: Source Han Sans CN;
  color: #ffffff;
}
.main {
  padding-right: 40px;
  padding-left: 40px;
  padding-bottom: 40px;
  .data-count {
    color: var(--main-assist-color3);
  }
}
.suggest-box {
  width: 100%;
  padding: 30px;
  padding-bottom: 0px;
  background: #ffffff;
  border-radius: 16px;
}
.suggest-item {
  width: 870px;
  height: 80px;
  margin-bottom: 30px;
  padding: 0px 20px;
  line-height: 80px;
  background: #edf6fe;
  border-radius: 8px;

  .icon {
    width: 17px;
    height: 17px;
    margin-right: 10px;
    background-color: var(--main-assist-color3);
    transform: rotate(45deg);
  }
  .text {
    width: 1px;
    font-size: 24px;
    font-family: Source Han Sans CN;
    font-weight: 500;
    color: #333333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .time {
    margin-left: 10px;
    font-size: 24px;
    font-family: Source Han Sans CN;
    font-weight: 500;
    color: #999999;
  }
}
/deep/.btn-prev {
  margin-right: 80px;
}
/deep/.btn-prev,
/deep/ .btn-next {
  width: 78px;
  height: 25px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: var(--main-theme-color1);
  line-height: 28px;
  span {
    font-size: 28px;
  }
}
</style>