2.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <div class="scrollTextSectorBox">
  3. <div class="scrollTextSectorLeft">
  4. <el-carousel :interval="3333" height="405px" indicator-position="none" arrow="always" @change="change_fun">
  5. <el-carousel-item v-for="item in component_style1_News1Array" :key="item.id">
  6. <NuxtLink
  7. :href="getLinkPathDetail(item)"
  8. :title="item.title"
  9. :target="item.islink == 1 ? '_blank' : '_self'"
  10. >
  11. <img :src="item.imgurl" />
  12. <span class="swiper_dot1 dot1">
  13. {{ item.title }}
  14. </span>
  15. </NuxtLink>
  16. </el-carousel-item>
  17. <div class="roll_num_box">
  18. <span class="roll_num_box_new">{{ roll_num_this + 1 }}</span>/{{ roll_num_lang }}
  19. </div>
  20. </el-carousel>
  21. </div>
  22. <div class="scrollTextSectorRight">
  23. <div class="listNewsTitle_skin2">
  24. <span>
  25. <NuxtLink
  26. v-if="titleLink.cid"
  27. :href="getLinkPath(titleLink)"
  28. :title="titleLink.alias"
  29. >
  30. {{titleLink.alias}}
  31. </NuxtLink>
  32. </span>
  33. </div>
  34. <!--样式1-->
  35. <div class="scrollTextSectorList" v-if="componentStyle==1">
  36. <div v-for="(item,index) in component_style1_News2Array">
  37. <NuxtLink
  38. :href="getLinkPathDetail(item)"
  39. :title="item.title"
  40. :target="item.islink == 1 ? '_blank' : '_self'"
  41. >
  42. {{ item.title }}
  43. </NuxtLink>
  44. </div>
  45. </div>
  46. <!--样式2-->
  47. <div class="scrollTextSectorList" v-if="componentStyle==2">
  48. <div v-for="(item,index) in component_style1_News2Array">
  49. <NuxtLink
  50. :href="getLinkPathDetail(item)"
  51. :title="item.title"
  52. :target="item.islink == 1 ? '_blank' : '_self'"
  53. >
  54. <span>[{{ titleLink.alias }}]</span>
  55. {{ item.title }}
  56. </NuxtLink>
  57. </div>
  58. </div>
  59. <!--样式3-->
  60. <div class="scrollTextSectorList scrollTextSectorStyle2" v-if="componentStyle==3">
  61. <div v-for="(item,index) in component_style1_News2Array">
  62. <NuxtLink
  63. :href="getLinkPathDetail(item)"
  64. :title="item.title"
  65. :target="item.islink == 1 ? '_blank' : '_self'"
  66. >
  67. <span>[{{ titleLink.alias }}]</span>
  68. {{ item.title }}
  69. </NuxtLink>
  70. </div>
  71. </div>
  72. <!--样式4-->
  73. <div class="scrollTextSectorList scrollTextSectorStyle4" v-if="componentStyle==4">
  74. <div v-for="(item,index) in component_style1_News2Array">
  75. <NuxtLink
  76. :href="getLinkPathDetail(item)"
  77. :title="item.title"
  78. :target="item.islink == 1 ? '_blank' : '_self'"
  79. >
  80. <span>[{{ titleLink.alias }}]</span>
  81. {{ item.title }}
  82. </NuxtLink>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script setup>
  89. //引入vue
  90. import {ref} from 'vue';
  91. import { ElCarousel, ElCarouselItem } from 'element-plus'
  92. //获得新闻数据
  93. const props = defineProps({
  94. titleLink:Object,//板块名称
  95. templateData:Array,//新闻数据
  96. componentStyle:Number,//样式编号
  97. templateAdData:Object,//广告
  98. });
  99. //轮播图
  100. const roll_num_this = ref(0)
  101. const roll_num_lang = ref(props.templateData.imgnum.length - 1);
  102. const change_fun = (the_1) => {
  103. roll_num_this.value = the_1
  104. }
  105. //样式1与样式2共用 start ---------------------------------------->
  106. const component_style1_News1Array = ref([]);
  107. component_style1_News1Array.value = props.templateData.imgnum.slice(0,5);
  108. const component_style1_News2Array = ref([]);
  109. component_style1_News2Array.value = props.templateData.textnum.slice(0,9);
  110. //样式1与样式2共用 end ---------------------------------------->
  111. </script>
  112. <style lang="less" scoped>
  113. //基本样式 start ---------------------------------------->
  114. .scrollTextSectorBox {
  115. width: 1200px;
  116. height: 410px;
  117. position: relative;
  118. display: flex;
  119. align-items: center;
  120. justify-content: space-between;
  121. img{
  122. width: 720px;
  123. height: 405px;
  124. display: block;
  125. }
  126. .scrollTextSectorLeft {
  127. width: 720px;
  128. height: 405px;
  129. }
  130. .scrollTextSectorRight {
  131. width: 450px;
  132. height: 405px;
  133. .listNewsTitle_skin2 {
  134. font-size:22px;
  135. font-weight:bold;
  136. height: 40px;
  137. line-height: 40px;
  138. border-bottom: 2px solid #A91B33;
  139. color:#A91B33;
  140. margin-bottom: 20px;
  141. box-sizing: border-box;
  142. a {
  143. color:#A91B33;
  144. display: block;
  145. height: 25px;
  146. line-height: 25px;
  147. }
  148. span {
  149. color:#A91B33;
  150. height: 25px;
  151. line-height: 25px;
  152. border-left: 3px solid #A91B33;
  153. padding-left: 12px;
  154. display: block;
  155. }
  156. }
  157. .scrollTextSectorList {
  158. div{
  159. font-size: 18px;
  160. height: 24px;
  161. line-height: 24px;
  162. margin-bottom: 16px;
  163. overflow: hidden;
  164. white-space: nowrap;
  165. text-overflow: ellipsis;
  166. span {
  167. margin-right: 5px;
  168. color:#A91B33;
  169. }
  170. a {
  171. color:#333333;
  172. }
  173. &:last-child {
  174. margin-bottom: 0;
  175. }
  176. &:first-child {
  177. a {
  178. color:#333;
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. .roll_num_box {
  186. position: absolute;
  187. z-index: 2;
  188. left: 60px;
  189. bottom: 5px;
  190. height: 60px;
  191. line-height: 60px;
  192. color: #fff;
  193. font-size: 16px;
  194. .roll_num_box_new {
  195. font-size: 20px;
  196. }
  197. }
  198. .dot1 {
  199. display: block;
  200. word-break: keep-all;
  201. white-space: nowrap;
  202. overflow: hidden;
  203. text-overflow: ellipsis;
  204. }
  205. .swiper_dot1 {
  206. display: block;
  207. width: 100%;
  208. line-height: 60px;
  209. height: 60px;
  210. color: #fff;
  211. font-size: 18px;
  212. text-indent: 20px;
  213. position: absolute;
  214. bottom: 0;
  215. left: 0;
  216. z-index: 10;
  217. box-sizing: border-box;
  218. padding: 0 144px;
  219. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  220. }
  221. .el-carousel {
  222. :deep(.el-carousel__arrow i) {
  223. font-size: 33px !important;
  224. }
  225. .roll_1_box {
  226. position: relative;
  227. }
  228. :deep(.el-carousel__arrow--left) {
  229. position: absolute;
  230. width: 35px;
  231. height: 57px;
  232. color: #fff;
  233. background: rgba(0, 0, 0, 0);
  234. left: 9px;
  235. border: none;
  236. border-radius: 0;
  237. top: 100%;
  238. margin-top: -36px;
  239. }
  240. :deep(.el-carousel__arrow--right) {
  241. width: 35px;
  242. height: 57px;
  243. color: #fff;
  244. background: rgba(0, 0, 0, 0);
  245. position: absolute;
  246. right: 9;
  247. border: none;
  248. border-radius: 0;
  249. top: 100%;
  250. margin-top: -36px;
  251. }
  252. :deep(.el-carousel__indicators) {
  253. // 指示器
  254. left: unset;
  255. transform: unset;
  256. right: 10px;
  257. bottom: 11px;
  258. }
  259. :deep(.el-carousel__button) {
  260. // 指示器按钮
  261. width: 10px;
  262. height: 10px;
  263. border: none;
  264. border-radius: 5px;
  265. background: #fff;
  266. opacity: 1;
  267. }
  268. :deep(.is-active .el-carousel__button) {
  269. // 指示器激活按钮
  270. background: #255590;
  271. width: 25px;
  272. opacity: 1;
  273. }
  274. :deep(.el-carousel__container) {
  275. height: 100%;
  276. }
  277. }
  278. .custom-indicator button {
  279. background-color: #fff;
  280. opacity: 1;
  281. width: 8px;
  282. height: 8px;
  283. }
  284. .custom-indicator button.is-active {
  285. background-color: #DD7D18;
  286. width: 58px;
  287. opacity: 1;
  288. }
  289. //基本样式 start ---------------------------------------->
  290. //样式2 start ---------------------------------------->
  291. .scrollTextSectorStyle2 {
  292. div:nth-child(1) {
  293. font-weight: bold;
  294. color: #333333;
  295. span {
  296. display: none;
  297. }
  298. }
  299. }
  300. //样式2 end ---------------------------------------->
  301. //样式4 start ---------------------------------------->
  302. .scrollTextSectorBox{
  303. .scrollTextSectorRight{
  304. .scrollTextSectorStyle4 {
  305. div:first-child {
  306. font-weight: bold;
  307. color: #A91B33;
  308. span{
  309. color: #A91B33;
  310. }
  311. a{
  312. color: #A91B33;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. //样式4 end ---------------------------------------->
  319. </style>