news.vue 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div class="page_news">
  3. <div class="content">
  4. <div class="contentOne" v-for="it in articlelist" :key="it.id">
  5. <div class="img">
  6. <img :src="it.imgs" style="width:100%;height:100%" alt />
  7. </div>
  8. <div class="detail" @click="singleArticleInfo(it.id,it.user_org_id)" v-if="it.title !=''">
  9. <p class="detailTitle">{{it.title}}</p>
  10. <p class="detailMessage"></p>
  11. </div>
  12. <div class="detail" v-else-if="it.title ==''">
  13. <div class="noImg">
  14. <img src="../../../static/images/none2.png" alt />
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { articlemore } from "@/api/micro/micro";
  23. export default {
  24. data() {
  25. return {
  26. articlelist: []
  27. };
  28. },
  29. methods: {
  30. articlemore(id, orgid) {
  31. articlemore(id, orgid).then(response => {
  32. if (response.data.state == 1) {
  33. var articlelist = response.data.data.articlelists;
  34. console.log("文章列表数据", articlelist);
  35. this.articlelist = response.data.data.articlelists;
  36. }
  37. });
  38. },
  39. singleArticleInfo(id, orgid) {
  40. this.$router.push({
  41. path: "/newsDetail",
  42. query: {
  43. id: id,
  44. orgid: orgid
  45. }
  46. });
  47. }
  48. },
  49. created() {
  50. const id = this.$route.query.id;
  51. const orgid = this.$route.query.orgid;
  52. console.log("id是多少", id);
  53. console.log("orgid是多少", orgid);
  54. this.articlemore(id, orgid);
  55. }
  56. };
  57. </script>
  58. <style lang="scss" scoped>
  59. .page_news {
  60. overflow: hidden;
  61. height: 100%;
  62. padding-bottom: 1.25rem;
  63. overflow-y: auto;
  64. &::-webkit-scrollbar {
  65. width: 0;
  66. }
  67. }
  68. .content {
  69. padding: 1;
  70. }
  71. .contentOne {
  72. margin: auto;
  73. margin-top: 1.125rem;
  74. width: 20.875rem;
  75. height: 7.4375rem;
  76. background: rgba(255, 255, 255, 1);
  77. box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.05);
  78. border-radius: 0.5rem;
  79. padding-left: 1rem;
  80. padding-top: 1.125rem;
  81. box-sizing: border-box;
  82. .img {
  83. float: left;
  84. width: 5rem;
  85. height: 5rem;
  86. img {
  87. border-radius: 0.3125rem;
  88. }
  89. }
  90. .detail {
  91. float: left;
  92. margin-left: 0.8125rem;
  93. width: 13.125rem;
  94. .detailTitle {
  95. margin-top: 0.5rem;
  96. width: 12.6875rem;
  97. height: 1rem;
  98. line-height: 1rem;
  99. font-size: 0.9375rem;
  100. font-weight: 600;
  101. color: rgba(7, 18, 40, 1);
  102. overflow: hidden;
  103. text-overflow: ellipsis;
  104. display: -webkit-box;
  105. -webkit-line-clamp: 1;
  106. -webkit-box-orient: vertical;
  107. }
  108. .detailMessage {
  109. margin-top: 0.25rem;
  110. width: 13.25rem;
  111. height: 3.625rem;
  112. font-size: 0.8125rem;
  113. font-weight: 400;
  114. color: rgba(155, 155, 155, 1);
  115. line-height: 1.125rem;
  116. }
  117. .noImg {
  118. width: 3.125rem;
  119. height: 3.125rem;
  120. margin: 1.25rem auto 0;
  121. img {
  122. width: 3.125rem;
  123. height: 3.125rem;
  124. }
  125. }
  126. }
  127. }
  128. </style>