<template>
  <div class="page_news">
    <div class="content">
      <div class="contentOne" v-for="it in articlelist" :key="it.id">
        <div class="img">
          <img :src="it.imgs" style="width:100%;height:100%" alt />
        </div>
        <div class="detail" @click="singleArticleInfo(it.id,it.user_org_id)" v-if="it.title !=''">
          <p class="detailTitle">{{it.title}}</p>
          <p class="detailMessage"></p>
        </div>
        <div class="detail" v-else-if="it.title ==''">
             <div class="noImg">
               <img src="../../../static/images/none2.png" alt />
            </div>
       </div>
      </div>
    </div>
  </div>
</template>
  <script>
import { articlemore } from "@/api/micro/micro";
export default {
  data() {
    return {
      articlelist: []
    };
  },
  methods: {
    articlemore(id, orgid) {
      articlemore(id, orgid).then(response => {
        if (response.data.state == 1) {
          var articlelist = response.data.data.articlelists;
          console.log("文章列表数据", articlelist);
          this.articlelist = response.data.data.articlelists;
        }
      });
    },
    singleArticleInfo(id, orgid) {
      this.$router.push({
        path: "/newsDetail",
        query: {
          id: id,
          orgid: orgid
        }
      });
    }
  },
  created() {
    const id = this.$route.query.id;
    const orgid = this.$route.query.orgid;
    console.log("id是多少", id);
    console.log("orgid是多少", orgid);
    this.articlemore(id, orgid);
  }
};
</script>
<style lang="scss" scoped>
.page_news {
  overflow: hidden;
  height: 100%;
  padding-bottom: 1.25rem;
  overflow-y: auto;
  &::-webkit-scrollbar {
    width: 0;
  }
}
.content {
  padding: 1;
}
.contentOne {
  margin: auto;
  margin-top: 1.125rem;
  width: 20.875rem;
  height: 7.4375rem;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
  padding-left: 1rem;
  padding-top: 1.125rem;
  box-sizing: border-box;
  .img {
    float: left;
    width: 5rem;
    height: 5rem;
    img {
      border-radius: 0.3125rem;
    }
  }
  .detail {
    float: left;
    margin-left: 0.8125rem;
    width: 13.125rem;
    .detailTitle {
      margin-top: 0.5rem;
      width: 12.6875rem;
      height: 1rem;
      line-height: 1rem;
      font-size: 0.9375rem;
      font-weight: 600;
      color: rgba(7, 18, 40, 1);
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 1;
      -webkit-box-orient: vertical;
    }
    .detailMessage {
      margin-top: 0.25rem;
      width: 13.25rem;
      height: 3.625rem;
      font-size: 0.8125rem;
      font-weight: 400;
      color: rgba(155, 155, 155, 1);
      line-height: 1.125rem;
    }
  .noImg {
    width: 3.125rem;
    height: 3.125rem;
    margin: 1.25rem auto 0;
    img {
      width: 3.125rem;
      height: 3.125rem;
    }
  }
  }
}
</style>
