12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-168c4e52"],{"109a":function(e,t,n){},"590c":function(e,t,n){"use strict";var r=n("622c"),a=n.n(r);a.a},"622c":function(e,t,n){},"7db0":function(e,t,n){"use strict";var r=n("23e7"),a=n("b727").find,s=n("44d2"),c=n("ae40"),o="find",i=!0,u=c(o);o in[]&&Array(1)[o]((function(){i=!1})),r({target:"Array",proto:!0,forced:i||!u},{find:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),s(o)},"811e":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"chats"}},[n("el-row",[n("el-col",{staticClass:"info chat_frame",attrs:{span:24,id:"chat"}},[e._l(e.talk,(function(t,r){return[e.isSender(t,r)?[n("el-col",{key:"div"+t.id+r,staticClass:"senderTime",attrs:{span:24}},[n("span",{key:"senderTime"+t.id+r},[e._v("["+e._s(t.send_time)+"] "+e._s(t.sender_name))]),n("span",{key:"senderContent"+t.id+r,domProps:{innerHTML:e._s(t.content)}})])]:[n("el-col",{key:"div"+t.id+r,staticClass:"receverTime",attrs:{span:24}},[n("span",{key:"receverTime"+t.id+r},[e._v(" "+e._s(t.sender_name)+" ["+e._s(t.send_time)+"]")]),n("span",{key:"receverContent"+t.id+r,domProps:{innerHTML:e._s(t.content)}})])]]}))],2),n("el-col",{staticStyle:{"text-align":"right"},attrs:{span:24}},[n("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",size:"mini"},on:{click:e.sendMessage}},[e._v("发送")]),n("wang-editor",{ref:"editor",model:{value:e.content,callback:function(t){e.content=t},expression:"content"}})],1)],1)],1)},a=[],s=(n("99af"),n("7db0"),n("b0c0"),n("b64b"),n("ac1f"),n("841c"),n("ade3")),c=(n("96cf"),n("1da1")),o=n("5530"),i=n("38d2"),u=n("2f62"),d=Object(u["a"])("personalchat"),l=d.mapActions,p={name:"chats",props:{room:{type:Object}},components:{wangEditor:i["a"]},data:function(){return{content:"",talk:[]}},created:function(){},mounted:function(){this.channel()},methods:Object(o["a"])({},l(["create","query"]),{search:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.query({personroom_id:e.room.id});case 2:n=t.sent,e.$checkRes(n)&&(e.$set(e,"talk",n.data),e.turnBottom());case 4:case"end":return t.stop()}}),t)})))()},sendMessage:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r,a,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(""==e.content){t.next=15;break}return n={personroom_id:e.room.id,content:e.content,sender_id:e.user.uid,sender_name:e.user.name,send_time:"13:00"},r=Object.keys(e.room),a=r.find((function(t){return e.room[t]==e.user.uid})),n.receiver_id="buyer_id"===a?e.room["seller_id"]:e.room["buyer_id"],n.receiver_name="buyer_id"===a?e.room["seller_name"]:e.room["buyer_name"],t.next=8,e.create(n);case 8:s=t.sent,e.$refs.editor.setContent(),e.$set(e,"content",""),e.$forceUpdate(),e.$checkRes(s,null,s.errmsg||"发言失败")&&(e.talk.push(s.data),e.turnBottom()),t.next=16;break;case 15:e.$message.error("请输入信息后发送");case 16:case"end":return t.stop()}}),t)})))()},channel:function(){this.room.id?this.$stomp(Object(s["a"])({},"/exchange/person_chat/".concat(this.room.id,"_").concat(this.user.uid),this.onMessage)):console.warn("未获取到房间id,无法进行订阅")},onMessage:function(e){var t=_.get(e,"body");t&&(t=JSON.parse(t),this.talk.push(t),this.turnBottom())},turnBottom:function(){this.$nextTick((function(){document.getElementById("chat").scrollTop=document.getElementById("chat").scrollHeight}))},isSender:function(e){return this.user.uid==e.sender_id}}),watch:{room:{handler:function(e){e.id&&this.search()},immediate:!0,deep:!0}},computed:Object(o["a"])({},Object(u["c"])(["user"]),{pageTitle:function(){return"".concat(this.$route.meta.title)}}),metaInfo:function(){return{title:this.$route.meta.title}}},m=p,f=(n("aa01"),n("2877")),h=Object(f["a"])(m,r,a,!1,null,"85b44030",null);t["a"]=h.exports},9223:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"dockDetail"}},[n("el-row",[n("el-col",{staticClass:"style",attrs:{span:24}},[n("el-col",{staticClass:"info",attrs:{span:24}},[n("div",{staticClass:"w_1200"},[n("el-col",{staticClass:"main",attrs:{span:24}},[n("el-col",{staticClass:"btn",attrs:{span:6}},[n("el-col",{attrs:{span:24}},[n("el-button",{attrs:{type:"primary",icon:"el-icon-tickets"},on:{click:e.btnInfo}},[e._v("项目信息")])],1),this.user.uid!=e.productInfo.userid?n("el-col",{attrs:{span:24}},[n("el-button",{attrs:{type:"danger",icon:"el-icon-phone-outline"},on:{click:e.btnPhone}},[e._v("对接")])],1):e._e(),this.user.uid!=e.productInfo.userid?n("el-col",{attrs:{span:24}},[n("el-button",{attrs:{type:"success",icon:"el-icon-check"},on:{click:e.btnTrade}},[e._v("申请交易")])],1):e._e()],1),n("el-col",{staticClass:"mainInfo",attrs:{span:18}},["1"===e.display?n("el-col",{attrs:{span:24}},[n("p",{staticClass:"name textOver"},[e._v(e._s(e.productInfo.name))]),n("div",{staticClass:"brief"},[n("p",[n("span",[e._v("应用领域:"+e._s(e.productInfo.field))]),n("span",[e._v("服务范围:"+e._s(e.productInfo.scope))])]),n("p",[n("span",[e._v("产品类型:"+e._s(e.productInfo.product_type_name))]),n("span",[e._v("研发阶段:"+e._s(1==e.productInfo.phase?"阶段成果":"最终成果"))])]),n("p",[n("span",[e._v(e._s("0"==e.productInfo.business?"公用":"1"==e.productInfo.business?"转让":"竞价"))]),n("span",[e._v("交易价格:"+e._s(e.productInfo.price)+"/"+e._s(e.productInfo.priceunit))])])]),n("p",{staticClass:"intro"},[n("span",[n("i",{staticClass:"el-icon-date"}),e._v("项目简介")]),n("span",[e._v(e._s(e.productInfo.introduction))])])]):e._e(),"2"===e.display?n("el-col",{staticClass:"contact",attrs:{span:24}},[n("chat",{attrs:{room:e.room}})],1):e._e()],1)],1)],1)])],1)],1)],1)},a=[],s=(n("b0c0"),n("96cf"),n("1da1")),c=n("5530"),o=n("2f62"),i=n("811e"),u=Object(o["a"])("marketproduct"),d=u.mapActions,l=Object(o["a"])("personalroom"),p=l.mapActions,m=Object(o["a"])("transaction"),f=m.mapActions,h={name:"dockDetail",props:{},components:{chat:i["a"]},data:function(){return{display:"1",productInfo:{},room:{}}},created:function(){this.$route.query.id&&this.searchInfo()},methods:Object(c["a"])({},d(["fetch"]),{},p(["create"]),{},f({buyProduct:"create"}),{searchInfo:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.fetch(e.$route.query.id);case 2:n=t.sent,0===n.errcode&&e.$set(e,"productInfo",n.data);case 4:case"end":return t.stop()}}),t)})))()},btnInfo:function(){this.display="1"},btnPhone:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.room.id){t.next=20;break}if(n={},e.user.uid){t.next=7;break}return e.$message.error("游客身份无法与卖家对话,请先注册"),t.abrupt("return");case 7:n.buyer_id=e.user.uid,n.buyer_name=e.user.name;case 9:if(e.productInfo.userid){t.next=14;break}return e.$message.error("缺少卖家信息,请联系卖家或管理员"),t.abrupt("return");case 14:n.seller_id=e.productInfo.userid,n.seller_name=e.productInfo.contact_user;case 16:return t.next=18,e.create(n);case 18:r=t.sent,e.$checkRes(r)&&e.$set(e,"room",r.data);case 20:e.display="2";case 21:case"end":return t.stop()}}),t)})))()},btnTrade:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n={},n.userid=e.user.uid,n.username=e.user.name,n.product_id=e.productInfo.id,n.product_name=e.productInfo.name,n.market_userid=e.productInfo.userid,n.market_username=e.productInfo.contact_user,n.status="0",t.next=10,e.buyProduct(n);case 10:r=t.sent,e.$checkRes(r,"购买申请成功",r.errmsg||"购买申请失败");case 12:case"end":return t.stop()}}),t)})))()}}),computed:Object(c["a"])({},Object(o["c"])(["user"]),{pageTitle:function(){return"".concat(this.$route.meta.title)}}),metaInfo:function(){return{title:this.$route.meta.title}}},_=h,b=(n("590c"),n("2877")),v=Object(b["a"])(_,r,a,!1,null,"20dcd202",null);t["default"]=v.exports},aa01:function(e,t,n){"use strict";var r=n("109a"),a=n.n(r);a.a},b0c0:function(e,t,n){var r=n("83ab"),a=n("9bf2").f,s=Function.prototype,c=s.toString,o=/^\s*function ([^ (]*)/,i="name";r&&!(i in s)&&a(s,i,{configurable:!0,get:function(){try{return c.call(this).match(o)[1]}catch(e){return""}}})}}]);
- //# sourceMappingURL=chunk-168c4e52.92c94d85.js.map
|