detail(第一版).vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <div id="roomDetail">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="video">
  6. <el-col :span="24" class="top">
  7. <el-col :span="24" class="downVideo" v-if="videoData != ''">
  8. <video :src="videoPath" autoplay="autoplay" controls="controls" loop="loop">
  9. 您的浏览器不支持 video 标签。
  10. </video>
  11. </el-col>
  12. <el-col :span="24" class="downTxt" v-else>
  13. <p>{{ dockInfo.title }}</p>
  14. </el-col>
  15. </el-col>
  16. <el-col :span="24" class="down">
  17. <el-col :span="12" class="left">
  18. <el-link :underline="false" class="back" @click="back()">返回列表</el-link>
  19. </el-col>
  20. <el-col :span="12" class="right">
  21. <el-link :underline="false" class="back" @click="showPopup">选择视频</el-link>
  22. </el-col>
  23. </el-col>
  24. </el-col>
  25. <el-col :span="24" class="chat">
  26. <van-tabs v-model="chatactive" type="card" animated>
  27. <van-tab title="图文直播">
  28. <textVideo :list="lunboList"></textVideo>
  29. </van-tab>
  30. <van-tab title="公共聊天">
  31. <chat></chat>
  32. </van-tab>
  33. </van-tabs>
  34. </el-col>
  35. <el-col :span="24" class="market">
  36. <van-tabs v-model="marketactive" type="card" animated>
  37. <van-tab title="技术成果">
  38. <el-col :span="24" class="one">
  39. <el-col :span="24" class="list" v-for="(item, index) in achieveList" :key="index">
  40. <p class="textOver">{{ item.name }}</p>
  41. <p class="textOver">领域:{{ item.field }}</p>
  42. <p class="textOver">联系人:{{ item.contacts }}</p>
  43. </el-col>
  44. </el-col>
  45. </van-tab>
  46. <van-tab title="科技需求">
  47. <el-col :span="24" class="one">
  48. <el-col :span="24" class="list" v-for="(item, index) in techolList" :key="index">
  49. <p class="textOver">{{ item.name }}</p>
  50. <p class="textOver">领域:{{ item.field }}</p>
  51. <p class="textOver">联系人:{{ item.contacts }}</p>
  52. </el-col>
  53. </el-col>
  54. </van-tab>
  55. <van-tab title="专家智库">
  56. <el-col :span="24" class="three">
  57. <el-col :span="24" class="expertList" v-for="(item, index) in expertList" :key="index" @click.native="expertBtn(item)">
  58. <el-col :span="5" class="image">
  59. <el-image
  60. :src="item.expertimage"
  61. style="width:70px;height: 70px;border: 1px solid #f1f1f1;"
  62. v-if="item.expertimage != null || undefined"
  63. ></el-image>
  64. <el-image :src="expertimage" style="width:70px;height: 70px;border: 1px solid #f1f1f1;" v-else></el-image>
  65. </el-col>
  66. <el-col :span="19" class="info1">
  67. <el-col :span="24" class="name textOver">
  68. {{ item.name }}
  69. </el-col>
  70. <el-col :span="24" class="txt textOver"> {{ item.zwzc || '暂无' }} </el-col>
  71. <el-col :span="24" class="txt textOver"> {{ item.company || '暂无' }} </el-col>
  72. </el-col>
  73. </el-col>
  74. </el-col>
  75. </van-tab>
  76. </van-tabs>
  77. </el-col>
  78. <el-col :span="24" class="jbxm">
  79. <van-tabs v-model="jbxmactive" type="card" animated>
  80. <van-tab title="嘉宾访谈">
  81. <el-col :span="24" class="jiabinlist">
  82. <el-col
  83. :span="24"
  84. class="jiabin"
  85. v-for="(item, index) in zxzdlist"
  86. :key="index"
  87. @click.native="$router.push({ path: '/live/detail2', query: { id: item.id, type: '1' } })"
  88. >
  89. <el-col :span="5" class="img4">
  90. <img :src="item.picture" style="width: 100%; height: 100%" />
  91. </el-col>
  92. <el-col :span="19" class="info">
  93. <el-col :span="16" class="title">
  94. {{ item.title }}
  95. </el-col>
  96. <el-col :span="8" class="time">
  97. {{ item.publish_time }}
  98. </el-col>
  99. <el-col :span="24" class="con">{{ item.titlejj }}</el-col>
  100. </el-col>
  101. </el-col>
  102. </el-col>
  103. </van-tab>
  104. <van-tab title="项目路演">
  105. <el-col :span="24" class="xmly">
  106. <el-col
  107. :span="24"
  108. class="xmlylist"
  109. v-for="(item, index) in xmlyList"
  110. :key="index"
  111. @click.native="$router.push({ path: '/live/detail2', query: { id: item.id, type: '2' } })"
  112. >
  113. <el-col :span="17" class="name textOver">
  114. {{ item.title }}
  115. </el-col>
  116. <el-col :span="7" class="date">{{ item.publish_time }} </el-col>
  117. <el-col :span="24" class="jianjie">
  118. {{ item.titlejj }}
  119. </el-col>
  120. </el-col>
  121. </el-col>
  122. </van-tab>
  123. </van-tabs>
  124. </el-col>
  125. </el-col>
  126. </el-row>
  127. <van-popup v-model="show" position="bottom">
  128. <van-picker
  129. title="视频信息"
  130. v-model="show"
  131. show-toolbar
  132. :columns="videoData"
  133. @confirm="onConfirm"
  134. @cancel="onCancel"
  135. @change="onChange"
  136. value-key="videointro"
  137. />
  138. </van-popup>
  139. </div>
  140. </template>
  141. <script>
  142. // 图文直播
  143. import textVideo from '@/components/parts/textVideo.vue';
  144. // 公共聊天
  145. import chat from '@/components/parts/chat.vue';
  146. import { mapState, createNamespacedHelpers } from 'vuex';
  147. const { mapActions: dock } = createNamespacedHelpers('dock');
  148. const { mapActions: marketuser } = createNamespacedHelpers('marketuser');
  149. const { mapActions: exportuser } = createNamespacedHelpers('exportuser');
  150. const { mapActions: newsguidance } = createNamespacedHelpers('newsguidance');
  151. const { mapActions: newsroadshow } = createNamespacedHelpers('newsroadshow');
  152. import moment from 'moment';
  153. export default {
  154. name: 'roomDetail',
  155. props: {},
  156. components: {
  157. textVideo,
  158. chat,
  159. },
  160. data: function() {
  161. return {
  162. // 展会id
  163. dock_id: '',
  164. //展会详情
  165. dockInfo: {},
  166. // 聊天
  167. chatactive: 0,
  168. // 图文直播
  169. lunboList: [],
  170. // 科技超市
  171. marketactive: 0,
  172. // 技术成果
  173. achieveList: [],
  174. // 科技需求
  175. techolList: [],
  176. // 专家智库
  177. expertList: [],
  178. expertimage: require('@/assets/222.png'),
  179. // 嘉宾,项目
  180. jbxmactive: 0,
  181. // 嘉宾访谈
  182. zxzdlist: [],
  183. // 项目路演
  184. xmlyList: [],
  185. // 选择视频
  186. show: false,
  187. // 视频管理
  188. menuIndex: '0',
  189. videoData: [],
  190. videoPath: '',
  191. };
  192. },
  193. async created() {
  194. if (this.id) {
  195. this.$set(this, `dock_id`, this.id);
  196. }
  197. await this.search();
  198. await this.seachtVideo();
  199. await this.seachLunbo();
  200. },
  201. methods: {
  202. ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
  203. ...exportuser({ expertQuery: 'query' }),
  204. ...marketuser({ operaFetch: 'operaFetch' }),
  205. ...newsguidance({ danceQuery: 'query' }),
  206. ...newsroadshow({ newsroadshowquery: 'query' }),
  207. // 查询
  208. async search() {
  209. //展会详情
  210. let res = await this.dockFetch(this.dock_id);
  211. if (this.$checkRes(res)) this.$set(this, `dockInfo`, res.data);
  212. let czxm = res.data.apply.map(item => item.goodsList);
  213. czxm = _.flattenDeep(czxm);
  214. var czxmNew = czxm.filter(item => item.dockStatus == '1');
  215. //科技需求
  216. var jishuData = czxmNew.filter(item => item.type === '0');
  217. this.$set(this, `techolList`, jishuData);
  218. //技术成果
  219. var chanpinData = czxmNew.filter(item => item.type === '1');
  220. if (chanpinData) this.$set(this, `achieveList`, chanpinData);
  221. // 专家智库
  222. let exportdata = await this.expertQuery({ role: 6 });
  223. if (this.$checkRes(exportdata)) this.$set(this, `expertList`, exportdata.data);
  224. //嘉宾访谈
  225. let jbftData = await this.danceQuery({ dock_id: this.id });
  226. if (this.$checkRes(jbftData)) this.$set(this, `zxzdlist`, jbftData.data);
  227. // 项目路演
  228. let xmly = await this.newsroadshowquery({ dock_id: this.id });
  229. if (this.$checkRes(xmly)) this.$set(this, `xmlyList`, xmly.data);
  230. },
  231. // 查询图文直播
  232. async seachLunbo() {
  233. let res = await this.operaFetch({ dockid: this.id });
  234. for (const val of res.data) {
  235. var date = moment(val.meta.createdAt).format('YYYY-MM-DD hh:mm');
  236. val.date = date;
  237. }
  238. if (this.$checkRes(res)) {
  239. this.$set(this, `lunboList`, res.data);
  240. }
  241. },
  242. // 专家详情
  243. expertBtn(data) {
  244. this.$router.push({ path: '/market/exportDetail', query: { id: data.id } });
  245. },
  246. // 返回
  247. back() {
  248. this.$router.push({ path: '/live/index' });
  249. },
  250. // 选择视频
  251. showPopup() {
  252. this.show = true;
  253. },
  254. // 视频管理
  255. async seachtVideo() {
  256. let res = await this.dockFetch(this.dock_id);
  257. if (this.$checkRes(res)) {
  258. this.$set(this, `videoData`, res.data.videodata);
  259. this.changeMenu('0', this.videoData[0]);
  260. }
  261. },
  262. channelvideo() {
  263. this.$stomp({
  264. [`/exchange/dock_video/${this.dock_id}`]: this.onMessageVideo,
  265. });
  266. },
  267. onMessageVideo(message) {
  268. let arr = JSON.parse(message.body);
  269. this.$set(this, `videoData`, arr);
  270. let num = this.videoData.length - 1;
  271. let newarr = _.last(arr);
  272. this.changeMenu(num, newarr);
  273. },
  274. changeMenu(index, item) {
  275. if (item) {
  276. this.menuIndex = index;
  277. this.$set(this, `videoPath`, item.file_path);
  278. }
  279. },
  280. // 确定
  281. onConfirm(value, index) {
  282. this.changeMenu(index, value);
  283. this.onCancel();
  284. },
  285. // 选择
  286. onChange(value, index) {
  287. this.changeMenu(index, value);
  288. },
  289. onCancel() {
  290. this.show = false;
  291. },
  292. },
  293. mounted() {
  294. this.channelvideo();
  295. },
  296. computed: {
  297. ...mapState(['user']),
  298. id() {
  299. return this.$route.query.id;
  300. },
  301. },
  302. metaInfo() {
  303. return { title: this.$route.meta.title };
  304. },
  305. };
  306. </script>
  307. <style lang="less" scoped>
  308. .main {
  309. // 视频
  310. .video {
  311. height: 255px;
  312. overflow: hidden;
  313. .top {
  314. height: 215px;
  315. overflow: hidden;
  316. .downVideo {
  317. position: fixed;
  318. z-index: 1;
  319. width: 100%;
  320. video {
  321. width: 100%;
  322. height: 215px;
  323. }
  324. }
  325. .downTxt {
  326. height: 215px;
  327. text-align: center;
  328. background-image: url('~@/assets/directBack.png');
  329. background-size: 100% 100%;
  330. background-repeat: no-repeat;
  331. p {
  332. font-size: 25px;
  333. color: #fff;
  334. padding: 25px 10px;
  335. }
  336. }
  337. }
  338. .down {
  339. height: 30px;
  340. overflow: hidden;
  341. background-color: #f1f1f1;
  342. .left {
  343. height: 30px;
  344. line-height: 30px;
  345. border-right: 1px dashed #ccc;
  346. text-align: center;
  347. .el-link {
  348. color: #333;
  349. font-weight: bold;
  350. }
  351. }
  352. .right {
  353. text-align: center;
  354. height: 30px;
  355. line-height: 30px;
  356. .el-link {
  357. color: #333;
  358. font-weight: bold;
  359. }
  360. }
  361. }
  362. }
  363. // 聊天
  364. .chat {
  365. margin: 15px 0 0 0;
  366. height: 400px;
  367. overflow: hidden;
  368. }
  369. // 科技超市
  370. .market {
  371. margin: 15px 0 0 0;
  372. .one {
  373. max-height: 550px;
  374. overflow-y: auto;
  375. padding: 0 16px;
  376. min-height: 102px;
  377. .list {
  378. border-bottom: 1px dashed #ccc;
  379. padding: 10px 0;
  380. p {
  381. font-size: 16px;
  382. color: #666;
  383. padding: 5px 0 0 0;
  384. }
  385. p:nth-child(1) {
  386. font-size: 18px;
  387. font-weight: bold;
  388. color: #000;
  389. }
  390. }
  391. }
  392. .three {
  393. max-height: 550px;
  394. overflow-y: auto;
  395. padding: 0 16px;
  396. min-height: 92px;
  397. .expertList {
  398. padding: 5px 0px;
  399. border-bottom: 1px dashed #ccc;
  400. overflow: hidden;
  401. white-space: nowrap;
  402. text-overflow: ellipsis;
  403. .name {
  404. font-size: 18px;
  405. font-weight: bolder;
  406. }
  407. .field {
  408. margin-top: 8px;
  409. font-size: 16px;
  410. color: #666;
  411. }
  412. .image {
  413. margin-top: 5px;
  414. .el-image {
  415. border-radius: 90%;
  416. }
  417. }
  418. .info1 {
  419. padding: 6px 0px 1px 20px;
  420. }
  421. }
  422. }
  423. }
  424. // 嘉宾,项目
  425. .jbxm {
  426. margin: 15px 0 0 0;
  427. // height: 500px;
  428. overflow: hidden;
  429. margin-bottom: 20px;
  430. .jiabinlist {
  431. max-height: 450px;
  432. margin-top: 10px;
  433. padding: 0px 16px;
  434. overflow-y: auto;
  435. min-height: 70px;
  436. .jiabin {
  437. height: 70px;
  438. margin-bottom: 6px;
  439. border-bottom: 1px dashed #ccc;
  440. .img4 {
  441. height: 65px;
  442. }
  443. .info {
  444. padding-left: 10px;
  445. .title {
  446. font-size: 18px;
  447. font-weight: bolder;
  448. text-overflow: ellipsis;
  449. font-size: 18px;
  450. font-weight: bolder;
  451. }
  452. .title:hover {
  453. color: #409eff;
  454. cursor: pointer;
  455. }
  456. .time {
  457. text-align: right;
  458. }
  459. .con {
  460. font-size: 16px;
  461. color: #666;
  462. margin-top: 3px;
  463. display: -webkit-box;
  464. -webkit-box-orient: vertical;
  465. -webkit-line-clamp: 2;
  466. overflow: hidden;
  467. }
  468. }
  469. }
  470. .jiabin:last-child {
  471. margin-bottom: 0px;
  472. }
  473. }
  474. .xmly {
  475. max-height: 450px;
  476. margin-top: 10px;
  477. padding: 0px 16px;
  478. overflow-y: auto;
  479. min-height: 70px;
  480. .xmlylist {
  481. border-bottom: 1px dashed #ccc;
  482. height: 70px;
  483. margin-bottom: 5px;
  484. .name {
  485. font-size: 18px;
  486. font-weight: bold;
  487. }
  488. .name:hover {
  489. color: #409eff;
  490. cursor: pointer;
  491. }
  492. .date {
  493. font-size: 16px;
  494. text-align: right;
  495. }
  496. .jianjie {
  497. height: 45px;
  498. font-size: 16px;
  499. overflow: hidden;
  500. text-overflow: ellipsis;
  501. -webkit-line-clamp: 2;
  502. word-break: break-all;
  503. display: -webkit-box;
  504. -webkit-box-orient: vertical;
  505. }
  506. }
  507. .xmlylist:last-child {
  508. margin-bottom: 0px;
  509. }
  510. }
  511. }
  512. }
  513. // 标签样式重定义
  514. /deep/.van-tab {
  515. font-size: 16px;
  516. }
  517. /deep/.van-tabs--card > .van-tabs__wrap {
  518. height: 35px;
  519. }
  520. /deep/.van-tabs__nav--card {
  521. height: 35px;
  522. // margin: 0;
  523. }
  524. /deep/.van-tabs__nav--card {
  525. border: 1px solid #409eff;
  526. }
  527. /deep/.van-tabs__nav--card .van-tab {
  528. color: #666;
  529. border-right: 1px solid #409eff;
  530. }
  531. /deep/.van-tabs__nav--card .van-tab.van-tab--active {
  532. background-color: #409eff;
  533. color: #fff;
  534. }
  535. </style>