context.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <div id="context">
  3. <el-col :span="24" class="one">
  4. <el-col :span="7" class="oneLeft">
  5. <el-carousel trigger="click" height="210px">
  6. <template v-if="detailInfo.image && detailInfo.image.length > 0">
  7. <el-carousel-item v-for="(item, index) in detailInfo.image" :key="index">
  8. <el-image :src="item.url" style="width:100%"> </el-image>
  9. </el-carousel-item>
  10. </template>
  11. </el-carousel>
  12. </el-col>
  13. <el-col :span="17" class="oneRight">
  14. <p class="textOver">
  15. {{ detailInfo.name }}
  16. </p>
  17. <p>
  18. <span>产品类型:{{ detailInfo.product_type_name || '暂无' }}</span>
  19. <span>收费标准:{{ detailInfo.price || '暂无' }}/{{ detailInfo.priceunit || '暂无' }}</span>
  20. </p>
  21. <p>
  22. <span>
  23. 交易方式:{{ detailInfo.business === '0' ? '公用' : detailInfo.business === '1' ? '转让' : detailInfo.business === '2' ? '竞价' : '暂无' }}
  24. </span>
  25. <span>研发阶段:{{ detailInfo.phase == 1 ? '阶段成果' : detailInfo.phase == 2 ? '最终成果' : '暂无' }}</span>
  26. </p>
  27. <p>
  28. <span>联系人:{{ detailInfo.contact_user || '暂无' }}</span>
  29. <span>联系电话:{{ detailInfo.contact_tel || '暂无' }}</span>
  30. </p>
  31. </el-col>
  32. <el-col :span="24" class="newDown">
  33. <div>
  34. <p>应用领域:</p>
  35. <p>{{ detailInfo.field || '暂无' }}</p>
  36. </div>
  37. <div>
  38. <p>
  39. <span>产品参数:</span>
  40. <span>
  41. <el-button type="text" @click="product_argsDia = true">查看详情</el-button>
  42. </span>
  43. </p>
  44. </div>
  45. <div>
  46. <p>服务范围:</p>
  47. <p class="moreScope" v-if="scope != ''">{{ detailInfo.scope || '暂无' }}</p>
  48. <p class="moreScope1" v-else>{{ detailInfo.scope || '暂无' }}</p>
  49. <span v-if="detailInfo.scope != null && detailInfo.scope.length > 420">
  50. <el-button size="mini" @click="scopeMore()" v-if="scope != ''">更多</el-button>
  51. <el-button size="mini" @click="scopeMore1()" v-else>收起</el-button>
  52. </span>
  53. </div>
  54. <div></div>
  55. <div>
  56. <p>产品简介:</p>
  57. <p class="introduction" v-if="introduction != ''">{{ detailInfo.introduction || '暂无' }}</p>
  58. <p class="introduction1" v-else>{{ detailInfo.introduction || '暂无' }}</p>
  59. <el-button size="mini" v-if="detailInfo.introduction != null && detailInfo.introduction.length > 420">
  60. <span v-if="introduction != ''" @click="introductionMore()">更多</span>
  61. <span v-else @click="introductionMore1()">收起</span>
  62. </el-button>
  63. </div>
  64. </el-col>
  65. <el-col :span="24" class="anniu">
  66. <el-button type="primary" @click="btnPhone()" v-if="this.user.uid != detailInfo.userid">对接聊天</el-button>
  67. <el-button v-if="this.user.uid != detailInfo.userid" @click="onSubmit()" type="success">洽谈交易</el-button>
  68. <!-- <el-button @click="onSubmit" type="success">对接聊天</el-button><el-button @click="onSubmit" type="primary">洽谈交易</el-button></el-col -->
  69. </el-col>
  70. <el-dialog title="对接聊天" :visible.sync="dialogTableVisible">
  71. <el-col :span="24" class="two">
  72. <chat :room="room"></chat>
  73. </el-col>
  74. </el-dialog>
  75. <el-dialog title="参数" class="argsDialog" :visible.sync="product_argsDia">
  76. <el-table :data="detailInfo.product_args" border style="width: 100%">
  77. <el-table-column prop="arg_name" label="参数名称" :show-overflow-tooltip="true"> </el-table-column>
  78. <el-table-column prop="memo" label="参数内容" :show-overflow-tooltip="true"> </el-table-column>
  79. </el-table>
  80. </el-dialog>
  81. </el-col>
  82. </div>
  83. </template>
  84. <script>
  85. import _ from 'lodash';
  86. import { mapState, createNamespacedHelpers } from 'vuex';
  87. import chat from '@/layout/market/parts/chat.vue';
  88. const { mapActions: personalRoom } = createNamespacedHelpers('personalroom');
  89. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  90. export default {
  91. name: 'context',
  92. props: {
  93. detailInfo: null,
  94. },
  95. components: {
  96. chat,
  97. },
  98. data: () => ({
  99. product_argsDia: false,
  100. dialogTableVisible: false,
  101. dialogFormVisible: false,
  102. scope: '123',
  103. introduction: '123',
  104. room: {},
  105. }),
  106. created() {},
  107. computed: {
  108. ...mapState(['user']),
  109. },
  110. methods: {
  111. // ...mapProduct(['fetch']),
  112. ...personalRoom(['create', 'countDelete']),
  113. ...transaction({ buyProduct: 'create' }),
  114. scopeMore() {
  115. this.scope = '';
  116. },
  117. // 收起
  118. scopeMore1() {
  119. this.scope = '123';
  120. },
  121. // 更多
  122. introductionMore() {
  123. this.introduction = '';
  124. },
  125. // 收起
  126. introductionMore1() {
  127. this.introduction = '123';
  128. },
  129. onSubmit() {
  130. this.$emit('onSubmit', this.detailInfo);
  131. },
  132. async btnPhone() {
  133. if (!this.room.id) {
  134. //TODO 请求房间号
  135. let obj = {};
  136. if (!this.user.uid) {
  137. // this.$message.error('游客身份无法与卖家对话,请先注册');
  138. this.$message({
  139. dangerouslyUseHTMLString: true,
  140. message: '<strong><a href="http://free.liaoningdoupo.com/platlive/newlogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  141. type: 'error',
  142. });
  143. return;
  144. } else {
  145. obj.buyer_id = this.user.uid;
  146. obj.buyer_name = this.user.name;
  147. }
  148. if (!this.detailInfo.userid) {
  149. this.$message.error('缺少卖家信息,请联系卖家或管理员');
  150. return;
  151. } else {
  152. obj.seller_id = this.detailInfo.userid;
  153. obj.seller_name = this.detailInfo.contact_user;
  154. }
  155. console.log(obj);
  156. let res = await this.create(obj);
  157. if (this.$checkRes(res)) {
  158. this.$set(this, `room`, res.data);
  159. }
  160. }
  161. this.dialogTableVisible = true;
  162. },
  163. },
  164. };
  165. </script>
  166. <style lang="less" scoped>
  167. p {
  168. padding: 0;
  169. margin: 0;
  170. }
  171. .textOver {
  172. overflow: hidden;
  173. text-overflow: ellipsis;
  174. white-space: nowrap;
  175. }
  176. // .textOver{}
  177. // overflow: hidden;
  178. // text-overflow: ellipsis;
  179. // -webkit-line-clamp: 3;
  180. // word-break: break-all;
  181. // display: -webkit-box;
  182. // -webkit-box-orient: vertical;
  183. // }
  184. .style {
  185. height: 100vh;
  186. }
  187. .style .info {
  188. position: relative;
  189. top: -450px;
  190. }
  191. .style .top {
  192. position: relative;
  193. top: 0;
  194. width: 100%;
  195. text-align: center;
  196. z-index: 999;
  197. height: 230px;
  198. margin: 0 0 20px 0;
  199. }
  200. .style .top p:first-child {
  201. font-size: 50px;
  202. color: #fff;
  203. }
  204. .style .top p:last-child {
  205. font-size: 30px;
  206. color: #fff;
  207. position: absolute;
  208. width: 100%;
  209. top: 170px;
  210. }
  211. .one {
  212. min-height: 550px;
  213. padding: 20px;
  214. .oneLeft {
  215. height: 210px;
  216. overflow: hidden;
  217. }
  218. .oneRight {
  219. padding: 0 15px;
  220. p {
  221. font-size: 16px !important;
  222. padding: 0 0 20px 0;
  223. span {
  224. display: inline-block;
  225. width: 50%;
  226. }
  227. }
  228. p:first-child {
  229. font-size: 18px;
  230. font-weight: bold;
  231. padding: 20px 0;
  232. }
  233. p:nth-child(2) span:last-child {
  234. color: red;
  235. font-weight: bold;
  236. }
  237. }
  238. .oneDown {
  239. border-top: 1px dashed #ccc;
  240. margin: 30px 0 0 0;
  241. padding: 30px 0 0 0;
  242. div {
  243. padding: 0 0 15px 0;
  244. p {
  245. font-size: 18px;
  246. }
  247. p:first-child {
  248. color: #333;
  249. font-weight: bold;
  250. padding: 0 0 10px 0;
  251. }
  252. }
  253. div:nth-child(2) p span:last-child {
  254. color: #409eff;
  255. padding: 0 10px;
  256. }
  257. div:nth-child(2) p span:last-child:hover {
  258. cursor: pointer;
  259. }
  260. div:nth-child(3) .moreScope {
  261. overflow: hidden;
  262. text-overflow: ellipsis;
  263. -webkit-line-clamp: 6;
  264. word-break: break-all;
  265. display: -webkit-box;
  266. -webkit-box-orient: vertical;
  267. }
  268. div:nth-child(3) .moreScope1 {
  269. overflow: none;
  270. }
  271. div:nth-child(3) .el-button {
  272. float: right;
  273. }
  274. div:nth-child(5) .introduction {
  275. overflow: hidden;
  276. text-overflow: ellipsis;
  277. -webkit-line-clamp: 6;
  278. word-break: break-all;
  279. display: -webkit-box;
  280. -webkit-box-orient: vertical;
  281. }
  282. div:nth-child(5) .introduction1 {
  283. overflow: none;
  284. }
  285. div:last-child .el-button {
  286. float: right;
  287. }
  288. }
  289. .newDown {
  290. border-top: 1px dashed #ccc;
  291. margin: 30px 0 0 0;
  292. padding: 30px 0 0 0;
  293. div {
  294. padding: 0 0 15px 0;
  295. p {
  296. font-size: 16px;
  297. }
  298. p:first-child {
  299. color: #333;
  300. padding: 0 0 10px 0;
  301. }
  302. }
  303. div:nth-child(2) p span:last-child {
  304. color: #409eff;
  305. padding: 0 10px;
  306. }
  307. div:nth-child(2) p span:last-child:hover {
  308. cursor: pointer;
  309. }
  310. div:nth-child(3) .moreScope {
  311. overflow: hidden;
  312. text-overflow: ellipsis;
  313. -webkit-line-clamp: 6;
  314. word-break: break-all;
  315. display: -webkit-box;
  316. -webkit-box-orient: vertical;
  317. }
  318. div:nth-child(3) .moreScope1 {
  319. overflow: none;
  320. }
  321. div:nth-child(3) .el-button {
  322. float: right;
  323. }
  324. div:nth-child(5) .introduction {
  325. overflow: hidden;
  326. text-overflow: ellipsis;
  327. -webkit-line-clamp: 6;
  328. word-break: break-all;
  329. display: -webkit-box;
  330. -webkit-box-orient: vertical;
  331. }
  332. div:nth-child(5) .introduction1 {
  333. overflow: none;
  334. }
  335. div:last-child .el-button {
  336. float: right;
  337. }
  338. }
  339. .mainDown {
  340. height: 50px;
  341. line-height: 50px;
  342. text-align: center;
  343. }
  344. }
  345. .anniu {
  346. float: left;
  347. text-align: center;
  348. }
  349. /deep/.argsDialog .el-dialog__body {
  350. min-height: 120px;
  351. height: 0;
  352. }
  353. /deep/.el-dialog__body {
  354. padding: 15px 20px;
  355. color: #606266;
  356. font-size: 14px;
  357. height: 660px;
  358. word-break: break-all;
  359. }
  360. </style>