3.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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_skin3">
  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 == 100">
  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 == 1">
  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_skin3 {
  115. font-size: 22px;
  116. font-weight: bold;
  117. height: 40px;
  118. line-height: 40px;
  119. background-color: #fdf8f7;
  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: #c82200;
  128. color: #fff;
  129. text-align: center;
  130. a {
  131. color: #fff;
  132. background-color: #c82200;
  133. }
  134. }
  135. }
  136. .scrollTextSectorList {
  137. div {
  138. font-size: 18px;
  139. height: 24px;
  140. line-height: 24px;
  141. margin-bottom: 16px;
  142. overflow: hidden;
  143. white-space: nowrap;
  144. text-overflow: ellipsis;
  145. span {
  146. margin-right: 5px;
  147. color: #c82200;
  148. }
  149. a {
  150. color: #333333;
  151. }
  152. &:last-child {
  153. margin-bottom: 0;
  154. }
  155. &:first-child {
  156. a {
  157. color: #333;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. }
  164. .roll_num_box {
  165. position: absolute;
  166. z-index: 2;
  167. left: 60px;
  168. bottom: 5px;
  169. height: 60px;
  170. line-height: 60px;
  171. color: #fff;
  172. font-size: 16px;
  173. .roll_num_box_new {
  174. font-size: 20px;
  175. }
  176. }
  177. .dot1 {
  178. display: block;
  179. word-break: keep-all;
  180. white-space: nowrap;
  181. overflow: hidden;
  182. text-overflow: ellipsis;
  183. }
  184. .swiper_dot1 {
  185. display: block;
  186. width: 100%;
  187. line-height: 60px;
  188. height: 60px;
  189. color: #fff;
  190. font-size: 18px;
  191. text-indent: 20px;
  192. position: absolute;
  193. bottom: 0;
  194. left: 0;
  195. z-index: 10;
  196. box-sizing: border-box;
  197. padding: 0 144px;
  198. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  199. }
  200. .el-carousel {
  201. :deep(.el-carousel__arrow i) {
  202. font-size: 33px !important;
  203. }
  204. .roll_1_box {
  205. position: relative;
  206. }
  207. :deep(.el-carousel__arrow--left) {
  208. position: absolute;
  209. width: 35px;
  210. height: 57px;
  211. color: #fff;
  212. background: rgba(0, 0, 0, 0);
  213. left: 9px;
  214. border: none;
  215. border-radius: 0;
  216. top: 100%;
  217. margin-top: -36px;
  218. }
  219. :deep(.el-carousel__arrow--right) {
  220. width: 35px;
  221. height: 57px;
  222. color: #fff;
  223. background: rgba(0, 0, 0, 0);
  224. position: absolute;
  225. right: 9;
  226. border: none;
  227. border-radius: 0;
  228. top: 100%;
  229. margin-top: -36px;
  230. }
  231. :deep(.el-carousel__indicators) {
  232. // 指示器
  233. left: unset;
  234. transform: unset;
  235. right: 10px;
  236. bottom: 11px;
  237. }
  238. :deep(.el-carousel__button) {
  239. // 指示器按钮
  240. width: 10px;
  241. height: 10px;
  242. border: none;
  243. border-radius: 5px;
  244. background: #fff;
  245. opacity: 1;
  246. }
  247. :deep(.is-active .el-carousel__button) {
  248. // 指示器激活按钮
  249. background: #255590;
  250. width: 25px;
  251. opacity: 1;
  252. }
  253. :deep(.el-carousel__container) {
  254. height: 100%;
  255. }
  256. }
  257. .custom-indicator button {
  258. background-color: #fff;
  259. opacity: 1;
  260. width: 8px;
  261. height: 8px;
  262. }
  263. .custom-indicator button.is-active {
  264. background-color: #DD7D18;
  265. width: 58px;
  266. opacity: 1;
  267. }
  268. //基本样式 start ---------------------------------------->
  269. //样式3 start ---------------------------------------->
  270. .scrollTextSectorBox {
  271. .scrollTextSectorRight {
  272. .scrollTextSectorStyle3 {
  273. div:first-child {
  274. font-weight: bold;
  275. color: #333333;
  276. span {
  277. color: #333333;
  278. }
  279. a {
  280. color: #333333;
  281. }
  282. }
  283. }
  284. }
  285. }
  286. //样式3 end ---------------------------------------->
  287. //样式4 start ---------------------------------------->
  288. .scrollTextSectorBox {
  289. .scrollTextSectorRight {
  290. .scrollTextSectorStyle4 {
  291. div:first-child {
  292. font-weight: bold;
  293. color: #c82200;
  294. span {
  295. color: #c82200;
  296. }
  297. a {
  298. color: #c82200;
  299. }
  300. }
  301. }
  302. }
  303. }
  304. //样式4 end ----------------------------------------></style>