1.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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" v-for="(item,index) in component_style1_News1Array">
  25. <NuxtLink
  26. :href="getLinkPathDetail(item)"
  27. :title="item.title"
  28. :target="item.islink == 1 ? '_blank' : '_self'"
  29. >
  30. <div class="listNewsContentItemLeft">
  31. <img :src="item.imgurl" />
  32. <span class="icon1" v-if="index==0"></span>
  33. <span class="icon2" v-if="index==1"></span>
  34. <span class="icon3" v-if="index==2"></span>
  35. </div>
  36. <div class="listNewsContentItemRight">
  37. {{ item.title }}
  38. </div>
  39. </NuxtLink>
  40. </div>
  41. </div>
  42. </div>
  43. </template>
  44. <script setup>
  45. //引入vue
  46. import {ref} from 'vue';
  47. //获得新闻数据
  48. const props = defineProps({
  49. titleLink:Object,//板块名称
  50. templateData:Array,//新闻数据
  51. skinId:String,//皮肤id
  52. });
  53. //样式1与样式2共用 start ---------------------------------------->
  54. const component_style1_News1Array = ref({});
  55. component_style1_News1Array.value = props.templateData.img.slice(0,7);
  56. //样式1与样式2共用 end ---------------------------------------->
  57. </script>
  58. <style lang="less" scoped>
  59. .listNewsBox {
  60. position: relative;
  61. .listNewsTitle {
  62. font-size:22px;
  63. font-weight:bold;
  64. height: 40px;
  65. line-height: 40px;
  66. border-bottom: 2px solid #004564;
  67. color:#004564;
  68. margin-bottom: 20px;
  69. box-sizing: border-box;
  70. a {
  71. color:#004564;
  72. display: block;
  73. height: 25px;
  74. line-height: 25px;
  75. }
  76. }
  77. .listNewsTitle_skin2 {
  78. font-size:22px;
  79. font-weight:bold;
  80. height: 40px;
  81. line-height: 40px;
  82. border-bottom: 2px solid #A91B33;
  83. color:#A91B33;
  84. margin-bottom: 20px;
  85. box-sizing: border-box;
  86. a {
  87. color:#A91B33;
  88. display: block;
  89. height: 25px;
  90. line-height: 25px;
  91. }
  92. span {
  93. color:#A91B33;
  94. height: 25px;
  95. line-height: 25px;
  96. border-left: 3px solid #A91B33;
  97. padding-left: 12px;
  98. display: block;
  99. }
  100. }
  101. .listNewsContent {
  102. .listNewsContentItem {
  103. width: 450px;
  104. height: 110px;
  105. margin-bottom: 20px;
  106. background: #F9FAFB;
  107. &:last-child {
  108. margin-bottom: 0;
  109. }
  110. a {
  111. display: flex;
  112. align-items: center;
  113. justify-content: space-between;
  114. }
  115. .listNewsContentItemLeft {
  116. width: 170px;
  117. height: 110px;
  118. position: relative;
  119. img {
  120. display: block;
  121. width: 170px;
  122. height: 110px;
  123. }
  124. span {
  125. position: absolute;
  126. top: -3px;
  127. left: 10px;
  128. display: block;
  129. width: 20px;
  130. height: 20px;
  131. }
  132. span.icon1 {
  133. background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250609/1749437491337294.jpg') no-repeat center center;
  134. }
  135. span.icon2 {
  136. background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250609/1749437499146137.jpg') no-repeat center center;
  137. }
  138. span.icon3 {
  139. background: url('http://img.bjzxtw.org.cn/pre/image/jpeg/20250609/1749437506412478.jpg') no-repeat center center;
  140. }
  141. }
  142. .listNewsContentItemRight {
  143. width: 280px;
  144. height: 110px;
  145. padding:15px 8px;
  146. box-sizing: border-box;
  147. font-size: 18px;
  148. color: #333333;
  149. overflow: hidden;
  150. text-overflow: ellipsis;
  151. display: -webkit-box;
  152. -webkit-box-orient: vertical;
  153. -webkit-line-clamp: 3;
  154. }
  155. }
  156. }
  157. }
  158. </style>