index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. <template>
  2. <div class="bg-F5">
  3. <div class="container">
  4. <el-row class="mt2rem" :gutter="20">
  5. <el-col :span="4">
  6. <mymenu></mymenu>
  7. </el-col>
  8. <el-col :span="14">
  9. <el-carousel class="bannerD marquee" :autoplay="false">
  10. <el-carousel-item>
  11. <img class="banner" src="@assets/lunbo1.png" att />
  12. </el-carousel-item>
  13. <el-carousel-item>
  14. <img class="banner" src="@assets/lunbo2.png" att />
  15. </el-carousel-item>
  16. <el-carousel-item>
  17. <img class="banner" src="@assets/lunbo3.png" att />
  18. </el-carousel-item>
  19. </el-carousel>
  20. </el-col>
  21. <el-col :span="6">
  22. <div class="loginDiv">
  23. <div class="txDiv">
  24. <img
  25. v-if="loginAccount == ''"
  26. src="@assets/touxiang01.png"
  27. alt=""
  28. />
  29. <img v-else src="@assets/touxiang02.png" alt="" />
  30. </div>
  31. <div class="username" v-if="loginAccount == ''">您还未登录哦!</div>
  32. <div class="username" v-else>{{ loginAccount }}</div>
  33. <div class="btnDiv" v-if="loginAccount == ''">
  34. <router-link to="/login">
  35. <el-button class="leftBtn">登录</el-button>
  36. </router-link>
  37. <router-link to="/register">
  38. <el-button class="rightBtn">注册</el-button>
  39. </router-link>
  40. </div>
  41. </div>
  42. <div class="noticeDiv">
  43. <div class="noticeTitle">
  44. 通知公告
  45. <router-link to="/news?active=first">
  46. <span class="more"
  47. >more<i class="el-icon-d-arrow-right"></i
  48. ></span>
  49. </router-link>
  50. </div>
  51. <div
  52. class="notice"
  53. v-for="item in noticeListTzgg"
  54. :key="item.noticeId"
  55. >
  56. <router-link :to="`/news/newsDetail?noticeId=${item.noticeId}`">
  57. {{ item.noticeTitle }}
  58. </router-link>
  59. </div>
  60. </div>
  61. </el-col>
  62. </el-row>
  63. <div class="partTitle"><span class="orangeLine"></span>服务能力</div>
  64. <div class="fwnl">
  65. <div class="fwnlItem">
  66. <div class="numDiv">
  67. <img src="@assets/qiyeruzhu.png" alt />
  68. <span>1536</span>
  69. </div>
  70. <div class="titleDiv">
  71. <span>1536</span>
  72. 家钢制家具生产企业入驻
  73. </div>
  74. <div class="line"></div>
  75. </div>
  76. <div class="fwnlItem">
  77. <div class="numDiv">
  78. <img src="@assets/chanpin.png" alt />
  79. <span>1536</span>
  80. </div>
  81. <div class="titleDiv">
  82. <span>1536</span>
  83. 个钢制家具产品入驻
  84. </div>
  85. <div class="line"></div>
  86. </div>
  87. <div class="fwnlItem">
  88. <div class="numDiv">
  89. <img src="@assets/huiyuan.png" alt />
  90. <span>1536</span>
  91. </div>
  92. <div class="titleDiv">
  93. <span>1536</span>
  94. 位平台会员注册
  95. </div>
  96. <div class="line"></div>
  97. </div>
  98. <div class="fwnlItem">
  99. <div class="numDiv">
  100. <img src="@assets/yingyee.png" alt />
  101. <span>1536</span>
  102. </div>
  103. <div class="titleDiv">
  104. <span>1536</span>
  105. 万在线电商营业额
  106. </div>
  107. <div class="line"></div>
  108. </div>
  109. </div>
  110. <!-- 广告位 -->
  111. <div class="ggzw bg-84 mt2rem">办公系列广告占位</div>
  112. <div class="partTitle">
  113. <span class="orangeLine"></span>热门商品
  114. <router-link to="/mall">
  115. <span class="more">more<i class="el-icon-d-arrow-right"></i></span>
  116. </router-link>
  117. </div>
  118. <div class="rmsp">
  119. <router-link
  120. :to="`/shop/${item.companyId}/${item.id}`"
  121. class="product"
  122. v-for="item in hotlistArr"
  123. :key="item.id"
  124. >
  125. <div class="rmspItem">
  126. <div class="imgDiv">
  127. <img :src="item.cover" alt />
  128. </div>
  129. <div class="name">{{ item.name }}</div>
  130. <div class="money">
  131. ¥
  132. <span>{{ item.price }}</span>
  133. </div>
  134. <div class="company mt15px">{{ item.companyName }}</div>
  135. </div>
  136. </router-link>
  137. </div>
  138. <div class="partTitle">
  139. <span class="orangeLine"></span>品牌商家<span class="more"
  140. >more<i class="el-icon-d-arrow-right"></i
  141. ></span>
  142. </div>
  143. <div class="rmsp">
  144. <div class="ppsjItem" v-for="item in 5" :key="item">
  145. <div class="imgDiv2">
  146. <img src="@assets/changjia.png" alt />
  147. </div>
  148. <div class="name">洛阳科飞亚有限公司</div>
  149. <div class="company">主营商品:文件柜,办公柜,文件柜,办公柜</div>
  150. </div>
  151. </div>
  152. <div class="partTitle"><span class="orangeLine"></span>需求供应</div>
  153. <el-row :gutter="20" class="xqgy">
  154. <el-col :span="4">
  155. <mymenu></mymenu>
  156. </el-col>
  157. <el-col :span="10">
  158. <div class="xqDiv">
  159. <div class="xqTitle">
  160. <img src="@assets/xuqiu.png" alt />需求
  161. <router-link to="/info?active=demand">
  162. <span class="more"
  163. >more<i class="el-icon-d-arrow-right"></i
  164. ></span>
  165. </router-link>
  166. </div>
  167. <router-link
  168. :to="`/info/buyDetail?id=${item.id}`"
  169. v-for="item in demandList"
  170. :key="item.id"
  171. >
  172. <div class="xq">
  173. <div class="con">【求购】{{ item.purchaseTitle }}</div>
  174. <div class="date">{{ item.releaseTime }}</div>
  175. </div>
  176. </router-link>
  177. </div>
  178. </el-col>
  179. <el-col :span="10">
  180. <div class="xqDiv">
  181. <div class="xqTitle">
  182. <img src="@assets/gongyingshang.png" alt />供应商
  183. <router-link to="/info?active=supply">
  184. <span class="more"
  185. >more<i class="el-icon-d-arrow-right"></i
  186. ></span>
  187. </router-link>
  188. </div>
  189. <router-link
  190. :to="`/info/supplyDetail?id=${item.id}`"
  191. v-for="item in supplyList"
  192. :key="item.id"
  193. >
  194. <div class="xq">
  195. <div class="con">【供应】{{ item.supplyTitle }}</div>
  196. <div class="date">{{ item.releaseTime }}</div>
  197. </div>
  198. </router-link>
  199. </div>
  200. </el-col>
  201. </el-row>
  202. <!-- 广告位 -->
  203. <div class="ggzw bg-88 mt2rem">智能家具保险柜广告占位</div>
  204. <el-row :gutter="20">
  205. <el-col :span="12">
  206. <div class="partTitle">
  207. <span class="orangeLine"></span>行业资讯
  208. <router-link to="/news?active=second">
  209. <span class="more"
  210. >more<i class="el-icon-d-arrow-right"></i
  211. ></span>
  212. </router-link>
  213. </div>
  214. <div class="hyzxDiv">
  215. <router-link
  216. :to="`/news/newsDetail?noticeId=${hyzxFirst.noticeId}`"
  217. >
  218. <div class="topDiv">
  219. <div class="leftDiv">
  220. <div>
  221. <img :src="hyzxFirst.fmzFileUrl" alt />
  222. </div>
  223. </div>
  224. <div class="rightDiv">
  225. <div class="title">{{ hyzxFirst.noticeTitle }}</div>
  226. <div class="content" v-html="hyzxFirst.noticeContent"></div>
  227. <div class="date">{{ hyzxFirst.createTime }}</div>
  228. </div>
  229. </div>
  230. </router-link>
  231. <ul class="bottomUl">
  232. <li v-for="item in hyzxOther" :key="item.noticeId">
  233. <router-link :to="`/news/newsDetail?noticeId=${item.noticeId}`">
  234. {{ item.noticeTitle }}
  235. </router-link>
  236. </li>
  237. </ul>
  238. </div>
  239. </el-col>
  240. <el-col :span="12">
  241. <div class="partTitle">
  242. <span class="orangeLine"></span>家具保养
  243. <router-link to="/news?active=third">
  244. <span class="more"
  245. >more<i class="el-icon-d-arrow-right"></i
  246. ></span>
  247. </router-link>
  248. </div>
  249. <div class="hyzxDiv">
  250. <router-link
  251. :to="`/news/newsDetail?noticeId=${jjbyFirst.noticeId}`"
  252. >
  253. <div class="topDiv">
  254. <div class="leftDiv">
  255. <div>
  256. <img :src="hyzxFirst.fmzFileUrl" alt />
  257. </div>
  258. </div>
  259. <div class="rightDiv">
  260. <div class="title">{{ jjbyFirst.noticeTitle }}</div>
  261. <div class="content" v-html="jjbyFirst.noticeContent"></div>
  262. <div class="date">{{ jjbyFirst.createTime }}</div>
  263. </div>
  264. </div>
  265. </router-link>
  266. <ul class="bottomUl">
  267. <li v-for="item in hyzxOther" :key="item.noticeId">
  268. <router-link :to="`/news/newsDetail?noticeId=${item.noticeId}`">
  269. {{ item.noticeTitle }}
  270. </router-link>
  271. </li>
  272. </ul>
  273. </div>
  274. </el-col>
  275. </el-row>
  276. </div>
  277. </div>
  278. </template>
  279. <script>
  280. import { Component, Vue } from "vue-property-decorator";
  281. import mymenu from "@/components/menu.vue";
  282. export default {
  283. name: "app",
  284. components: {
  285. mymenu
  286. },
  287. data() {
  288. return {
  289. shangpin: [],
  290. demandList: [],
  291. supplyList: [],
  292. noticeListTzgg: [],
  293. noticeListHyzx: [],
  294. hyzxFirst: {},
  295. hyzxOther: [],
  296. noticeListJjby: [],
  297. jjbyFirst: {},
  298. jjbyOther: [],
  299. loginAccount: "",
  300. hotlistArr: []
  301. };
  302. },
  303. methods: {
  304. // 通知公告前5条 liuqiwen
  305. noticeList(noticeType) {
  306. var that = this;
  307. that
  308. .$post("/interface/notice/getNoticeListTop5", {
  309. noticeType: noticeType
  310. })
  311. .then(function(res) {
  312. if (!res[0]) {
  313. for (let i = 0; i < res[1].list.length; i++) {
  314. res[1].list[i].fmzFileUrl =
  315. that.$basePath + res[1].list[i].fmzFileUrl;
  316. }
  317. if (noticeType == 1) {
  318. that.noticeListTzgg = res[1].list;
  319. } else if (noticeType == 2) {
  320. that.noticeListHyzx = res[1].list;
  321. that.hyzxFirst = that.noticeListHyzx[0];
  322. that.hyzxOther = that.noticeListHyzx.splice(1, 4);
  323. } else {
  324. that.noticeListJjby = res[1].list;
  325. that.jjbyFirst = that.noticeListJjby[0];
  326. that.jjbyOther = that.noticeListJjby.splice(1, 4);
  327. }
  328. }
  329. });
  330. },
  331. // 需求信息前十条数据 liuqiwen
  332. demandInfoTenList() {
  333. var that = this;
  334. that.$post("/demand/info/getDemandInfoTenList").then(function(res) {
  335. console.log(res);
  336. if (!res[0]) {
  337. that.demandList = res[1].demandList;
  338. }
  339. });
  340. },
  341. // 供应信息前10条 liuqiwen
  342. supplyInfoTenLsit() {
  343. var that = this;
  344. that.$post("/supply/info/getSupplyInfoTenLsit").then(function(res) {
  345. console.log(res);
  346. if (!res[0]) {
  347. that.supplyList = res[1].supplyList;
  348. }
  349. });
  350. },
  351. // 热门商品 liuqiwen
  352. hotlist() {
  353. var that = this;
  354. that.$post("/goods/info/hotlist").then(function(res) {
  355. console.log(res);
  356. if (!res[0]) {
  357. for (let i = 0; i < res[1].list.length; i++) {
  358. res[1].list[i].cover = that.$basePath + res[1].list[i].cover;
  359. }
  360. that.hotlistArr = res[1].list;
  361. }
  362. });
  363. }
  364. },
  365. activated() {
  366. if (this.$store.state.user.UserInfo) {
  367. this.loginAccount = this.$store.state.user.UserInfo.loginAccount;
  368. }
  369. },
  370. mounted() {
  371. this.noticeList(1);
  372. this.noticeList(2);
  373. this.noticeList(3);
  374. this.demandInfoTenList();
  375. this.supplyInfoTenLsit();
  376. this.hotlist();
  377. }
  378. };
  379. </script>
  380. <style lang="scss" scoped>
  381. .bannerD {
  382. height: 39rem;
  383. .banner {
  384. width: 100%;
  385. height: 100%;
  386. }
  387. }
  388. .loginDiv {
  389. height: 16rem;
  390. background: #fff;
  391. border-radius: 0.4rem;
  392. text-align: center;
  393. padding: 2rem;
  394. box-sizing: border-box;
  395. .txDiv {
  396. img {
  397. height: 5.8rem;
  398. width: 5.8rem;
  399. border-radius: 50%;
  400. }
  401. }
  402. .username {
  403. height: 2.4rem;
  404. line-height: 2.4rem;
  405. font-size: 1.2rem;
  406. color: #666;
  407. }
  408. .btnDiv {
  409. padding-top: 1rem;
  410. font-size: 1.4rem;
  411. .leftBtn {
  412. width: 40%;
  413. height: 2.8rem;
  414. line-height: 2.8rem;
  415. color: #fff;
  416. background: #fd5522;
  417. margin-right: 1rem;
  418. padding: 0;
  419. border: 0;
  420. }
  421. .rightBtn {
  422. width: 40%;
  423. height: 2.8rem;
  424. line-height: 2.8rem;
  425. color: #fd5522;
  426. border-color: #fd5522;
  427. background: #fff;
  428. padding: 0;
  429. // border: 0;
  430. }
  431. }
  432. }
  433. .noticeDiv {
  434. margin-top: 1rem;
  435. height: 22rem;
  436. background: #fff;
  437. border-radius: 0.4rem;
  438. padding: 2rem;
  439. box-sizing: border-box;
  440. .noticeTitle {
  441. height: 3rem;
  442. line-height: 3rem;
  443. font-size: 1.6rem;
  444. color: #333;
  445. .more {
  446. line-height: 3rem;
  447. font-size: 1.4rem;
  448. color: #999;
  449. float: right;
  450. }
  451. }
  452. .notice {
  453. height: 3rem;
  454. line-height: 3rem;
  455. overflow: hidden;
  456. font-size: 1.4rem;
  457. color: #666;
  458. a {
  459. color: #666;
  460. }
  461. }
  462. }
  463. .partTitle {
  464. padding: 3rem 0 2rem 0;
  465. font-size: 1.8rem;
  466. color: #333;
  467. .orangeLine {
  468. display: inline-block;
  469. height: 1.8rem;
  470. width: 0.3rem;
  471. background: #fd5522;
  472. vertical-align: middle;
  473. border-radius: 0.15rem;
  474. margin-right: 1rem;
  475. }
  476. .more {
  477. line-height: 3rem;
  478. font-size: 1.4rem;
  479. color: #999;
  480. float: right;
  481. }
  482. }
  483. .fwnl {
  484. width: 100%;
  485. height: 17rem;
  486. display: table;
  487. background: #fff;
  488. text-align: center;
  489. .fwnlItem {
  490. width: 25%;
  491. display: table-cell;
  492. vertical-align: middle;
  493. position: relative;
  494. .numDiv {
  495. margin-bottom: 1rem;
  496. img {
  497. height: 3.6rem;
  498. vertical-align: bottom;
  499. }
  500. span {
  501. font-size: 1.8rem;
  502. color: #fd5522;
  503. font-weight: bold;
  504. vertical-align: bottom;
  505. margin-left: 1rem;
  506. }
  507. }
  508. .titleDiv {
  509. font-size: 1.6rem;
  510. color: #333;
  511. }
  512. .line {
  513. width: 0.1rem;
  514. height: 4rem;
  515. background: #e5e5e5;
  516. position: absolute;
  517. top: 50%;
  518. right: 0;
  519. margin-top: -2rem;
  520. }
  521. }
  522. }
  523. .ggzw {
  524. height: 13rem;
  525. line-height: 13rem;
  526. font-size: 2.6rem;
  527. font-weight: bold;
  528. color: #fff;
  529. text-align: center;
  530. }
  531. .rmsp {
  532. width: 100%;
  533. overflow: hidden;
  534. .rmspItem,
  535. .ppsjItem {
  536. width: 18%;
  537. float: left;
  538. margin-right: 2.5%;
  539. background: #fff;
  540. border-radius: 0.4rem;
  541. box-sizing: border-box;
  542. &:last-child {
  543. margin-right: 0;
  544. }
  545. .name {
  546. height: 2rem;
  547. line-height: 2rem;
  548. font-size: 1.4rem;
  549. color: #333;
  550. font-weight: bold;
  551. margin-top: 2rem;
  552. overflow: hidden;
  553. }
  554. .company {
  555. height: 2rem;
  556. line-height: 2rem;
  557. font-size: 1.2rem;
  558. color: #666;
  559. overflow: hidden;
  560. }
  561. }
  562. .rmspItem {
  563. padding: 2rem;
  564. .imgDiv {
  565. border: 0.1rem solid #e5e5e5;
  566. text-align: center;
  567. line-height: 0;
  568. img {
  569. width: 100%;
  570. }
  571. }
  572. .money {
  573. height: 2rem;
  574. line-height: 2rem;
  575. font-size: 1.8rem;
  576. color: #fd5522;
  577. margin-top: 1.5rem;
  578. }
  579. }
  580. .ppsjItem {
  581. padding-bottom: 1.6rem;
  582. .imgDiv {
  583. img {
  584. width: 100%;
  585. }
  586. }
  587. .name {
  588. padding: 0 2rem;
  589. box-sizing: border-box;
  590. }
  591. .company {
  592. padding: 0 2rem;
  593. box-sizing: border-box;
  594. }
  595. }
  596. }
  597. .xqgy {
  598. .xqDiv {
  599. background: #fff;
  600. padding: 2rem;
  601. box-sizing: border-box;
  602. .xqTitle {
  603. height: 3rem;
  604. line-height: 3rem;
  605. font-size: 1.6rem;
  606. color: #fd5522;
  607. img {
  608. height: 1.6rem;
  609. vertical-align: middle;
  610. margin-right: 1rem;
  611. }
  612. .more {
  613. line-height: 3rem;
  614. font-size: 1.4rem;
  615. color: #999;
  616. float: right;
  617. }
  618. }
  619. .xq {
  620. height: 3.6rem;
  621. line-height: 3.6rem;
  622. overflow: hidden;
  623. .con {
  624. width: 65%;
  625. float: left;
  626. height: 100%;
  627. font-size: 1.4rem;
  628. color: #333;
  629. padding-right: 1rem;
  630. box-sizing: border-box;
  631. overflow: hidden;
  632. }
  633. .date {
  634. width: 35%;
  635. float: left;
  636. height: 100%;
  637. font-size: 1.2rem;
  638. color: #666;
  639. text-align: right;
  640. }
  641. }
  642. }
  643. }
  644. .hyzxDiv {
  645. background: #fff;
  646. border-radius: 0.4rem;
  647. padding: 1.6rem;
  648. box-sizing: border-box;
  649. margin-bottom: 4rem;
  650. .topDiv {
  651. width: 100%;
  652. display: table;
  653. border: 0.1rem solid #e5e5e5;
  654. .leftDiv {
  655. display: table-cell;
  656. width: 30%;
  657. text-align: center;
  658. vertical-align: top;
  659. div {
  660. width: 80%;
  661. display: inline-block;
  662. border: 0.1rem solid #e5e5e5;
  663. line-height: 0;
  664. img {
  665. width: 100%;
  666. }
  667. }
  668. }
  669. .rightDiv {
  670. display: table-cell;
  671. width: 70%;
  672. padding-left: 1rem;
  673. box-sizing: border-box;
  674. vertical-align: top;
  675. .title {
  676. font-size: 1.6rem;
  677. color: #333;
  678. height: 3rem;
  679. line-height: 3rem;
  680. overflow: hidden;
  681. }
  682. .content {
  683. height: 5rem;
  684. line-height: 2.5rem;
  685. font-size: 1.2rem;
  686. color: #666;
  687. overflow: hidden;
  688. }
  689. .date {
  690. font-size: 1.2rem;
  691. color: #666;
  692. line-height: 2.4rem;
  693. }
  694. }
  695. }
  696. .bottomUl {
  697. list-style: none;
  698. padding-top: 1rem;
  699. li {
  700. height: 3rem;
  701. line-height: 3rem;
  702. font-size: 1.4rem;
  703. color: #333;
  704. overflow: hidden;
  705. }
  706. }
  707. }
  708. .bg-88 {
  709. background: #889fe9;
  710. }
  711. .bg-84 {
  712. background: #84ccc9;
  713. }
  714. .mt15px {
  715. margin-top: 1.5rem;
  716. }
  717. .mt2rem {
  718. margin-top: 2rem;
  719. }
  720. </style>