dockDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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"> </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">
  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">
  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="primary" @click="btnPhone()" v-if="this.user.uid != detailInfo.userid">对接聊天</el-button>
  85. <el-button v-if="this.user.uid != detailInfo.userid" @click="btnTrade()" type="success">洽谈交易</el-button>
  86. <el-dialog title="对接聊天" :visible.sync="dialogTableVisible">
  87. <el-col :span="24" class="two">
  88. <chat :room="room"></chat>
  89. </el-col>
  90. </el-dialog>
  91. </el-col>
  92. </el-col>
  93. </div>
  94. </el-col>
  95. </el-col>
  96. </el-row>
  97. <el-dialog title="产品参数" :visible.sync="dialogVisible" width="50%">
  98. <el-table :data="tableData" border style="width: 100%">
  99. <el-table-column prop="arg_name" label="参数名称" align="center"> </el-table-column>
  100. <el-table-column prop="memo" label="参数内容" align="center"> </el-table-column>
  101. </el-table>
  102. </el-dialog>
  103. <el-col :span="24" class="marketPublish" @click.native="back()"> <span>返回</span></el-col>
  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. this.dialogTableVisible = true;
  178. if (!this.room.id) {
  179. //TODO 请求房间号
  180. let obj = {};
  181. if (!this.user.uid) {
  182. this.$message.error('游客身份无法与卖家对话,请先注册');
  183. return;
  184. } else {
  185. obj.buyer_id = this.user.uid;
  186. obj.buyer_name = this.user.name;
  187. }
  188. if (!this.detailInfo.userid) {
  189. this.$message.error('缺少卖家信息,请联系卖家或管理员');
  190. return;
  191. } else {
  192. obj.seller_id = this.detailInfo.userid;
  193. obj.seller_name = this.detailInfo.contact_user;
  194. }
  195. let res = await this.create(obj);
  196. if (this.$checkRes(res)) {
  197. this.$set(this, `room`, res.data);
  198. }
  199. }
  200. // this.display = '2';
  201. },
  202. async btnTrade() {
  203. let form = {};
  204. form.userid = this.user.uid;
  205. form.username = this.user.name;
  206. form.product_id = this.detailInfo.id;
  207. form.product_name = this.detailInfo.name;
  208. form.market_userid = this.detailInfo.userid;
  209. form.market_username = this.detailInfo.contact_user;
  210. form.status = '0';
  211. let res = await this.buyProduct(form);
  212. this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
  213. },
  214. // killTalk() {
  215. // this.$alert('您确认对话已经可以结束了吗?');
  216. // let room_id = _.get(this.room, 'id');
  217. // if (room_id) {
  218. // this.countDelete(room_id);
  219. // }
  220. // },
  221. back() {
  222. history.back();
  223. },
  224. },
  225. computed: {
  226. ...mapState(['user']),
  227. pageTitle() {
  228. return `${this.$route.meta.title}`;
  229. },
  230. },
  231. metaInfo() {
  232. return { title: this.$route.meta.title };
  233. },
  234. // beforeDestroy() {
  235. // this.killTalk();
  236. // },
  237. beforeRouteLeave(to, from, next) {
  238. // this.killTalk();
  239. next();
  240. },
  241. };
  242. </script>
  243. <style lang="less" scoped>
  244. .w_1200 {
  245. width: 1200px;
  246. margin: 0 auto;
  247. }
  248. p {
  249. padding: 0;
  250. margin: 0;
  251. }
  252. .textOver {
  253. overflow: hidden;
  254. text-overflow: ellipsis;
  255. white-space: nowrap;
  256. }
  257. // .textOver{}
  258. // overflow: hidden;
  259. // text-overflow: ellipsis;
  260. // -webkit-line-clamp: 3;
  261. // word-break: break-all;
  262. // display: -webkit-box;
  263. // -webkit-box-orient: vertical;
  264. // }
  265. .style {
  266. height: 100vh;
  267. }
  268. .style .info {
  269. position: relative;
  270. top: -450px;
  271. }
  272. .style .top {
  273. position: relative;
  274. top: 0;
  275. width: 100%;
  276. text-align: center;
  277. z-index: 999;
  278. height: 172px;
  279. margin: 0 0 20px 0;
  280. }
  281. .style .top p:first-child {
  282. font-size: 50px;
  283. color: #fff;
  284. }
  285. .style .top p:last-child {
  286. font-size: 30px;
  287. color: #fff;
  288. position: absolute;
  289. width: 100%;
  290. top: 135px;
  291. }
  292. .style .main {
  293. min-height: 600px;
  294. border: 1px solid red;
  295. background: #fff;
  296. padding: 30px 20px;
  297. .mainTop {
  298. min-height: 550px;
  299. .one {
  300. min-height: 550px;
  301. .oneLeft {
  302. height: 210px;
  303. overflow: hidden;
  304. }
  305. .oneRight {
  306. padding: 0 15px;
  307. p {
  308. font-size: 16px;
  309. padding: 0 0 20px 0;
  310. span {
  311. display: inline-block;
  312. width: 50%;
  313. }
  314. }
  315. p:first-child {
  316. font-size: 20px;
  317. font-weight: bold;
  318. padding: 20px 0;
  319. }
  320. p:nth-child(2) span:last-child {
  321. color: red;
  322. font-weight: bold;
  323. }
  324. }
  325. .oneDown {
  326. border-top: 1px dashed #ccc;
  327. margin: 30px 0 0 0;
  328. padding: 30px 0 0 0;
  329. div {
  330. padding: 0 0 15px 0;
  331. p {
  332. font-size: 18px;
  333. }
  334. p:first-child {
  335. color: #333;
  336. font-weight: bold;
  337. padding: 0 0 10px 0;
  338. }
  339. }
  340. div:nth-child(2) p span:last-child {
  341. color: #409eff;
  342. padding: 0 10px;
  343. }
  344. div:nth-child(2) p span:last-child:hover {
  345. cursor: pointer;
  346. }
  347. div:nth-child(3) .moreScope {
  348. overflow: hidden;
  349. text-overflow: ellipsis;
  350. -webkit-line-clamp: 6;
  351. word-break: break-all;
  352. display: -webkit-box;
  353. -webkit-box-orient: vertical;
  354. }
  355. div:nth-child(3) .moreScope1 {
  356. overflow: none;
  357. }
  358. div:nth-child(3) .el-button {
  359. float: right;
  360. }
  361. div:last-child .introduction {
  362. overflow: hidden;
  363. text-overflow: ellipsis;
  364. -webkit-line-clamp: 4;
  365. word-break: break-all;
  366. display: -webkit-box;
  367. -webkit-box-orient: vertical;
  368. }
  369. div:last-child .introduction1 {
  370. overflow: none;
  371. }
  372. div:last-child .el-button {
  373. float: right;
  374. }
  375. }
  376. }
  377. }
  378. .mainDown {
  379. height: 50px;
  380. text-align: center;
  381. /deep/.el-dialog__body {
  382. padding: 15px 20px;
  383. color: #606266;
  384. font-size: 14px;
  385. height: 660px;
  386. word-break: break-all;
  387. }
  388. }
  389. }
  390. .marketPublish {
  391. position: fixed;
  392. background: #0279d5;
  393. width: 100px;
  394. height: 100px;
  395. z-index: 999;
  396. left: 13%;
  397. top: 49%;
  398. border-radius: 20px;
  399. box-shadow: 2px 2px 2px #055c9f;
  400. text-align: center;
  401. line-height: 100px;
  402. font-size: 20px;
  403. color: #fff;
  404. font-weight: bold;
  405. }
  406. .marketPublish:hover {
  407. background: #f60;
  408. cursor: pointer;
  409. }
  410. </style>