index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. <template>
  2. <div id="index">
  3. <el-col :span="24" class="main">
  4. <el-col :span="24" class="marketTop">
  5. <!-- <el-col :span="12" class="left">
  6. <el-col :span="1" class="leftTitle">
  7. <p>科<br />技<br />产<br />品</p>
  8. <p></p>
  9. </el-col>
  10. <el-col :span="23" class="infoLeft">
  11. <el-col :span="12" class="productList" v-for="(item, index) in productList" :key="index" @click.native="productDetail(item.id)">
  12. <el-image :src="item.image[0].url"></el-image>
  13. <p class="textOver">{{ item.name }}</p>
  14. </el-col>
  15. </el-col>
  16. <el-col :span="24" class="leftListDown"><span></span><span @click="toProductList">MORE</span></el-col>
  17. </el-col> -->
  18. <!-- <el-col :span="12" class="right">
  19. <el-col :span="24" class="rightListTop"><span @click="toTecList">MORE</span><span></span></el-col>
  20. <el-col :span="23" class="infoRight">
  21. <el-col :span="24" class="tecList" v-for="(item, index) in tecList" :key="index">
  22. <span></span>
  23. <span class="textOver" @click="tecDetail(item.id)">{{ item.name }}</span>
  24. <span>对接</span>
  25. <span>{{ item.meta | getDate }}</span>
  26. </el-col>
  27. </el-col>
  28. <el-col :span="1" class="rightTitle">
  29. <p></p>
  30. <p>技<br />术<br />供<br />求</p>
  31. </el-col>
  32. </el-col> -->
  33. <el-col :span="12" class="left">
  34. <el-col :span="24" class="downLeftTop">
  35. <el-image :src="downLeftTopImage"></el-image>
  36. <span class="topText">
  37. <span>科技产品</span>
  38. <span
  39. ><p>P</p>
  40. <p>roduct</p></span
  41. >
  42. <span @click="toProductList">更多</span>
  43. </span>
  44. </el-col>
  45. <el-col :span="12" class="productList" v-for="(item, index) in productList" :key="index" @click.native="productDetail(item.id)">
  46. <!-- <el-image :src="item.image[0].url"></el-image> -->
  47. <template v-if="item.image.length > 0">
  48. <el-image :src="item.image[0].url"></el-image>
  49. </template>
  50. <template v-else>暂无图片</template>
  51. <p class="textOver">{{ item.name || '暂无' }}</p>
  52. </el-col>
  53. </el-col>
  54. <el-col :span="12" class="right">
  55. <el-col :span="24" class="downLeftTop">
  56. <el-image :src="downLeftTopImage"></el-image>
  57. <span class="topText">
  58. <span>技术供求</span>
  59. <span
  60. ><p>T</p>
  61. <p>echnology</p></span
  62. >
  63. <span @click="toTecList">更多</span>
  64. </span>
  65. </el-col>
  66. <el-col :span="24" class="tecList" v-for="(item, index) in tecList" :key="index">
  67. <span></span>
  68. <span class="textOver" @click="tecDetail(item.id)">{{ item.name || '暂无' }}</span>
  69. <span @click="toChat(item)" style="display:none">对接</span>
  70. <span>{{ item.meta | getDate }}</span>
  71. </el-col>
  72. </el-col>
  73. <el-col :span="24">
  74. <el-image :src="gongqiuImage" class="gongqiuImage"></el-image>
  75. </el-col>
  76. </el-col>
  77. <el-col :span="24" class="marketDown">
  78. <el-col :span="24" class="downMain">
  79. <el-col :span="12" class="left">
  80. <el-col :span="24" class="downLeftTop">
  81. <el-image :src="downLeftTopImage"></el-image>
  82. <span class="topText">
  83. <span>服务供求</span>
  84. <span
  85. ><p>S</p>
  86. <p>ervice</p></span
  87. >
  88. <span @click="toServiceList">更多</span>
  89. </span>
  90. </el-col>
  91. <el-col :span="24" class="downLeftInfo">
  92. <el-col :span="24" class="bankingList" v-for="(item, index) in serviceList" :key="index" @click.native="serviceDetail(item.id)">
  93. <el-col :span="10">
  94. <template v-if="item.image.length > 0">
  95. <el-image :src="item.image[0].url"></el-image>
  96. </template>
  97. <template v-else>暂无图片</template>
  98. </el-col>
  99. <el-col :span="14">
  100. <span class="textOver">{{ item.name || '暂无' }}</span>
  101. <span>{{ item.introduction || '暂无' }}</span>
  102. </el-col>
  103. </el-col>
  104. </el-col>
  105. </el-col>
  106. <el-col :span="12" class="right">
  107. <el-col :span="24" class="downLeftTop">
  108. <el-image :src="downLeftTopImage"></el-image>
  109. <span class="topText">
  110. <span>专家供求</span>
  111. <span
  112. ><p>E</p>
  113. <p>xpert</p></span
  114. >
  115. <span @click="zhuanjia">更多</span>
  116. </span>
  117. </el-col>
  118. <el-col :span="24">
  119. <el-col :span="24" class="downRightList" v-for="(item, index) in expertsList" :key="index" @click.native="zhuanjiaDetail(item.id)">
  120. <el-col :span="10"><el-image :src="item.imgpath"></el-image></el-col>
  121. <el-col :span="14"
  122. ><p>{{ item.name || '暂无' }}</p>
  123. <p>从事领域:</p>
  124. <p>{{ item.field || '暂无' }}</p></el-col
  125. >
  126. <el-col :span="24"
  127. ><p>{{ item.job_profile || '暂无' }}</p></el-col
  128. >
  129. </el-col>
  130. </el-col>
  131. </el-col>
  132. </el-col>
  133. </el-col>
  134. <!-- <el-col :span="24" class="marketNew">
  135. <el-col :span="24" class="downLeftTop">
  136. <el-image :src="downLeftTopImage"></el-image>
  137. <span class="topTexts">
  138. <span>最新发布</span>
  139. <span
  140. ><p>N</p>
  141. <p>ewing</p></span
  142. >
  143. <span @click="fabu()">我要发布</span>
  144. </span>
  145. <el-col :span="24" class="downLeftInfos">
  146. <el-col :span="12" class="bankingLists" v-for="(item, index) in newList" :key="index" @click.native="productDetail(item.id)">
  147. <el-col :span="10">
  148. <template v-if="item.image.length > 0">
  149. <el-image :src="item.image[0].url"></el-image>
  150. </template>
  151. <template v-else>暂无图片</template>
  152. </el-col>
  153. <el-col :span="12">
  154. <span class="textOvers">{{ item.name || '暂无' }}</span>
  155. <span>{{ item.introduction || '暂无' }}</span>
  156. </el-col>
  157. </el-col>
  158. </el-col>
  159. </el-col>
  160. </el-col> -->
  161. <el-col :span="24" class="marketPublish" @click.native="fabu()"> <span @click="fabu()">我要发布</span></el-col>
  162. </el-col>
  163. </div>
  164. </template>
  165. <script>
  166. import _ from 'lodash';
  167. import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
  168. const { mapActions: product } = createNamespacedHelpers('marketproduct');
  169. const { mapActions: talentExperts } = createNamespacedHelpers('talentExperts');
  170. var moment = require('moment');
  171. export default {
  172. name: 'index',
  173. props: {},
  174. components: {},
  175. data: () => ({
  176. gongqiuImage: require('@/assets/live/main2.png'),
  177. downLeftTopImage: require('@/assets/live/square_big.png'),
  178. productList: [],
  179. tecList: [],
  180. expertsList: [],
  181. serviceList: [],
  182. newList: [],
  183. }),
  184. created() {
  185. this.search();
  186. },
  187. filters: {
  188. getDate(meta) {
  189. let createdAt = _.get(meta, `createdAt`);
  190. let date = new Date(createdAt)
  191. .toLocaleDateString()
  192. .replace('/', '-')
  193. .replace('/', '-');
  194. return date;
  195. },
  196. },
  197. computed: {
  198. ...mapState(['user']),
  199. pageTitle() {
  200. return `${this.$route.meta.title}`;
  201. },
  202. },
  203. metaInfo() {
  204. return { title: this.$route.meta.title };
  205. },
  206. methods: {
  207. ...product(['newquery']),
  208. ...talentExperts({ expertQuery: 'query' }),
  209. async search() {
  210. let res = await this.newquery({ skip: 0, limit: 6, totaltype: '0', status: '1' });
  211. if (this.$checkRes(res)) this.$set(this, `tecList`, res.data);
  212. res = await this.newquery({ skip: 0, limit: 4, totaltype: '1', status: '1' });
  213. if (this.$checkRes(res)) this.$set(this, `productList`, res.data);
  214. if (this.$checkRes(res)) this.$set(this, `newList`, res.data);
  215. res = await this.newquery({ skip: 0, limit: 4, totaltype: '2', status: '1' });
  216. if (this.$checkRes(res)) this.$set(this, `serviceList`, res.data);
  217. res = await this.expertQuery({ skip: 0, limit: 4, status: '1' });
  218. if (this.$checkRes(res)) this.$set(this, `expertsList`, res.data);
  219. },
  220. toProductList() {
  221. this.$router.push({ path: '/market/marketlists', query: { totaltype: 1, column_name: '科技产品', display: 1 } });
  222. },
  223. productDetail(id) {
  224. this.$router.push({ path: '/market/marketlists', query: { totaltype: 2, id: id, display: 2, column_name: '科技产品' } });
  225. },
  226. toTecList() {
  227. this.$router.push({ path: '/market/marketlists', query: { totaltype: 0, column_name: '技术供求', display: 1 } });
  228. },
  229. tecDetail(id) {
  230. this.$router.push({ path: '/market/marketlists', query: { totaltype: 0, id: id, display: 2, column_name: '技术供求' } });
  231. },
  232. toServiceList() {
  233. this.$router.push({ path: '/market/marketlists', query: { totaltype: 2, column_name: '技术供求', display: 1 } });
  234. },
  235. serviceDetail(id) {
  236. this.$router.push({ path: '/market/marketlists', query: { totaltype: 2, id: id, display: 2, column_name: '技术供求' } });
  237. },
  238. zhuanjia() {
  239. this.$router.push({ path: '/market/marketlists', query: { column_name: '专家供求', display: 1 } });
  240. },
  241. zhuanjiaDetail(id) {
  242. this.$router.push({ path: '/market/marketlists', query: { id: id, display: 3, column_name: '专家供求' } });
  243. },
  244. fabu() {
  245. if (this.user.role == '2' || this.user.role == '3') {
  246. this.$router.push({ path: '/market/marketfabu' });
  247. } else if (this.user.uid == undefined) {
  248. this.$router.push({ path: '/login' });
  249. } else {
  250. }
  251. },
  252. toChat(data) {
  253. this.$router.push({ path: '/market/contact', query: { id: data.id } });
  254. },
  255. },
  256. };
  257. </script>
  258. <style lang="less" scoped>
  259. .gongqiuImage {
  260. width: 100%;
  261. height: 100%;
  262. }
  263. .main {
  264. width: 100%;
  265. margin: 20px auto;
  266. float: none;
  267. }
  268. .marketTop {
  269. width: 80%;
  270. margin: 20px auto;
  271. float: none;
  272. }
  273. .left {
  274. float: left;
  275. height: 500px;
  276. margin: 10px 0 20px 0;
  277. overflow: hidden;
  278. // box-shadow: 2px 2px 2px #888888;
  279. border-right: 1px dashed #044b79;
  280. width: 49.5%;
  281. }
  282. .leftTitle {
  283. text-align: center;
  284. position: relative;
  285. }
  286. .leftTitle p:first-child {
  287. font-size: 18px;
  288. color: #044b79;
  289. font-weight: bold;
  290. }
  291. .leftTitle p:last-child {
  292. float: left;
  293. width: 2px;
  294. height: 402px;
  295. background-color: #044b79;
  296. margin: 0 5px;
  297. position: absolute;
  298. left: 9px;
  299. }
  300. .infoLeft {
  301. height: 480px;
  302. padding: 0 10px;
  303. }
  304. .productList {
  305. position: relative;
  306. margin: 0 10px 10px 0;
  307. width: 48%;
  308. height: 220px;
  309. cursor: pointer;
  310. }
  311. .productList:nth-child(2n) {
  312. margin: 0 0 10px 0;
  313. }
  314. .productList .el-image {
  315. width: 100%;
  316. height: 220px;
  317. }
  318. .productList p {
  319. position: absolute;
  320. text-align: center;
  321. bottom: 0;
  322. height: 50px;
  323. line-height: 50px;
  324. text-indent: 5px;
  325. // padding: 0 10px;
  326. background: #044b799f;
  327. color: #fff;
  328. width: 100%;
  329. font-size: 18px;
  330. }
  331. .leftListDown {
  332. position: relative;
  333. }
  334. .leftListDown span:first-child {
  335. display: inline-block;
  336. width: 80%;
  337. height: 3px;
  338. background: rgba(4, 75, 121, 0.37);
  339. margin: 0 10px 0 0;
  340. position: absolute;
  341. left: -10px;
  342. top: 10px;
  343. }
  344. .leftListDown span:last-child {
  345. font-size: 16px;
  346. float: right;
  347. padding: 0 15px 0 0;
  348. color: #044b79;
  349. font-weight: 700;
  350. cursor: pointer;
  351. }
  352. .right {
  353. float: right;
  354. height: 500px;
  355. overflow: hidden;
  356. margin: 10px 0 20px 0;
  357. width: 49.5%;
  358. }
  359. .rightListTop {
  360. position: relative;
  361. }
  362. .rightListTop span:first-child {
  363. font-size: 16px;
  364. float: left;
  365. padding: 0 0 0 15px;
  366. color: #044b79;
  367. font-weight: 700;
  368. cursor: pointer;
  369. }
  370. .rightListTop span:last-child {
  371. display: inline-block;
  372. width: 80%;
  373. height: 3px;
  374. background: rgba(4, 75, 121, 0.37);
  375. margin: 0 10px 0 0;
  376. position: absolute;
  377. right: -10px;
  378. top: 10px;
  379. }
  380. .infoRight {
  381. height: 480px;
  382. padding: 0 10px;
  383. }
  384. .tecList {
  385. padding: 0 15px;
  386. margin: 10px 0 10px 0;
  387. }
  388. .tecList span:first-child {
  389. display: inline-block;
  390. width: 10px;
  391. height: 10px;
  392. background: #2188c6;
  393. border-radius: 90px;
  394. }
  395. .tecList span:nth-child(2n) {
  396. display: inline-block;
  397. width: 80%;
  398. font-size: 18px;
  399. padding: 0 15px;
  400. cursor: pointer;
  401. }
  402. .tecList span:nth-child(3n) {
  403. display: inline-block;
  404. width: 10%;
  405. text-align: center;
  406. background-color: #044b79;
  407. color: #ffffff;
  408. font-size: 16px;
  409. padding: 3px 0px;
  410. cursor: pointer;
  411. }
  412. .tecList span:last-child {
  413. display: block;
  414. width: 120px;
  415. text-align: left;
  416. padding: 5px 0 5px 25px;
  417. font-size: 14px;
  418. }
  419. .rightTitle {
  420. text-align: center;
  421. }
  422. .rightTitle p:first-child {
  423. width: 2px;
  424. height: 370px;
  425. background: #044b79;
  426. position: relative;
  427. left: 10px;
  428. top: -20px;
  429. }
  430. .rightTitle p:last-child {
  431. font-size: 18px;
  432. font-weight: bold;
  433. color: #044b79;
  434. }
  435. .marketDown {
  436. height: 550px;
  437. overflow: hidden;
  438. margin: 20px 0 20px 0;
  439. background: #e9edf6;
  440. padding-top: 30px;
  441. }
  442. .downMain {
  443. width: 80%;
  444. float: none;
  445. height: 550px;
  446. margin: 0 auto;
  447. }
  448. .downLeftTop .el-image {
  449. width: 40px;
  450. }
  451. .topTexts {
  452. width: 100%;
  453. border-bottom: 2.5px solid #044b79;
  454. display: inline-block;
  455. position: relative;
  456. top: -10px;
  457. margin: 0 0 0 5px;
  458. }
  459. .topTexts span:first-child {
  460. font-size: 24px;
  461. font-weight: 700;
  462. color: #000000;
  463. padding: 0 10px;
  464. top: 4px;
  465. }
  466. .topTexts span p:first-child {
  467. font-weight: 800;
  468. font-size: 34px;
  469. color: #92959a;
  470. top: 11px;
  471. display: inline-block;
  472. }
  473. .topTexts span p:last-child {
  474. display: inline-block;
  475. font-weight: 700;
  476. font-size: 18px;
  477. color: #92959a;
  478. }
  479. .topTexts span:last-child {
  480. float: right;
  481. font-size: 16px;
  482. font-weight: 700;
  483. color: #044b79;
  484. position: relative;
  485. top: 20px;
  486. cursor: pointer;
  487. }
  488. .topText {
  489. width: 89%;
  490. border-bottom: 2.5px solid #044b79;
  491. display: inline-block;
  492. position: relative;
  493. top: -10px;
  494. margin: 0 0 0 5px;
  495. }
  496. .topText span:first-child {
  497. font-size: 24px;
  498. font-weight: 700;
  499. color: #000000;
  500. padding: 0 10px;
  501. top: 4px;
  502. }
  503. .topText span p:first-child {
  504. font-weight: 800;
  505. font-size: 34px;
  506. color: #92959a;
  507. top: 11px;
  508. display: inline-block;
  509. }
  510. .topText span p:last-child {
  511. display: inline-block;
  512. font-weight: 700;
  513. font-size: 18px;
  514. color: #92959a;
  515. }
  516. .topText span:last-child {
  517. float: right;
  518. font-size: 16px;
  519. font-weight: 700;
  520. color: #044b79;
  521. position: relative;
  522. top: 20px;
  523. cursor: pointer;
  524. }
  525. .bankingLists {
  526. height: 152px;
  527. cursor: pointer;
  528. }
  529. .bankingLists .el-image {
  530. width: 100%;
  531. height: 130px;
  532. display: inline-block;
  533. }
  534. .bankingLists span {
  535. margin: 0 5px 0 5px;
  536. display: inline-block;
  537. width: 80%;
  538. font-size: 18px;
  539. padding: 0 0 0 10px;
  540. color: #044b79;
  541. font-weight: 700;
  542. }
  543. .bankingLists span:last-child {
  544. margin: 10px 0 0 5px;
  545. font-size: 16px;
  546. overflow: hidden;
  547. text-overflow: ellipsis;
  548. -webkit-line-clamp: 4;
  549. word-break: break-all;
  550. display: -webkit-box;
  551. -webkit-box-orient: vertical;
  552. padding: 0 0 0 10px;
  553. color: #666;
  554. line-height: 25px;
  555. font-weight: 400;
  556. }
  557. .bankingList {
  558. height: 152px;
  559. cursor: pointer;
  560. }
  561. .bankingList .el-image {
  562. width: 100%;
  563. height: 130px;
  564. display: inline-block;
  565. }
  566. .bankingList span {
  567. margin: 0 5px 0 5px;
  568. display: inline-block;
  569. width: 80%;
  570. font-size: 18px;
  571. padding: 0 0 0 10px;
  572. color: #044b79;
  573. font-weight: 700;
  574. }
  575. .bankingList span:last-child {
  576. margin: 10px 0 0 5px;
  577. font-size: 16px;
  578. overflow: hidden;
  579. text-overflow: ellipsis;
  580. -webkit-line-clamp: 4;
  581. word-break: break-all;
  582. display: -webkit-box;
  583. -webkit-box-orient: vertical;
  584. padding: 0 0 0 10px;
  585. color: #666;
  586. line-height: 25px;
  587. font-weight: 400;
  588. }
  589. .downRightList {
  590. width: 49%;
  591. margin: 10px 0;
  592. height: 200px;
  593. font-size: 16px;
  594. display: inline-block;
  595. cursor: pointer;
  596. }
  597. .downRightList .el-image {
  598. width: 100%;
  599. height: 100px;
  600. border-radius: 100%;
  601. }
  602. .downRightList p {
  603. padding-left: 10px;
  604. }
  605. .downRightList p:first-child {
  606. font-size: 20px;
  607. height: 40px;
  608. }
  609. .downRightList p:last-child {
  610. width: 90%;
  611. font-size: 16px;
  612. overflow: hidden;
  613. text-overflow: ellipsis;
  614. -webkit-line-clamp: 5;
  615. word-break: break-all;
  616. display: -webkit-box;
  617. -webkit-box-orient: vertical;
  618. height: auto;
  619. }
  620. .marketNew {
  621. float: none;
  622. width: 80%;
  623. margin: 30px auto;
  624. height: 400px;
  625. }
  626. .downLeftInfos {
  627. height: 330px;
  628. }
  629. .marketPublish {
  630. position: fixed;
  631. background: #0279d5;
  632. width: 100px;
  633. height: 100px;
  634. z-index: 999;
  635. left: 2%;
  636. top: 80%;
  637. border-radius: 20px;
  638. box-shadow: 2px 2px 2px #055c9f;
  639. text-align: center;
  640. line-height: 100px;
  641. font-size: 20px;
  642. color: #fff;
  643. font-weight: bold;
  644. }
  645. .marketPublish:hover {
  646. background: #f60;
  647. cursor: pointer;
  648. }
  649. </style>