(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/common_tools/my_consulting/conversation"],{"393c":function(e,t,n){"use strict";var i=n("d0ac"),o=n.n(i);o.a},"500e":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return i}));var i={GoEasyAudioPlayer:function(){return n.e("components/GoEasyAudioPlayer/GoEasyAudioPlayer").then(n.bind(null,"cf0e"))}},o=function(){var e=this,t=e.$createElement,n=(e._self._c,e.__map(e.messages,(function(t,n){var i=e.__get_orig(t),o=t.receiverId!=e.currentUser.uuid?e.renderMessageDate(e.message,n):null;return{$orig:i,m0:o}})));e.$mp.data=Object.assign({},{$root:{l0:n}})},s=[]},5123:function(e,t,n){"use strict";n.r(t);var i=n("500e"),o=n("ac57");for(var s in o)"default"!==s&&function(e){n.d(t,e,(function(){return o[e]}))}(s);n("393c");var r,a=n("f0c5"),c=Object(a["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],r);t["default"]=c.exports},6683:function(e,t,n){"use strict";(function(e){n("02cf");i(n("66fd"));var t=i(n("5123"));function i(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},ac57:function(e,t,n){"use strict";n.r(t);var i=n("ff08"),o=n.n(i);for(var s in i)"default"!==s&&function(e){n.d(t,e,(function(){return i[e]}))}(s);t["default"]=o.a},d0ac:function(e,t,n){},ff08:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;n("a602");var i=function(){n.e("components/GoEasyAudioPlayer/GoEasyAudioPlayer").then(function(){return resolve(n("cf0e"))}.bind(null,n)).catch(n.oe)},o=e.getRecorderManager(),s={components:{GoEasyAudioPlayer:i},onLoad:function(t){this.imService=getApp().globalData.imService,this.doctorInfo=JSON.parse(t.doctor),this.friend={uuid:"doctor_"+this.doctorInfo.id,name:this.doctorInfo.name,avatar:this.doctorInfo.avatar},this.currentUser=this.imService.currentUser;var n=this.imService.getPrivateMessages(this.friend.uuid);this.messages=n.sentMessages,this.pendingMessages=n.pendingMessages,e.setNavigationBarTitle({title:this.friend.name}),this.initialListeners(),this.scrollToBottom(),0!=this.messages.length&&this.imService.markPrivateMessageAsRead(this.friend.uuid)},mounted:function(){},data:function(){return{keyword:"",InputBottom:0,isvoice:!1,textinput:"请输入",isinput:!1,messages:[],self_messages:[],friend:null,currentUser:null,imService:null,audio:{recording:!1},doctorInfo:{}}},onPullDownRefresh:function(e){this.loadMoreHistoryMessage()},onUnload:function(){this.imService&&(this.imService.onNewPrivateMessageReceive=function(e,t){})},methods:{renderMessageDate:function(e,t){return 0===t||e.timestamp-this.messages[t-1].timestamp>3e5?this.formatDate(e.timestamp):""},InputFocus:function(e){this.InputBottom=e.detail.height},InputBlur:function(e){this.InputBottom=0},sendvoice:function(){this.isvoice=!this.isvoice},subscribeMessage:function(){},yulan:function(t){e.previewImage({urls:[t],current:t})},initialListeners:function(){var e=this;this.imService.onNewPrivateMessageReceive=function(t,n){t==e.friend.uuid&&(e.imService.markPrivateMessageAsRead(t),e.scrollToBottom())},this.initRecorderListeners()},initRecorderListeners:function(){var e=this;o.onStart((function(){e.audio.recording=!0})),o.onStop((function(t){console.log(t),e.audio.recording=!1,e.imService.sendPrivateAudioMessage(e.friend.uuid,t)})),o.onError((function(e){console.log("录音报错：",e)}))},onRecordStart:function(t){try{o.start()}catch(n){e.showModal({title:"发送语音错误",content:"请联系客服"})}t.preventDefault()},onRecordEnd:function(){try{o.stop()}catch(t){e.showModal({title:"发送语音错误",content:"请联系客服"})}},sendMessage:function(){""!=this.keyword.trim()&&(console.log(this.friend.uuid),this.imService.sendPrivateTextMessage(this.friend.uuid,this.keyword)),this.keyword=""},scrollToBottom:function(){this.$nextTick((function(){e.pageScrollTo({scrollTop:2e6,duration:10})}))},sendImage:function(){var t=this;e.chooseImage({count:1,success:function(e){t.imService.sendPrivateImageMessage(t.friend.uuid,e)}})},loadMoreHistoryMessage:function(){var t=this,n=Date.now(),i=this.messages[0];i&&(n=i.timestamp);var o=this.messages.length,s=this.imService.loadPrivateHistoryMessage(this.friend.uuid,n);s.then((function(n){n.length==o&&(t.allHistoryLoaded=!0),t.messages=n,e.stopPullDownRefresh()})).catch((function(t){console.log(t),e.stopPullDownRefresh()}))}}};t.default=s}).call(this,n("543d")["default"])}},[["6683","common/runtime","common/vendor"]]]);