chat.js 4.7 KB

1
  1. require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageA/chat/chat"],{1264:function(e,n,o){"use strict";(function(e,n){var t=o("4ea4");o("f93b");t(o("66fd"));var r=t(o("4652"));e.__webpack_require_UNI_MP_PLUGIN__=o,n(r.default)}).call(this,o("bc2e")["default"],o("543d")["createPage"])},"3bb7":function(e,n,o){},4652:function(e,n,o){"use strict";o.r(n);var t=o("7384"),r=o("6b7d");for(var u in r)["default"].indexOf(u)<0&&function(e){o.d(n,e,(function(){return r[e]}))}(u);o("9818");var a,s=o("f0c5"),i=Object(s["a"])(r["default"],t["b"],t["c"],!1,null,null,null,!1,t["a"],a);n["default"]=i.exports},"6b7d":function(e,n,o){"use strict";o.r(n);var t=o("e720"),r=o.n(t);for(var u in t)["default"].indexOf(u)<0&&function(e){o.d(n,e,(function(){return t[e]}))}(u);n["default"]=r.a},7384:function(e,n,o){"use strict";o.d(n,"b",(function(){return r})),o.d(n,"c",(function(){return u})),o.d(n,"a",(function(){return t}));var t={uNavbar:function(){return Promise.all([o.e("common/vendor"),o.e("uview-ui/components/u-navbar/u-navbar")]).then(o.bind(null,"b6bd"))},uIcon:function(){return Promise.all([o.e("common/vendor"),o.e("uview-ui/components/u-icon/u-icon")]).then(o.bind(null,"01eb"))},kjChat:function(){return Promise.all([o.e("common/vendor"),o.e("components/kj-chat/kj-chat")]).then(o.bind(null,"2452"))}},r=function(){var e=this,n=e.$createElement,o=(e._self._c,e.__map(e.list,(function(n,o){var t=e.__get_orig(n),r=e.renderTime(n.time),u=n.from==e.user_other_no&&"audio"==n.type?n.length:null,a=n.from==e.user_other_no&&"audio"==n.type?n.length:null,s=n.from==e.user_no&&"audio"==n.type?n.length:null,i=n.from==e.user_no&&"audio"==n.type?n.length:null;return{$orig:t,m0:r,g0:u,g1:a,g2:s,g3:i}})));e.$mp.data=Object.assign({},{$root:{l0:o}})},u=[]},9818:function(e,n,o){"use strict";var t=o("3bb7"),r=o.n(t);r.a},e720:function(e,n,o){"use strict";(function(e,t){var r=o("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var u=r(o("b823")),a=r(o("01d0")),s=o("970c"),i=o("fbb8"),c=e.createInnerAudioContext(),l={data:function(){return{user_other_no:"",user_no:"",user:{},user_other:{},pageSize:20,loadText:"",list:[],renderTime:i.renderTime,playStatus:0,statusheight:""}},onLoad:function(n){this.user=e.getStorageSync("user_info"),console.log("user",this.user),n.user_other&&(this.user_other=JSON.parse(decodeURIComponent(n.user_other))),this.user_other_no=n.user_other_no,console.log(this.user_other_no),e.getStorageSync("user_no")&&(this.user_no=e.getStorageSync("user_no")),u.default.$on("message",this.getdata)},onShow:function(){this.getdata()},computed:{i18n:function(){return this.$t("index")}},methods:{goshop:function(n){e.navigateTo({url:"/pageD/homepage/homepage?merchant_id="+n+"&show="+!0})},callphone:function(){e.$u.http.get("/api/config",{params:{module:"basic"}}).then((function(n){console.log(n),e.makePhoneCall({phoneNumber:n.service_mobile})})).catch((function(){}))},previewimg:function(n){var o=[];o.push(n),e.previewImage({urls:o,longPressActions:{itemList:["发送给朋友","保存图片","收藏"],success:function(e){console.log("选中了第"+(e.tapIndex+1)+"个按钮,第"+(e.index+1)+"张图片")},fail:function(e){console.log(e.errMsg)}}})},playaudio:function(e){var n=this;c.src=e,console.log(e);t.setInnerAudioOption({obeyMuteSwitch:!1,success:function(e){console.log("开启静音模式下播放音乐的功能")},fail:function(e){console.log(e),console.log("静音设置失败")}});console.log(this.playStatus),0==this.playStatus?(c.play(),c.onPlay((function(){console.log("开始播放"),n.playStatus=1}))):(c.pause(),c.onPause((function(){console.log("暂停播放"),n.playStatus=0}))),c.onError((function(e){console.log("onError",e.errMsg),console.log("onError",e.errCode)})),c.onEnded((function(e){n.playStatus=0}))},return1:function(){e.navigateBack()},getuser:function(){var e=this,n=this;getEmchatUsersData({user_no:this.user_no+","+this.user_other_no}).then((function(o){1==o.code?(e.user=o.data[0],e.user_other=o.data[1]):n.$u.toast(o.msg)}))},getdata:function(){var n=this,o={chatType:"singleChat",type:"channel",to:this.user_other_no},t=new a.default.message.create(o);s.conn.send(t);var r={targetId:this.user_other_no,pageSize:this.pageSize,cursor:-1,chatType:"singleChat",searchDirection:"up"};s.conn.getHistoryMessages(r).then((function(o){console.log("res",o),o.isLast&&(n.loadText=n.i18n.Nofurtherdata),n.list=o.messages.reverse(),console.log(n.list),n.$nextTick((function(){e.pageScrollTo({scrollTop:99999})}))})).catch((function(e){console.log("失败",e)}))},toinfo:function(n){e.navigateTo({url:"/pageA/productdetails?id="+n})}}};n.default=l}).call(this,o("543d")["default"],o("bc2e")["default"])}},[["1264","common/runtime","common/vendor","pageA/common/vendor"]]]);