HotNews2.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="title">
  3. <h4>
  4. 热点精选
  5. </h4>
  6. </div>
  7. <!-- 列表 -->
  8. <ul class="rightList">
  9. <li v-for="item in hotNewsList">
  10. <NuxtLink :to="item.linkurl" v-show="item.islink == 1" :title="item.title">
  11. <!-- <img class="left hotNewsImg" :src="item.imgurl"> -->
  12. <p class="left">{{ item.title }}</p>
  13. </NuxtLink>
  14. <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink == 0" :title="item.title">
  15. <!-- <img class="left hotNewsImg" :src="item.imgurl"> -->
  16. <p class="left">{{ item.title }}</p>
  17. </NuxtLink>
  18. </li>
  19. </ul>
  20. </template>
  21. <script setup>
  22. const hotNewsList = ref([])
  23. async function getPageData() {
  24. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  25. method: 'GET',
  26. query: {
  27. 'pageSize': 8,
  28. 'level': 4,
  29. 'placeid': 15
  30. },
  31. });
  32. hotNewsList.value = mkdata.data;
  33. }
  34. getPageData();
  35. </script>
  36. <style lang="less" scoped>
  37. .title {
  38. width: 380px;
  39. height: 40px;
  40. line-height: 40px;
  41. border-top: 1px solid #139602;
  42. border-bottom: 1px solid #e7e7e7;
  43. background-color: #fbfbfb;
  44. >h4 {
  45. font-family: Microsoft YaHei, Microsoft YaHei;
  46. font-weight: 400;
  47. margin-left: 20px;
  48. font-size: 20px;
  49. color: #000000;
  50. text-align: left;
  51. font-style: normal;
  52. text-transform: none;
  53. >span {
  54. float: right;
  55. font-family: Microsoft YaHei, Microsoft YaHei;
  56. font-weight: 400;
  57. font-size: 14px;
  58. margin-right: 10px;
  59. color: #999999;
  60. text-align: left;
  61. font-style: normal;
  62. text-transform: none;
  63. }
  64. }
  65. }
  66. .rightList {
  67. height: 654px;
  68. padding-top: 20px;
  69. background-color: #fbfbfb;
  70. >li {
  71. height: 40px;
  72. margin-bottom: 10px;
  73. margin-left: 15px;
  74. a {
  75. display: block;
  76. }
  77. >img {
  78. width: 150px;
  79. height: 100px;
  80. border-radius: 4px;
  81. }
  82. p {
  83. width: 347px;
  84. height: 80px;
  85. box-sizing: border-box;
  86. padding-left: 12px;
  87. padding-right: 10px;
  88. box-sizing: border-box;
  89. font-family: PingFang SC, PingFang SC;
  90. font-weight: 400;
  91. font-size: 16px;
  92. color: #333333;
  93. line-height: 22px;
  94. text-align: left;
  95. font-style: normal;
  96. text-transform: none;
  97. border-bottom: 1px solid #e7e7e7;
  98. padding-bottom: 20px;
  99. padding-top: 20px;
  100. }
  101. }
  102. >li:hover {
  103. p {
  104. //box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.1);
  105. color: #139602;
  106. }
  107. }
  108. }
  109. .hotNewsImg {
  110. width: 150px;
  111. height: 100px;
  112. border-radius: 4px;
  113. }
  114. </style>