1.vue 8.5 KB

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