PageMessage.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <!-- 资讯 -->
  2. <template>
  3. <div class="message">
  4. <div class="inner">
  5. <!-- 大标题 -->
  6. <div class="bigTitle">
  7. <div class="inner" v-for="(item, index) in headlinelist" :key="index">
  8. <img src="../../public/head/mainTitleicon.png" alt="" class="left">
  9. <!-- <h1 class="left">{{ item.title }}</h1> -->
  10. <!-- <a>{{ item.title }}</a> -->
  11. <NuxtLink :to="item.linkurl" v-if="item.islink==1" :title="item.title">
  12. <h1 class="left">{{ item.title }}</h1>
  13. </NuxtLink>
  14. <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink==0" :title="item.title">
  15. <h1 class="left">{{ item.title }}</h1>
  16. </NuxtLink>
  17. </div>
  18. </div>
  19. <!-- 大标题下的列表 -->
  20. <HomeBigTitleList></HomeBigTitleList>
  21. <div class="messageLeft">
  22. <!-- 轮播图 -->
  23. <HomeBigSwiper></HomeBigSwiper>
  24. </div>
  25. <div class="messageRight">
  26. <!-- 列表 -->
  27. <div class="hotTop">
  28. <h3>今日热点</h3>
  29. <ul>
  30. <li v-for="(item, index) in hotNewsList" :key="index">
  31. <strong>{{ index + 1 }}</strong>
  32. <NuxtLink :to="item.linkurl" v-if="item.islink==1" :title="item.title">{{ item.title }}</NuxtLink>
  33. <NuxtLink :to="`/newsDetail/${item.id}`" v-if="item.islink==0" :title="item.title">{{ item.title }}</NuxtLink>
  34. </li>
  35. </ul>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </template>
  41. <script setup>
  42. import { NuxtLink } from "#components";
  43. import { ref, onMounted } from "vue"
  44. const nuxtApp = useNuxtApp();
  45. const axios = nuxtApp.$axios;
  46. //1.获得板块数据 start ---------------------------------------->
  47. //大标题
  48. const headlinelist = ref("")
  49. async function getModelData1() {
  50. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  51. method: 'GET',
  52. query: {
  53. 'pageSize': 1,
  54. 'level': 1,
  55. 'placeid': 0
  56. },
  57. });
  58. headlinelist.value = mkdata.data;
  59. }
  60. getModelData1()
  61. const recommendImage = ref("")
  62. async function getModelData2() {
  63. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  64. method: 'GET',
  65. query: {
  66. 'pageSize': 3,
  67. 'level': 3,
  68. 'placeid': 0
  69. },
  70. });
  71. recommendImage.value = mkdata.data;
  72. }
  73. getModelData2()
  74. const hotNewsList = ref("")
  75. async function getModelData3() {
  76. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  77. method: 'GET',
  78. query: {
  79. 'pageSize': 8,
  80. 'level': 4,
  81. 'placeid': 0
  82. },
  83. });
  84. hotNewsList.value = mkdata.data;
  85. }
  86. getModelData3()
  87. //1.获得板块数据 end ---------------------------------------->
  88. </script>
  89. <style lang="less" scoped>
  90. // 大标题
  91. .bigTitle {
  92. width: 100%;
  93. height: 70px;
  94. margin-top: 20px;
  95. img {
  96. width: 57px;
  97. height: 52px;
  98. margin: 6px 17px 9px 97px;
  99. vertical-align: middle;
  100. }
  101. h1 {
  102. width: 960px;
  103. height: 70px;
  104. font-family: PingFang SC, PingFang SC;
  105. font-weight: 600;
  106. font-size: 30px;
  107. // font-size: 38px;
  108. //margin-bottom: 25px;
  109. white-space: nowrap;
  110. /* 防止文本换行 */
  111. overflow: hidden;
  112. /* 隐藏溢出的内容 */
  113. text-overflow: ellipsis;
  114. color: #49A769;
  115. line-height: 59px;
  116. text-align: left;
  117. font-style: normal;
  118. text-transform: none;
  119. }
  120. }
  121. // 资讯
  122. .message {
  123. width: 100%;
  124. height: 570px;
  125. .messageLeft,
  126. .messageRight {
  127. float: left;
  128. }
  129. // 左侧
  130. .messageLeft {
  131. // 轮播图
  132. >img {
  133. width: 790px;
  134. height: 440px;
  135. }
  136. // 轮播图下小图列表
  137. .smallList {
  138. width: 790px;
  139. height: 140px;
  140. margin-top: 16px;
  141. >li {
  142. width: 250px;
  143. height: 140px;
  144. float: left;
  145. padding-right: 20px;
  146. position: relative;
  147. // background-color: #f5f5f5;
  148. img {
  149. width: 250px;
  150. height: 140px;
  151. }
  152. p {
  153. position: absolute;
  154. bottom: 0;
  155. left: 0;
  156. width: 250px;
  157. height: 30px;
  158. white-space: nowrap;
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. line-height: 30px;
  162. padding-left: 4px;
  163. box-sizing: border-box;
  164. font-family: PingFang SC, PingFang SC;
  165. font-weight: 500;
  166. font-size: 16px;
  167. color: #FFFFFF;
  168. text-align: left;
  169. font-style: normal;
  170. text-transform: none;
  171. background: rgba(0, 0, 0, 0.5);
  172. border-radius: 0px 0px 2px 2px;
  173. }
  174. }
  175. >li:nth-child(3) {
  176. padding-right: 0px;
  177. }
  178. }
  179. }
  180. // 右侧
  181. .messageRight {
  182. width: 450px;
  183. height: 405px;
  184. margin-left: 30px;
  185. .hotTop,
  186. .suggest {
  187. width: 450px;
  188. height: 283px;
  189. >h3 {
  190. height: 40px;
  191. line-height: 40px;
  192. font-family: Source Han Sans, Source Han Sans;
  193. font-weight: bold;
  194. font-size: 24px;
  195. color: #000000;
  196. line-height: 28px;
  197. text-align: left;
  198. font-style: normal;
  199. text-transform: none;
  200. border-bottom: 1px solid #139602;
  201. >span {
  202. float: right;
  203. width: 56px;
  204. height: 20px;
  205. line-height: 24px;
  206. font-family: PingFang SC, PingFang SC;
  207. font-weight: 400;
  208. font-size: 14px;
  209. color: #999999;
  210. font-style: normal;
  211. text-transform: none;
  212. }
  213. }
  214. ul {
  215. >li {
  216. height: 25px;
  217. padding-top: 20px;
  218. >strong {
  219. display: inline-block;
  220. width: 24px;
  221. height: 24px;
  222. line-height: 24px;
  223. background-color: #cecece;
  224. padding-left: 6px;
  225. box-sizing: border-box;
  226. font-family: Source Han Sans, Source Han Sans;
  227. font-weight: 500;
  228. font-size: 18px;
  229. color: #FFFFFF;
  230. font-style: normal;
  231. text-transform: none;
  232. vertical-align: -2px;
  233. }
  234. &:nth-child(1)>strong {
  235. background-color: #00C524;
  236. }
  237. &:nth-child(2)>strong {
  238. background-color: #FFDF27;
  239. }
  240. &:nth-child(3)>strong {
  241. background-color: #F3C57F;
  242. }
  243. >em {
  244. display: inline-block;
  245. width: 6px;
  246. height: 6px;
  247. border-radius: 10px;
  248. border: 2px solid #8CBA86;
  249. vertical-align: -1px;
  250. }
  251. >a,
  252. >span {
  253. display: inline-block;
  254. width: 416px;
  255. height: 25px;
  256. font-family: PingFang SC, PingFang SC;
  257. font-weight: 500;
  258. font-size: 18px;
  259. color: #333333;
  260. line-height: 21px;
  261. text-align: left;
  262. font-style: normal;
  263. text-transform: none;
  264. padding-left: 9px;
  265. white-space: nowrap;
  266. overflow: hidden;
  267. text-overflow: ellipsis;
  268. vertical-align: middle;
  269. }
  270. >a:hover,
  271. >span:hover {
  272. color: #139609;
  273. }
  274. }
  275. }
  276. }
  277. .hotTop {
  278. width: 450px;
  279. }
  280. .suggest {
  281. margin-top: 32px;
  282. }
  283. }
  284. }
  285. </style>