2.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="listNewsBox">
  3. <div class="listNewsTitle" v-if="skinId==1">
  4. <NuxtLink
  5. v-if="titleLink.cid"
  6. :href="getLinkPath(titleLink)"
  7. :title="titleLink.alias"
  8. >
  9. {{titleLink.alias}}
  10. </NuxtLink>
  11. </div>
  12. <div class="listNewsTitle_skin2" v-if="skinId==2">
  13. <span>
  14. <NuxtLink
  15. v-if="titleLink.cid"
  16. :href="getLinkPath(titleLink)"
  17. :title="titleLink.alias"
  18. >
  19. {{titleLink.alias}}
  20. </NuxtLink>
  21. </span>
  22. </div>
  23. <div class="listNewsContent">
  24. <div class="listNewsBigContentBottom">
  25. <div class="listNewsContentBottom">
  26. <div v-for="item in component_style1_News2Array">
  27. <NuxtLink
  28. :href="getLinkPathDetail(item)"
  29. :title="item.title"
  30. :target="item.islink == 1 ? '_blank' : '_self'"
  31. >
  32. {{ item.title }}
  33. </NuxtLink>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="listNewsContentTop">
  38. <div class="listNewsContentLeftTop" v-for="item in component_style1_News1Array">
  39. <NuxtLink
  40. :href="getLinkPathDetail(item)"
  41. :title="item.title"
  42. :target="item.islink == 1 ? '_blank' : '_self'"
  43. >
  44. <img :src="item.imgurl" />
  45. <div class="listNewsContentLeftTopTitle">{{ item.title }}</div>
  46. </NuxtLink>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </template>
  52. <script setup>
  53. //引入vue
  54. import {ref} from 'vue';
  55. //获得新闻数据
  56. const props = defineProps({
  57. titleLink:Object,//板块名称
  58. templateData:Array,//新闻数据
  59. skinId:String,//皮肤id
  60. });
  61. //样式1与样式2共用 start ---------------------------------------->
  62. const component_style1_News1Array = ref({});
  63. const component_style1_News2Array = ref([]);
  64. component_style1_News1Array.value = props.templateData.img.slice(0,2);
  65. component_style1_News2Array.value = props.templateData.text;
  66. //样式1与样式2共用 end ---------------------------------------->
  67. </script>
  68. <style lang="less" scoped>
  69. .listNewsBox {
  70. position: relative;
  71. .listNewsTitle {
  72. font-size:22px;
  73. font-weight:bold;
  74. height: 40px;
  75. line-height: 40px;
  76. border-bottom: 2px solid #004564;
  77. color:#004564;
  78. margin-bottom: 20px;
  79. box-sizing: border-box;
  80. a {
  81. color:#004564;
  82. display: block;
  83. height: 25px;
  84. line-height: 25px;
  85. }
  86. }
  87. .listNewsTitle_skin2 {
  88. font-size:22px;
  89. font-weight:bold;
  90. height: 40px;
  91. line-height: 40px;
  92. border-bottom: 2px solid #A91B33;
  93. color:#A91B33;
  94. margin-bottom: 20px;
  95. box-sizing: border-box;
  96. a {
  97. color:#A91B33;
  98. display: block;
  99. height: 25px;
  100. line-height: 25px;
  101. }
  102. span {
  103. color:#A91B33;
  104. height: 25px;
  105. line-height: 25px;
  106. border-left: 3px solid #A91B33;
  107. padding-left: 12px;
  108. display: block;
  109. }
  110. }
  111. .listNewsContent {
  112. .listNewsContentTop {
  113. width: 720px;
  114. height: 245px;
  115. display: flex;
  116. align-items: center;
  117. justify-content: space-between;
  118. .listNewsContentLeftTop {
  119. position: relative;
  120. img {
  121. width: 350px;
  122. height: 245px;
  123. display: block;
  124. }
  125. .listNewsContentLeftTopTitle {
  126. position: absolute;
  127. bottom: 0;
  128. z-index: 1;
  129. width: 100%;
  130. color: #fff;
  131. height: 44px;
  132. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  133. box-sizing: border-box;
  134. padding: 0 10px;
  135. overflow: hidden;
  136. text-overflow: ellipsis;
  137. white-space: nowrap;
  138. line-height: 44px;
  139. font-size: 18px;
  140. }
  141. }
  142. }
  143. .listNewsBigContentBottom {
  144. height: 295px;
  145. margin-bottom: 20px;
  146. }
  147. .listNewsContentBottom {
  148. display: flex;
  149. flex-wrap: wrap;
  150. justify-content: space-between;
  151. div {
  152. color:#333333;
  153. font-size:18px;
  154. line-height: 24px;
  155. height: 24px;
  156. margin-bottom: 20px;
  157. overflow: hidden;
  158. text-overflow: ellipsis;
  159. white-space: nowrap;
  160. width: 345px;
  161. &:last-child {
  162. margin-bottom: 0;
  163. }
  164. &:nth-child(1),&:nth-child(2),&:nth-child(7),&:nth-child(8){
  165. font-weight: bold;
  166. }
  167. a {
  168. color:#333333;
  169. }
  170. }
  171. }
  172. }
  173. }
  174. </style>