index.vue 18 KB

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