(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-index"],{"28e8":function(e,t,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(i("1f61")),o=n(i("81b7")),r=n(i("3242")),s=getApp(),c={data:function(){return{title:"Hello",baseUrl:getApp().globalData.baseUrl,wsBaseUrl:getApp().globalData.wsBaseUrl,visitorList:[],token:"",timer:null,wsOpen:!1,noticeContent:"通知: 无",innerAudioContext:null}},onShow:function(){var e=uni.getStorageSync("app");console.log(e),e&&(this.token=e.token);var t=uni.getStorageSync("domain");t&&(this.baseUrl=t.domain,this.wsBaseUrl=o.default.getWsUrl(t.domain)),this.checkAuth(),this.initPush()},onLoad:function(){},methods:{initSocket:function(){s.globalData.socketObj?s.globalData.socketObj.isConnect||s.globalData.socketObj.initSocket():(s.globalData.socketObj=new r.default(this.wsBaseUrl+"?token="+this.token,60),s.globalData.socketObj.initSocket())},onlineIntime:function(){var e=this;uni.onSocketMessage((function(t){var i=JSON.parse(t.data);switch(i.type){case"allUsers":break;case"userOnline":e.addOnlineUser(i.data),o.default.playVoice();break;case"userOffline":console.log("下线"),e.removeOfflineUser(i.data);break;case"notice":break;case"message":e.recvMessage(i.data);break}}))},getOnlineUser:function(){var e=this,t=this.baseUrl;uni.request({url:t+"/kefu/onlineVisitors?token="+e.token,method:"GET",success:function(t){if(console.log(t),t.data.result){for(var i=t.data.result,n=0;n0&&void 0!==arguments[0]?arguments[0]:"关闭",t=this;this.socketExamples.close({reason:e,success:function(){t.data=null,t.isCreate=!1,t.isConnect=!1,t.isInitiative=!0,t.socketExamples=null,clearInterval(t.heartbeatTimer),clearTimeout(t.reconnectTimer),console.log("关闭 WebSocket 成功")},fail:function(){console.log("关闭 WebSocket 失败")}})}}]),e}(),s=r;t.default=s},"3cb0":function(e,t,i){"use strict";i.r(t);var n=i("b900"),a=i("5d11");for(var o in a)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(o);i("49e3");var r=i("f0c5"),s=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"65ce8772",null,!1,n["a"],void 0);t["default"]=s.exports},"49e3":function(e,t,i){"use strict";var n=i("a0f9"),a=i.n(n);a.a},"5d11":function(e,t,i){"use strict";i.r(t);var n=i("28e8"),a=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(o);t["default"]=a.a},"81b7":function(module,exports,__webpack_require__){"use strict";function replaceMutiFile(e,t){return e.replace(/mutiFile\[(.*?)\]/g,(function(e){var i=e.match(/mutiFile\[(.*?)\]/);if(i.length<2)return e;var n=JSON.parse(i[1]),a="";switch(n.ext){case".mp3":a=t+"/static/images/ext/MP3.png";break;case".zip":a=t+"/static/images/ext/ZIP.png";break;case".txt":a=t+"/static/images/ext/TXT.png";break;case".7z":a=t+"/static/images/ext/7z.png";break;case".bpm":a=t+"/static/images/ext/BMP.png";break;case".png":a=t+"/static/images/ext/PNG.png";break;case".jpg":a=t+"/static/images/ext/JPG.png";break;case".jpeg":a=t+"/static/images/ext/JPEG.png";break;case".pdf":a=t+"/static/images/ext/PDF.png";break;case".doc":a=t+"/static/images/ext/DOC.png";break;case".docx":a=t+"/static/images/ext/DOCX.png";break;case".rar":a=t+"/static/images/ext/RAR.png";break;case".xlsx":a=t+"/static/images/ext/XLSX.png";break;case".csv":a=t+"/static/images/ext/XLSX.png";break;default:a=t+"/static/images/ext/default.png";break}var o="",r=getImageUrl(n.path,t),s='\n \n '+o+"\n
\n

"+n.name+'

\n

'+formatFileSize(n.size)+"

\n
\n
\n ";return s}))}function formatFileSize(e){if(e<1024)return e+"B";if(e<1048576){var t=e/1024;return t=t.toFixed(2),t+"KB"}if(e<1073741824){t=e/1048576;return t=t.toFixed(2),t+"MB"}t=e/1073741824;return t=t.toFixed(2),t+"GB"}function beautifyTime(e){var t=Math.round(new Date/1e3)-e;if(t<=0)return"刚刚";var i=t>0?"前":"后";t=Math.abs(t);for(var n=["年","个月","周","天","小时","分钟","秒"],a=[31536e3,2592e3,604800,86400,3600,60,1],o=0;o<7;o++){var r=Math.floor(t/a[o]);if(0!=r)return r+n[o]+i}}function formatTime(time,fmt){if(null!=time){var fmt=fmt||"yyyy-MM-dd hh:mm:ss",time=new Date(time),z={M:time.getMonth()+1,d:time.getDate(),h:time.getHours(),m:time.getMinutes(),s:time.getSeconds()};return fmt=fmt.replace(/(M+|d+|h+|m+|s+)/g,(function(v){return((v.length>1?"0":"")+eval("z."+v.slice(-1))).slice(-2)})),fmt.replace(/(y+)/g,(function(e){return time.getFullYear().toString().slice(-e.length)}))}}function getNowDate(){var e=new Date,t=e.getFullYear(),i=e.getMonth()+1,n=e.getDate(),a=e.getHours(),o=e.getMinutes(),r=e.getSeconds(),s=t+"-"+i+"-"+n+" "+a+":"+o+":"+r;return s}function getTimestamp(){return new Date(getNowDate()).getTime()}function getBaseUrl(){var e="https:"==document.location.protocol,t=window.location.host;return t=e?"https://"+t:"http://"+t,t}function getWsUrl(e){var t=e.substr(0,5),i=e.replace("http://","").replace("https://","");return"https"==t?"wss://"+i+"/ws_kefu":"ws://"+i+"/ws_kefu"}function getImageUrl(e,t){var i=e.substr(0,4);return"http"==i?e:t+e}function trim(e,t){return t&&(e=e.replace(new RegExp("^\\"+t+"+|\\"+t+"+$","g"),"")),e.replace(/^\s+|\s+$/g,"")}function emojiGifs(e){for(var t=[],i=["[a]","[b]","[c]","[d]","[e]","[f]","[g]","[h]","[i]","[j]","[k]","[l]","[m]","[n]","[o]","[p]","[q]","[r]","[s]","[t]","[u]","[v]","[w]","[x]","[y]","[z]","[aa]","[bb]","[cc]","[dd]","[ee]","[ff]","[gg]","[hh]","[ii]","[jj]","[kk]","[ll]","[mm]","[nn]","[oo]","[pp]","[qq]","[rr]"],n=0;n/g,"")}function getCompatibleUserMedia(e,t,i){var n=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return n?(n.call(navigator,e,t,i),!0):(console.error("Your browser does not support the getUserMedia API."),!1)}function b64EncodeUnicode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)})))}function urlDecode(e){return decodeURIComponent(e.replace(/\%20/g,"+"))}function b64DecodeUnicode(e){return e=urlDecode(e),decodeURIComponent(atob(e.replace(/\_/g,"/").replace(/\-/g,"+")).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}__webpack_require__("7a82"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,__webpack_require__("ac1f"),__webpack_require__("5319"),__webpack_require__("466d"),__webpack_require__("fb6a"),__webpack_require__("d401"),__webpack_require__("d3b7"),__webpack_require__("25f0"),__webpack_require__("4d63"),__webpack_require__("c607"),__webpack_require__("2c3e"),__webpack_require__("14d9"),__webpack_require__("0eb6"),__webpack_require__("b7ef"),__webpack_require__("8bd4"),__webpack_require__("d81d"),__webpack_require__("81b2");var _default={b64DecodeUnicode:b64DecodeUnicode,b64EncodeUnicode:b64EncodeUnicode,getCompatibleUserMedia:getCompatibleUserMedia,replaceMutiFile:replaceMutiFile,beautifyTime:beautifyTime,getNowDate:getNowDate,playVoice:playVoice,getBaseUrl:getBaseUrl,getWsUrl:getWsUrl,getImageUrl:getImageUrl,trim:trim,emojiGifsMap:emojiGifsMap,replaceHtml:replaceHtml};exports.default=_default},a0f9:function(e,t,i){var n=i("e37b");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i("4f06").default;a("c0ddaaaa",n,!0,{sourceMap:!1,shadowMode:!1})},b900:function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return n}));var n={uniList:i("99b2").default,uniListChat:i("3764").default},a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",{staticClass:"content"},[0!=e.visitorList.length?n("uni-list",{attrs:{border:!0}},e._l(e.visitorList,(function(t){return n("uni-list-chat",{key:t.visitor_id,attrs:{"avatar-circle":!0,clickable:!0,title:t.username,avatar:t.avator,note:e.showLastMessage(t.last_message),time:e.formatTime(t.last_time),"badge-positon":"left","badge-text":e.showUnreadNum(t.unread_num)},on:{click:function(i){arguments[0]=i=e.$handleEvent(i),e.chatVisitor(i,t.visitor_id)}}})})),1):e._e(),0==e.visitorList.length?n("v-uni-view",{staticClass:"flyNotice"},[n("v-uni-view",[n("v-uni-image",{staticStyle:{width:"135px",height:"132px"},attrs:{src:i("dac7")}})],1),n("v-uni-view",{staticStyle:{color:"#333"}},[e._v("暂无在线访客")]),n("v-uni-view",[e._v("没有要处理的对话,休息一下吧")])],1):e._e()],1)},o=[]},dac7:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIcAAACECAYAAAC6czikAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAuFSURBVHhe7Z3pcxNHGofz/3/aqmx2s5WqZbNUkq1KdjcHV8CxsQHb2IDBtoyxkQ/k+0A4EJ2WOv2TmcpIeefsnpn3HXVXPWUXzGhG3Y/7Pj55+66hHA4KJ4cjECeHIxAnhyMQJ4cjECdHCLWThnq13xwr8J297+/kCAER9WCjNVY4OWLi5PBFhmMYJ4cvMhzDODl8keEYxsnhiwzHME4OX2Q4hnFy+CLDMYyTwxcZjmGcHL7IcAzj5PBFhmMYJ4cvMsrGG/1FX+411bOtplqsNtV8taUe6QiYedVS99evwO/4N/wfrsG1uGf3GDg5hiJUIuf1htrRiflit6lmN1vqbqWl/vesbczXj9vq84dt9eV8W337pK1urbQHQlGRWhbEy3Hy9mq09In+K5982VLfL9GJawrk+MtU50988aitvtGy/PC8rSZLJotYObaOmmphq6VuLtvJGaIIksPPp/c76vpCW91YbpORLQ1RchyeNQbFxS9r+QjhJ44cfpCjfPtU5yY6N6MiXgIi5ECFcEFXEn/SWTeVcHmQV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DEPpIOOUmWFiOtarHOc/SygNRcvg5Ors6Uh3nmE2utdQPOW05PaGf9UQ/E5KanmfCHbFyUGBsApv547QH/EWbnBeD/ccmKi01r4sK5AwoLiT0TdikVHJQYPEPmshY64G/dnS6ocsaHVEAv+Pf8H+4Btfa2sdTOqWXw5GWhvodVL2Al8m3vVIAAAAASUVORK5CYII="},e37b:function(e,t,i){var n=i("24fb");t=n(!1),t.push([e.i,"uni-page-body[data-v-65ce8772]{background-color:#eef0f6}body.?%PAGE?%[data-v-65ce8772]{background-color:#eef0f6}",""]),e.exports=t}}]);