6.vue 13 KB

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