HotNews2.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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': 5,
  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: 540px;
  68. padding-top: 20px;
  69. background-color: #fbfbfb;
  70. >li {
  71. height: 100px;
  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: 216px;
  84. height: 100px;
  85. padding-left: 12px;
  86. padding-right: 10px;
  87. box-sizing: border-box;
  88. font-family: PingFang SC, PingFang SC;
  89. font-weight: 400;
  90. font-size: 16px;
  91. color: #333333;
  92. line-height: 22px;
  93. text-align: left;
  94. font-style: normal;
  95. text-transform: none;
  96. }
  97. }
  98. >li:hover {
  99. p {
  100. box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.1);
  101. color: #139602;
  102. }
  103. }
  104. }
  105. .hotNewsImg {
  106. width: 150px;
  107. height: 100px;
  108. border-radius: 4px;
  109. }
  110. </style>