xmcg.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <template>
  2. <div id="xmcg">
  3. <el-row style="min-width: 1200px;">
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="one">
  6. <div class="w_1200">
  7. <el-col :span="20" class="left">
  8. <el-col :span="24" class="leftone">
  9. <span>科技成果展洽会</span>
  10. <span>欢迎您</span>
  11. </el-col>
  12. <el-col :span="24" class="lefttwo">
  13. SCIENTIFIC AND TECHNOLOGICAL ACHIEVEEMENTS EXHIBITION
  14. </el-col>
  15. </el-col>
  16. <el-col :span="4" class="right">
  17. <el-link :underline="false">帮助中心</el-link>
  18. </el-col>
  19. </div>
  20. </el-col>
  21. <el-col :span="24" class="two">
  22. <div class="w_1200">
  23. <el-col :span="24" class="twotop">
  24. <el-col :span="18" class="left">
  25. <p>{{ dockInfo.title }}</p>
  26. <el-image :src="two1"></el-image>
  27. </el-col>
  28. <el-col :span="6" class="right">
  29. <el-image :src="two2"></el-image>
  30. <p>{{ dockInfo.start_time }}</p>
  31. <p>距离展会开始还有</p>
  32. <p>{{ djs }}</p>
  33. </el-col>
  34. </el-col>
  35. <el-col :span="24" class="twocen">
  36. <el-col :span="15" class="left"> <span>主办单位:</span>{{ dockInfo.sponsor }} </el-col>
  37. <el-col :span="8" class="right">
  38. <el-button class="btn1" @click="$router.push({ path: '/halltwo/directTwo', query: { id: dockInfo.id } })">返回展会进行页</el-button>
  39. <el-button class="btn2" @click="$router.push({ path: '/halltwo/detail', query: { dock_id: dockInfo.id } })">进入展会总结页</el-button>
  40. </el-col>
  41. </el-col>
  42. </div>
  43. </el-col>
  44. <el-col :span="24" class="three">
  45. <div class="w_1200">
  46. <el-col :span="24" class="threeinfo">
  47. <p>项目成果</p>
  48. <el-col :span="24" class="all">
  49. <span class="field" v-for="(item, index) in fieldList" :key="index" @click="change(item, index)" :class="{ active: num == index }">{{
  50. item.name
  51. }}</span>
  52. </el-col>
  53. <el-col :span="24" class="list">
  54. <el-table :data="list1" stripe style="width: 100%" fit :show-header="false">
  55. <el-table-column prop="field" width="300">
  56. <template slot-scope="scope">
  57. <span style="margin-left: 20px">{{ scope.row.field || '暂无' }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="name" width="700">
  61. <template slot-scope="scope">
  62. <span class="name">{{ scope.row.name }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column>
  66. <template slot-scope="scope">
  67. <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">对接</el-button>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <el-col class="page1" :span="24">
  72. <el-pagination
  73. @current-change="handleCurrentChange"
  74. :current-page="currentPage"
  75. layout="total, prev, pager, next, jumper"
  76. :total="total"
  77. :page-size="pageSize"
  78. >
  79. </el-pagination>
  80. </el-col>
  81. </el-col>
  82. </el-col>
  83. </div>
  84. </el-col>
  85. <el-col :span="24" class="four">
  86. <div class="w_1200">
  87. <ywlx></ywlx>
  88. </div>
  89. </el-col>
  90. </el-col>
  91. <div class="pz_down">
  92. <live-foot></live-foot>
  93. </div>
  94. </el-row>
  95. </div>
  96. </template>
  97. <script>
  98. import ywlx from './parts/ywlx.vue';
  99. import liveFoot from '@/layout/live/foot.vue';
  100. import { mapState, createNamespacedHelpers } from 'vuex';
  101. const { mapActions: dock } = createNamespacedHelpers('dock');
  102. const { mapActions: markettype } = createNamespacedHelpers('markettype');
  103. var moment = require('moment');
  104. export default {
  105. metaInfo() {
  106. return { title: this.$route.meta.title };
  107. },
  108. name: 'xmcg',
  109. props: {},
  110. components: {
  111. liveFoot,
  112. ywlx,
  113. },
  114. data: function() {
  115. return {
  116. two1: require('@a/sy_04.png'),
  117. two2: require('@a/dock2.png'),
  118. // 展會詳情
  119. dockInfo: {},
  120. // 指导单位
  121. erweima: require('@a/二维码.jpg'),
  122. //领域列表
  123. fieldList: [],
  124. //全部列表
  125. list: [],
  126. //列表头部
  127. // showHead: false,
  128. pageSize: 10,
  129. total: 0,
  130. currentPage: 1,
  131. origin: [],
  132. list1: [],
  133. num: '0',
  134. // 倒计时
  135. djs: '',
  136. };
  137. },
  138. async created() {
  139. await this.searchType();
  140. await this.searchInfo();
  141. },
  142. methods: {
  143. ...dock({ dockQuery: 'query', dockFetch: 'fetch', goodsquery: 'goodsquery' }),
  144. ...markettype({ markettypeList: 'query' }),
  145. async searchInfo() {
  146. // 查询展会详情
  147. if (this.dock_id) {
  148. let res = await this.dockFetch(this.dock_id);
  149. if (this.$checkRes(res)) {
  150. this.$set(this, `dockInfo`, res.data);
  151. let czxm = res.data.apply.map(item => item.goodsList);
  152. czxm = _.flattenDeep(czxm);
  153. let czxmNew = czxm.filter(item => item.dockStatus == '1');
  154. // 技术成果
  155. let achieve = czxmNew.filter(i => i.type == '1');
  156. this.$set(this, `list`, achieve);
  157. this.$set(this, `total`, achieve.length);
  158. }
  159. }
  160. },
  161. seachtime() {
  162. // 倒计时
  163. this.timer = setInterval(() => {
  164. this.setTime(this.dockInfo.start_time);
  165. }, 1000);
  166. },
  167. // 倒计时
  168. setTime(end) {
  169. let now = moment().format('YYYY-MM-DD HH:mm:ss');
  170. // let now = moment().format('2020-11-20 08:00:00');
  171. if (end == now) {
  172. clearInterval(this.timer);
  173. this.$set(this, `djs`, '展会开始');
  174. } else {
  175. let sec = moment(end).diff(now, 'seconds');
  176. let day = _.floor(sec / 60 / 60 / 24);
  177. let hour = _.floor(Math.abs(day * 24 - sec / 60 / 60));
  178. let dayhour = day * 24;
  179. let minute = _.floor(Math.abs(day * 24 * 60 + hour * 60 - sec / 60));
  180. let second = _.floor(Math.abs(day * 24 * 60 * 60 + hour * 60 * 60 + minute * 60 - sec));
  181. let str = `${hour + dayhour}小时${minute}分${second}秒`;
  182. this.$set(this, `djs`, str);
  183. }
  184. },
  185. async searchType() {
  186. //查领域
  187. const res1 = await this.markettypeList({ category: '01' });
  188. if (res1) {
  189. res1.data.unshift({ name: '全部' });
  190. this.$set(this, `fieldList`, res1.data);
  191. }
  192. },
  193. searchPage(page = 1) {
  194. this.$set(this, `list1`, this.origin[page - 1]);
  195. },
  196. handleCurrentChange(currentPage) {
  197. this.searchPage(currentPage);
  198. },
  199. // 项目对接
  200. handleEdit(index, row) {
  201. this.$router.push({ path: '/halltwo/xmdj', query: { dock_id: this.dock_id, id: row._id, type: row.type } });
  202. },
  203. change(item, index) {
  204. let val = this.list;
  205. if (item.name == '全部') {
  206. this.searchInfo();
  207. } else {
  208. let techol = val.filter(i => i.field == item.name);
  209. this.$set(this, `list1`, techol);
  210. this.$set(this, `total`, techol.length);
  211. }
  212. this.num = index;
  213. },
  214. },
  215. computed: {
  216. ...mapState(['user']),
  217. dock_id() {
  218. return this.$route.query.dock_id;
  219. },
  220. },
  221. watch: {
  222. list: {
  223. immediate: true,
  224. deep: true,
  225. handler(val) {
  226. if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
  227. this.searchPage();
  228. },
  229. },
  230. dockInfo: {
  231. immediate: true,
  232. deep: true,
  233. handler(val) {
  234. this.seachtime();
  235. },
  236. },
  237. },
  238. };
  239. </script>
  240. <style lang="less" scoped>
  241. .active {
  242. background-color: #2152cb;
  243. color: #fff;
  244. }
  245. .main {
  246. .one {
  247. height: 100px;
  248. .left {
  249. height: 100px;
  250. .leftone {
  251. margin: 15px 0 0 0;
  252. span:nth-child(1) {
  253. font-size: 35px;
  254. color: #535353;
  255. font-weight: bold;
  256. font-family: cursive;
  257. }
  258. span:nth-child(2) {
  259. font-size: 15px;
  260. padding: 0 10px;
  261. color: #535353;
  262. }
  263. }
  264. .lefttwo {
  265. font-size: 12px;
  266. color: #535353;
  267. }
  268. }
  269. .right {
  270. height: 100px;
  271. line-height: 100px;
  272. text-align: right;
  273. }
  274. }
  275. .two {
  276. height: 610px;
  277. background: url('~@/assets/bj1.jpg');
  278. padding: 20px 0;
  279. .twotop {
  280. margin: 0 0 10px 0;
  281. .left {
  282. height: 357px;
  283. margin: 0 10px 0 0;
  284. background: url('~@/assets/dock1.png');
  285. p {
  286. float: left;
  287. width: 79%;
  288. font-size: 43px;
  289. color: #fff;
  290. font-weight: bold;
  291. padding: 13% 0 0 20px;
  292. }
  293. .el-image {
  294. float: left;
  295. width: 153px;
  296. height: 94px;
  297. margin: 4% 0 0 0;
  298. }
  299. }
  300. .right {
  301. background-color: #ffffff;
  302. width: 24%;
  303. height: 357px;
  304. text-align: center;
  305. padding: 0 10px;
  306. .el-image {
  307. width: 120px;
  308. height: 48px;
  309. margin: 50px 0 0px 0;
  310. }
  311. p:nth-child(2) {
  312. font-size: 18px;
  313. margin: 30px 0 5px 0;
  314. }
  315. p:nth-child(3) {
  316. font-size: 22px;
  317. font-weight: bold;
  318. margin-bottom: 30px;
  319. }
  320. p:nth-child(4) {
  321. background: #f5f5f5;
  322. padding: 20px 0px;
  323. border-radius: 5px;
  324. font-size: 30px;
  325. }
  326. }
  327. .right:hover {
  328. cursor: pointer;
  329. p:nth-child(3) {
  330. color: #535353;
  331. }
  332. }
  333. }
  334. .twocen {
  335. height: 130px;
  336. overflow: hidden;
  337. line-height: 130px;
  338. background-color: #fff;
  339. margin: 0 0 35px 0;
  340. .left {
  341. font-size: 18px;
  342. margin: 0 0 0 30px;
  343. span {
  344. font-size: 22px;
  345. font-weight: bold;
  346. }
  347. }
  348. .right {
  349. .btn1 {
  350. font-size: 16px;
  351. color: #fff;
  352. background: red;
  353. border: none;
  354. font-weight: bold;
  355. }
  356. .btn2 {
  357. font-size: 16px;
  358. color: #ff0000;
  359. border: 1px solid #ff0000;
  360. font-weight: bold;
  361. }
  362. }
  363. }
  364. }
  365. .three {
  366. height: 860px;
  367. overflow: hidden;
  368. position: relative;
  369. top: -50px;
  370. z-index: 999;
  371. .threeinfo {
  372. height: 860px;
  373. overflow: hidden;
  374. background-color: #fff;
  375. box-shadow: 0 5px 15px rgba(33, 82, 203, 0.35);
  376. padding: 30px;
  377. p:nth-child(1) {
  378. font-family: '微软雅黑';
  379. font-weight: 400;
  380. font-size: 26px;
  381. }
  382. .all {
  383. line-height: 46px;
  384. background: #f8f8f8;
  385. margin: 20px 0 40px 0;
  386. .field {
  387. font-size: 18px;
  388. display: inline-block;
  389. height: 46px;
  390. min-width: 106px;
  391. text-align: center;
  392. padding: 0 15px;
  393. }
  394. .field:hover {
  395. color: #fff;
  396. background-color: #2152cb;
  397. cursor: pointer;
  398. }
  399. }
  400. .list {
  401. .page1 {
  402. margin: 40px 0px;
  403. text-align: center;
  404. }
  405. .name:hover {
  406. color: #777;
  407. cursor: pointer;
  408. }
  409. }
  410. }
  411. }
  412. .four {
  413. border-top: 2px solid #305798;
  414. height: 250px;
  415. .info {
  416. .left {
  417. h1 {
  418. padding: 15px 0;
  419. font-weight: bold;
  420. color: #4d4d4d;
  421. }
  422. p {
  423. font-size: 16px;
  424. color: #4d4d4d;
  425. padding: 5px 0;
  426. }
  427. }
  428. .right {
  429. text-align: center;
  430. }
  431. }
  432. }
  433. }
  434. /deep/.el-table .cell {
  435. font-weight: 400;
  436. font-size: 14px;
  437. color: black;
  438. overflow: hidden;
  439. text-overflow: ellipsis;
  440. display: -webkit-box;
  441. -webkit-line-clamp: 1;
  442. -webkit-box-orient: vertical;
  443. }
  444. </style>