index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. <template>
  2. <div class="bg-F5">
  3. <div class="container">
  4. <el-row class="mt2rem" :gutter="20">
  5. <el-col :span="4">
  6. <category @change="e => $router.push({ path: `/mall`, query: e })" />
  7. </el-col>
  8. <el-col :span="14">
  9. <el-carousel class="bannerD marquee">
  10. <el-carousel-item v-for="x in 3" :key="`banner${x}`">
  11. <img class="banner" :src="require(`@assets/lunbo${x}.png`)" />
  12. </el-carousel-item>
  13. </el-carousel>
  14. </el-col>
  15. <el-col :span="6">
  16. <user-info />
  17. <div class="noticeDiv">
  18. <div class="noticeTitle">
  19. 通知公告
  20. <router-link to="/news">
  21. <span class="more"
  22. >more<i class="el-icon-d-arrow-right"></i
  23. ></span>
  24. </router-link>
  25. </div>
  26. <div class="notice" v-for="item in notices[0]" :key="item.noticeId">
  27. <router-link :to="`/newsDetail/${item.noticeId}`">
  28. {{ item.noticeTitle }}
  29. </router-link>
  30. </div>
  31. </div>
  32. </el-col>
  33. </el-row>
  34. <div class="partTitle"><span class="orangeLine"></span>服务能力</div>
  35. <div class="fwnl">
  36. <div
  37. class="fwnlItem"
  38. v-for="({ text, img, num }, index) in fwList"
  39. :key="`fwList${index}`"
  40. >
  41. <div class="numDiv">
  42. <img :src="require(`@assets/${img}.png`)" alt />
  43. <span>{{ num }}</span>
  44. </div>
  45. <div class="titleDiv">
  46. <span>{{ num }}</span>
  47. {{ text }}
  48. </div>
  49. <div class="line" v-if="index < fwList.length - 1"></div>
  50. </div>
  51. </div>
  52. <!-- 广告位 -->
  53. <div class="mt2rem">
  54. <img src="@assets/home_ggw1.png" alt />
  55. </div>
  56. <div class="partTitle">
  57. <span class="orangeLine"></span>热门商品
  58. <router-link to="/mall">
  59. <span class="more">more<i class="el-icon-d-arrow-right"></i></span>
  60. </router-link>
  61. </div>
  62. <div class="rmspList">
  63. <router-link
  64. :to="`/shop/${item.companyId}/${item.id}`"
  65. class="product"
  66. v-for="item in products"
  67. :key="item.id"
  68. >
  69. <div class="imgDiv">
  70. <img :src="`${$basePath}${item.cover}`" />
  71. </div>
  72. <a :title="item.name" class="name">{{ item.name }}</a>
  73. <div class="money">
  74. ¥
  75. <span>{{ item.price }}</span>
  76. </div>
  77. <div class="company ">{{ item.companyName }}</div>
  78. </router-link>
  79. </div>
  80. <div class="partTitle ppsj">
  81. <span class="orangeLine"></span>品牌商家
  82. <router-link to="/shops" class="more"
  83. >more<i class="el-icon-d-arrow-right"></i
  84. ></router-link>
  85. </div>
  86. <div class="ppsjList">
  87. <div class="plist" :style="`animation-duration:${shops.length * 3}s`">
  88. <router-link
  89. class="item"
  90. v-for="({ defaultImgUrl, primaryBusiness, companyName, id },
  91. index) in [...shops, ...shops]"
  92. :key="`ppsjList${index}`"
  93. :to="`/shop/${id}`"
  94. >
  95. <div class="imgDiv2">
  96. <img :src="`${$basePath}${defaultImgUrl}`" alt />
  97. </div>
  98. <div class="name">{{ companyName }}</div>
  99. <div class="company">主营商品:{{ primaryBusiness }}</div>
  100. </router-link>
  101. </div>
  102. </div>
  103. <div class="partTitle"><span class="orangeLine"></span>需求供应</div>
  104. <div class="xqgy">
  105. <template v-for="(info, index) in infos">
  106. <div :key="`info${index}`" class="xqDiv">
  107. <div class="xqTitle">
  108. <img
  109. :src="
  110. require(`@assets/${index ? 'gongyingshang' : 'xuqiu'}.png`)
  111. "
  112. alt
  113. />{{ index ? "供应商" : "需求" }}
  114. <router-link :to="`/info/${index}`">
  115. <span class="more"
  116. >more<i class="el-icon-d-arrow-right"></i
  117. ></span>
  118. </router-link>
  119. </div>
  120. <router-link
  121. :to="`/info/${index ? 'sell' : 'buy'}/${item.id}`"
  122. v-for="item in info"
  123. :key="item.id"
  124. >
  125. <div class="xq">
  126. <div class="con">
  127. 【{{ index ? "供应" : "求购" }}】{{
  128. index ? item.supplyTitle : item.purchaseTitle
  129. }}
  130. </div>
  131. <div class="date">
  132. {{ `${item.releaseTime}`.split(" ")[0] }}
  133. </div>
  134. </div>
  135. </router-link>
  136. </div>
  137. <div class="t" :key="`info-t${index}`" v-if="index === 0"></div>
  138. </template>
  139. </div>
  140. <!-- 广告位 -->
  141. <div class=" mt2rem">
  142. <img src="@assets/home_ggw2.png" alt />
  143. </div>
  144. <el-row :gutter="20">
  145. <el-col
  146. :span="12"
  147. v-for="([item, ...items], index) in notices.slice(1)"
  148. :key="`notices${index}`"
  149. >
  150. <div class="partTitle">
  151. <span class="orangeLine"></span
  152. >{{ index ? "家具保养" : "行业资讯" }}
  153. <router-link :to="`/news/${index + 1}`">
  154. <span class="more"
  155. >more<i class="el-icon-d-arrow-right"></i
  156. ></span>
  157. </router-link>
  158. </div>
  159. <div class="hyzxDiv" v-if="item">
  160. <router-link
  161. :to="`/newsDetail/${item.noticeId}`"
  162. class="noticeDetails"
  163. >
  164. <div class="img">
  165. <img :src="`${$basePath}${item.fmzFileUrl}`" alt />
  166. </div>
  167. <div class="content">
  168. <div class="tit">{{ item.noticeTitle }}</div>
  169. <div class="desc">
  170. {{ item.noticeOutline }}
  171. </div>
  172. <div class="date">{{ `${item.createTime}`.split(" ")[0] }}</div>
  173. </div>
  174. </router-link>
  175. <ul class="bottomUl">
  176. <li v-for="item in items" :key="item.noticeId">
  177. <router-link :to="`/newsDetail/${item.noticeId}`">
  178. {{ item.noticeTitle }}
  179. </router-link>
  180. </li>
  181. </ul>
  182. </div>
  183. </el-col>
  184. </el-row>
  185. </div>
  186. </div>
  187. </template>
  188. <script lang="ts">
  189. import { Component, Vue, Watch, Prop } from "vue-property-decorator";
  190. @Component
  191. export default class extends Vue {
  192. private notices: IAny[] = [];
  193. private infos: IAny[] = [];
  194. private products: IAny[] = [];
  195. private shops: IAny[] = [];
  196. private fwList: Array<{
  197. img: string;
  198. num: number;
  199. text: string;
  200. }> = [
  201. {
  202. img: "qiyeruzhu",
  203. num: 0,
  204. text: "家钢制家具生产企业入驻"
  205. },
  206. {
  207. img: "chanpin",
  208. num: 0,
  209. text: "个钢制家具产品入驻"
  210. },
  211. {
  212. img: "huiyuan",
  213. num: 0,
  214. text: "位平台会员注册"
  215. },
  216. {
  217. img: "yingyee",
  218. num: 0,
  219. text: "万在线电商营业额"
  220. }
  221. ];
  222. async created() {
  223. const arr = `/goods/info/hotlist,
  224. /demand/info/getDemandInfoTenList,
  225. /supply/info/getSupplyInfoTenLsit,
  226. /company/hotlist,
  227. /company/countCompanyInfo`
  228. .split(",")
  229. .map(url => this.$post(url.trim()));
  230. const [
  231. { list: p },
  232. { demandList: d },
  233. { supplyList: s },
  234. { list: shops },
  235. { companyNum, goodsNum, memberNum },
  236. ...n
  237. ] = await Promise.all([
  238. ...arr,
  239. ...[...Array(3)].map((x, index) =>
  240. this.$post("/interface/notice/getNoticeListTop5", {
  241. noticeType: index + 1
  242. })
  243. )
  244. ]).then(x => x.map(([, data]) => data));
  245. this.products = p;
  246. this.infos = [d, s];
  247. this.shops = shops;
  248. [companyNum, goodsNum, memberNum].forEach(
  249. (x: number, index) => (this.fwList[index].num = x)
  250. );
  251. this.notices = n.map(({ list }) => list);
  252. }
  253. }
  254. </script>
  255. <style lang="scss" scoped>
  256. .bannerD {
  257. height: 39rem;
  258. .banner {
  259. width: 100%;
  260. height: 100%;
  261. }
  262. }
  263. .noticeDiv {
  264. margin-top: 1rem;
  265. height: 22rem;
  266. background: #fff;
  267. border-radius: 0.4rem;
  268. padding: 2rem;
  269. box-sizing: border-box;
  270. .noticeTitle {
  271. height: 3rem;
  272. line-height: 3rem;
  273. font-size: 1.6rem;
  274. color: #333;
  275. .more {
  276. line-height: 3rem;
  277. font-size: 1.4rem;
  278. color: #999;
  279. float: right;
  280. }
  281. }
  282. .notice {
  283. height: 3rem;
  284. line-height: 3rem;
  285. overflow: hidden;
  286. font-size: 1.4rem;
  287. color: #666;
  288. a {
  289. color: #666;
  290. }
  291. }
  292. }
  293. .partTitle {
  294. padding: 3rem 0 2rem 0;
  295. font-size: 1.8rem;
  296. color: #333;
  297. &.ppsj {
  298. padding-top: 2rem;
  299. }
  300. .orangeLine {
  301. display: inline-block;
  302. height: 1.8rem;
  303. width: 0.3rem;
  304. background: #fd5522;
  305. vertical-align: middle;
  306. border-radius: 0.15rem;
  307. margin-right: 1rem;
  308. }
  309. .more {
  310. line-height: 3rem;
  311. font-size: 1.4rem;
  312. color: #999;
  313. float: right;
  314. }
  315. }
  316. .fwnl {
  317. width: 100%;
  318. height: 17rem;
  319. display: table;
  320. background: #fff;
  321. text-align: center;
  322. .fwnlItem {
  323. width: 25%;
  324. display: table-cell;
  325. vertical-align: middle;
  326. position: relative;
  327. .numDiv {
  328. margin-bottom: 1rem;
  329. img {
  330. height: 3.6rem;
  331. vertical-align: bottom;
  332. }
  333. span {
  334. font-size: 1.8rem;
  335. color: #fd5522;
  336. font-weight: bold;
  337. vertical-align: bottom;
  338. margin-left: 1rem;
  339. }
  340. }
  341. .titleDiv {
  342. font-size: 1.6rem;
  343. color: #333;
  344. }
  345. .line {
  346. width: 0.1rem;
  347. height: 4rem;
  348. background: #e5e5e5;
  349. position: absolute;
  350. top: 50%;
  351. right: 0;
  352. margin-top: -2rem;
  353. }
  354. }
  355. }
  356. .ppsjList {
  357. width: 100%;
  358. overflow: hidden;
  359. .plist {
  360. animation: marquee linear infinite;
  361. box-sizing: border-box;
  362. white-space: nowrap;
  363. display: inline-block;
  364. &:hover {
  365. animation-play-state: paused;
  366. }
  367. }
  368. .item {
  369. width: 216px;
  370. height: 210px;
  371. display: inline-block;
  372. margin-right: 20px;
  373. background: #fff;
  374. border-radius: 0.4rem;
  375. box-sizing: border-box;
  376. padding-bottom: 1.6rem;
  377. .name {
  378. height: 2rem;
  379. line-height: 2rem;
  380. font-size: 1.4rem;
  381. color: #333;
  382. font-weight: bold;
  383. margin-top: 2rem;
  384. overflow: hidden;
  385. padding: 0 2rem;
  386. box-sizing: border-box;
  387. }
  388. .company {
  389. height: 2rem;
  390. line-height: 2rem;
  391. font-size: 1.2rem;
  392. color: #666;
  393. overflow: hidden;
  394. padding: 0 2rem;
  395. box-sizing: border-box;
  396. }
  397. .imgDiv2 {
  398. width: 100%;
  399. height: 115px;
  400. img {
  401. width: 100%;
  402. max-height: 100%;
  403. }
  404. }
  405. }
  406. }
  407. .rmspList {
  408. .product {
  409. display: inline-block;
  410. width: 216px;
  411. height: 340px;
  412. background: #fff;
  413. overflow: hidden;
  414. margin-right: 20px;
  415. margin-bottom: 1rem;
  416. border-radius: 0.4rem;
  417. box-sizing: border-box;
  418. padding: 2rem;
  419. &:nth-child(5n + 5) {
  420. margin-right: 0;
  421. }
  422. .imgDiv {
  423. border: 0.1rem solid #e5e5e5;
  424. width: 175px;
  425. height: 200px;
  426. text-align: center;
  427. line-height: 0;
  428. position: relative;
  429. img {
  430. width: 90%;
  431. position: absolute;
  432. top: 50%;
  433. left: 50%;
  434. transform: translate(-50%, -50%);
  435. }
  436. }
  437. .name {
  438. font-size: 1.4rem;
  439. color: #333;
  440. font-weight: bold;
  441. margin-top: 15px;
  442. overflow: hidden;
  443. text-overflow: ellipsis;
  444. white-space: nowrap;
  445. display: block;
  446. }
  447. .money {
  448. font-size: 1.2rem;
  449. margin-top: 5px;
  450. color: #fd5522;
  451. span {
  452. font-size: 1.8rem;
  453. }
  454. }
  455. .company {
  456. margin-top: 10px;
  457. font-size: 1.2rem;
  458. color: #666;
  459. }
  460. }
  461. }
  462. .xqgy {
  463. overflow: hidden;
  464. // height: 430px;
  465. background: #fff;
  466. position: relative;
  467. .t {
  468. position: absolute;
  469. top: 0;
  470. left: 560px;
  471. bottom: 0;
  472. width: 20px;
  473. background: #f5f5f5;
  474. }
  475. .xqDiv {
  476. float: left;
  477. width: 560px;
  478. height: 100%;
  479. margin-left: 20px;
  480. padding: 20px;
  481. box-sizing: border-box;
  482. &:first-child {
  483. margin-left: 0;
  484. }
  485. .xqTitle {
  486. height: 3rem;
  487. line-height: 3rem;
  488. font-size: 1.6rem;
  489. color: #fd5522;
  490. img {
  491. height: 1.6rem;
  492. vertical-align: middle;
  493. margin-right: 1rem;
  494. }
  495. .more {
  496. line-height: 3rem;
  497. font-size: 1.4rem;
  498. color: #999;
  499. float: right;
  500. }
  501. }
  502. .xq {
  503. height: 3.6rem;
  504. line-height: 3.6rem;
  505. overflow: hidden;
  506. .con {
  507. width: 65%;
  508. float: left;
  509. height: 100%;
  510. font-size: 1.4rem;
  511. color: #333;
  512. padding-right: 1rem;
  513. box-sizing: border-box;
  514. overflow: hidden;
  515. }
  516. .date {
  517. width: 35%;
  518. float: left;
  519. height: 100%;
  520. font-size: 1.2rem;
  521. color: #666;
  522. text-align: right;
  523. }
  524. }
  525. }
  526. }
  527. .hyzxDiv {
  528. background: #fff;
  529. border-radius: 0.4rem;
  530. padding: 1.6rem;
  531. box-sizing: border-box;
  532. margin-bottom: 4rem;
  533. .noticeDetails {
  534. height: 100px;
  535. display: inline-block;
  536. overflow: hidden;
  537. box-sizing: border-box;
  538. .img {
  539. border: 1px solid #e5e5e5;
  540. width: 120px;
  541. float: left;
  542. height: 100%;
  543. position: relative;
  544. box-sizing: border-box;
  545. img {
  546. width: 80%;
  547. max-height: 100%;
  548. position: absolute;
  549. top: 50%;
  550. left: 50%;
  551. transform: translate(-50%, -50%);
  552. }
  553. }
  554. .content {
  555. float: left;
  556. margin-left: 20px;
  557. width: 388px;
  558. .tit {
  559. font-size: 1.6rem;
  560. color: #333;
  561. }
  562. .desc {
  563. margin-top: 5px;
  564. font-size: 1.2rem;
  565. color: #666;
  566. overflow: hidden;
  567. text-overflow: ellipsis;
  568. display: -webkit-box;
  569. -webkit-line-clamp: 2;
  570. -webkit-box-orient: vertical;
  571. }
  572. .date {
  573. font-size: 12px;
  574. color: #666;
  575. margin-top: 10px;
  576. }
  577. }
  578. }
  579. .bottomUl {
  580. list-style: none;
  581. padding-top: 1rem;
  582. li {
  583. height: 3rem;
  584. line-height: 3rem;
  585. font-size: 1.4rem;
  586. color: #333;
  587. overflow: hidden;
  588. }
  589. }
  590. }
  591. .bg-88 {
  592. background: #889fe9;
  593. }
  594. .bg-84 {
  595. background: #84ccc9;
  596. }
  597. .mt15px {
  598. margin-top: 1.5rem;
  599. }
  600. @keyframes marquee {
  601. from {
  602. transform: translateX(0px);
  603. }
  604. to {
  605. transform: translateX(-50%);
  606. }
  607. }
  608. </style>