dockDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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 v-if="this.user.uid != detailInfo.userid" @click="btnTrade()" type="success">洽谈交易</el-button>
  85. </el-col>
  86. </el-col>
  87. </div>
  88. </el-col>
  89. </el-col>
  90. </el-row>
  91. <el-dialog title="产品参数" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
  92. <el-table :data="tableData" border style="width: 100%">
  93. <el-table-column prop="arg_name" label="参数名称" align="center"> </el-table-column>
  94. <el-table-column prop="memo" label="参数内容" align="center"> </el-table-column>
  95. </el-table>
  96. </el-dialog>
  97. </div>
  98. </template>
  99. <script>
  100. import _ from 'lodash';
  101. import { mapState, createNamespacedHelpers } from 'vuex';
  102. import chat from './parts/chat.vue';
  103. const { mapActions: mapProduct } = createNamespacedHelpers('marketproduct');
  104. const { mapActions: personalRoom } = createNamespacedHelpers('personalroom');
  105. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  106. export default {
  107. name: 'dockDetail',
  108. props: {},
  109. components: {
  110. chat,
  111. },
  112. data: () => ({
  113. beijingPic: require('@a/live/top_3.png'),
  114. display: '1',
  115. detailInfo: {},
  116. scope: '123',
  117. introduction: '123',
  118. dialogVisible: false,
  119. tableData: [],
  120. room: {},
  121. }),
  122. created() {
  123. if (this.$route.query.id) {
  124. this.searchInfo();
  125. }
  126. },
  127. methods: {
  128. ...mapProduct(['fetch']),
  129. ...personalRoom(['create', 'countDelete']),
  130. ...transaction({ buyProduct: 'create' }),
  131. async searchInfo() {
  132. let res = await this.fetch(this.$route.query.id);
  133. if (res.errcode === 0) {
  134. this.$set(this, `detailInfo`, res.data);
  135. }
  136. },
  137. argsBtn(data) {
  138. this.dialogVisible = true;
  139. this.$set(this, `tableData`, data);
  140. },
  141. handleClose(done) {
  142. this.$confirm('确认关闭?')
  143. .then(_ => {
  144. done();
  145. })
  146. .catch(_ => {});
  147. },
  148. // 更多
  149. scopeMore() {
  150. this.scope = '';
  151. },
  152. // 收起
  153. scopeMore1() {
  154. this.scope = '123';
  155. },
  156. // 更多
  157. introductionMore() {
  158. this.introduction = '';
  159. },
  160. // 收起
  161. introductionMore1() {
  162. this.introduction = '123';
  163. },
  164. btnInfo() {
  165. this.display = '1';
  166. },
  167. // 线下对接
  168. async btnPhone() {
  169. if (!this.room.id) {
  170. //TODO 请求房间号
  171. let obj = {};
  172. if (!this.user.uid) {
  173. this.$message.error('游客身份无法与卖家对话,请先注册');
  174. return;
  175. } else {
  176. obj.buyer_id = this.user.uid;
  177. obj.buyer_name = this.user.name;
  178. }
  179. if (!this.detailInfo.userid) {
  180. this.$message.error('缺少卖家信息,请联系卖家或管理员');
  181. return;
  182. } else {
  183. obj.seller_id = this.detailInfo.userid;
  184. obj.seller_name = this.detailInfo.contact_user;
  185. }
  186. let res = await this.create(obj);
  187. if (this.$checkRes(res)) {
  188. this.$set(this, `room`, res.data);
  189. }
  190. }
  191. this.display = '2';
  192. },
  193. async btnTrade() {
  194. let form = {};
  195. form.userid = this.user.uid;
  196. form.username = this.user.name;
  197. form.product_id = this.detailInfo.id;
  198. form.product_name = this.detailInfo.name;
  199. form.market_userid = this.detailInfo.userid;
  200. form.market_username = this.detailInfo.contact_user;
  201. form.status = '0';
  202. let res = await this.buyProduct(form);
  203. this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
  204. },
  205. // killTalk() {
  206. // this.$alert('您确认对话已经可以结束了吗?');
  207. // let room_id = _.get(this.room, 'id');
  208. // if (room_id) {
  209. // this.countDelete(room_id);
  210. // }
  211. // },
  212. },
  213. computed: {
  214. ...mapState(['user']),
  215. pageTitle() {
  216. return `${this.$route.meta.title}`;
  217. },
  218. },
  219. metaInfo() {
  220. return { title: this.$route.meta.title };
  221. },
  222. // beforeDestroy() {
  223. // this.killTalk();
  224. // },
  225. beforeRouteLeave(to, from, next) {
  226. // this.killTalk();
  227. next();
  228. },
  229. };
  230. </script>
  231. <style lang="less" scoped>
  232. .w_1200 {
  233. width: 1200px;
  234. margin: 0 auto;
  235. }
  236. p {
  237. padding: 0;
  238. margin: 0;
  239. }
  240. .textOver {
  241. overflow: hidden;
  242. text-overflow: ellipsis;
  243. white-space: nowrap;
  244. }
  245. // .textOver{}
  246. // overflow: hidden;
  247. // text-overflow: ellipsis;
  248. // -webkit-line-clamp: 3;
  249. // word-break: break-all;
  250. // display: -webkit-box;
  251. // -webkit-box-orient: vertical;
  252. // }
  253. .style {
  254. height: 100vh;
  255. }
  256. .style .info {
  257. position: relative;
  258. top: -450px;
  259. }
  260. .style .top {
  261. position: relative;
  262. top: 0;
  263. width: 100%;
  264. text-align: center;
  265. z-index: 999;
  266. height: 200px;
  267. margin: 0 0 20px 0;
  268. }
  269. .style .top p:first-child {
  270. font-size: 50px;
  271. color: #fff;
  272. }
  273. .style .top p:last-child {
  274. font-size: 30px;
  275. color: #fff;
  276. position: absolute;
  277. width: 100%;
  278. top: 150px;
  279. }
  280. .style .main {
  281. min-height: 600px;
  282. border: 1px solid red;
  283. background: #fff;
  284. padding: 30px 20px;
  285. .mainTop {
  286. min-height: 550px;
  287. .one {
  288. min-height: 550px;
  289. .oneLeft {
  290. height: 210px;
  291. overflow: hidden;
  292. }
  293. .oneRight {
  294. padding: 0 15px;
  295. p {
  296. font-size: 16px;
  297. padding: 0 0 20px 0;
  298. span {
  299. display: inline-block;
  300. width: 50%;
  301. }
  302. }
  303. p:first-child {
  304. font-size: 20px;
  305. font-weight: bold;
  306. padding: 20px 0;
  307. }
  308. p:nth-child(2) span:last-child {
  309. color: red;
  310. font-weight: bold;
  311. }
  312. }
  313. .oneDown {
  314. border-top: 1px dashed #ccc;
  315. margin: 30px 0 0 0;
  316. padding: 30px 0 0 0;
  317. div {
  318. padding: 0 0 15px 0;
  319. p {
  320. font-size: 18px;
  321. }
  322. p:first-child {
  323. color: #333;
  324. font-weight: bold;
  325. padding: 0 0 10px 0;
  326. }
  327. }
  328. div:nth-child(2) p span:last-child {
  329. color: #409eff;
  330. padding: 0 10px;
  331. }
  332. div:nth-child(2) p span:last-child:hover {
  333. cursor: pointer;
  334. }
  335. div:nth-child(3) .moreScope {
  336. overflow: hidden;
  337. text-overflow: ellipsis;
  338. -webkit-line-clamp: 6;
  339. word-break: break-all;
  340. display: -webkit-box;
  341. -webkit-box-orient: vertical;
  342. }
  343. div:nth-child(3) .moreScope1 {
  344. overflow: none;
  345. }
  346. div:nth-child(3) .el-button {
  347. float: right;
  348. }
  349. div:last-child .introduction {
  350. overflow: hidden;
  351. text-overflow: ellipsis;
  352. -webkit-line-clamp: 4;
  353. word-break: break-all;
  354. display: -webkit-box;
  355. -webkit-box-orient: vertical;
  356. }
  357. div:last-child .introduction1 {
  358. overflow: none;
  359. }
  360. div:last-child .el-button {
  361. float: right;
  362. }
  363. }
  364. }
  365. }
  366. .mainDown {
  367. height: 50px;
  368. line-height: 50px;
  369. text-align: center;
  370. }
  371. }
  372. </style>