4.vue 9.2 KB

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