2.vue 6.7 KB

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