12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/kj-chat/kj-chat"],{2452:function(t,e,n){"use strict";n.r(e);var o=n("9423"),i=n("91d0");for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);n("a8c5");var a,c=n("f0c5"),u=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=u.exports},"91d0":function(t,e,n){"use strict";n.r(e);var o=n("b692"),i=n.n(o);for(var s in o)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(s);e["default"]=i.a},9423:function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.isjianpan=!0},t.e1=function(e){t.isjianpan=!1,t.showtype=0})},s=[]},a8c5:function(t,e,n){"use strict";var o=n("f291"),i=n.n(o);i.a},b692:function(t,e,n){"use strict";(function(t){var o=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i,s=n("970c"),a=o(n("01d0")),c=o(n("63af")),u=t.getRecorderManager(),l={props:{to:{typeof:String,default:""},list:{typeof:Array,default:[]},user_other:{type:Object,default:{}},user:{type:Object,default:{}}},data:function(){return{height:"100rpx",showtype:0,emoji:c.default,text:"",changlist:[],isjianpan:!0,longPress:"1",time:0,duration:6e4,tempFilePath:"",playStatus:0}},created:function(){},methods:{longpressBtn:function(){var t=this;console.log("长按说话"),this.longPress="2",u.onStop((function(e){console.log("onstop",e),t.tempFilePath=e.tempFilePath,t.recordingTimer(t.time)}));var e={duration:this.duration,sampleRate:16e3,numberOfChannels:1,encodeBitRate:96e3,format:"mp3",frameSize:10};this.recordingTimer(),u.start(e),u.onStart((function(t){})),u.onError((function(t){}))},touchendBtn:function(){console.log("长按松开录音事件");var e=this;this.longPress="1",u.onStop((function(n){console.log(n),e.tempFilePath=n.tempFilePath,console.log(e.tempFilePath),t.uploadFile({url:"https://cbec.hdlkeji.com/api/upload/images",filePath:e.tempFilePath,name:"file",success:function(n){console.log("发送语音",n),t.hideLoading(),1==JSON.parse(n.data).code?e.sendluyin(JSON.parse(n.data).data.fullurl):e.$u.toast(JSON.parse(n.data).msg)},fail:function(t){console.log(t)}})})),this.recordingTimer(this.time),u.stop()},recordingTimer:function(t){var e=this;void 0==t?i=setInterval((function(){e.time++}),1e3):clearInterval(i)},sendluyin:function(t){var e=this,n={type:"audio",chatType:"singleChat",filename:t,to:this.to,body:{url:t,type:"audio",filename:t,length:this.time}},o=new a.default.message.create(n);s.conn.send(o).then((function(t){console.log("Success"),setTimeout((function(){e.$emit("success",!0)}),800)})).catch((function(t){console.log("Fail",t)}))},send:function(){var t=this;if(""!=this.text&&null!=this.text){var e=s.conn.getUniqueId(),n=new a.default.message("txt",e);console.log(this.user_other),n.set({msg:this.text,to:this.to,chatType:"singleChat",ext:{user_other:this.user_other,user:this.user},success:function(e,n){console.log("成功发送消息"),setTimeout((function(){t.$emit("success",!0)}),800)},fail:function(t){console.log("发送消息失败")}}),s.conn.send(n.body),this.text=""}else this.$u.toast("发送消息不能为空")},toalbum:function(){var e=this;t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album"],success:function(n){t.showLoading({mask:!0,title:"请稍后"}),console.log("img",n),t.uploadFile({url:"https://hire.hdlkeji.com/api/common/upload",filePath:n.tempFilePaths[0],name:"file",success:function(n){t.hideLoading(),1==JSON.parse(n.data).code?(console.log("data",JSON.parse(n.data).data.fullurl),e.sendPrivateImg(JSON.parse(n.data).data.fullurl)):e.$u.toast(JSON.parse(n.data).msg)},fail:function(t){console.log(t)}})}})},tocapture:function(){var e=this;t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["camera"],success:function(n){t.showLoading({mask:!0,title:"请稍后"}),t.uploadFile({url:"https://hire.hdlkeji.com/api/common/upload",filePath:n.tempFilePaths[0],name:"file",success:function(n){t.hideLoading(),1==JSON.parse(n.data).code?e.sendPrivateImg(JSON.parse(n.data).data.fullurl):e.$u.toast(JSON.parse(n.data).msg)},fail:function(t){console.log(t)}})}})},sendPrivateImg:function(t){var e=this;console.log("sendPrivateImg",t);var n={chatType:"singleChat",type:"img",url:t,to:this.to,ext:{user_other:this.user_other,user:this.user}},o=new a.default.message.create(n);s.conn.send(o).then((function(t){console.log("发送图片成功"),setTimeout((function(){e.$emit("success",!0)}),800)}))},select:function(t){this.text=t.content},tolist:function(){t.navigateTo({url:"/pagesC/changyong-list"})},toadd:function(){t.navigateTo({url:"/pagesC/changyong-add"})},changeemoji:function(t){this.text=this.text+t},openemoji:function(){this.showtype=3==this.showtype?0:3,this.height=3==this.showtype?"400rpx":"100rpx"},openmore:function(){this.showtype=1==this.showtype?0:1,this.height=1==this.showtype?"300rpx":"100rpx"},openchangyong:function(){this.showtype=2==this.showtype?0:2,this.height=2==this.showtype?"600rpx":"100rpx",this.isjianpan=!0}}};e.default=l}).call(this,n("543d")["default"])},f291:function(t,e,n){}}]);
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'components/kj-chat/kj-chat-create-component',
- {
- 'components/kj-chat/kj-chat-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('543d')['createComponent'](__webpack_require__("2452"))
- })
- },
- [['components/kj-chat/kj-chat-create-component']]
- ]);
|