2.vue 6.5 KB

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