function loadExtentFile(filePath, fileType){ if(fileType == "js"){ var oJs = document.createElement('script'); oJs.setAttribute("type","text/javascript"); oJs.setAttribute("src", filePath);//文件的地址 ,可为绝对及相对路径 document.getElementsByTagName("head")[0].appendChild(oJs);//绑定 }else if(fileType == "css"){ var oCss = document.createElement("link"); oCss.setAttribute("rel", "stylesheet"); oCss.setAttribute("type", "text/css"); oCss.setAttribute("href", filePath); document.getElementsByTagName("head")[0].appendChild(oCss);//绑定 } } // 悬浮窗口 function hoverOrLeave(type) { if(type == 1){ document.getElementsByClassName("yb_conct")[0].style.width= '180px'; document.getElementsByClassName("yb_ercode")[0].style.height= '200px'; }else{ document.getElementsByClassName("yb_conct")[0].style.width= '54px'; document.getElementsByClassName("yb_ercode")[0].style.height= '53px'; } }; // 返回顶部 function goTop() { document.getElementsByTagName("body")[0].scrollTop= 0; } loadExtentFile("http://new-im.tracingyun.cn:80/tccrm2_saas_im/lib/im/css/kefu.css", "css"); //================ start of Fingerprint=====================// ;(function(name,context,definition){if(typeof module!=='undefined'&&module.exports){module.exports=definition()}else if(typeof define==='function'&&define.amd){define(definition)}else{context[name]=definition()}})('Fingerprint',this,function(){'use strict';var Fingerprint=function(options){var nativeForEach,nativeMap;nativeForEach=Array.prototype.forEach;nativeMap=Array.prototype.map;this.each=function(obj,iterator,context){if(obj===null){return}if(nativeForEach&&obj.forEach===nativeForEach){obj.forEach(iterator,context)}else if(obj.length===+obj.length){for(var i=0,l=obj.length;i < l;i++){if(iterator.call(context,obj[i],i,obj)==={})return}}else{for(var key in obj){if(obj.hasOwnProperty(key)){if(iterator.call(context,obj[key],key,obj)==={})return}}}};this.map=function(obj,iterator,context){var results=[];if(obj==null)return results;if(nativeMap&&obj.map===nativeMap)return obj.map(iterator,context);this.each(obj,function(value,index,list){results[results.length]=iterator.call(context,value,index,list)});return results};if(typeof options=='object'){this.hasher=options.hasher;this.screen_resolution=options.screen_resolution;this.screen_orientation=options.screen_orientation;this.canvas=options.canvas;this.ie_activex=options.ie_activex}else if(typeof options=='function'){this.hasher=options}};Fingerprint.prototype={get:function(){var keys=[];keys.push(navigator.userAgent);keys.push('affa7be3128cd021f458ae26ca255d72');keys.push(navigator.language);keys.push(screen.colorDepth);if(this.screen_resolution){var resolution=this.getScreenResolution();if(typeof resolution!=='undefined'){keys.push(resolution.join('x'))}}keys.push(new Date().getTimezoneOffset());keys.push(this.hasSessionStorage());keys.push(this.hasLocalStorage());keys.push(this.hasIndexDb());if(document.body){keys.push(typeof(document.body.addBehavior))}else{keys.push(typeof undefined)}keys.push(typeof(window.openDatabase));keys.push(navigator.cpuClass);keys.push(navigator.platform);keys.push(navigator.doNotTrack);keys.push(this.getPluginsString());if(this.canvas&&this.isCanvasSupported()){keys.push(this.getCanvasFingerprint())}if(this.hasher){return this.hasher(keys.join('###'),31)}else{return this.murmurhash3_32_gc(keys.join('###'),31)}},murmurhash3_32_gc:function(key,seed){var remainder,bytes,h1,h1b,c1,c2,k1,i;remainder=key.length&3;bytes=key.length-remainder;h1=seed;c1=0xcc9e2d51;c2=0x1b873593;i=0;while(i < bytes){k1=((key.charCodeAt(i)&0xff))|((key.charCodeAt(++i)&0xff)<<8)|((key.charCodeAt(++i)&0xff)<<16)|((key.charCodeAt(++i)&0xff)<<24);++i;k1=((((k1&0xffff)*c1)+((((k1>>>16)*c1)&0xffff)<<16)))&0xffffffff;k1=(k1<<15)|(k1>>>17);k1=((((k1&0xffff)*c2)+((((k1>>>16)*c2)&0xffff)<<16)))&0xffffffff;h1^=k1;h1=(h1<<13)|(h1>>>19);h1b=((((h1&0xffff)*5)+((((h1>>>16)*5)&0xffff)<<16)))&0xffffffff;h1=(((h1b&0xffff)+0x6b64)+((((h1b>>>16)+0xe654)&0xffff)<<16))}k1=0;switch(remainder){case 3:k1^=(key.charCodeAt(i+2)&0xff)<<16;case 2:k1^=(key.charCodeAt(i+1)&0xff)<<8;case 1:k1^=(key.charCodeAt(i)&0xff);k1=(((k1&0xffff)*c1)+((((k1>>>16)*c1)&0xffff)<<16))&0xffffffff;k1=(k1<<15)|(k1>>>17);k1=(((k1&0xffff)*c2)+((((k1>>>16)*c2)&0xffff)<<16))&0xffffffff;h1^=k1}h1^=key.length;h1^=h1>>>16;h1=(((h1&0xffff)*0x85ebca6b)+((((h1>>>16)*0x85ebca6b)&0xffff)<<16))&0xffffffff;h1^=h1>>>13;h1=((((h1&0xffff)*0xc2b2ae35)+((((h1>>>16)*0xc2b2ae35)&0xffff)<<16)))&0xffffffff;h1^=h1>>>16;return h1>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return true;}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return true;}},hasIndexDb:function(){try{return!!window.indexedDB}catch(e){return true;}},isCanvasSupported:function(){var elem=document.createElement('canvas');return!!(elem.getContext&&elem.getContext('2d'))},isIE:function(){if(navigator.appName==='Microsoft Internet Explorer'){return true}else if(navigator.appName==='Netscape'&&/Trident/.test(navigator.userAgent)){return true}return false},getPluginsString:function(){if(this.isIE()&&this.ie_activex){return this.getIEPluginsString()}else{return this.getRegularPluginsString()}},getRegularPluginsString:function(){return this.map(navigator.plugins,function(p){var mimeTypes=this.map(p,function(mt){return[mt.type,mt.suffixes].join('~')}).join(',');return[p.name,p.description,mimeTypes].join('::')},this).join(';')},getIEPluginsString:function(){if(window.ActiveXObject){var names=['ShockwaveFlash.ShockwaveFlash','AcroPDF.PDF','PDF.PdfCtrl','QuickTime.QuickTime','rmocx.RealPlayer G2 Control','rmocx.RealPlayer G2 Control.1','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)','RealVideo.RealVideo(tm) ActiveX Control (32-bit)','RealPlayer','SWCtl.SWCtl','WMPlayer.OCX','AgControl.AgControl','Skype.Detection'];return this.map(names,function(name){try{new ActiveXObject(name);return name}catch(e){return null}}).join(';')}else{return"";}},getScreenResolution:function(){var resolution;if(this.screen_orientation){resolution=(screen.height>screen.width)?[screen.height,screen.width]:[screen.width,screen.height]}else{resolution=[screen.height,screen.width]}return resolution},getCanvasFingerprint:function(){var canvas=document.createElement('canvas');var ctx=canvas.getContext('2d');var txt='http://valve.github.io';ctx.textBaseline="top";ctx.font="14px 'Arial'";ctx.textBaseline="alphabetic";ctx.fillStyle="#f60";ctx.fillRect(125,1,62,20);ctx.fillStyle="#069";ctx.fillText(txt,2,15);ctx.fillStyle="rgba(102, 204, 0, 0.7)";ctx.fillText(txt,4,17);return canvas.toDataURL()}};return Fingerprint}); //================ end of Fingerprint=====================// function getCookie(key) { var strCookie = document.cookie; var arrCookie = strCookie.split("; "); for (var i = 0; i < arrCookie.length; i++) { var arr = arrCookie[i].split("="); if (arr[0] == key) return arr[1]; } return ""; } function setCookie(obj, value, exp, domain) { var cookieTime = 24 * 60 * 60 * 1000; if (exp && exp!="session") { cookieTime = cookieTime * exp; } var d = new Date(); d.setTime(d.getTime() + cookieTime); var cookieExpires = "; expires=" + d.toGMTString(); var domainStr = ""; if (domain && domain != undefined) { domainStr = "; domain=" + domain; } if ("string" == typeof obj) { document.cookie = obj + "=" + encodeURIComponent(value) + (exp=="session"?"":cookieExpires) + domainStr + "; path=/"; } } var snsid = 'affa7be3128cd021f458ae26ca255d72'; var result = ''; result = snsid+'_'+result; var cookie_sid = getCookie('WEBIM_affa7be3128cd021f458ae26ca255d72'); if(cookie_sid != ''){ result = cookie_sid; }else{ result = 'affa7be3128cd021f458ae26ca255d72_27eab34860894600b1739145abff2842'; setCookie('WEBIM_affa7be3128cd021f458ae26ca255d72', result, 100000); } var signal = 0 ; var data = {}; /****** id:"xxxxxxxxxxxx", name:'webim', email:'webim@cxipcc.com', mobile:'18588888888' ****/ //追加元素 function append(parent, text) { if (typeof text === 'string') { var temp = document.createElement('div'); temp.innerHTML = text; parent.appendChild(temp); }else { parent.appendChild(text); } } var webim = { time : new Date().getTime(), in :"http://new-im.tracingyun.cn:80/tccrm2_saas_im//im/affa7be3128cd021f458ae26ca255d72/userlist.html?snsid=affa7be3128cd021f458ae26ca255d72&orgi=hztracing&client=27eab34860894600b1739145abff2842" , url : "http://new-im.tracingyun.cn:80/tccrm2_saas_im//im/visit/online?snsid=affa7be3128cd021f458ae26ca255d72&orgi=hztracing&client=27eab34860894600b1739145abff2842&userid="+result+"&t="+new Date().getTime() , chat : "http://new-im.tracingyun.cn:80/tccrm2_saas_im//im/visit/imChat.html?snsid=affa7be3128cd021f458ae26ca255d72&orgi=hztracing&client=27eab34860894600b1739145abff2842&userid="+result+"&t="+new Date().getTime()+"&organId=" , refuse :"http://new-im.tracingyun.cn:80/tccrm2_saas_im//im/refuse.html?snsid=affa7be3128cd021f458ae26ca255d72&orgi=hztracing&client=27eab34860894600b1739145abff2842", config : function(d){ data = d ; if(d.id != null && d.id != ''){ result = d.id ; } } , ajax:function(url , success , error) { var xhr = false; signal = signal + 1 ; try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); // ie msxml3.0+(IE7.0及以上) } catch (e) { try{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); //ie msxml2.6(IE5/6) }catch (e2) { xhr = false; } } if (!xhr && typeof XMLHttpRequest != 'undefined') {// Firefox, Opera 8.0+, Safari xhr = new XMLHttpRequest(); } xhr.onreadystatechange = function (data) { if (xhr.readyState == 4) { var status = xhr.status; if (status >= 200 && status < 300) { var event = xhr.responseText ; if(event && event.indexOf('invite') >= 0){ alert('invite'); webim.writeinvite() ; }else if(event && event.indexOf('refuse') >= 0){ alert('refuse'); webim.refuseInvite() ; }else if(event && event.indexOf('accept') >= 0){ alert('accept'); webim.acceptInvite() ; } if(success){ success(event); } } else { // if(error){ error(); } } xhr.abort(); signal = signal - 1 ; } } xhr.open("GET", url , true); try{ xhr.send(null); }catch(e){} }, ping : function(){ var url = webim.url ; if(data){ if(data.id){ url = url + "&id="+data.id ; } if(data.name){ url = url + "&name="+encodeURIComponent(data.name); } if(data.email){ url = url + "&email="+encodeURIComponent(data.email); } if(data.mobile){ url = url + "&mobile="+encodeURIComponent(data.mobile); } url = url + "&title="+encodeURIComponent(document.title.replaceAll("|", "丨")); var traceid = ""; if(traceid){ ul = url+"&traceid="; } url = url+"&url="+encodeURIComponent(location.href) } webim.ajax(url + "&sessionid=c20b03d3-a6a7-452c-bbc4-6405bde358d0&sign="+result+"&t="+new Date().getTime() , function(){console.info('ping 返回');}); }, writepoint:writepoint, openChatDialog:function(){ webim.openChatDialogWithURL(webim.chat); }, openChatDialogWithURL:function(url){ url = url + "&sessionid=c20b03d3-a6a7-452c-bbc4-6405bde358d0" if(data){ if(data.id){ url = url + "&id="+data.id ; } if(data.name){ url = url + "&name="+encodeURIComponent(data.name); } if(data.email){ url = url + "&email="+encodeURIComponent(data.email); } if(data.mobile){ url = url + "&mobile="+encodeURIComponent(data.mobile); } } url = url + "&title="+encodeURIComponent(document.title.replaceAll("|", "丨")); var traceid = ""; if(traceid){ ul = url+"&traceid="; } url = url+"&url="+encodeURIComponent(location.href) ; try{ window.open(url+"&t="+new Date().getTime(), "webim-chat", "height=600, width=850, top="+ (window.screen.availHeight - 30 - 600) /2+", left="+(window.screen.availWidth - 10 - 750)/2+",toolbar=no, menubar=no, scrollbars=no, resizable=no, directories=no,location=no, status=no"); }catch(e){} return false; }, display:function(data){ //writepoint(data); if('1' <= '3'){ writepointOrgan(data); }else{ writepointOtherModel(data); } writepointConsult(data); // 是否显示访客入口 //if(0 != null || '0' != 'null') { if(0 == 0){ document.getElementById("webim-point").style.display = "block" ; }else{ setTimeout(function(){ document.getElementById("webim-point").style.display = "block" ; }, new Number('0')); //延时显示 访客入口 } //} // 是否显示邀请框 if(true == true) { if('5000' == null || '5000' == 'null' || '5000' == 'false'){ document.getElementById("webim-invite-dialog").style.display = "block" ; }else{ setTimeout(function(){ document.getElementById("webim-invite-dialog").style.display = "block" ; }, new Number('5000')); //延时显示 邀请入口 } } }, writeinvite:function(){ document.getElementById('webim-invite-dialog').style.display = "block" ; }, refuseInvite:function(){ document.getElementById('webim-invite-dialog').style.display = "none" ; webim.ajax(webim.refuse + "&userid="+result+"&sessionid=c20b03d3-a6a7-452c-bbc4-6405bde358d0&t="+new Date().getTime()); }, acceptInvite:function(){ document.getElementById('webim-invite-dialog').style.display = "none" ; }, check:function(){ var checkTimes = 0 ; setInterval(function(){ if(signal <= 0){ checkTimes++ ; }else{ checkTimes = 0 ; } if(checkTimes >= 3){ //检查当前的 Keep-Alive是否存活,检查3次都处于未存活状态,则启动 // signal = 0 ; checkTimes = 0 ; webim.ping(); console.log("优客服客户端信息校对"); } },5000) ; } } function openAgentChatDialog(url){ return webim.openChatDialogWithURL(url) ; } function writepoint(data){ var invite = "
" +"
" +" " +" " +"

在线客服

" +"
" +"
" +"
" +" " +" " +"

客服热线

" +" " +" " +" " +"
" +"
" +"
" +" " +" " +"

返回顶部

" +"
" +"
" +"
" ; append(document.body, invite); document.getElementById("webim-tel").onmouseover=function(){ document.getElementById("webim-tel-number").style.display = 'block'; document.getElementById("webim-tel-arrow").style.display = 'block'; document.getElementById("webim-tel-arrow-bg").style.display = 'block'; } document.getElementById("webim-tel").onmouseout=function(){ document.getElementById("webim-tel-number").style.display = 'none'; document.getElementById("webim-tel-arrow").style.display = 'none'; document.getElementById("webim-tel-arrow-bg").style.display = 'none'; } } //邀请技能组框 function writepointOrgan(data){ var STYLE = 'text-align:center;height: 150px;border-radius: 30px;width: 40px;margin: 0px 5px 0 0; float:left ; word-wrap: break-word;overflow: hidden;font-size:15px;color:#FFFFFF;text-align: center;padding-top: 15px;border: 1px solid #DCDCDC;background-color:#008df3;'; if('1' == '2'){ STYLE = 'height: 70px;border-radius: 3px; width: 70px;margin: 40px auto;word-wrap:break-word;overflow:hidden;font-size: 22px;color:#FFFFFF;text-align:center;padding-top:10px;border: 1px solid #DCDCDC;background-color:#dddddd;'; }else if('1' == '3'){ STYLE = 'height: 70px;border-radius: 70px; width: 70px;margin: 40px auto;word-wrap:break-word;overflow:hidden;font-size: 22px;color:#FFFFFF;text-align:center;padding-top:5px;border: 1px solid #DCDCDC;background-color:#dddddd;'; } var TEXT = 'width:25px;'; if('1' == '2'){ TEXT = 'width:100%;'; }else if('1' == '3'){ TEXT = 'width:100%;'; } var POSITION = 'right:10px;top:40%;'; if('right,middle' == 'right,top'){ POSITION = 'right:10px;top:10px;'; }else if('right,middle' == 'right,bottom'){ POSITION = 'right:10px;bottom:10px;'; }else if('right,middle' == 'right,middle'){ POSITION = 'right:10px;top:40%;'; }else if('right,middle' == 'left,top'){ POSITION = 'left:10px;top:10px;'; }else if('right,middle' == 'left,middle'){ POSITION = 'left:10px;top:40%;'; }else if('right,middle' == 'left,bottom'){ POSITION = 'left:10px;bottom:10px;'; } var CONSULTTHEME = 'background-color: #377FED !important;'; if('1' == '2'){ CONSULTTHEME = 'background-color: #67CAFF !important;'; }else if('1' == '3'){ CONSULTTHEME = 'background-color: #8E8E8E !important;'; }else if('1' == '4'){ CONSULTTHEME = 'background-color: #32c24d !important;'; }else if('1' == '5'){ CONSULTTHEME = 'background-color: #E45DB3 !important;'; }else if('1' == '6'){ CONSULTTHEME = 'background-color: #FF626F !important;'; } var skillHtml = ''; if('false' == 'true'){ skillHtml += "" +"
" +"
" +"
" // +" " ; if('智能客服' != null && '智能客服' != 'null' && '智能客服' != ''){ skillHtml += "智能客服"; } skillHtml += "" +"
" +"
" ; if('' == null || '' == 'null' || '' == ''){ skillHtml += "" +" " ; }else{ if('' == 'image'){ skillHtml += "" +" " ; }else{ skillHtml += "" +"
" ; } } skillHtml += "" +"
" ; if('false' == 'true'){ skillHtml += "工作时间 08:30~17:30"; } skillHtml += "" +"
" ; for(var i=0; i < data.organList.length; i ++){ if(i < '5'){ skillHtml += "" +"
" +" "+data.organList[i].name+"("+data.organList[i].organUserList.length+")" +"
"; if('false' == 'true'){ skillHtml += "" +" "; } } } if(data.organList.length <= 0 && 'false' == 'true' && '' != null){ skillHtml += "
" ; } skillHtml = skillHtml +"
" +"
" +" 智能客服系统" +"
" +"
" +"
" ; } var invite = ''; append(document.body, invite);//=====技能组 if('false' == 'true'){ document.getElementById("webim-im-point-text").onclick=function(){ if(document.getElementById("ichatContent").style.display == "none"){ document.getElementById("ichatContent").style.display = 'block'; }else{ document.getElementById("ichatContent").style.display = 'none'; } } }else{ document.getElementById("webim-point").onclick=function(){ webim.openChatDialog(); } } if('' != null && '' != 'null' && '' != ''){ var inviteAdHtml = ''; if('' =="image"){ inviteAdHtml += ""; }else{ inviteAdHtml += "
"; } var inviteBody = document.getElementById('webim_consult_body'); if(inviteBody){ inviteBody.innerHTML = inviteAdHtml ; } } } //邀请技能组框,其他类型 function writepointOtherModel(data){ var POSITION = 'right:10px;top:40%;'; if('right,middle' == 'right,top'){ POSITION = 'right:10px;top:10px;'; }else if('right,middle' == 'right,bottom'){ POSITION = 'right:10px;bottom:10px;'; }else if('right,middle' == 'right,middle'){ POSITION = 'right:10px;top:40%;'; }else if('right,middle' == 'left,top'){ POSITION = 'left:10px;top:10px;'; }else if('right,middle' == 'left,middle'){ POSITION = 'left:10px;top:40%;'; }else if('right,middle' == 'left,bottom'){ POSITION = 'left:10px;bottom:10px;'; } var CONSULTTHEME = 'background-color: #377FED !important;'; var CONSULTTOP = 'background: url(\'http://new-im.tracingyun.cn:80/tccrm2_saas_im/lib/im/images/webAccess/1/fixCont1.png\') no-repeat 0 0;'; var CONSULTPHONE = 'background: url(\'http://new-im.tracingyun.cn:80/tccrm2_saas_im/lib/im/images/webAccess/1/fixCont1.png\') no-repeat 0 -57px;'; var CONSULTQQ = 'background: url(\'http://new-im.tracingyun.cn:80/tccrm2_saas_im/lib/im/images/webAccess/1/fixCont1.png\') no-repeat 0 -113px;'; var CONSULTERCODE = 'background: url(\'http://new-im.tracingyun.cn:80/tccrm2_saas_im/lib/im/images/webAccess/1/fixCont1.png\') no-repeat 0 -169px;'; if('1' == '2'){ CONSULTTHEME = 'background-color: #67CAFF !important;'; }else if('1' == '3'){ CONSULTTHEME = 'background-color: #8E8E8E !important;'; }else if('1' == '4'){ CONSULTTHEME = 'background-color: #32c24d !important;'; }else if('1' == '5'){ CONSULTTHEME = 'background-color: #E45DB3 !important;'; }else if('1' == '6'){ CONSULTTHEME = 'background-color: #FF626F !important;'; } var invite = '
' +'
' +' ' +'
' +'
' ; append(document.body, invite);//=====技能组 } //邀请咨询框 function writepointConsult(data){ var INVITETHEME = 'background-color: #377FED !important;'; if('1' == '2'){ INVITETHEME = 'background-color: #67CAFF !important;'; }else if('1' == '3'){ INVITETHEME = 'background-color: #8E8E8E !important;'; }else if('1' == '4'){ INVITETHEME = 'background-color: #32c24d !important;'; }else if('1' == '5'){ INVITETHEME = 'background-color: #E45DB3 !important;'; }else if('1' == '6'){ INVITETHEME = 'background-color: #FF626F !important;'; } //===============咨询========================// var consult = ''; consult += '' +'' ; append(document.body, consult); var inviteDialog = document.getElementById('webim-invite-dialog'); if('false' == 'true'){ inviteDialog.style.bottom = 0 ; }else{ var height = document.documentElement.clientHeight ; var width = document.documentElement.clientWidth ; var top = (50 - 92*100/height)+"%"; var left = (50 - 210*100/width)+"%" ; inviteDialog.style.top = top ; inviteDialog.style.left = left ; } } //获取数据并显示 webim.ajax("http://new-im.tracingyun.cn:80/tccrm2_saas_im//im/visit/getInviteDate?snsid=affa7be3128cd021f458ae26ca255d72&orgi=hztracing&client=27eab34860894600b1739145abff2842&userid="+result+"&t="+new Date().getTime() , function(data){ if(typeof(data) == 'string'){ data = JSON.parse(data); } webim.display(data); // webim.check(); } );