2.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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 v-if="index!=0">[国际贸易]</span>
  51. {{ item.title }}
  52. </NuxtLink>
  53. </div>
  54. </div>
  55. <div class="scrollTextSectorList_skin2" v-if="skinId==2">
  56. <div v-for="(item,index) in component_style1_News2Array">
  57. <NuxtLink
  58. :href="getLinkPathDetail(item)"
  59. :title="item.title"
  60. :target="item.islink == 1 ? '_blank' : '_self'"
  61. >
  62. <span v-if="index!=0">[国际贸易]</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. &:first-child {
  174. a {
  175. color:#333;
  176. font-weight: bold;
  177. }
  178. }
  179. }
  180. }
  181. .scrollTextSectorList_skin2 {
  182. div{
  183. font-size: 18px;
  184. height: 24px;
  185. line-height: 24px;
  186. margin-bottom: 16px;
  187. overflow: hidden;
  188. white-space: nowrap;
  189. text-overflow: ellipsis;
  190. span {
  191. margin-right: 5px;
  192. color:#A91B33;
  193. }
  194. a {
  195. color:#333333;
  196. }
  197. &:last-child {
  198. margin-bottom: 0;
  199. }
  200. &:first-child {
  201. a {
  202. color:#333;
  203. font-weight: bold;
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. .roll_num_box {
  211. position: absolute;
  212. z-index: 2;
  213. left: 60px;
  214. bottom: 5px;
  215. height: 60px;
  216. line-height: 60px;
  217. color: #fff;
  218. font-size: 16px;
  219. .roll_num_box_new {
  220. font-size: 20px;
  221. }
  222. }
  223. .dot1 {
  224. display: block;
  225. word-break: keep-all;
  226. white-space: nowrap;
  227. overflow: hidden;
  228. text-overflow: ellipsis;
  229. }
  230. .swiper_dot1 {
  231. display: block;
  232. width: 100%;
  233. line-height: 60px;
  234. height: 60px;
  235. color: #fff;
  236. font-size: 18px;
  237. text-indent: 20px;
  238. position: absolute;
  239. bottom: 0;
  240. left: 0;
  241. z-index: 10;
  242. box-sizing: border-box;
  243. padding: 0 144px;
  244. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  245. }
  246. .el-carousel {
  247. /deep/.el-carousel__arrow i {
  248. font-size: 33px !important;
  249. }
  250. .roll_1_box {
  251. position: relative;
  252. }
  253. /deep/.el-carousel__arrow--left {
  254. position: absolute;
  255. width: 35px;
  256. height: 57px;
  257. color: #fff;
  258. background: rgba(0, 0, 0, 0);
  259. left: 9px;
  260. border: none;
  261. border-radius: 0;
  262. top: 100%;
  263. margin-top: -36px;
  264. }
  265. /deep/.el-carousel__arrow--right {
  266. width: 35px;
  267. height: 57px;
  268. color: #fff;
  269. background: rgba(0, 0, 0, 0);
  270. position: absolute;
  271. right: 9;
  272. border: none;
  273. border-radius: 0;
  274. top: 100%;
  275. margin-top: -36px;
  276. }
  277. /deep/ .el-carousel__indicators {
  278. // 指示器
  279. left: unset;
  280. transform: unset;
  281. right: 10px;
  282. bottom: 11px;
  283. }
  284. /deep/ .el-carousel__button {
  285. // 指示器按钮
  286. width: 10px;
  287. height: 10px;
  288. border: none;
  289. border-radius: 5px;
  290. background: #fff;
  291. opacity: 1;
  292. }
  293. /deep/ .is-active .el-carousel__button {
  294. // 指示器激活按钮
  295. background: #255590;
  296. width: 25px;
  297. opacity: 1;
  298. }
  299. /deep/ .el-carousel__container {
  300. height: 100%;
  301. }
  302. }
  303. .custom-indicator button {
  304. background-color: #fff;
  305. opacity: 1;
  306. width: 8px;
  307. height: 8px;
  308. }
  309. .custom-indicator button.is-active {
  310. background-color: #DD7D18;
  311. width: 58px;
  312. opacity: 1;
  313. }
  314. </style>