index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <template>
  2. <div class="home">
  3. <div class="home-page" id="home-page">
  4. <div class="carousel">
  5. <n-carousel :autoplay="true" :interval="3000">
  6. <template v-for="item in carouselList" :key="item">
  7. <n-carousel-item>
  8. <div class="img">
  9. <img class="carousel-img" :src="BaseUrl+'/carousel/'+item.name" />
  10. </div>
  11. <div class="desc">
  12. <div class="slogan">
  13. <h3 class="wow fadeInLeft">{{ item.title }}</h3>
  14. <!-- <h3 class="mywow animate__fadeInLeft animate-duration-0.3s animate__animated">{{ item.title }}</h3> -->
  15. <p class="wow fadeInRight">{{ item.desc }}</p>
  16. </div>
  17. </div>
  18. </n-carousel-item>
  19. </template>
  20. </n-carousel>
  21. </div>
  22. </div>
  23. <!--报告类别-->
  24. <div class="reports-category" id="reports-category">
  25. <div class="container">
  26. <div class="report-title title wow fadeInUp" data-wow-duration="3s" data-wow-iteration="1" data-wow-offset="30">
  27. <h2>{{$t('home.report.title')}}</h2>
  28. </div>
  29. <div class="reports-category-box wow fadeInDown" data-wow-duration="3s" data-wow-iteration="1" data-wow-offset="30">
  30. <template v-for="vo in reportDict" :key="vo">
  31. <div class="rcb-box">
  32. <!--handleReport-->
  33. <a :href="(lang === 'zh-CN'?'':'/en')+'/report-industries/'+vo.dictValue" class="rcb-item">
  34. <n-card size="medium">
  35. <span :class="vo.dictIcon" class="f70"></span>
  36. <span class="rcb-text">{{ vo.dictLabel }}</span>
  37. </n-card>
  38. </a>
  39. </div>
  40. </template>
  41. </div>
  42. </div>
  43. </div>
  44. <!--研究分析报告-->
  45. <div class="report">
  46. <div class="container">
  47. <div class="report-title title wow fadeInUp" data-wow-duration="2s" data-wow-iteration="1">
  48. <h2>{{ $t('home.report.sndtitle') }}</h2>
  49. </div>
  50. <div class="report-content wow fadeInDown" data-wow-duration="2s" data-wow-iteration="1">
  51. <template v-for="item in reports" :key="item">
  52. <div class="report-box">
  53. <n-card size="medium" content-style="display:flex">
  54. <div class="img">
  55. <img :src="BaseUrl+'/report/'+item.fileName" />
  56. </div>
  57. <div class="text">
  58. <h4><a :href="(lang === 'zh-CN'?'': '/en')+'/reports/'+item.webTitle+'-'+item.id">{{ item.title }}</a></h4>
  59. <span>{{ item.publishDate }}</span>
  60. <div class="show">
  61. <a @click="viewReportDetail(item)"><n-icon :component="MdEye" size="16" />{{$t('home.report.look')}}</a>
  62. <a @click="reportDetail" class="more"><n-icon :component="MdReorder" size="16" />{{$t('home.report.more')}}</a>
  63. </div>
  64. </div>
  65. </n-card>
  66. </div>
  67. </template>
  68. </div>
  69. </div>
  70. </div>
  71. <!--市场资讯-->
  72. <div class="hot-news" id="hot-news">
  73. <div class="container">
  74. <div class="news-title title wow fadeInUp" data-wow-duration="2s">
  75. <h2>{{ $t('home.news.title') }}</h2>
  76. </div>
  77. <div class="news-content">
  78. <template v-for="item in markets" :key="item">
  79. <div class="news-box wow fadeInDown" data-wow-duration="2s" data-wow-delay="0s" data-wow-offset="0">
  80. <div class="image">
  81. <a><img :src="BaseUrl+'/fileupload/'+item.filePath+item.fileName" /></a>
  82. </div>
  83. <div class="box-content">
  84. <a @click="viewNewsDetail(item)">
  85. <h3>{{ item.title }}</h3>
  86. </a>
  87. <p>{{ item.publishDate }}</p>
  88. </div>
  89. </div>
  90. </template>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="home-contact" id="home-contact">
  95. <div class="contact-row wow fadeInDown" data-wow-duration="2s" data-wow-delay="0s" data-wow-offset="0">
  96. <div class="contact-txt">
  97. <span>{{$t('home.custom.sndtitle')}}</span>
  98. </div>
  99. <div class="contact-btn">
  100. <a @click="handleContact">{{ $t('report.detail.custom') }}</a>
  101. </div>
  102. </div>
  103. <div class="contact-img wow fadeInUp" data-wow-duration="2s" data-wow-delay="0s" data-wow-offset="0">
  104. <img src="@/assets/images/swtp.jpg" />
  105. </div>
  106. </div>
  107. <n-modal :show="demandShow" preset="dialog" :title="$t('report.detail.subscribe')" @close="demandShow = false" @esc="demandShow = false" @mask-click="demandShow = false" :style="'min-width: 40%'">
  108. <demand @closeDialog="handleCloseDiag" />
  109. </n-modal>
  110. </div>
  111. </template>
  112. <script setup>
  113. import { useI18n } from "#imports"
  114. import { onMounted, ref } from "vue";
  115. import { useRouter } from "vue-router";
  116. import { useUserStore } from "@/store/user";
  117. import { MdEye, MdReorder, MdSearch } from "@vicons/ionicons4";
  118. const config = useRuntimeConfig();
  119. const BaseUrl = ref(config.public.baseUrl);
  120. const { t } = useI18n();
  121. const carouselList = ref(); // 轮播图数据
  122. const reports = ref(); //研究报告
  123. const markets = ref(); //市场资讯
  124. const reportDict = ref();
  125. const demandShow = ref(false); // 需求页面
  126. const keyword = ref(""); //关键字
  127. const userStore = useUserStore();
  128. const lang = ref();
  129. // 联系我们
  130. function handleContact () {
  131. demandShow.value = true;
  132. }
  133. // 关闭diag
  134. function handleCloseDiag () {
  135. demandShow.value = false;
  136. }
  137. //查询
  138. const router = useRouter();
  139. function handleSearch () {
  140. router.push({
  141. name: "reports",
  142. params: { keyword: keyword.value },
  143. });
  144. }
  145. // 资讯详情
  146. function viewNewsDetail (item) {
  147. router.push({
  148. name: "newsDetail",
  149. params: { webTitle: item.webTitle + "-" + item.id },
  150. });
  151. }
  152. // 报告详情
  153. function viewReportDetail (item) {
  154. router.push({
  155. name: "reportDetail",
  156. params: { webTitle: item.webTitle + "-" + item.id },
  157. });
  158. }
  159. // 报告列表
  160. function reportDetail () {
  161. router.push({ name: "reports" });
  162. }
  163. function handleReport (value) {
  164. router.push({ name: "reports", params: { category: value } });
  165. }
  166. lang.value = userStore.getLang
  167. // 轮播图
  168. const data = await carouselListData();
  169. carouselList.value = data;
  170. console.log(carouselList.value)
  171. // 研究报告分类
  172. reportDict.value = await getLocalSessionReport();
  173. // 研究报告列表
  174. const map = await reportAndMarketListData();
  175. reports.value = map.report;
  176. markets.value = map.market;
  177. // onMounted(async () => {
  178. reportDict.value = await getLocalSessionReport();
  179. // })
  180. useHead({
  181. title: t('defaultSettings.title'),
  182. viewport: "width=device-width,initial-scale=1,maximum-scale=1 ",
  183. charset: "utf-8",
  184. meta: [
  185. { hid: "keywords", name: "keywords", content: t('defaultSettings.keyword') },
  186. {
  187. hid: "description",
  188. name: "description",
  189. content: t('defaultSettings.desc'),
  190. },
  191. ],
  192. });
  193. </script>
  194. <style scoped lang="scss">
  195. .home {
  196. height: 100%;
  197. overflow: auto;
  198. overflow-x: hidden;
  199. scroll-snap-type: y mandatory;
  200. .home-page {
  201. height: 100vh;
  202. scroll-snap-align: start;
  203. overflow: hidden;
  204. .carousel {
  205. width: 100%;
  206. height: 100%;
  207. overflow: hidden;
  208. .desc {
  209. //width: 1200px;
  210. padding-top: 140px;
  211. margin: 0 auto;
  212. line-height: 1;
  213. position: relative;
  214. height: 100%;
  215. overflow: hidden;
  216. z-index: 100;
  217. .slogan {
  218. display: inline-block;
  219. height: 300px;
  220. h3 {
  221. color: #fff;
  222. font-size: 48px;
  223. line-height: 1.5;
  224. margin-bottom: 48px;
  225. }
  226. p {
  227. opacity: 1;
  228. font-size: 18px;
  229. color: #fff;
  230. line-height: 1.7;
  231. }
  232. }
  233. .search {
  234. padding-top: 60px;
  235. width: 75%;
  236. .search-btn {
  237. .n-icon {
  238. vertical-align: middle;
  239. }
  240. }
  241. }
  242. }
  243. .img {
  244. position: absolute;
  245. top: -50px;
  246. bottom: -50px;
  247. left: -50px;
  248. right: -50px;
  249. .carousel-img {
  250. width: 100%;
  251. height: 100%;
  252. object-fit: cover;
  253. }
  254. }
  255. }
  256. }
  257. }
  258. // 报告分类
  259. .reports-category-box {
  260. display: flex;
  261. flex-wrap: wrap;
  262. width: 100%;
  263. justify-content: flex-end;
  264. .rcb-box {
  265. width: 15.66%;
  266. margin-right: 12px;
  267. margin-bottom: 12px;
  268. .rcb-item {
  269. text-align: center;
  270. &::after {
  271. position: absolute;
  272. left: 0;
  273. bottom: 0;
  274. content: "";
  275. width: 100%;
  276. background: #18a058;
  277. display: block;
  278. }
  279. &:hover {
  280. position: relative;
  281. height: 3px;
  282. .rcb-text {
  283. color: #18a058;
  284. }
  285. }
  286. .rcb-text {
  287. display: flex;
  288. justify-content: center;
  289. font-size: 16px;
  290. font-weight: 600;
  291. &:hover {
  292. color: #18a058;
  293. }
  294. &:after {
  295. bottom: 0;
  296. left: 50%;
  297. -webkit-transform: translateX(-50%);
  298. transform: translateX(-50%);
  299. -webkit-transition: 0.55s;
  300. transition: 0.55s;
  301. content: "";
  302. background: #18a058;
  303. position: absolute;
  304. display: block;
  305. height: 5rem;
  306. width: 0;
  307. }
  308. }
  309. }
  310. }
  311. }
  312. .report {
  313. //background-color: #edf0f5;
  314. .report-content {
  315. display: flex;
  316. justify-content: flex-start;
  317. flex-wrap: wrap;
  318. .report-box {
  319. width: 33.33%;
  320. padding: 0px 10px 10px 0;
  321. //box-shadow: 2.5px 4.33px 15px 0px rgb(0 0 0 / 15%);
  322. :hover {
  323. background-color: #18a058;
  324. color: #fff;
  325. .text {
  326. span {
  327. color: #fff;
  328. }
  329. }
  330. }
  331. .img {
  332. width: 11em;
  333. height: 13em;
  334. img {
  335. width: 100%;
  336. height: 100%;
  337. box-shadow: 7px 0 15px rgba(0, 87, 149, 0.33);
  338. }
  339. }
  340. .text {
  341. padding-left: 1.5em;
  342. width: calc(100% - 10em);
  343. h4 {
  344. //color: #333333;
  345. line-height: 30px;
  346. margin: 0.25rem 0 1rem 0;
  347. transition: all 0.4s ease;
  348. min-height: 90px;
  349. max-height: 90px;
  350. overflow: hidden;
  351. text-overflow: ellipsis;
  352. font-size: 18px;
  353. word-break: break-all;
  354. }
  355. span {
  356. color: #9caac6;
  357. font-size: 14px;
  358. transition: all 0.4s ease;
  359. }
  360. }
  361. }
  362. }
  363. }
  364. // .container{
  365. // //width: 75%;
  366. // //margin: 0 auto;
  367. // //padding: 80px 0 50px 0;
  368. // // .title{
  369. // // display: flex;
  370. // // flex-flow: row nowrap;
  371. // // align-items: center;
  372. // // justify-content: center;
  373. // // line-height: 1em;
  374. // // padding-bottom: 20px;
  375. // // >span{
  376. // // padding-right: 5px;
  377. // // }
  378. // // }
  379. // }
  380. .show {
  381. padding-top: 10px;
  382. .n-icon {
  383. vertical-align: sub;
  384. }
  385. .more {
  386. padding-left: 30px;
  387. }
  388. }
  389. // 热门资讯
  390. .news-content {
  391. width: 100%;
  392. display: flex;
  393. flex-wrap: wrap;
  394. .news-box {
  395. width: 20%;
  396. //padding: 25px 30px 22px;
  397. visibility: visible;
  398. > .image {
  399. width: 100%;
  400. height: 240px;
  401. overflow: hidden;
  402. img {
  403. height: 100%;
  404. transition: transform 0.7s ease;
  405. object-fit: cover;
  406. &:hover {
  407. transform: scale(1.3);
  408. }
  409. }
  410. }
  411. .box-content {
  412. margin: 20px 30px 5px 0;
  413. a {
  414. &:hover {
  415. color: #096ed7;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. .news-content {
  422. :nth-child(5n + 2).news-box {
  423. padding-top: 50px;
  424. }
  425. :nth-child(5n + 3).news-box {
  426. padding-top: 100px;
  427. }
  428. :nth-child(5n + 4).news-box {
  429. padding-top: 150px;
  430. }
  431. :nth-child(5n + 5).news-box {
  432. padding-top: 200px;
  433. }
  434. }
  435. .category {
  436. background-color: #edf0f5;
  437. }
  438. .category-box {
  439. display: flex;
  440. padding: 20px 30px;
  441. margin-bottom: 10px;
  442. border-radius: 10px;
  443. background-color: #fff;
  444. margin-right: 10px;
  445. .img {
  446. width: 140px;
  447. }
  448. .text {
  449. padding-left: 20px;
  450. width: calc(100% - 140px);
  451. h3 {
  452. padding-bottom: 0;
  453. line-height: 30px;
  454. font-size: 20px;
  455. font-weight: 600;
  456. a {
  457. overflow: hidden;
  458. text-overflow: ellipsis;
  459. }
  460. a:hover {
  461. color: #096ed7;
  462. }
  463. }
  464. .time {
  465. > .icon {
  466. vertical-align: sub;
  467. }
  468. > span {
  469. padding-left: 4px;
  470. vertical-align: text-bottom;
  471. }
  472. }
  473. > p {
  474. min-height: 60px;
  475. max-height: 60px;
  476. overflow: hidden;
  477. text-overflow: ellipsis;
  478. line-height: 20px;
  479. }
  480. }
  481. }
  482. img {
  483. width: 100%;
  484. }
  485. //定制报告
  486. .home-profile-box {
  487. display: flex;
  488. .box-text {
  489. width: 50%;
  490. padding: 40px;
  491. > h3 {
  492. font-size: 20px;
  493. font-weight: 600;
  494. }
  495. > p {
  496. font-size: 18px;
  497. }
  498. .btn {
  499. padding-top: 50px;
  500. }
  501. }
  502. .box-img {
  503. width: 50%;
  504. }
  505. }
  506. .home-contact {
  507. position: relative;
  508. .contact-row {
  509. position: absolute;
  510. left: 12.5%;
  511. top: 160px;
  512. width: 1200px;
  513. display: flex;
  514. justify-content: space-between;
  515. align-items: center;
  516. flex-wrap: wrap;
  517. .contact-txt {
  518. width: 40%;
  519. span {
  520. font-size: 26px;
  521. color: #fff;
  522. font-weight: 600;
  523. }
  524. }
  525. .contact-btn {
  526. width: 30%;
  527. > a {
  528. color: #fff;
  529. font-size: 26px;
  530. background: #18a058;
  531. padding: 15px 25px;
  532. }
  533. }
  534. }
  535. .contact-img {
  536. height: 360px;
  537. overflow: hidden;
  538. > img {
  539. height: 100%;
  540. width: 100%;
  541. object-fit: cover;
  542. }
  543. }
  544. }
  545. </style>