1.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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="listNewsContentItemLeft">
  25. <div class="listNewsContentItemLeftItem" v-for="item in component_style1_News1Array">
  26. <NuxtLink
  27. :href="getLinkPathDetail(item)"
  28. :title="item.title"
  29. :target="item.islink == 1 ? '_blank' : '_self'"
  30. >
  31. <img :src="item.imgurl" />
  32. <div class="listNewsContentItemLeftTitle">{{ item.title }}</div>
  33. </NuxtLink>
  34. </div>
  35. </div>
  36. <div class="listNewsContentItemRight">
  37. <div class="listNewsContentItemRightItem">
  38. <div v-for="item in component_style1_News2Array">
  39. <NuxtLink
  40. :href="getLinkPathDetail(item)"
  41. :title="item.title"
  42. :target="item.islink == 1 ? '_blank' : '_self'"
  43. >
  44. {{ item.title }}
  45. </NuxtLink>
  46. </div>
  47. </div>
  48. <div class="listNewsContentItemRightItem">
  49. <div v-for="item in component_style1_News2Array_2">
  50. <NuxtLink
  51. :href="getLinkPathDetail(item)"
  52. :title="item.title"
  53. :target="item.islink == 1 ? '_blank' : '_self'"
  54. >
  55. {{ item.title }}
  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. templateData:Array,//新闻数据
  70. skinId:String,//皮肤id
  71. });
  72. //样式1与样式2共用 start ---------------------------------------->
  73. const component_style1_News1Array = ref({});
  74. const component_style1_News2Array = ref([]);
  75. const component_style1_News2Array_2 = ref([]);
  76. component_style1_News1Array.value = props.templateData.img.slice(0,2);
  77. component_style1_News2Array.value = props.templateData.text.slice(0,3);
  78. component_style1_News2Array_2.value = props.templateData.text.slice(3,6);
  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: flex-start;
  127. margin-bottom: 20px;
  128. .listNewsContentItemLeft {
  129. .listNewsContentItemLeftItem {
  130. width: 170px;
  131. height: 110px;
  132. display: block;
  133. position: relative;
  134. margin-bottom: 20px;
  135. &:last-child {
  136. margin-bottom: 0;
  137. }
  138. img {
  139. display: block;
  140. width: 170px;
  141. height: 110px;
  142. }
  143. }
  144. .listNewsContentItemLeftTitle {
  145. position: absolute;
  146. bottom: 0;
  147. z-index: 1;
  148. width: 100%;
  149. color: #fff;
  150. height: 28px;
  151. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  152. box-sizing: border-box;
  153. padding: 0 5px;
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. white-space: nowrap;
  157. line-height: 28px;
  158. font-size: 14px;
  159. }
  160. }
  161. .listNewsContentItemRight {
  162. flex: 1;
  163. overflow: hidden;
  164. .listNewsContentItemRightItem {
  165. padding: 10px;
  166. box-sizing: border-box;
  167. height: 110px;
  168. margin-bottom: 20px;
  169. background: #F9FAFB;
  170. &:last-child {
  171. margin-bottom: 0;
  172. }
  173. div {
  174. box-sizing: border-box;
  175. height: 24px;
  176. line-height: 24px;
  177. padding-left: 16px;
  178. font-size: 18px;
  179. margin-bottom: 10px;
  180. background: url(http://img.bjzxtw.org.cn/pre/image/png/20250605/1749100871349444.png) no-repeat left center;
  181. &:last-child {
  182. margin-bottom: 0;
  183. }
  184. a {
  185. color:#333333;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. }
  192. </style>