12345678910 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/kj-chat/kj-chat"],{2452:function(t,e,o){"use strict";o.r(e);var n=o("de1a"),s=o("91d0");for(var i in s)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return s[t]}))}(i);o("a8c5");var a,c=o("f0c5"),u=Object(c["a"])(s["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],a);e["default"]=u.exports},"91d0":function(t,e,o){"use strict";o.r(e);var n=o("b692"),s=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(i);e["default"]=s.a},a8c5:function(t,e,o){"use strict";var n=o("f291"),s=o.n(n);s.a},b692:function(t,e,o){"use strict";(function(t){var n=o("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s,i=o("970c"),a=n(o("01d0")),c=n(o("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(){console.log(u),console.log("长按说话"),this.longPress="2",u.onStop((function(t){console.log("onstop",t)}));var t={duration:this.duration,sampleRate:16e3,numberOfChannels:1,encodeBitRate:96e3,format:"mp3",frameSize:10};this.recordingTimer(),u.start(t),u.onStart((function(t){})),u.onError((function(t){console.log(t)}))},touchendBtn:function(){console.log("长按松开录音事件");var e=this;this.longPress="1",u.onStop((function(o){console.log(o),e.tempFilePath=o.tempFilePath,console.log(e.tempFilePath),t.uploadFile({url:"https://cbec.hdlkeji.com/api/upload/images",filePath:e.tempFilePath,name:"file",success:function(o){console.log("发送语音",o),t.hideLoading(),1e4==JSON.parse(o.data).code?e.sendluyin(JSON.parse(o.data).data.filePath):e.$u.toast(JSON.parse(o.data).msg)},fail:function(t){console.log(t)}})})),this.recordingTimer(this.time),u.stop()},recordingTimer:function(t){var e=this;void 0==t?s=setInterval((function(){e.time++}),1e3):clearInterval(s)},sendluyin:function(t){var e=this,o={type:"audio",chatType:"singleChat",filename:t,to:this.to,body:{url:t,type:"audio",filename:t,length:this.time},ext:{user_other:this.user_other,user:this.user}},n=new a.default.message.create(o);i.conn.send(n).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=i.conn.getUniqueId(),o=new a.default.message("txt",e);console.log(this.user_other),o.set({msg:this.text,to:this.to,chatType:"singleChat",ext:{user_other:this.user_other,user:this.user},success:function(e,o){console.log("成功发送消息"),setTimeout((function(){t.$emit("success",!0)}),800)},fail:function(t){console.log("发送消息失败")}}),i.conn.send(o.body),this.text=""}else this.$u.toast("发送消息不能为空")},toalbum:function(){var e=this;t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album"],success:function(o){t.showLoading({mask:!0,title:"请稍后"}),console.log("img",o),t.uploadFile({url:"https://cbec.hdlkeji.com/api/upload/images",filePath:o.tempFilePaths[0],name:"file",success:function(o){t.hideLoading(),console.log(JSON.parse(o.data)),1e4==JSON.parse(o.data).code?(console.log("data",JSON.parse(o.data).data.filePath),e.sendPrivateImg(JSON.parse(o.data).data.filePath)):e.$u.toast(JSON.parse(o.data).msg)},fail:function(t){console.log(t)}})}})},tocapture:function(){var e=this;t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["camera"],success:function(o){t.showLoading({mask:!0,title:"请稍后"}),console.log("img",o),t.uploadFile({url:"https://cbec.hdlkeji.com/api/upload/images",filePath:o.tempFilePaths[0],name:"file",success:function(o){t.hideLoading(),console.log(JSON.parse(o.data)),1e4==JSON.parse(o.data).code?e.sendPrivateImg(JSON.parse(o.data).data.filePath):e.$u.toast(JSON.parse(o.data).msg)},fail:function(t){console.log(t)}})}})},sendPrivateImg:function(t){var e=this;console.log("sendPrivateImg",t);var o={chatType:"singleChat",type:"img",url:t,to:this.to,ext:{user_other:this.user_other,user:this.user}},n=new a.default.message.create(o);i.conn.send(n).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,o("543d")["default"])},de1a:function(t,e,o){"use strict";var n;o.d(e,"b",(function(){return s})),o.d(e,"c",(function(){return i})),o.d(e,"a",(function(){return n}));var s=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})},i=[]},f291:function(t,e,o){}}]);
- ;(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']]
- ]);
|