dockDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <div id="dockDetail">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-image :src="beijingPic"></el-image>
  6. <el-col :span="24" class="info">
  7. <div class="w_1200">
  8. <el-col :span="24" class="top">
  9. <p>吉林省计算中心对接直播大厅</p>
  10. <p>主办方:吉林省计算中心</p>
  11. </el-col>
  12. <el-col :span="24" class="main">
  13. <el-col :span="24" class="mainTop">
  14. <span v-if="display === '1'">
  15. <el-col :span="24" class="one">
  16. <el-col :span="7" class="oneLeft">
  17. <el-carousel trigger="click" height="210px">
  18. <template v-if="detailInfo.image && detailInfo.image.length > 0">
  19. <el-carousel-item v-for="(item, index) in detailInfo.image" :key="index">
  20. <el-image :src="item.url" style="width: 100%;height: 210px;"> </el-image>
  21. </el-carousel-item>
  22. </template>
  23. </el-carousel>
  24. </el-col>
  25. <el-col :span="17" class="oneRight">
  26. <p class="textOver">
  27. {{ detailInfo.name }}
  28. </p>
  29. <p>
  30. <span>产品类型:{{ detailInfo.product_type_name || '暂无' }}</span>
  31. <span>收费标准:{{ detailInfo.price || '暂无' }}/{{ detailInfo.priceunit || '暂无' }}</span>
  32. </p>
  33. <p>
  34. <span>
  35. 交易方式:{{
  36. detailInfo.business === '0' ? '公用' : detailInfo.business === '1' ? '转让' : detailInfo.business === '2' ? '竞价' : '暂无'
  37. }}
  38. </span>
  39. <span>研发阶段:{{ detailInfo.phase == 1 ? '阶段成果' : detailInfo.phase == 2 ? '最终成果' : '暂无' }}</span>
  40. </p>
  41. <p>
  42. <span>联系人:{{ detailInfo.contact_user || '暂无' }}</span>
  43. <span>联系电话:{{ detailInfo.contact_tel || '暂无' }}</span>
  44. </p>
  45. </el-col>
  46. <el-col :span="24" class="oneDown">
  47. <div>
  48. <p>应用领域:</p>
  49. <p>{{ detailInfo.field || '暂无' }}</p>
  50. </div>
  51. <div>
  52. <p><span>产品参数:</span><span @click="argsBtn(detailInfo.product_args)">查看详情</span></p>
  53. </div>
  54. <div>
  55. <p>服务范围:</p>
  56. <p class="moreScope" v-if="scope != ''">{{ detailInfo.scope || '暂无' }}</p>
  57. <p class="moreScope1" v-else>{{ detailInfo.scope || '暂无' }}</p>
  58. <el-button size="mini" v-if="detailInfo.scope != null && detailInfo.scope.length > 300">
  59. <span v-if="scope != ''" @click="scopeMore()">更多</span>
  60. <span v-else @click="scopeMore1()">收起</span>
  61. </el-button>
  62. </div>
  63. <div>
  64. <p>产品简介:</p>
  65. <p class="introduction" v-if="introduction != ''">{{ detailInfo.introduction || '暂无' }}</p>
  66. <p class="introduction1" v-else>{{ detailInfo.introduction || '暂无' }}</p>
  67. <el-button size="mini" v-if="detailInfo.introduction != null && detailInfo.introduction.length > 300">
  68. <span v-if="introduction != ''" @click="introductionMore()">更多</span>
  69. <span v-else @click="introductionMore1()">收起</span>
  70. </el-button>
  71. </div>
  72. </el-col>
  73. </el-col>
  74. </span>
  75. <!-- <span v-if="display === '2'">
  76. <el-col :span="24" class="two">
  77. <chat :room="room"></chat>
  78. </el-col>
  79. </span> -->
  80. </el-col>
  81. <el-col class="mainDown">
  82. <!-- <el-button @click="btnInfo()" type="info">项目详情</el-button> -->
  83. <!-- <el-button v-if="this.user.uid != detailInfo.userid" @click="btnPhone()" type="primary">对接聊天</el-button> -->
  84. <el-button type="warning" style="float:left;" @click.native="back()">返回</el-button>
  85. <el-button type="primary" @click="btnPhone()" v-if="this.user.uid != detailInfo.userid">对接聊天</el-button>
  86. <el-button v-if="this.user.uid != detailInfo.userid" @click="btnTrade()" type="success">洽谈交易</el-button>
  87. <el-dialog title="对接聊天" :visible.sync="dialogTableVisible">
  88. <el-col :span="24" class="two">
  89. <chat :room="room"></chat>
  90. </el-col>
  91. </el-dialog>
  92. </el-col>
  93. </el-col>
  94. </div>
  95. </el-col>
  96. </el-col>
  97. </el-row>
  98. <el-dialog title="产品参数" :visible.sync="dialogVisible" width="50%">
  99. <el-table :data="tableData" border style="width: 100%">
  100. <el-table-column prop="arg_name" label="参数名称" align="center"> </el-table-column>
  101. <el-table-column prop="memo" label="参数内容" align="center"> </el-table-column>
  102. </el-table>
  103. </el-dialog>
  104. </div>
  105. </template>
  106. <script>
  107. import _ from 'lodash';
  108. import { mapState, createNamespacedHelpers } from 'vuex';
  109. import chat from './parts/chat.vue';
  110. const { mapActions: mapProduct } = createNamespacedHelpers('marketproduct');
  111. const { mapActions: personalRoom } = createNamespacedHelpers('personalroom');
  112. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  113. export default {
  114. name: 'dockDetail',
  115. props: {},
  116. components: {
  117. chat,
  118. },
  119. data: () => ({
  120. beijingPic: require('@a/live/top_3.png'),
  121. display: '1',
  122. detailInfo: {},
  123. scope: '123',
  124. introduction: '123',
  125. dialogVisible: false,
  126. tableData: [],
  127. dialogTableVisible: false,
  128. room: {},
  129. }),
  130. created() {
  131. if (this.$route.query.id) {
  132. this.searchInfo();
  133. }
  134. },
  135. methods: {
  136. ...mapProduct(['fetch']),
  137. ...personalRoom(['create', 'countDelete']),
  138. ...transaction({ buyProduct: 'create' }),
  139. async searchInfo() {
  140. let res = await this.fetch(this.$route.query.id);
  141. if (res.errcode === 0) {
  142. this.$set(this, `detailInfo`, res.data);
  143. }
  144. },
  145. argsBtn(data) {
  146. this.dialogVisible = true;
  147. this.$set(this, `tableData`, data);
  148. },
  149. // handleClose(done) {
  150. // this.$confirm('确认关闭?')
  151. // .then(_ => {
  152. // done();
  153. // })
  154. // .catch(_ => {});
  155. // },
  156. // 更多
  157. scopeMore() {
  158. this.scope = '';
  159. },
  160. // 收起
  161. scopeMore1() {
  162. this.scope = '123';
  163. },
  164. // 更多
  165. introductionMore() {
  166. this.introduction = '';
  167. },
  168. // 收起
  169. introductionMore1() {
  170. this.introduction = '123';
  171. },
  172. btnInfo() {
  173. this.display = '1';
  174. },
  175. // 线下对接
  176. async btnPhone() {
  177. if (!this.room.id) {
  178. //TODO 请求房间号
  179. let obj = {};
  180. if (!this.user.uid) {
  181. // this.$message.error({
  182. // dangerouslyUseHTMLString: true,
  183. // message: '<strong><a href="/login" >游客身份无法与卖家对话,请先注册<a></strong>',
  184. // });
  185. this.$message({
  186. dangerouslyUseHTMLString: true,
  187. message: '<strong><a href="http://free.liaoningdoupo.com/platlive/newlogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  188. type: 'error',
  189. });
  190. return;
  191. } else {
  192. obj.buyer_id = this.user.uid;
  193. obj.buyer_name = this.user.name;
  194. }
  195. if (!this.detailInfo.userid) {
  196. this.$message.error('缺少卖家信息,请联系卖家或管理员');
  197. return;
  198. } else {
  199. obj.seller_id = this.detailInfo.userid;
  200. obj.seller_name = this.detailInfo.contact_user;
  201. }
  202. let res = await this.create(obj);
  203. if (this.$checkRes(res)) {
  204. this.$set(this, `room`, res.data);
  205. }
  206. }
  207. this.dialogTableVisible = true;
  208. },
  209. async btnTrade() {
  210. let form = {};
  211. form.userid = this.user.uid;
  212. form.username = this.user.name;
  213. form.product_id = this.detailInfo.id;
  214. form.product_name = this.detailInfo.name;
  215. form.market_userid = this.detailInfo.userid;
  216. form.market_username = this.detailInfo.contact_user;
  217. form.dockid = this.$route.query.dockid;
  218. form.status = '0';
  219. if (!this.user.uid) {
  220. // this.$message.error('游客身份无法与卖家对话,请先注册');
  221. // this.$message.error({
  222. // dangerouslyUseHTMLString: true,
  223. // message: '<strong>游客身份无法与卖家对话,请先注册<a href="/login" >注册<a> </strong>',
  224. // });
  225. this.$message({
  226. dangerouslyUseHTMLString: true,
  227. message: '<strong><a href="http://free.liaoningdoupo.com/platlive/newlogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  228. type: 'error',
  229. });
  230. return;
  231. } else {
  232. let res = await this.buyProduct(form);
  233. this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
  234. }
  235. },
  236. // killTalk() {
  237. // this.$alert('您确认对话已经可以结束了吗?');
  238. // let room_id = _.get(this.room, 'id');
  239. // if (room_id) {
  240. // this.countDelete(room_id);
  241. // }
  242. // },
  243. back() {
  244. history.back();
  245. },
  246. },
  247. computed: {
  248. ...mapState(['user']),
  249. pageTitle() {
  250. return `${this.$route.meta.title}`;
  251. },
  252. },
  253. metaInfo() {
  254. return { title: this.$route.meta.title };
  255. },
  256. // beforeDestroy() {
  257. // this.killTalk();
  258. // },
  259. beforeRouteLeave(to, from, next) {
  260. // this.killTalk();
  261. next();
  262. },
  263. };
  264. </script>
  265. <style lang="less" scoped>
  266. .w_1200 {
  267. width: 1200px;
  268. margin: 0 auto;
  269. }
  270. p {
  271. padding: 0;
  272. margin: 0;
  273. }
  274. .textOver {
  275. overflow: hidden;
  276. text-overflow: ellipsis;
  277. white-space: nowrap;
  278. }
  279. // .textOver{}
  280. // overflow: hidden;
  281. // text-overflow: ellipsis;
  282. // -webkit-line-clamp: 3;
  283. // word-break: break-all;
  284. // display: -webkit-box;
  285. // -webkit-box-orient: vertical;
  286. // }
  287. .style {
  288. height: 100vh;
  289. }
  290. .style .info {
  291. position: relative;
  292. top: -450px;
  293. }
  294. .style .top {
  295. position: relative;
  296. top: 0;
  297. width: 100%;
  298. text-align: center;
  299. z-index: 999;
  300. height: 172px;
  301. margin: 0 0 20px 0;
  302. }
  303. .style .top p:first-child {
  304. font-size: 50px;
  305. color: #fff;
  306. }
  307. .style .top p:last-child {
  308. font-size: 30px;
  309. color: #fff;
  310. position: absolute;
  311. width: 100%;
  312. top: 135px;
  313. }
  314. .style .main {
  315. min-height: 600px;
  316. border: 1px solid red;
  317. background: #fff;
  318. padding: 30px 20px;
  319. .mainTop {
  320. min-height: 550px;
  321. .one {
  322. min-height: 550px;
  323. .oneLeft {
  324. height: 210px;
  325. overflow: hidden;
  326. }
  327. .oneRight {
  328. padding: 0 15px;
  329. p {
  330. font-size: 16px;
  331. padding: 0 0 20px 0;
  332. span {
  333. display: inline-block;
  334. width: 50%;
  335. }
  336. }
  337. p:first-child {
  338. font-size: 20px;
  339. font-weight: bold;
  340. padding: 20px 0;
  341. }
  342. p:nth-child(2) span:last-child {
  343. color: red;
  344. font-weight: bold;
  345. }
  346. }
  347. .oneDown {
  348. border-top: 1px dashed #ccc;
  349. margin: 30px 0 0 0;
  350. padding: 30px 0 0 0;
  351. div {
  352. padding: 0 0 15px 0;
  353. p {
  354. font-size: 18px;
  355. }
  356. p:first-child {
  357. color: #333;
  358. font-weight: bold;
  359. padding: 0 0 10px 0;
  360. }
  361. }
  362. div:nth-child(2) p span:last-child {
  363. color: #409eff;
  364. padding: 0 10px;
  365. }
  366. div:nth-child(2) p span:last-child:hover {
  367. cursor: pointer;
  368. }
  369. div:nth-child(3) .moreScope {
  370. overflow: hidden;
  371. text-overflow: ellipsis;
  372. -webkit-line-clamp: 6;
  373. word-break: break-all;
  374. display: -webkit-box;
  375. -webkit-box-orient: vertical;
  376. }
  377. div:nth-child(3) .moreScope1 {
  378. overflow: none;
  379. }
  380. div:nth-child(3) .el-button {
  381. float: right;
  382. }
  383. div:last-child .introduction {
  384. overflow: hidden;
  385. text-overflow: ellipsis;
  386. -webkit-line-clamp: 4;
  387. word-break: break-all;
  388. display: -webkit-box;
  389. -webkit-box-orient: vertical;
  390. }
  391. div:last-child .introduction1 {
  392. overflow: none;
  393. }
  394. div:last-child .el-button {
  395. float: right;
  396. }
  397. }
  398. }
  399. }
  400. .mainDown {
  401. height: 50px;
  402. text-align: center;
  403. /deep/.el-dialog__body {
  404. padding: 15px 20px;
  405. color: #606266;
  406. font-size: 14px;
  407. height: 660px;
  408. word-break: break-all;
  409. }
  410. }
  411. }
  412. .marketPublish {
  413. position: fixed;
  414. background: #0279d5;
  415. width: 100px;
  416. height: 100px;
  417. z-index: 999;
  418. left: 13%;
  419. top: 49%;
  420. border-radius: 20px;
  421. box-shadow: 2px 2px 2px #055c9f;
  422. text-align: center;
  423. line-height: 100px;
  424. font-size: 20px;
  425. color: #fff;
  426. font-weight: bold;
  427. }
  428. .marketPublish:hover {
  429. background: #f60;
  430. cursor: pointer;
  431. }
  432. </style>