1.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. async function getPageData() {
  46. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  47. method: 'GET',
  48. query: {
  49. 'imgnum': 0,
  50. 'textnum': 8,
  51. 'level': 5,
  52. 'placeid': 0,
  53. 'id': 0
  54. },
  55. });
  56. if (mkdata.code == 200) {
  57. component_style1_News1Array.value = mkdata.data.text;
  58. }
  59. }
  60. getPageData();
  61. </script>
  62. <style lang="less" scoped>
  63. .hotNewsBox {
  64. .listNewsTitle {
  65. font-size:22px;
  66. font-weight:bold;
  67. height: 40px;
  68. line-height: 25px;
  69. border-bottom: 2px solid #004564;
  70. color:#004564;
  71. margin-bottom: 20px;
  72. box-sizing: border-box;
  73. b {
  74. color:#004564;
  75. display: block;
  76. height: 25px;
  77. line-height: 25px;
  78. }
  79. }
  80. .listNewsTitle_skin2 {
  81. font-size:22px;
  82. font-weight:bold;
  83. height: 40px;
  84. line-height: 25px;
  85. border-bottom: 2px solid #A91B33;
  86. color:#A91B33;
  87. margin-bottom: 20px;
  88. box-sizing: border-box;
  89. b {
  90. color:#A91B33;
  91. display: block;
  92. height: 25px;
  93. line-height: 25px;
  94. }
  95. span {
  96. color:#A91B33;
  97. height: 25px;
  98. line-height: 25px;
  99. border-left: 3px solid #A91B33;
  100. padding-left: 12px;
  101. display: block;
  102. }
  103. }
  104. .hotNewsContent {
  105. font-size:18px;
  106. color:#333333;
  107. div {
  108. a {
  109. display: block;
  110. color:#333333;
  111. overflow: hidden;
  112. white-space: nowrap;
  113. text-overflow: ellipsis;
  114. }
  115. padding-bottom:20px;
  116. border-bottom:1px solid #E4E4E4;
  117. margin-bottom: 22px;
  118. span {
  119. margin-right: 15px;
  120. font-size:20px;
  121. font-weight:bold;
  122. font-style: italic;
  123. }
  124. &:nth-child(1) span,
  125. &:nth-child(2) span,
  126. &:nth-child(3) span {
  127. color: #004564;
  128. }
  129. &:nth-child(n+4) span {
  130. color: #D9D9D9;
  131. }
  132. }
  133. }
  134. .hotNewsContent_skin2 {
  135. font-size:18px;
  136. color:#333333;
  137. div {
  138. padding-bottom:20px;
  139. border-bottom:1px solid #E4E4E4;
  140. margin-bottom: 22px;
  141. a {
  142. display: block;
  143. color:#333333;
  144. overflow: hidden;
  145. white-space: nowrap;
  146. text-overflow: ellipsis;
  147. }
  148. span {
  149. margin-right: 15px;
  150. font-size:20px;
  151. font-weight:bold;
  152. font-style: italic;
  153. }
  154. &:nth-child(1) span,
  155. &:nth-child(2) span,
  156. &:nth-child(3) span {
  157. color: #A91B33;
  158. }
  159. &:nth-child(n+4) span {
  160. color: #D9D9D9;
  161. }
  162. }
  163. }
  164. }
  165. </style>