7.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. <template>
  2. <div class="list_right_box_1" v-if="componentStyle == 1">
  3. <h4 class="list_right_head">
  4. <span>最新资讯</span>
  5. </h4>
  6. <div class="list_right_img_ul">
  7. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array">
  8. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  9. :target="item.islink == 1 ? '_blank' : '_self'">
  10. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  11. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  12. </NuxtLink>
  13. </div>
  14. </div>
  15. <div class="list_right_ul">
  16. <NuxtLink
  17. :href="getLinkPathDetail(item)"
  18. :title="item.title"
  19. :target="item.islink == 1 ? '_blank' : '_self'"
  20. class="list_right_ul_a"
  21. v-for="item in component_style1_News2Array"
  22. >
  23. {{ item.title }}
  24. </NuxtLink>
  25. </div>
  26. </div>
  27. <div class="list_right_box_2" v-if="componentStyle == 2">
  28. <h4 class="list_right_head">
  29. <span>最新资讯</span>
  30. </h4>
  31. <div class="list_right_ul">
  32. <NuxtLink
  33. :href="getLinkPathDetail(item)"
  34. :title="item.title"
  35. :target="item.islink == 1 ? '_blank' : '_self'"
  36. class="list_right_ul_a"
  37. v-for="item in component_style1_News2Array"
  38. >
  39. {{ item.title }}
  40. </NuxtLink>
  41. </div>
  42. <div class="list_right_img_ul">
  43. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array">
  44. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  45. :target="item.islink == 1 ? '_blank' : '_self'">
  46. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  47. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  48. </NuxtLink>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="list_right_box_3" v-if="componentStyle == 3">
  53. <h4 class="list_right_head">
  54. <span>最新资讯</span>
  55. </h4>
  56. <div class="list_right_img_ul">
  57. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array_1">
  58. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  59. :target="item.islink == 1 ? '_blank' : '_self'">
  60. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  61. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  62. </NuxtLink>
  63. </div>
  64. </div>
  65. <div class="list_right_ul">
  66. <NuxtLink
  67. :href="getLinkPathDetail(item)"
  68. :title="item.title"
  69. :target="item.islink == 1 ? '_blank' : '_self'"
  70. class="list_right_ul_a"
  71. v-for="item in component_style1_News2Array"
  72. >
  73. {{ item.title }}
  74. </NuxtLink>
  75. </div>
  76. <div class="list_right_img_ul">
  77. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array_2">
  78. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  79. :target="item.islink == 1 ? '_blank' : '_self'">
  80. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  81. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  82. </NuxtLink>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="list_right_box_4" v-if="componentStyle == 4">
  87. <h4 class="list_right_head">
  88. <span>最新资讯</span>
  89. </h4>
  90. <div class="list_right_img_ul">
  91. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array">
  92. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  93. :target="item.islink == 1 ? '_blank' : '_self'">
  94. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  95. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  96. </NuxtLink>
  97. </div>
  98. </div>
  99. <div class="list_right_ul">
  100. <NuxtLink
  101. :href="getLinkPathDetail(item)"
  102. :title="item.title"
  103. :target="item.islink == 1 ? '_blank' : '_self'"
  104. class="list_right_ul_a"
  105. v-for="item in component_style1_News2Array"
  106. >
  107. {{ item.title }}
  108. </NuxtLink>
  109. </div>
  110. </div>
  111. <div class="list_right_box_5" v-if="componentStyle == 5">
  112. <h4 class="list_right_head">
  113. <span>最新资讯</span>
  114. </h4>
  115. <div class="list_right_ul">
  116. <NuxtLink
  117. :href="getLinkPathDetail(item)"
  118. :title="item.title"
  119. :target="item.islink == 1 ? '_blank' : '_self'"
  120. class="list_right_ul_a"
  121. v-for="item in component_style1_News2Array"
  122. >
  123. {{ item.title }}
  124. </NuxtLink>
  125. </div>
  126. <div class="list_right_img_ul">
  127. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array">
  128. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  129. :target="item.islink == 1 ? '_blank' : '_self'">
  130. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  131. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  132. </NuxtLink>
  133. </div>
  134. </div>
  135. </div>
  136. <div class="list_right_box_6" v-if="componentStyle == 6">
  137. <h4 class="list_right_head">
  138. <span>最新资讯</span>
  139. </h4>
  140. <div class="list_right_img_ul">
  141. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array_1">
  142. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  143. :target="item.islink == 1 ? '_blank' : '_self'">
  144. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  145. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  146. </NuxtLink>
  147. </div>
  148. </div>
  149. <div class="list_right_ul">
  150. <NuxtLink
  151. :href="getLinkPathDetail(item)"
  152. :title="item.title"
  153. :target="item.islink == 1 ? '_blank' : '_self'"
  154. class="list_right_ul_a"
  155. v-for="item in component_style1_News2Array"
  156. >
  157. {{ item.title }}
  158. </NuxtLink>
  159. </div>
  160. <div class="list_right_img_ul">
  161. <div class="list_right_img_ul_li" v-for="item in component_style1_News1Array_2">
  162. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  163. :target="item.islink == 1 ? '_blank' : '_self'">
  164. <img class="list_right_img_ul_li_img" :src="item.imgurl" />
  165. <div class="list_right_img_ul_li_dot3">{{ item.title }}</div>
  166. </NuxtLink>
  167. </div>
  168. </div>
  169. </div>
  170. </template>
  171. <script setup>
  172. //引入vue
  173. import { ref } from 'vue';
  174. //获得新闻数据
  175. const props = defineProps({
  176. componentStyle: Number,//样式编号
  177. });
  178. const component_style1_News1Array = ref([]);
  179. const component_style1_News1Array_1 = ref([]);
  180. const component_style1_News1Array_2 = ref([]);
  181. const component_style1_News2Array = ref([]);
  182. const component_style1_News2Array_1 = ref([]);
  183. const component_style1_News2Array_2 = ref([]);
  184. // component_style1_News1Array.value = props.templateData.img.slice(0,2);
  185. // component_style1_News2Array.value = props.templateData.text.slice(0,4);
  186. //最新资讯数据 start ---------------------------------------->
  187. async function getPageData() {
  188. const mkdata = await requestDataPromise('/web/getWebsiteArticlett', {
  189. method: 'GET',
  190. query: {
  191. 'imgnum': 4,
  192. 'textnum': 4,
  193. 'level': 4,
  194. 'id': 0,
  195. 'placeid': 0,
  196. },
  197. });
  198. if (mkdata.code == 200) {
  199. component_style1_News1Array.value = mkdata.data.img.slice(0, 2);
  200. component_style1_News1Array_1.value = mkdata.data.img.slice(0, 1);
  201. component_style1_News1Array_2.value = mkdata.data.img.slice(1, 2);
  202. component_style1_News2Array.value = mkdata.data.text.slice(0, 4);
  203. component_style1_News2Array_1.value = mkdata.data.text.slice(0, 2);
  204. component_style1_News2Array_2.value = mkdata.data.text.slice(2, 4);
  205. }
  206. }
  207. getPageData();
  208. </script>
  209. <style lang="less" scoped>
  210. //基本样式 start ---------------------------------------->
  211. .list_right_box_1 {
  212. width: 100%;
  213. overflow: hidden;
  214. .list_right_head {
  215. height: 47px;
  216. border-top: solid 2px #A72213;
  217. border-bottom: solid 1px #DCDDDF;
  218. margin: 0px;
  219. box-sizing: border-box;
  220. }
  221. .list_right_head * {
  222. float: left;
  223. height: 100%;
  224. line-height: 47px;
  225. box-sizing: border-box;
  226. font-weight: bold;
  227. color: #A72213;
  228. font-size: 20px;
  229. }
  230. .list_right_img_ul {
  231. margin-top: 20px;
  232. .list_right_img_ul_li {
  233. height: 80px;
  234. overflow: hidden;
  235. width: 100%;
  236. margin-bottom: 20px;
  237. }
  238. .list_right_img_ul_li_a {
  239. display: block;
  240. width: 100%;
  241. height: 100%;
  242. }
  243. .list_right_img_ul_li_img {
  244. float: left;
  245. width: 120px;
  246. height: 80px;
  247. margin-right: 10px;
  248. }
  249. .list_right_img_ul_li_dot3 {
  250. height: 72px;
  251. line-height: 24px;
  252. color: #333;
  253. font-size: 18px;
  254. overflow: hidden;
  255. display: -webkit-box !important;
  256. -webkit-box-orient: vertical;
  257. -webkit-line-clamp: 3;
  258. }
  259. }
  260. .list_right_ul {
  261. margin-top: 20px;
  262. .list_right_ul_a {
  263. height: 24px;
  264. line-height: 24px;
  265. color: #333;
  266. font-size: 18px;
  267. margin-bottom: 20px;
  268. display: block;
  269. word-break: keep-all;
  270. white-space: nowrap;
  271. overflow: hidden;
  272. text-overflow: ellipsis;
  273. }
  274. }
  275. }
  276. .list_right_box_2 {
  277. width: 100%;
  278. overflow: hidden;
  279. .list_right_head {
  280. height: 47px;
  281. border-top: solid 2px #A72213;
  282. border-bottom: solid 1px #DCDDDF;
  283. margin: 0px;
  284. box-sizing: border-box;
  285. }
  286. .list_right_head * {
  287. float: left;
  288. height: 100%;
  289. line-height: 47px;
  290. box-sizing: border-box;
  291. font-weight: bold;
  292. color: #A72213;
  293. font-size: 20px;
  294. }
  295. .list_right_img_ul {
  296. margin-top: 20px;
  297. .list_right_img_ul_li {
  298. height: 80px;
  299. overflow: hidden;
  300. width: 100%;
  301. margin-bottom: 20px;
  302. }
  303. .list_right_img_ul_li_a {
  304. display: block;
  305. width: 100%;
  306. height: 100%;
  307. }
  308. .list_right_img_ul_li_img {
  309. float: left;
  310. width: 120px;
  311. height: 80px;
  312. margin-right: 10px;
  313. }
  314. .list_right_img_ul_li_dot3 {
  315. height: 72px;
  316. line-height: 24px;
  317. color: #333;
  318. font-size: 18px;
  319. overflow: hidden;
  320. display: -webkit-box !important;
  321. -webkit-box-orient: vertical;
  322. -webkit-line-clamp: 3;
  323. }
  324. }
  325. .list_right_ul {
  326. margin-top: 20px;
  327. .list_right_ul_a {
  328. height: 24px;
  329. line-height: 24px;
  330. color: #333;
  331. font-size: 18px;
  332. margin-bottom: 20px;
  333. display: block;
  334. word-break: keep-all;
  335. white-space: nowrap;
  336. overflow: hidden;
  337. text-overflow: ellipsis;
  338. }
  339. }
  340. }
  341. .list_right_box_3 {
  342. width: 100%;
  343. overflow: hidden;
  344. .list_right_head {
  345. height: 47px;
  346. border-top: solid 2px #A72213;
  347. border-bottom: solid 1px #DCDDDF;
  348. margin: 0px;
  349. box-sizing: border-box;
  350. }
  351. .list_right_head * {
  352. float: left;
  353. height: 100%;
  354. line-height: 47px;
  355. box-sizing: border-box;
  356. font-weight: bold;
  357. color: #A72213;
  358. font-size: 20px;
  359. }
  360. .list_right_img_ul {
  361. margin-top: 20px;
  362. .list_right_img_ul_li {
  363. height: 80px;
  364. overflow: hidden;
  365. width: 100%;
  366. margin-bottom: 20px;
  367. }
  368. .list_right_img_ul_li_a {
  369. display: block;
  370. width: 100%;
  371. height: 100%;
  372. }
  373. .list_right_img_ul_li_img {
  374. float: left;
  375. width: 120px;
  376. height: 80px;
  377. margin-right: 10px;
  378. }
  379. .list_right_img_ul_li_dot3 {
  380. height: 72px;
  381. line-height: 24px;
  382. color: #333;
  383. font-size: 18px;
  384. overflow: hidden;
  385. display: -webkit-box !important;
  386. -webkit-box-orient: vertical;
  387. -webkit-line-clamp: 3;
  388. }
  389. }
  390. .list_right_ul {
  391. margin-top: 20px;
  392. .list_right_ul_a {
  393. height: 24px;
  394. line-height: 24px;
  395. color: #333;
  396. font-size: 18px;
  397. margin-bottom: 20px;
  398. display: block;
  399. word-break: keep-all;
  400. white-space: nowrap;
  401. overflow: hidden;
  402. text-overflow: ellipsis;
  403. }
  404. }
  405. }
  406. .list_right_box_4 {
  407. width: 100%;
  408. overflow: hidden;
  409. .list_right_head {
  410. height: 47px;
  411. border-top: solid 2px #A72213;
  412. border-bottom: solid 1px #DCDDDF;
  413. margin: 0px;
  414. box-sizing: border-box;
  415. }
  416. .list_right_head * {
  417. float: left;
  418. height: 100%;
  419. line-height: 47px;
  420. box-sizing: border-box;
  421. font-weight: bold;
  422. color: #A72213;
  423. font-size: 20px;
  424. }
  425. .list_right_img_ul {
  426. margin-top: 20px;
  427. .list_right_img_ul_li {
  428. height: 80px;
  429. overflow: hidden;
  430. width: 100%;
  431. margin-bottom: 20px;
  432. }
  433. .list_right_img_ul_li_a {
  434. display: block;
  435. width: 100%;
  436. height: 100%;
  437. }
  438. .list_right_img_ul_li_img {
  439. float: left;
  440. width: 120px;
  441. height: 80px;
  442. margin-right: 10px;
  443. }
  444. .list_right_img_ul_li_dot3 {
  445. height: 72px;
  446. line-height: 24px;
  447. color: #333;
  448. font-size: 18px;
  449. overflow: hidden;
  450. display: -webkit-box !important;
  451. -webkit-box-orient: vertical;
  452. -webkit-line-clamp: 3;
  453. }
  454. }
  455. .list_right_ul {
  456. margin-top: 20px;
  457. .list_right_ul_a {
  458. height: 24px;
  459. line-height: 24px;
  460. color: #333;
  461. font-size: 18px;
  462. margin-bottom: 20px;
  463. display: block;
  464. word-break: keep-all;
  465. white-space: nowrap;
  466. overflow: hidden;
  467. text-overflow: ellipsis;
  468. }
  469. .list_right_ul_a:nth-of-type(1) {
  470. font-weight: bold;
  471. }
  472. }
  473. }
  474. .list_right_box_5 {
  475. width: 100%;
  476. overflow: hidden;
  477. .list_right_head {
  478. height: 47px;
  479. border-top: solid 2px #A72213;
  480. border-bottom: solid 1px #DCDDDF;
  481. margin: 0px;
  482. box-sizing: border-box;
  483. }
  484. .list_right_head * {
  485. float: left;
  486. height: 100%;
  487. line-height: 47px;
  488. box-sizing: border-box;
  489. font-weight: bold;
  490. color: #A72213;
  491. font-size: 20px;
  492. }
  493. .list_right_img_ul {
  494. margin-top: 20px;
  495. .list_right_img_ul_li {
  496. height: 80px;
  497. overflow: hidden;
  498. width: 100%;
  499. margin-bottom: 20px;
  500. }
  501. .list_right_img_ul_li_a {
  502. display: block;
  503. width: 100%;
  504. height: 100%;
  505. }
  506. .list_right_img_ul_li_img {
  507. float: left;
  508. width: 120px;
  509. height: 80px;
  510. margin-right: 10px;
  511. }
  512. .list_right_img_ul_li_dot3 {
  513. height: 72px;
  514. line-height: 24px;
  515. color: #333;
  516. font-size: 18px;
  517. overflow: hidden;
  518. display: -webkit-box !important;
  519. -webkit-box-orient: vertical;
  520. -webkit-line-clamp: 3;
  521. }
  522. }
  523. .list_right_ul {
  524. margin-top: 20px;
  525. .list_right_ul_a {
  526. height: 24px;
  527. line-height: 24px;
  528. color: #333;
  529. font-size: 18px;
  530. margin-bottom: 20px;
  531. display: block;
  532. word-break: keep-all;
  533. white-space: nowrap;
  534. overflow: hidden;
  535. text-overflow: ellipsis;
  536. }
  537. .list_right_ul_a:nth-of-type(1) {
  538. font-weight: bold;
  539. }
  540. }
  541. }
  542. .list_right_box_6 {
  543. width: 100%;
  544. overflow: hidden;
  545. .list_right_head {
  546. height: 47px;
  547. border-top: solid 2px #A72213;
  548. border-bottom: solid 1px #DCDDDF;
  549. margin: 0px;
  550. box-sizing: border-box;
  551. }
  552. .list_right_head * {
  553. float: left;
  554. height: 100%;
  555. line-height: 47px;
  556. box-sizing: border-box;
  557. font-weight: bold;
  558. color: #A72213;
  559. font-size: 20px;
  560. }
  561. .list_right_img_ul {
  562. margin-top: 20px;
  563. .list_right_img_ul_li {
  564. height: 80px;
  565. overflow: hidden;
  566. width: 100%;
  567. margin-bottom: 20px;
  568. }
  569. .list_right_img_ul_li_a {
  570. display: block;
  571. width: 100%;
  572. height: 100%;
  573. }
  574. .list_right_img_ul_li_img {
  575. float: left;
  576. width: 120px;
  577. height: 80px;
  578. margin-right: 10px;
  579. }
  580. .list_right_img_ul_li_dot3 {
  581. height: 72px;
  582. line-height: 24px;
  583. color: #333;
  584. font-size: 18px;
  585. overflow: hidden;
  586. display: -webkit-box !important;
  587. -webkit-box-orient: vertical;
  588. -webkit-line-clamp: 3;
  589. }
  590. }
  591. .list_right_ul {
  592. margin-top: 20px;
  593. .list_right_ul_a {
  594. height: 24px;
  595. line-height: 24px;
  596. color: #333;
  597. font-size: 18px;
  598. margin-bottom: 20px;
  599. display: block;
  600. word-break: keep-all;
  601. white-space: nowrap;
  602. overflow: hidden;
  603. text-overflow: ellipsis;
  604. }
  605. .list_right_ul_a:nth-of-type(1) {
  606. font-weight: bold;
  607. }
  608. }
  609. }
  610. //基本样式 end ---------------------------------------->
  611. </style>