1.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="hotNewsBox">
  3. <div class="listNewsTitle" v-if="skinId==1">
  4. <b>最新资讯</b>
  5. </div>
  6. <div class="listNewsTitle_skin2" v-if="skinId==2">
  7. <span><b>最新资讯</b></span>
  8. </div>
  9. <div class="hotNewsContent" v-if="skinId==1">
  10. <div v-for="(item,index) in component_style1_News1Array">
  11. <NuxtLink
  12. :href="getLinkPathDetail(item)"
  13. :title="item.title"
  14. :target="item.islink == 1 ? '_blank' : '_self'"
  15. >
  16. <span>{{ index+1 }}</span>
  17. {{ item.title }}
  18. </NuxtLink>
  19. </div>
  20. </div>
  21. <div class="hotNewsContent_skin2" v-if="skinId==2">
  22. <div v-for="(item,index) in component_style1_News1Array">
  23. <NuxtLink
  24. :href="getLinkPathDetail(item)"
  25. :title="item.title"
  26. :target="item.islink == 1 ? '_blank' : '_self'"
  27. >
  28. <span>{{ index+1 }}</span>
  29. {{ item.title }}
  30. </NuxtLink>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script setup>
  36. //引入vue
  37. import {ref} from 'vue';
  38. //获得新闻数据
  39. const props = defineProps({
  40. templateData:Array,//新闻数据
  41. skinId:String,//皮肤id
  42. });
  43. const component_style1_News1Array = ref([]);
  44. component_style1_News1Array.value = props.templateData.text.slice(0,8);
  45. </script>
  46. <style lang="less" scoped>
  47. .hotNewsBox {
  48. .listNewsTitle {
  49. font-size:22px;
  50. font-weight:bold;
  51. height: 40px;
  52. line-height: 40px;
  53. border-bottom: 2px solid #004564;
  54. color:#004564;
  55. margin-bottom: 20px;
  56. box-sizing: border-box;
  57. b {
  58. color:#004564;
  59. display: block;
  60. height: 25px;
  61. line-height: 25px;
  62. }
  63. }
  64. .listNewsTitle_skin2 {
  65. font-size:22px;
  66. font-weight:bold;
  67. height: 40px;
  68. line-height: 40px;
  69. border-bottom: 2px solid #A91B33;
  70. color:#A91B33;
  71. margin-bottom: 20px;
  72. box-sizing: border-box;
  73. b {
  74. color:#A91B33;
  75. display: block;
  76. height: 25px;
  77. line-height: 25px;
  78. }
  79. span {
  80. color:#A91B33;
  81. height: 25px;
  82. line-height: 25px;
  83. border-left: 3px solid #A91B33;
  84. padding-left: 12px;
  85. display: block;
  86. }
  87. }
  88. .hotNewsContent {
  89. font-size:18px;
  90. color:#333333;
  91. div {
  92. a {
  93. display: block;
  94. color:#333333;
  95. overflow: hidden;
  96. white-space: nowrap;
  97. text-overflow: ellipsis;
  98. }
  99. padding-bottom:20px;
  100. border-bottom:1px solid #E4E4E4;
  101. margin-bottom: 22px;
  102. span {
  103. margin-right: 15px;
  104. font-size:20px;
  105. font-weight:bold;
  106. font-style: italic;
  107. }
  108. &:nth-child(1) span,
  109. &:nth-child(2) span,
  110. &:nth-child(3) span {
  111. color: #004564;
  112. }
  113. &:nth-child(n+4) span {
  114. color: #D9D9D9;
  115. }
  116. }
  117. }
  118. .hotNewsContent_skin2 {
  119. font-size:18px;
  120. color:#333333;
  121. div {
  122. padding-bottom:20px;
  123. border-bottom:1px solid #E4E4E4;
  124. margin-bottom: 22px;
  125. a {
  126. display: block;
  127. color:#333333;
  128. overflow: hidden;
  129. white-space: nowrap;
  130. text-overflow: ellipsis;
  131. }
  132. span {
  133. margin-right: 15px;
  134. font-size:20px;
  135. font-weight:bold;
  136. font-style: italic;
  137. }
  138. &:nth-child(1) span,
  139. &:nth-child(2) span,
  140. &:nth-child(3) span {
  141. color: #A91B33;
  142. }
  143. &:nth-child(n+4) span {
  144. color: #D9D9D9;
  145. }
  146. }
  147. }
  148. }
  149. </style>