var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); var facilitator_id='1';var local_cookie='cookie'; var information_switch=''; var acc_host='accwww13.53kf.com';var companyid='72577221';var hz6d_guest_ip='207.241.233.247';var ipstr='%E7%BE%8E%E5%9B%BD';var areastr='%E5%8A%A0%E5%88%A9%E7%A6%8F%E5%B0%BC%E4%BA%9A%2D%E6%97%A7%E9%87%91%E5%B1%B1';var ipContinent='%E5%8C%97%E7%BE%8E%E6%B4%B2';var in_timestamp='1657044732179';var hz6d_guest_id='11525611848000';var hz6d_style_id= '3';var hz6d_alias_host='https://web.archive.org/web/20220705181212/https://www13.53kf.com';var company_site={};var mnone=0;var hz6d_device='';var get_gdt_openid='0';var kf_sign='zA0NDMTY1NczMjExNTI1NjExODQ4MDAwNzI1NzcyMjE%3D';var cloud_service=''; try{var local_guest_id=localStorage["53kf_guest_id"];if (local_guest_id!=""&&local_guest_id!=undefined) {hz6d_guest_id=local_guest_id;}else{localStorage["53kf_guest_id"]=hz6d_guest_id;}}catch(e){} var force_kf = "";//强制对话携带的客服,原kf_ivt_new.php定义,防止品房阁强制对话时kf_ivt_new没加载完成,这里预定义 try{ if(hz6d_device == "android"){ var android_guest_id = Android.giveInformation(null); if(android_guest_id){ hz6d_guest_id = android_guest_id; }else if(hz6d_guest_id != "0"){ Android.writeData(hz6d_guest_id.toString()); } } }catch(e){} in_timestamp = parseInt(in_timestamp/1000); var http_pro = (document.location.protocol == 'https:')?'https://':'http://'; onliner_zdfq = 0; //indexOf低版本ie兼容 if(!Array.prototype.indexOf){ Array.prototype.indexOf = function(val){ var value = this; for(var i =0; i < value.length; i++){ if(value[i] == val) return i; } return -1; }; } (function(window, undefined) { var w = window, d = document, dd = d.documentElement, db = d.body,// db kf.php在head中时获取不到 head = d.head || d.getElementsByTagName("head")[0] || dd, isStrict = d.compatMode == "CSS1Compat", m = Math.max, ua = navigator.userAgent, np = navigator.platform, EN = w.encodeURIComponent, DE = w.decodeURIComponent; var $53 = function(id) {return d.getElementById(id) ? d.getElementById(id) : null}; $53.version = '1.0.0'; $53.global = {}; $53.getKFscript = function(){ if (typeof $53.global[''] == 'undefined' || $53.global[''] == null) { var scripts = document.getElementsByTagName('script'), len = scripts.length, i = 0; for(;i 1) return; if (ie) { (function () { if (!isReady) { try { d.documentElement.doScroll('left'); run(); } catch (err) { setTimeout(arguments.callee, 0); } } })(); } else if (wk) { var t = setInterval(function () { if (/^(loaded|complete)$/.test(d.readyState)) clearInterval(t), run(); }, 0); } }; })(); $53.forEach = function(enumerable, iterator, context) { var i, n, t; if (typeof iterator == "function" && enumerable) { // Array or ArrayLike or NodeList or String or ArrayBuffer n = typeof enumerable.length == "number" ? enumerable.length: enumerable.byteLength; if (typeof n == "number") { if (Object.prototype.toString.call(enumerable) === "[object Function]") { return enumerable; } for (i = 0; i < n; i++) { t = enumerable[i]; t === undefined && (t = enumerable.charAt && enumerable.charAt(i)); iterator.call(context || null, t, i, enumerable); } // enumerable is number } else if (typeof enumerable == "number") { for (i = 0; i < enumerable; i++) { iterator.call(context || null, i, i, i); } // enumerable is json } else if (typeof enumerable == "object") { for (i in enumerable) { if (enumerable.hasOwnProperty(i)) { iterator.call(context || null, enumerable[i], i, enumerable); } } } } return enumerable; }; $53.type = (function() { var objectType = {}, nodeType = [, "HTMLElement", "Attribute", "Text", , , , , "Comment", "Document", , "DocumentFragment", ], str = "Array Boolean Date Error Function Number RegExp String", retryType = { 'object': 1, 'function': '1' }, toString = objectType.toString; $53.forEach(str.split(" "), function(name) { objectType["[object " + name + "]"] = name.toLowerCase(); $53["is" + name] = function(unknow) { return $53.type(unknow) == name.toLowerCase(); } }); return function(unknow) { var s = typeof unknow; return ! retryType[s] ? s: unknow == null ? "null": unknow._type_ || objectType[toString.call(unknow)] || nodeType[unknow.nodeType] || (unknow == unknow.window ? "Window": "") || "object"; }; })(); $53.isObject = function(unknow) { return typeof unknow === "function" || (typeof unknow === "object" && unknow != null) }; $53.isPlainObject = function(unknow) { var key, hasOwnProperty = Object.prototype.hasOwnProperty; if ($53.type(unknow) != "object") { return false; } if (unknow.constructor && !hasOwnProperty.call(unknow, "constructor") && !hasOwnProperty.call(unknow.constructor.prototype, "isPrototypeOf")) { return false; } for (key in unknow) {} return key === undefined || hasOwnProperty.call(unknow, key); }; $53.kfextend = function(depthClone, object) { var second, options, key, src, copy, i = 1, n = arguments.length, result = depthClone || {}, copyIsArray, clone; $53.isBoolean(depthClone) && (i = 2) && (result = object || {}); ! $53.isObject(result) && (result = {}); for (; i < n; i++) { options = arguments[i]; if ($53.isObject(options)) { for (key in options) { src = result[key]; copy = options[key]; if (src === copy) { continue; } if ($53.isBoolean(depthClone) && depthClone && copy && ($53.isPlainObject(copy) || (copyIsArray = $53.isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && $53.isArray(src) ? src: []; } else { clone = src && $53.isPlainObject(src) ? src: {}; } result[key] = $53.kfextend(depthClone, clone, copy); } else if (copy !== undefined) { result[key] = copy; } } } } return result; } $53.kfextend($53, { $: function(id) { return d.getElementById(id) ? d.getElementById(id) : null; }, EN: EN, DE: DE, isStrict: isStrict, counter:1, //计数器 data: function(key, value) { if(typeof value == 'undefined') { return $53.global[key] === undefined ? null : $53.global[key]; } else { $53.global[key] = value; } }, trim: function(text) { //return text == null ? "": (text + "").replace(new RegExp('(^[\\\\s\\\\t\\\\xa0\\\\u3000\\\\uFEFF]+)|([\\\\u3000\\\\xa0\\\\s\\\\t\\\\uFEFF]+\\x24)', 'g'), ''); return text == null ? "": (text + "").replace(new RegExp('(^[\\s\\t\\xa0\\u3000\\uFEFF]+)|([\\u3000\\xa0\\s\\t\\uFEFF]+\x24)', 'g'), ''); }, getOs: function() { var allOs = ['iphone', 'android', 'macos', 'linux', 'win2008', 'win8', 'win7', 'winvista', 'win98', 'win2000', 'win2003', 'winxp', 'os_other']; var isWin = (np == "Win32") || (np == "Windows") || (np == "Win64"); if (isWin) { var winos = { 'win98': '(Win98)|(Windows 98)', 'win2000': '(Windows NT 5.0)|(Windows 2000)', 'winxp': '(Windows NT 5.1)|(Windows XP)', 'win2003': '(Windows NT 5.2)|(Windows 2003)', 'win7': '(Windows NT 6.1)|(Windows 7)', 'winvista': '(Windows NT 6.0)|(Windows Vista)', 'win8': '(Windows NT 6.2)|(Windows 8)', 'win2008': '(Windows NT 6.1)|(Windows 2008)' }; for (var i in winos) { if (winos.hasOwnProperty(i) && (new RegExp(winos[i], 'i')).test(ua)) return i; } } var isMac = (np == "Mac68K") || (np == "MacPPC") || (np == "Macintosh") || (np == "MacIntel"); if (isMac) return "macos"; if ((np == "X11") && !isWin && !isMac) return "unix"; if ((np.toLowerCase() + ua.toLowerCase()).indexOf('iphone') > -1) return 'iphone'; if (np.toLowerCase().indexOf("linux") > -1 && ua.toLowerCase().indexOf('android') > -1) return 'android'; if (np.indexOf("Linux") > -1) return "linux"; return "os_other"; }, isMobile: function() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = 'n'; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = 'y'; break; } } return flag; }, getUrlHost: function(url) { if(typeof url == "undefined" || url == "") return ""; var domain = url.split("/"); if(domain[2]) domain = domain[2]; else domain = ""; return domain; }, getUrlParam: function() { var url = location.search; var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=strs[i].split("=")[1]; } } return theRequest; }, getBrowser: function() { var browsers = { 'sogou': 'sogou', 'maxthon': 'maxthon', 'opera': 'opera', 'qq': 'tencent', 'uc': 'uc', '360': '360', 'firefox': 'firefox', 'chrome': 'chrome', 'safari': 'safari', 'ie10': 'msie 10', 'ie9': 'msie 9', 'ie8': 'msie 8', 'ie7': 'msie 7', 'ie6': 'msie 6', 'ie5': 'msie 5' }; for (var i in browsers) { if (browsers.hasOwnProperty(i) && (new RegExp(browsers[i], 'i')).test(ua)) return i; } return 'ua_other'; }, getScreen: function() { return screen.width + "_" + screen.height; }, setCookie: function(key,value,options) { if (!$53.isCookieKey(key)) {return;} options = options || {}; var expires = options.expires; try{ if((facilitator_id == "36" || facilitator_id=="24" || local_cookie == 'localStorage') && window.localStorage && window.sessionStorage){ if('number' == typeof options.expires){ expires = new Date().getTime() + options.expires*1000; window.localStorage.setItem(key,JSON.stringify({data:value,time:expires})); }else{ window.sessionStorage.setItem(key,value); } return; } }catch(e){} if ('number' == typeof options.expires) { expires = new Date(); expires.setTime(expires.getTime() + options.expires*1000); } document.cookie = key + "=" + EN(value) + (options.path ? "; path=" + options.path : "") + (expires ? "; expires=" + expires.toUTCString() : "") + ("; domain=" + (options.domain ? options.domain : location.hostname)) + (options.secure ? "; secure" : ""); }, getCookie: function(key) { try{ if((facilitator_id == "36" || facilitator_id=="24" || local_cookie == 'localStorage') && window.localStorage && window.sessionStorage){ if(typeof window.localStorage.getItem(key) == "string"){ var dataObj = JSON.parse(window.localStorage.getItem(key)); if (new Date().getTime() - dataObj.time > 0) { return ""; }else{ return dataObj.data; } } if(typeof window.sessionStorage.getItem(key) == "string"){ return window.sessionStorage.getItem(key); } } }catch(e){} if ($53.isCookieKey(key)) { var reg = new RegExp('(^| )' + key + '=([^;]*)(;|$)'), result = reg.exec(document.cookie); if (result) { var value = (result[2] === undefined || result[2] === null) ? '' : result[2]; } } if ('string' == typeof value) { return DE(value); } return ''; }, isCookieKey:function(key) { // return (new RegExp('^[^\\\\x00-\\\\x20\\\\x7f\\\\(\\\\)<>@,;:\\\\\\\\\\\\"\\\\[\\\\]\\\\?=\\\\{\\\\}\\\\/\\\\u0080-\\\\uffff]+\\x24')).test(key); return (new RegExp('^[^\\x00-\\x20\\x7f\\(\\)<>@,;:\\\\\\"\\[\\]\\?=\\{\\}\\/\\u0080-\\uffff]+\x24')).test(key); }, setKfCookie:function(data){ //设置主域名53kf.com下的cookie data为二维数组 [['name1','张三',0],['name2','李四',3600]] 第三个参数为过期时间 0:回话 -1:永久 时间戳:过期时间 var _this = this; var url = "//web.archive.org/web/20220705181212/https://tb.53kf.com/code/ck/"; var param = new Array(); for (var i=0;i').replace(/&douhao/g, ",").replace(/&jinghao/g, '#'); }, creElm: function(o, t, a, loc) { loc = loc || 0; if(companyid === '72202088') loc = 1; var b = d.createElement(t || 'div'), c = (a || d.body || dd); for (var p in o) { if (!o.hasOwnProperty(p)) continue; p == 'style' ? b[p].cssText = o[p] : b[p] = o[p]; if(p == 'id' && $53(o[p])) $53(o[p]).parentNode.removeChild($53(o[p])); } if (!loc) return c.insertBefore(b, c.firstChild); else return $53.insertAfter(b, c.lastChild); }, insertAfter: function(newEl, targetEl) { var parentEl = targetEl.parentNode; if(parentEl.lastChild == targetEl) { return parentEl.appendChild(newEl); }else { return parentEl.insertBefore(newEl,targetEl.nextSibling); } }, createScript: function(id,url){ $53.creElm({ 'id':id == '' ? 'hz6d_script_' + Math.random() : id, 'src':url, 'charset':'utf-8' },'script',head); }, before: function(html, elem){ var frag = d.createDocumentFragment(), div=d.createElement('div'); div.innerHTML = html; frag.appendChild(div); return (elem.parentNode || d.body || dd).insertBefore(div.firstChild.cloneNode(true), elem); frag = null; }, after: function(html, elem){ var frag = d.createDocumentFragment(), div=d.createElement('div'); div.innerHTML = html; frag.appendChild(div); return $53.insertAfter(div.firstChild.cloneNode(true), elem); frag = null; }, insertFixed: function(html){ // 图标嵌入固定模式用 // $53.ready(function(){ var script = $53.getKFscript(), elem = null; if (script.parentNode == head) elem = $53.before(html, d.body.firstChild); else elem = $53.after(html, script); }); }, getTimeTo24: function(){ //get senconds time from now to tomorrow 00:00 var d1 = new Date(), d2 = new Date(); d1.setDate(d1.getDate() + 1); d1.setHours(0); d1.setMinutes(0); d1.setSeconds(0); return (d1.getTime() - d2.getTime())/1000; }, json2str : function(json,code){ var arr = []; var encode = code == 'urlencode' ? $53.EN : function(data){return data}; for(var i in json) { if (json.hasOwnProperty(i)) { arr.push(i + '=' + encode(json[i])); } } return arr.join('&'); }, addEvent : function( obj, type, fn ) { if ( obj.attachEvent ) { obj['e'+type+fn] = fn; obj[type+fn] = function(){obj['e'+type+fn]( window.event );} obj.attachEvent( 'on'+type, obj[type+fn] ); } else { obj.addEventListener( type, fn, false ); } }, removeEvent : function( obj, type, fn ) { if ( obj.detachEvent ) { obj.detachEvent( 'on'+type, obj[type+fn] ); obj[type+fn] = null; } else { obj.removeEventListener( type, fn, false ); } }, callBackPhone:function(data){ //var data_json = eval('('+data+')'); var data_json = data; if(data_json.code == 0){ location.href='tel:'+data_json.msg; }else{ alert("客服繁忙!"); } } }); //对外开放接口 $53.kfextend($53, { $: function(id) { return d.getElementById(id) ? d.getElementById(id) : null; }, EN: EN, DE: DE, isStrict: isStrict, online : 'false', terminal : 'pc', openurl : '', workers : [], groups : [], groupIds : [], popParam : '', apiArr : [], uuid : '', host : '', sign : '', callBackArr:{}, isTalk:'', talkApiArr:{}, createApi:function(){ var api = new _53API(this.online,this.terminal,this.openurl,this.workers,this.groups,this.groupIds); this.apiArr.push(api); return api; }, setOnline : function(online){ this.online = online; }, setUrl : function(url){ this.openurl = url; }, setTerminal : function(terminal){ if(terminal == 'mobile'){ this.terminal = 'mobile'; } }, apiOnload : function (terminal){ if (this.talkApiArr.type != undefined) { var client_api = $53.createApi(); client_api.openClinet(this.talkApiArr.type, this.talkApiArr.group_id, this.talkApiArr.worker_id, this.talkApiArr.id6d); } }, setIsTalk : function(isTalk){ this.isTalk = isTalk; $53.data("is_talk",isTalk); try{ if(typeof handle_is_talk == "function") handle_is_talk(); }catch(e){} }, setWorkers : function(workers){ this.workers = workers; }, setGroups : function(groups){ this.groups = groups; for(var i=0;i40) return _this.reback('601','custom_info length cannot exceed 40'); var script_id = 'kf_script_guest'; var url = hz6d_alias_host+'/kfapi_guest.php?company_id='+companyid+'&guest_id='+hz6d_guest_id+'&u_cust_id='+id+'&u_cust_name='+name+'&email='+email+'&qq='+qq+'&phone='+phone+'&company='+company+'&address='+address+'¬es='+notes+'&custom_info='+custom_info+'&id='+encodeURIComponent($53.uuid); $53.createScript(script_id,url); break; case 'status': return _this.reback('201',_this.online); break; case 'grouplist': return _this.reback('201',_this.groups); break; case 'workerlist': return _this.reback('201',_this.workers); break; case 'jzl': case 'mxsj': case 'xsgl': var data = $53.trim(_this.param.stat_id); _this.saveData(_this.param.cmd,data); break; case 'stat': var type = $53.trim(_this.param.id); var data = $53.trim(_this.param.stat_id); _this.saveData(type,data); case 'lword': var msg = $53.trim(_this.param.msg); if(msg == "") return _this.reback('601','msg is null'); var name = $53.trim(_this.param.name ? _this.param.name : ""); var email = $53.trim(_this.param.email ? _this.param.email : ""); var qq = $53.trim(_this.param.qq ? _this.param.qq : ""); var phone = $53.trim(_this.param.phone ? _this.param.phone : ""); var company = $53.trim(_this.param.company ? _this.param.company : ""); var address = $53.trim(_this.param.address ? _this.param.address : ""); var notes = $53.trim(_this.param.notes ? _this.param.notes : ""); _this.saveLword(_this.param.cmd,msg,name,email,qq,phone,company,address,notes); break; case 'callphone': var id6d = $53.trim(_this.param.id6d ? _this.param.id6d : ""); var call = $53.trim(_this.param.call ? _this.param.call : ""); var worker_id = $53.trim(_this.param.worker_id ? _this.param.worker_id : ""); var reg = /^((0\d{2,3}-?\d{7,8})|(1[3-9]\d{9}))$/; if(call != "" && !reg.test(call)) return _this.reback('601','error call'); // if(id6d=="" && worker_id == "") return _this.reback('602','worker_id and id6d cannot be empty at the same time'); _this.savePhone(call,id6d,worker_id); break; case 'callpriphone': var worker_id = $53.trim(_this.param.worker_id ? _this.param.worker_id : ""); _this.savePriPhone(worker_id); break; case 'comeinfo': var title = $53.trim(_this.param.title); var logo = $53.trim(_this.param.logo); var content = $53.trim(_this.param.content); var curl = $53.trim(_this.param.curl); var sendtype = typeof _this.param.sendtype == "undefined" ? '0' : $53.trim(_this.param.sendtype); _this.saveCinfo(logo,title,content,curl,sendtype); break; case 'custmsg': var msg = $53.trim(_this.param.msg).replace(/<[^>]+>/g,""); var type = $53.trim(_this.param.type);//0不打开窗口,1打开浮框,2打开新窗口 if(msg == "") return _this.reback('601','msg cannot null'); var callback = ""; if(type == "1"){ if(_this.terminal == 'pc'){ callback = "hz6d_startReautoTimer2(3)"; }else{ callback = "change_kf_openurl()"; } }else if(type == "2"){ if(_this.terminal == 'pc'){ callback = 'window.open("'+_this.openurl+'","_blank","height=600,width=800,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=no,location=no,titlebar=no")'; }else{ callback = 'location.href = "'+_this.openurl+'"'; } } _this.saveCustMsg(msg,callback); break; default: return _this.reback('601','error cmd'); break; } }, this.talk = function(type,zdkf_type,kf){ var _this = this; var param = kf != '' ? ('&zdkf_type='+zdkf_type+'&kf='+kf) : ''; if(_this.terminal == 'mobile'){ _this.setPopParam(param); change_kf_openurl(param); } }, this.openkf = function(type,zdkf_type,kf){ var _this = this; var param = kf != '' ? ('&zdkf_type='+zdkf_type+'&kf='+kf) : ''; if(type == 'new'){ var url = _this.openurl+param; if(_this.terminal == 'pc'){ window.open(url,"_blank","height=600,width=800,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=no,location=no,titlebar=no"); }else{ location.href = url; } }else{ if(_this.terminal == 'pc'){ _this.setPopParam(param); hz6d_startReautoTimer2(3); }else{ show_mobile_chat(); } } }, this.openClinet = function(type, group_id, worker_id, id6d) { var _this = this; if(((group_id != '' && (worker_id != '' || id6d != '')) || (worker_id != '' && id6d != ''))){ console.log('worker_id and group_id and id6d can only choose one'); } var zdkf_type = 1; var kf = worker_id; if (id6d != '') { var workers = $53.data('workers'); id6ds = id6d.split(','); kf = ''; var tmpid = ''; for(var i=0; i < id6ds.length; i++){ if (typeof workers[id6ds[i]] == 'undefined') { tmpid = id6ds[i]; }else{ tmpid = workers[id6ds[i]].worker_id; } if (kf != '') tmpid = ','+tmpid; kf = kf + tmpid; } } if(group_id != ''){ zdkf_type = 3; kf = group_id; } if(type == "new" || _this.terminal != 'mobile') _this.openkf(type,zdkf_type,kf); else _this.talk(type,zdkf_type,kf); } this.saveData = function(type,data){ $53.sendData(type,data); }, this.saveLword = function(type,msg,name,email,qq,phone,company,address,notes){ $53.sendLword(type,msg,name,email,qq,phone,company,address,notes); }, this.savePhone = function(call,id6d,worker_id){ $53.callPhone(call,id6d,worker_id); }, this.savePriPhone = function(worker_id){ $53.callPriPhone(worker_id); }, this.saveCinfo = function(logo,title,content,curl,sendtype){ $53.comeInfo(logo,title,content,curl,sendtype); }, this.saveCustMsg = function(msg,callback){ $53.addCustMsg(msg,callback); } this.openUrl = function(url,resize){ //内部调用接口 用来点击打开咨询页面 window.open(url,"_blank","height=470,width=702,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable="+resize+",scrollbars=no,location=no,titlebar=no"); }, this.reback = function(code,info,clear){ //返回信息 var _this = this; var data = {}; if(code == '201'){ data = {code:code,cmd:_this.param.cmd,info:info}; }else{ data = {code:code,info:info}; } if(clear !== false){ _this.param = {}; //清空参数 } return data; } } // window.open 方法重写 // 支持ie/ff/chrome/safari/opera var _open = window.open; window.open = function(sURL, sName, sFeatures, bReplace) { if (sURL == undefined) { sURL = '' } if (sName == undefined) { sName = "" } if (sFeatures == undefined) { sFeatures = "" } if (bReplace == undefined) { bReplace = false } if (/webCompany.php|webClientMin.php/.test(sURL)) { sURL += '&timeStamp=' + new Date().getTime() + '&ucust_id=' + $53.EN($53.getCookie('ucust_id')); } else if ('$zdyurl' != '') { var _zdyurl = '$zdyurl'; if (sURL.indexOf(_zdyurl) > -1) { sURL += '&timeStamp=' + new Date().getTime() + '&ucust_id=' + $53.EN($53.getCookie('ucust_id')); } } try{sURL = sURL.replace('&referer={hz6d_referer}',hz6d_referer);}catch(e){} var win = _open(sURL, sName, sFeatures, bReplace); return win; } window.$53 = $53; })(window); /* ↓图标相关函数↓ */ function hz6d_html_replace(html) { if(html.indexOf('{hz6d_keyword}') == -1) { return html.replace(/%7Bhz6d_keyword%7D/gim, encodeURIComponent(hz6d_from_page_new) + "&tfrom=1"); }else{ return html.replace(/{hz6d_keyword}/gim, hz6d_from_page_new + "&tfrom=1"); } } function hz6d_is_exist(html){ if (typeof(hz6d_showContent) == "function" && hz6d_showContent && typeof(hz6d_ID('hz6d_chatting_iframes')) != undefined){ hz6d_showContent(); }else{ var new_clic = html.replace(/#liyc#/g,"\'"); eval(decodeURIComponent(new_clic)); } } function hz6d_is_exists(html,kf){ if (typeof(hz6d_showContent) == "function" && hz6d_showContent && typeof(hz6d_ID('hz6d_chatting_iframes')) != undefined){ hz6d_showContent(kf); }else{ eval(decodeURIComponent(html)); } } // has defined function hasdoctype() { if (document.compatMode == "BackCompat") { ret = false; } else { ret = true; } return ret; } function detectBrowser() { var ret = "ie6"; // default var user_agent = navigator.userAgent; if (user_agent.indexOf("compatible") > -1) { if (user_agent.indexOf("MSIE 6.0") > -1) { ret = "ie6"; } else if (user_agent.indexOf("MSIE 7.0") > -1) { ret = "ie7"; } else if (user_agent.indexOf("MSIE 8.0") > -1) { ret = "ie8"; } if (user_agent.indexOf("360") > -1) { ret = "360"; } } else if (user_agent.indexOf("Gecko") > -1) { ret = "firefox"; } if (user_agent.indexOf("TheWorld") > -1) { ret = "TheWorld"; } return ret; } // 间距小于步进,则移动间距的距离 function smoothMove(start, end) { var step = Math.abs(end - start); var forword = end - start; if (step > 2) { step = Math.ceil(step * 0.2) * (forword / Math.abs(forword)); } else { step = step * (forword / Math.abs(forword)); } posi = start + step; if (step > 0) { if (posi > end) posi = end; } else { if (posi < end) posi = end; } return posi; } var hasdoctype = hasdoctype(); var browser = detectBrowser(); // 点击图标设置变量 function setIsinvited() { try { onliner_zdfq = 2; if (acc_autotype == 3) { document.cookie = "onliner_zdfq"+companyid+"=" + onliner_zdfq; } } catch (e) {} } /* ↑图标相关函数↑ */ // 设置 新老访客 function set53gidCookie(key,value,expire){ $53.setCookie(key,value,{ "expires":expire }); switch(key){ case '53gid2': // new visitor $53.setCookie('visitor_type','new'); break; case '53gid0': $53.data('is_uv',1); break; case '53gid1': $53.data('is_rv',1); break; } } if(!$53.getCookie('53gid2')) { set53gidCookie('53gid2',hz6d_guest_id,10*365*24*3600); } else if($53.getCookie('53gid2')) { var hz6d_53gid2 = $53.getCookie('53gid2'); // old visitor if(hz6d_guest_id == hz6d_53gid2){ $53.setCookie('visitor_type','old'); hz6d_guest_id = $53.getCookie('53gid2'); }else{ set53gidCookie('53gid2',hz6d_guest_id,10*365*24*3600); } } // set my site uid -> crm // set 53kf guest_id 设置UV if (!$53.getCookie('53gid0')){ set53gidCookie('53gid0',hz6d_guest_id,$53.getTimeTo24()); } else if($53.getCookie('53gid2')){ var hz6d_53gid0 = $53.getCookie('53gid0'); if(hz6d_guest_id == hz6d_53gid0){ $53.data('is_uv',0); }else{ set53gidCookie('53gid0',hz6d_guest_id,$53.getTimeTo24()); } } // 设置RV if (!$53.getCookie('53gid1')){ set53gidCookie('53gid1',hz6d_guest_id,86400); } else if($53.getCookie('53gid2')){ var hz6d_53gid1= $53.getCookie('53gid1'); if(hz6d_guest_id == hz6d_53gid1){ $53.data('is_rv',0); }else{ set53gidCookie('53gid1',hz6d_guest_id,86400); } } var is_revisit = 0; if (!$53.getCookie('53revisit')) { $53.setCookie('53revisit',new Date().getTime(),{ expires:10*365*24*3600,'path':'/' }); } else { if((new Date().getTime() - $53.getCookie('53revisit')) > 86400000){ is_revisit = 1; } } // 获取访问的入口来源页面:搜索引擎/外部链接/直接输入 var hz6d_from_page = $53.getCookie("53kf_"+companyid+"_keyword"); var hz6d_now_host = window.location.host; function getHz6dReferer(){ var referer = ""; var hz6d_request = $53.getUrlParam(); var hz6d_tglink = false; var search_engine_list = {'baidu':'wd=', 'haosou':'q=', 'sogou':'query=', 'google':'q=', 'youdao':'q=', 'sm':'q=' }; if(hz6d_request['tgse'] && hz6d_request['tgkwd']){ hz6d_tglink = 'https://web.archive.org/web/20220705181212/http://www.' + hz6d_request['tgse'] + '.com/s?' + search_engine_list[hz6d_request['tgse']] + decodeURIComponent(hz6d_request['tgkwd']); } if(hz6d_tglink){//是否是推广页面 referer = hz6d_tglink; }else{ referer = document.referrer; } return referer; } if(hz6d_from_page == ""){ hz6d_from_page = getHz6dReferer(); if(hz6d_now_host != "") $53.setCookie("53kf_"+companyid+"_from_host",hz6d_now_host,{'path':'/'}); }else { var hz6d_from_page_referer = getHz6dReferer(); var hz6d_from_page_host = $53.getUrlHost(hz6d_from_page_referer); if(hz6d_from_page_host != "" && hz6d_now_host != "" && hz6d_now_host != hz6d_from_page_host){ var hz6d_now_hosts_string = $53.getCookie("53kf_"+companyid+"_from_host"); var hz6d_now_hosts = hz6d_now_hosts_string.split(","); if(hz6d_now_hosts.length>0){ if(hz6d_now_hosts.indexOf(hz6d_from_page_host) == -1){ hz6d_from_page = hz6d_from_page_referer; } if(hz6d_now_hosts.indexOf(hz6d_now_host) == -1){ hz6d_now_hosts_string += ","+hz6d_now_host; $53.setCookie("53kf_"+companyid+"_from_host",hz6d_now_hosts_string,{'path':'/'}); } }else { hz6d_from_page = hz6d_from_page_referer; $53.setCookie("53kf_"+companyid+"_from_host",hz6d_now_host,{'path':'/'}); } } } $53.data('page_referer',hz6d_from_page); $53.setCookie("53kf_"+companyid+"_keyword",hz6d_from_page,{'path':'/'}); //eval("var kf_"+companyid+"_keyword_ok=$53.getCookie('kf_"+companyid+"_keyword_ok');"); //if (!eval("kf_"+companyid+"_keyword_ok")) //{ // var hz6d_request = $53.getUrlParam(); // var hz6d_tglink = false; // var search_engine_list = {'baidu':'wd=', // 'haosou':'q=', // 'sogou':'query=', // 'google':'q=', // 'youdao':'q=', // 'sm':'q=' // }; // if(hz6d_request['tgse'] && hz6d_request['tgkwd']){ // hz6d_tglink = 'https://web.archive.org/web/20220705181212/http://www.' + hz6d_request['tgse'] + '.com/s?' + search_engine_list[hz6d_request['tgse']] + decodeURIComponent(hz6d_request['tgkwd']); // } // if(hz6d_tglink){//是否是推广页面 // hz6d_from_page = hz6d_tglink; // }else{ // hz6d_from_page = document.referrer; // } //} //$53.data('page_referer',hz6d_from_page); //$53.setCookie("53kf_"+companyid+"_keyword",hz6d_from_page,{'path':'/'}); //$53.setCookie("kf_"+companyid+"_keyword_ok",1,{'path':'/'}); hz6d_from_page_new = "&keyword=" + $53.EN(hz6d_from_page); var acc_browser = $53.getBrowser(); var acc_os = $53.getOs(); var hz6d_land_page = $53.getCookie("53kf_"+companyid+"_land_page"); eval("var kf_"+companyid+"_land_page_ok=$53.getCookie('kf_"+companyid+"_land_page_ok');"); //公司站点 try{ var in_site = false; var talk_page_now = window.location.href; if(talk_page_now.indexOf('hz6d{') != -1) { talk_page_now = talk_page_now.substring(0,talk_page_now.indexOf('hz6d{')); } var talk_page = window.encodeURIComponent(talk_page_now); if (!eval("kf_"+companyid+"_land_page_ok")){ hz6d_land_page = talk_page; } var is_null = true; if(talk_page_now.indexOf("53kf.com") == -1){ for (var p in company_site){ if(company_site.hasOwnProperty(p)){ is_null = false; if(talk_page_now.indexOf(company_site[p].replace(/\\\//g,"/")) != -1){ in_site = true; break; } } } if(is_null) in_site = true; }else{ in_site = true; } }catch(e){ in_site = true; } if(window.location.href.substr(0,4) == "file") in_site = false; $53.setCookie("53kf_"+companyid+"_land_page",hz6d_land_page,{'path':'/'}); $53.setCookie("kf_"+companyid+"_land_page_ok",1,{'path':'/'}); var acc_first_time = new Date().getTime(); var acc_get_force = false; function hz6d_sendACC() { var kh_status = 0; if(onliner_zdfq==3) { kh_status = 3; } // var talk_page_tmp = window.location.href; // if(talk_page_tmp.indexOf('hz6d{') != -1) { // talk_page_tmp = talk_page_tmp.substring(0,talk_page_tmp.indexOf('hz6d{')); // } // var talk_page = window.encodeURIComponent(talk_page_tmp); // var kf_time = "$in_timestamp"; var time = new Date().getTime(); if(time - acc_first_time > 24*60*60*1000) return; var curSecond = Math.floor(time/1000); var page_title = document.title; // var url = "$http://$acc_host/sendacc.jsp?cmd=ACC&did=0&sid=12&company_id="+com_id+"&guest_id="+hz6d_guest_id+"&status="+kh_status+"&guest_name=&guest_ip="+ip+"&guest_ip_info="+guest_ip_info+"&from_page="+from_page+"&talk_page="+talk_page+"&kf_time="+kf_time+"&bto_id6d=-99&time="+time + '&ucust_id=' + $53.getCookie('ucust_id') + '&style=' + $style_id + '&is_mobile=n&visitor_type='+$53.getCookie('visitor_type')+'&is_uv='+$53.data('is_uv'); var url = http_pro + acc_host + "/sendacc.jsp?cmd=ACC&did=0&sid=12&company_id="+companyid+"&guest_id="+hz6d_guest_id+"&status="+kh_status+"&guest_name=&guest_ip="+$53.EN(hz6d_guest_ip)+"&guest_ip_info="+ipstr+"&area="+areastr+"&from_page=" + $53.EN($53.getCookie("53kf_"+companyid+"_keyword")) +"&talk_page="+talk_page+"&kf_time="+in_timestamp+"&bto_id6d=-99&time="+time + '&ucust_id=' + $53.EN($53.getCookie('ucust_id')) + '&style='+hz6d_style_id+'&is_mobile='+$53.isMobile()+'&visitor_type='+$53.getCookie('visitor_type')+'&is_uv='+$53.data('is_uv')+'&browser='+acc_browser+'&os='+acc_os+'&is_revisit='+is_revisit+"&page_title="+$53.EN(page_title); if (information_switch == 1) { var url = http_pro + acc_host + "/sendacc.jsp?cmd=ACC&did=0&sid=12&company_id="+companyid+"&guest_id="+hz6d_guest_id+"&status="+kh_status+"&guest_name=&guest_ip="+"&guest_ip_info="+"&area="+"&from_page=" +"&talk_page="+"&kf_time="+in_timestamp+"&bto_id6d=-99&time="+time + '&ucust_id=' + $53.EN($53.getCookie('ucust_id')) + '&style='+hz6d_style_id+'&is_mobile='+$53.isMobile()+'&visitor_type='+$53.getCookie('visitor_type')+'&is_uv='+$53.data('is_uv')+'&browser='+acc_browser+'&os='+acc_os+'&is_revisit='+is_revisit+"&page_title="; } if(companyid==72153759) url += "&acc_first_time="+acc_first_time; if(cloud_service == "www111" || (hz6d_alias_host.indexOf("w111.53kf.com") !== -1)) url += "&acc_get_force="+acc_get_force; $53.createScript("hz6d_send_acc", url); var acc_times = 20000; if(cloud_service == "www111" || (hz6d_alias_host.indexOf("w111.53kf.com") !== -1) || companyid == 72211675 || companyid == 72212262 || companyid == 72212337 || companyid == 72212338 || companyid == 72212339 || companyid == 72212341 || companyid == 72087813) acc_times = 1000; setTimeout("hz6d_sendACC()",acc_times); } if (in_site) hz6d_sendACC(); if(get_gdt_openid == 1){ var gdt_time = new Date().getTime(); var gdt_url = "//web.archive.org/web/20220705181212/https://cm.e.qq.com/cm.fcg?gdt_dspid=8417552&gdt_dsp_checksum="+companyid+"&gdt_dsp_timestamp=" + gdt_time.toString().substr(0,10); $53.createScript("hz6d_get_gdt_openid", gdt_url); } $53.data("workers",{"11174581":{"worker_id":"1392450151@qq.com","state":0,"bname":"客服专员"},"11047701":{"worker_id":"1424725862@qq.com","state":1,"bname":"1424725862@qq.com"},"11174621":{"worker_id":"2571213881@qq.com","state":0,"bname":null},"11174631":{"worker_id":"3384144650@qq.com","state":0,"bname":null}});$53.data("groups",{"68870013":{"group_name":"kefu","workers":["11174631","11047701"]}});$53.data("shunt_info",{"shunt_type":"1"});$53.data("area_shunt",{});$53.data("source_shunt",{});$53.data("channel_shunt",{});$53.data("over_flow",{});$53.data("over_flow_schedule",{});$53.data("of_all_worker",{"11174581":{"worker_id":"1392450151@qq.com","state":0,"bname":"客服专员"},"11047701":{"worker_id":"1424725862@qq.com","state":1,"bname":"1424725862@qq.com"},"11174621":{"worker_id":"2571213881@qq.com","state":0,"bname":null},"11174631":{"worker_id":"3384144650@qq.com","state":0,"bname":null}});$53.data("of_groups",{"68870013":{"group_name":"kefu","workers":["11174631","11047701"]}});$53.data("mobileCompanyInfo",{"stop_back":"1","company_logo":"","company_intr":"","company_short":"","mobile_music":"","zdyurl":"","minchat_height":""});$53.data("icon_award",{});$53.data("api_uuid","b78dd58e6b40fc92f6c27751e4cfc00d"); $53.setUuid("b78dd58e6b40fc92f6c27751e4cfc00d"); if(window.location.href.substr(0,4) != "file"){ (function(window,undefined){ var head=document.getElementsByTagName("head")[0]; var kfscript1= document.createElement("script"); kfscript1.src="https://web.archive.org/web/20220705181212/https://www13.53kf.com/js/default/mobile_icon_default.js?v=2017080212"; var done1=false; kfscript1.onload=kfscript1.onreadystatechange=function(){ if(!done1&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){ done1=true; kfscript1.onload=kfscript1.onreadystatechange=null;head.removeChild(kfscript1); } } head.appendChild(kfscript1); var kfscript2= document.createElement("script"); kfscript2.src="https://web.archive.org/web/20220705181212/https://www13.53kf.com/js/default/mobile_invite_default.js?v=2017080212"; var done2=false; kfscript2.onload=kfscript2.onreadystatechange=function(){ if(!done2&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){ done2=true; kfscript2.onload=kfscript2.onreadystatechange=null;head.removeChild(kfscript2); } } head.appendChild(kfscript2); var kfscript3= document.createElement("script"); kfscript3.src="https://web.archive.org/web/20220705181212/https://www13.53kf.com/custom/72577221/assign_worker_72577221_3.js?v=1656898959"; var done3=false; kfscript3.onload=kfscript3.onreadystatechange=function(){ if(!done3&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){ done3=true; kfscript3.onload=kfscript3.onreadystatechange=null;head.removeChild(kfscript3); } } head.appendChild(kfscript3); var kfscript4= document.createElement("script"); kfscript4.src="https://web.archive.org/web/20220705181212/https://www13.53kf.com/js/default/mobile_chat_default.js?v=2017080212"; var done4=false; kfscript4.onload=kfscript4.onreadystatechange=function(){ if(!done4&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){ done4=true; kfscript4.onload=kfscript4.onreadystatechange=null;head.removeChild(kfscript4); } } head.appendChild(kfscript4); })(window); (function(window,document,talkHost,ipStr,ipContinent,companyId,styleId,undefined){ /** *$53.data('workers') 工号信息 *$53.data('groups') 分组信息 *$53.data('page_referer') 访问来源 *$53.data('mobile_icon') 手机图标设置 *$53.data('mobile_invite') 手机邀请框设置 *$53.data('assign_worker') 指定客服设置 *$53.data('zdkf_type') 客服指定类型 1:指定工号 2:指定部门(已废弃) 3:指定分组 *$53.data('kf') 具体指定客服 *$53.data('is_online') 是否在线 0:离线 1:在线 */ /****************************************事件处理基类开始*************************************/ function handler(){ var _this = this; _this.app_name = '_53App'; _this.ipStr = decodeURI(ipStr); _this.talkHost = talkHost; _this.isOnline = false; _this.companyId = companyId; _this.fromPage = $53.data('page_referer'); _this.styleId = styleId; } handler.prototype.setSession = function(key,value){ try{ if(window.sessionStorage){ sessionStorage.setItem(key,value); }else{ $53.setCookie(key,value); } } catch (error) { return false; } } handler.prototype.getSession = function(key){ try{ if(window.sessionStorage){ return sessionStorage.getItem(key); }else{ $53.getCookie(key); } } catch (error) { return false; } } handler.prototype.getWorkerInfo = function(id6d){ var workers = $53.data('workers'); return workers[id6d]; } /** *事件处理接口,具体功能由继承类实现 */ handler.prototype.show = function(){} //图标/邀请框显示 handler.prototype.hide = function(){} //图标/邀请框隐藏 handler.prototype.talk = function(){} //点击咨询 handler.prototype.setMsgTip = function(obj){} //来消息设置 /****************************************事件处理基类结束*************************************/ /****************************************手机图标类开始*************************************/ function _53_mobile_icon(icon_set){ var _this = this; _this.isOnline = $53.data('is_online') === '1' ? true:false; if(icon_set.m_icon_type != "") _this.isOnline = true; // 新客服图标兼容 _this.iconElm = null; if(typeof icon_set.on_is_open != "undefined"){//老数据兼容 _this.on_is_open = icon_set.on_is_open; _this.on_left = icon_set.on_left; _this.on_top = icon_set.on_top; //_this.on_content = icon_set.on_content; _this.off_is_open = icon_set.off_is_open; _this.off_left = icon_set.off_left; _this.off_top = icon_set.off_top; _this.m_icon_type = icon_set.m_icon_type; //_this.off_content = icon_set.off_content; }else { _this.on_is_open = icon_set.is_open; _this.on_left = icon_set.left; _this.on_top = icon_set.top; _this.off_is_open = icon_set.is_open; _this.off_left = icon_set.left; _this.off_top = icon_set.top; _this.m_icon_type = icon_set.m_icon_type; } _this.on_content = icon_set.on_content; _this.off_content = icon_set.off_content; _this.chat_type = icon_set.chat_type ? icon_set.chat_type : 0; _this.lotto_top = icon_set.lotto_top ? icon_set.lotto_top : 45; _this.lotto_left = icon_set.lotto_left ? icon_set.lotto_left : 100; _this.icon_award = $53.data("icon_award"); _this._53Api = $53.createApi(); _this.init(); } _53_mobile_icon.prototype = new handler(); //继承事件处理基类 _53_mobile_icon.prototype.init = function(){ var _this = this; _this.on_content = _this.formatContent(_this.on_content); _this.off_content = _this.formatContent(_this.off_content); _this.createIcon(); _this.lot = new Lotto(); _this.lot.iconTalk = function(){ _this.talk(); }; if((_this.isOnline&&_this.on_is_open == 'yes')||(!_this.isOnline&&_this.off_is_open == 'yes')){ // if((_this.isOnline&&_this.on_is_open == 'yes')||(!_this.isOnline&&_this.off_is_open == 'yes') || _this.m_icon_type != ""){ if(_this.on_content != ""){ // 新图标模式容错 if(mnone != 1) _this.show(); } } } _53_mobile_icon.prototype.getOpenUrl = function(){ var _this = this; var mobile_config = $53.data("mobileCompanyInfo"); try{ if(mobile_config["zdyurl"] != "" && _this.chat_window != 1){ var openUrl = mobile_config["zdyurl"]; if(openUrl.indexOf("http://") == -1 && openUrl.indexOf("https://") == -1) openUrl = talkHost + openUrl; if(openUrl.indexOf("?") == -1) openUrl += "?"; }else { var openUrl = talkHost+'/m.php?'; } }catch(e){ var openUrl = talkHost+'/m.php?'; } var openUrl = openUrl+'kf_sign='+kf_sign+'&cid='+_this.companyId+'&style='+_this.styleId+'&keyword='+encodeURIComponent(_this.fromPage)+'&referer='+encodeURIComponent(window.location.href)+'&guest_id='+hz6d_guest_id+'&tpl='+encodeURIComponent($53.data('tpl'))+'&uid='+encodeURIComponent($53.data('api_uuid'))+'&u_stat_id='+encodeURIComponent($53.data('u_stat_id'))+'&talktitle='+encodeURIComponent(document.title)+'&tfrom=50&device='+hz6d_device; return openUrl; } _53_mobile_icon.prototype.show = function(){ var _this = this; _this.iconElm.style.display = 'block'; if(_this.iconElm.innerHTML != "") _this.setPosition(); // 图标为空的容错 } _53_mobile_icon.prototype.hide = function(){ var _this = this; _this.iconElm.style.display = 'none'; } _53_mobile_icon.prototype.talk = function(params){ var _this = this; _this.setSession(_this.companyId+'_invite_times',0); location.href = _this.getOpenUrl()+params; } _53_mobile_icon.prototype.setPosition = function(){ var _this = this; var icon_left = _this.isOnline?_this.on_left:_this.off_left; var icon_bottom = 100-(_this.isOnline?_this.on_top:_this.off_top); // 百度落地页图标模式 if(_this.m_icon_type == "7"){ icon_left = 0; icon_bottom = 0; } var iconElm = _this.iconElm; if(iconElm.firstChild.hasAttribute("53kf_icon_versions")){ var client_width = document.body.clientWidth || document.documentElement.clientWidth; iconElm.firstChild.style.fontSize = 10*client_width/375 + "px"; } var icon_width,icon_height; if(iconElm.firstChild.id == "lotto_icon"){ icon_width = iconElm.firstChild.style.width; icon_height = iconElm.firstChild.style.height; }else{ icon_width = iconElm.offsetWidth==0?iconElm.firstChild.offsetWidth:iconElm.offsetWidth; icon_height = iconElm.offsetHeight==0?iconElm.firstChild.offsetHeight:iconElm.offsetHeight; } var w = window.innerWidth; var h= window.innerHeight; if(iconElm.firstChild){ iconElm.firstChild.style.position = 'fixed'; iconElm.firstChild.style.marginLeft = '0px'; iconElm.firstChild.style.marginTop = '0px'; iconElm.firstChild.style.height = icon_height+'px'; iconElm.firstChild.style.left = (w-icon_width)*(icon_left/100)+'px'; iconElm.firstChild.style.bottom = (h-icon_height)*(icon_bottom/100)+'px'; } if(typeof _this.icon_award.activity_name != "undefined"){ _this.lot.positionIcon(_this.lotto_left,_this.lotto_top); } } _53_mobile_icon.prototype.createIcon = function(){ var _this = this; $53.creElm({ 'style':'position:fixed;display:none;font-family:Microsoft YaHei,Arial;z-index:1000000;width:auto;height:auto', 'id':'mobile_icon_div', 'innerHTML':_this.isOnline?_this.on_content:_this.off_content },'div'); _this.iconElm = document.getElementById('mobile_icon_div'); } _53_mobile_icon.prototype.formatContent = function(content){ var _this = this; content = content.replace(/\.\.\//g,_this.talkHost+'/'); content = content.replace(/class=".*?"/g,''); content = content.replace(/event="\{(.*?)\}"/g, function(match, contents){ return _this.getEvent(contents.split('|')); } ); if(typeof _this.icon_award.award_name != "undefined"){ content = content.replace(/{jh6d_award_name}/g,_this.icon_award.award_name); } return content; } _53_mobile_icon.prototype.setMsgTip = function(obj){ var _this = this; var tipElm = obj.parentNode; tipElm.style.display = 'none'; var msg_tip_count = 0; _this._53Api.push('msg_callback',function(){ tipElm.style.display = 'block'; msg_tip_count += 1; if(_this.m_icon_type == "7"){ tipElm.innerHTML = "新消息 " + msg_tip_count }else{ tipElm.innerHTML = msg_tip_count; } }); if(typeof icon_msg_tip_hide != "function"){ window.icon_msg_tip_hide = function(){ tipElm.style.display = 'none'; msg_tip_count = 0; if(_this.m_icon_type == "7"){ tipElm.innerHTML = "新消息 " + msg_tip_count }else{ tipElm.innerHTML = msg_tip_count; } } } } _53_mobile_icon.prototype.getAppObj = function(obj){ var _this = this; return _this[obj]; } _53_mobile_icon.prototype.getEvent = function(eventArr){ var _this = this; var eventStr = ''; switch(eventArr[0]){ case 'close': eventStr = 'onclick="'+_this.app_name+'.hide(\'icon\');"'; break; case 'talk': if(_this.chat_type == 0){ var params = ''; if(eventArr[2] == 'group'){ params += '&zdkf_type=3&kf='+eventArr[3]; }else if(eventArr[2] == 'kf'){ var workInfo = _this.getWorkerInfo(eventArr[3]); params += '&zdkf_type=1&kf='+$53.EN(workInfo['worker_id']); }else{ params += '&zdkf_type='+$53.data('zdkf_type')+'&kf='+$53.EN($53.data('kf'))+'&kflist='+$53.data('kflist'); var addLinkParams = $53.data("add_link_params"); if(addLinkParams != null) params+=addLinkParams; } eventStr = 'onclick="'+_this.app_name+'.talk(\'icon\',\''+params+'\');"'; }else { if(document.getElementById("mini_chat") != null && document.getElementById("mini_chat").length > 0 ) eventStr = 'onclick="'+_this.app_name+'.getApp(\'chat\').talk(\'\',\'float\');"'; else eventStr = 'onclick="'+_this.app_name+'.getApp(\'chat\').openSdkUrl(\'float\');"'; } break; case 'qq': //eventStr = 'onclick="location.href=\'mqqwpa://im/chat?chat_type=wpa&uin='+eventArr[1]+'&version=1&src_type=web&web_src=oicqzone.com\'"'; eventStr = 'onclick="location.href=\'http://wpa.qq.com/msgrd?v=3&uin='+eventArr[1]+'&site=qq&menu=yes\'"'; break; case 'tel': eventStr = 'onclick="location.href=\'tel:'+eventArr[1]+'\'"'; break; case 'msgTip': eventStr = ''; break; case 'lottoShow': eventStr = 'onclick="'+_this.app_name+'.getAppObj(\'icon\',\'lot\').lottoShow();"'; break; case 'lottoHide': eventStr = 'onclick="'+_this.app_name+'.getAppObj(\'icon\',\'lot\').lottoHide();"'; break; case 'justNum': eventStr = 'onclick="'+_this.app_name+'.getAppObj(\'icon\',\'lot\').justNum(this);"'; break; case 'lottoChange': var award_id = 0; if(typeof _this.icon_award.award_id != "undefined") award_id = _this.icon_award.award_id; eventStr = 'onclick="'+_this.app_name+'.getAppObj(\'icon\',\'lot\').lottoChange(\''+award_id+'\');"'; break; case 'onFocus': eventStr = 'onfocus="'+_this.app_name+'.getAppObj(\'icon\',\'lot\').onFocus()"'; break; case 'onBlur': eventStr = 'onblur="'+_this.app_name+'.getAppObj(\'icon\',\'lot\').onBlur()"' break; default: break; } return eventStr; } /****************************************手机图标类结束*************************************/ /****************************************手机抽奖类结束*************************************/ function Lotto(){ this.icon = document.getElementById("lotto_icon"); this.l = document.getElementById("lotto_redpacket"); this.d = document.getElementById("lotto_decorate"); this.r = document.getElementById("lotto_round"); this.i = document.getElementById("lotto_inp"); this.m = document.getElementById("lotto_message"); this.w = document.getElementById("lotto_win"); this.b = document.getElementById("lotto_btn"); this.t = document.getElementById("lotto_btntext"); this.s = document.getElementById("lotto_s"); this.n = document.getElementById("lotto_name"); this.p = document.getElementById("lotto_phonenum"); this.u = document.getElementById("lotto_statu"); }; Lotto.prototype = { // 抽奖图标font-size初始化 lotFontSize:function(){ var _this = this; var client_width = document.body.clientWidth || document.documentElement.clientWidth; var ratio = client_width/375; if(this.icon.hasAttribute("53kf_icon_versions")){ this.icon.style.fontSize = 10*ratio + "px"; } _this.icon.style.display = "block"; }, //设置抽奖位置 positionIcon : function(left,top){ var _this = this; //var wid=document.documentElement.clientWidth; //var hei=document.documentElement.clientHeight; _this.lotFontSize(); var wid = document.documentElement.clientWidth,hei; if(navigator.appName == "Microsoft Internet Explorer"){ hei=document.documentElement.clientHeight; }else{ hei=window.innerHeight; } _this.icon.style.left =( wid-parseInt(_this.icon.offsetWidth))*(left/100) + 'px'; _this.icon.style.top = (hei-parseInt(_this.icon.offsetHeight))*(top/100) + 'px'; }, // 抽奖红包出现 lottoShow : function(){ var _this = this; if(_this.l.style.display == "none"){ _this.b.setAttribute('data-class',0); _this.l.style.display = "block"; _this.r.style.display = "block"; _this.d.style.display = "none"; _this.m.style.display = "none"; _this.i.style.display = "none"; _this.w.style.display = "none"; _this.t.innerHTML = "立即抽奖"; _this.s.style.display = "inline-block"; clearInterval(_this.timout); _this.s.innerHTML = "(60s)"; _this.timeGo(); }else{ return false; } }, // 抽奖红包隐藏 lottoHide : function(){ clearInterval(this.timout); this.s.innerHTML = "(60s)"; this.n.value = ""; this.p.value = ""; this.l.style.display = "none"; }, // 抽奖状态切换(待添加验证:该手机号码已领取奖励) lottoChange : function(award_id){ var _this = this; if(!obj) var obj = _this.b; if(_this.b.getAttribute('data-class') == 0){ _this.b.setAttribute('data-class',1); _this.r.style.display = "none"; _this.d.style.display = "block"; _this.m.style.display = "block"; _this.i.style.display = "block"; _this.t.innerHTML = "立即领取"; _this.s.style.display = "inline-block"; clearInterval(_this.timout); _this.s.innerHTML = "(60s)"; _this.timeGo(); }else if(_this.b.getAttribute('data-class') == 1){ var mobil = /^1[3-9]\d{9}$/; if(_this.p.value == ""){ _this.statuSh("请输入手机号码"); return false; }else if(!mobil.test(_this.p.value)){ _this.statuSh("请输入有效的手机号码"); }else{ var script_id = 'kf_script_award'; var name = _this.n.value; var mobile = _this.p.value; var callBackFunName = "award_callback_"+new Date().getTime(); eval(callBackFunName + '= function(data){_this.createResult(data)}'); var url = hz6d_alias_host+'/client/kfapi_award.php?company_id='+companyid+'&style='+hz6d_style_id+'&guest_id='+hz6d_guest_id+'&name='+encodeURIComponent(name)+'&mobile='+mobile+'&award_id='+award_id+'&callback='+callBackFunName+'&device=2'; // var url = hz6d_alias_host+'/visitor/kfapiAward.php?company_id='+companyid+'&style='+hz6d_style_id+'&guest_id='+hz6d_guest_id+'&name='+encodeURIComponent(name)+'&mobile='+mobile+'&award_id='+award_id+'&callback='+callBackFunName+'&device=2'; $53.createScript(script_id,url); _this.t.innerHTML = "抽奖中..."; _this.s.style.display = "none"; clearInterval(_this.timout); } }else{ _this.iconTalk(); _this.l.style.display = "none"; } }, createResult:function(data){ var _this = this; if(data.code == 200){ _this.b.setAttribute('data-class',2); _this.r.style.display = "none"; _this.m.style.display = "none"; _this.i.style.display = "none"; _this.w.style.display = "block"; _this.t.innerHTML = "咨询在线客服"; _this.s.style.display = "none"; _this.icon.style.display = "none"; }else{ _this.statuSh(data.info); } }, // 状态提醒 statuSh : function(str){ var _this = this; _this.u.innerHTML = str; _this.u.style.display = "block"; _this.u.style.marginLeft = (-_this.u.offsetWidth/2) + "px"; _this.u.style.left = "50%"; var timer = setTimeout(function(){ _this.u.style.display = "none"; clearTimeout(timer); },1500) }, // 禁止输入非数字 justNum : function(obj) { obj.value = obj.value.replace(/[^\d]/g,''); }, // 60s倒计时 timeGo : function() { var _this = this; var count = 60; _this.timout = setInterval(function(){ count--; _this.s.innerHTML = "("+count+"s)"; if(count == 0){ clearInterval(_this.timout) _this.l.style.display = "none"; } },1000) }, // 获取焦点 onFocus : function(){ if( $53.data('mobile_chat').chat_bottom != 2 ){ if(document.getElementById("mobile_minchat_div")){ document.getElementById("mobile_minchat_div").style.display = "none"; } } }, // 失去焦点 onBlur : function(){ if( $53.data('mobile_chat').chat_bottom != 2 ){ if(document.getElementById("mobile_minchat_div")){ document.getElementById("mobile_minchat_div").style.display = "block"; } } }, iconTalk : function(){} }; /****************************************手机抽奖类结束*************************************/ /****************************************手机邀请框类开始***********************************/ function _53_mobile_ivt(ivt_set){ var _this = this; _this.isOnline = $53.data('is_online') === '1'?true:false; _this.ivtElm = null; _this.is_open = ivt_set.is_open; _this.invite_off = ivt_set.invite_off; _this.invite_left = ivt_set.invite_left; _this.invite_top = ivt_set.invite_top; _this.invite_area = ivt_set.invite_area; _this.fanfu_time = ivt_set.fanfu_time; _this.invite_times = ivt_set.invite_times; _this.page_times = ivt_set.page_times; _this.timeout = ivt_set.timeout; _this.ivt_content = ivt_set.content; _this.force_kf = "";//客服强制邀请数据 _this.man_content = "";//客服强制邀请文本,暂不使用 _this.acc_from_kf = false;//是否为客服强制邀请 if(typeof ivt_set.invite_is_reauto != 'undefined') _this.invite_is_reauto = ivt_set.invite_is_reauto; else _this.invite_is_reauto = 2; _this.init(); } _53_mobile_ivt.prototype = new handler(); //继承事件处理基类 _53_mobile_ivt.prototype.init = function(){ var _this = this; _this.ivt_content = _this.formatContent(_this.ivt_content); _this.createIvt(); if(_this.getSession(_this.companyId+'_invite_times') == null){ _this.setSession(_this.companyId+'_invite_times',_this.invite_times); } if(_this.is_open == 'yes'&&(_this.isOnline||(!_this.isOnline&&_this.invite_off == 'yes'))){ setTimeout(function(){ if(mnone != 1) _this.show("first"); },_this.timeout*1000) } window.hz6d_showIvt = function(){//手动邀请 _this.forceShow(); } } _53_mobile_ivt.prototype.createIvt = function(){ var _this = this; $53.creElm({ 'style':'display:none;position:fixed;font-family:Microsoft YaHei,Arial;z-index:1000000;', 'id':'mobile_ivt_div', 'innerHTML':_this.ivt_content },'div'); _this.ivtElm = document.getElementById('mobile_ivt_div'); } _53_mobile_ivt.prototype.getOpenUrl = function(){ var _this = this; var mobile_config = $53.data("mobileCompanyInfo"); try{ if(mobile_config["zdyurl"] != "" && _this.chat_window != 1){ var openUrl = mobile_config["zdyurl"]; if(openUrl.indexOf("http://") == -1 && openUrl.indexOf("https://") == -1) openUrl = talkHost + openUrl; if(openUrl.indexOf("?") == -1) openUrl += "?"; }else { var openUrl = talkHost+'/m.php?'; } }catch(e){ var openUrl = talkHost+'/m.php?'; } var openUrl = openUrl+'kf_sign='+kf_sign+'&cid='+_this.companyId+'&style='+_this.styleId+'&keyword='+encodeURIComponent(_this.fromPage)+'&referer='+encodeURIComponent(window.location.href)+'&guest_id='+hz6d_guest_id+'&tpl='+encodeURIComponent($53.data('tpl'))+'&uid='+encodeURIComponent($53.data('api_uuid'))+'&u_stat_id='+encodeURIComponent($53.data('u_stat_id'))+'&talktitle='+encodeURIComponent(document.title)+'&tfrom=51&device='+hz6d_device; return openUrl; } _53_mobile_ivt.prototype.formatContent = function(content){ var _this = this; content = content.replace(/\.\.\//g,_this.talkHost+'/'); content = content.replace(/class=".*?"/g,''); content = content.replace(/event="\{(.*?)\}"/g, function(match, contents){ return _this.getEvent(contents.split('|')); } ); return content; } _53_mobile_ivt.prototype.getEvent = function(eventArr){ var _this = this; var eventStr = ''; switch(eventArr[0]){ case 'close': eventStr = 'onclick="'+_this.app_name+'.hide(\'invite\');"'; break; case 'talk': var params = ''; if(eventArr[2] == 'group'){ params += '&zdkf_type=3&kf='+eventArr[3]; }else if(eventArr[2] == 'kf'){ var workInfo = _this.getWorkerInfo(eventArr[3]); params += '&zdkf_type=1&kf='+$53.EN(workInfo['worker_id']); }else{ params += '&zdkf_type='+$53.data('zdkf_type')+'&kf='+$53.EN($53.data('kf')); } eventStr = 'onclick="'+_this.app_name+'.talk(\'invite\',\''+params+'\');"'; break; case 'qq': //eventStr = 'onclick="location.href=\'mqqwpa://im/chat?chat_type=wpa&uin='+eventArr[1]+'&version=1&src_type=web&web_src=oicqzone.com\'"'; eventStr = 'onclick="location.href=\'http://wpa.qq.com/msgrd?v=3&uin='+eventArr[1]+'&site=qq&menu=yes\'"'; break; case 'tel': eventStr = 'onclick="location.href=\'tel:'+eventArr[1]+'\'"'; break; case 'new_tel': eventStr = 'onclick="$53.callPriPhone()"'; break; default: break; } return eventStr; } _53_mobile_ivt.prototype.checkArea = function(){ var _this = this; var ipStr = _this.ipStr; if(typeof _this.invite_area == "undefined" || _this.invite_area == "") return true; var setAreas = _this.invite_area.split(','); if(setAreas.length <= 0){ return true; } var citys = []; for(var i in setAreas){ citys = setAreas[i].split('.'); if(citys.length >=1 && ipStr.indexOf(citys[1]) >=0){ return true; }else if(citys.length == 1 && ipStr.indexOf(citys[0]) >=0){ return true; } } return false; } _53_mobile_ivt.prototype.talk = function(params){ var _this = this; _this.setSession(_this.companyId+'_invite_times',0); var location_href = _this.getOpenUrl()+params; if(_this.acc_from_kf == true) location_href += _this.force_kf; location.href = location_href; } _53_mobile_ivt.prototype.show = function(type){ var _this = this; try{ if(document.getElementById('mini_chat') && document.getElementById('mini_chat').style.display == 'block') { return false; } }catch (e){} if(_this.ivtElm.style.display == 'block'){ return false; } if(_this.checkArea() === false){ return false; } if(_this.page_times<=0){ return false; } if(_this.invite_is_reauto == 2){ var invite_times = _this.getSession(_this.companyId+'_invite_times'); if(invite_times == '' || invite_times <=0){ return false; } invite_times--; _this.setSession(_this.companyId+'_invite_times',invite_times); }else{ if(type != "first"){ if(_this.invite_is_reauto != 1 || _this.invite_times <=0){ return false; } _this.invite_times--; } } _this.page_times--; _this.ivtElm.style.display = 'block'; _this.setPosition(); } _53_mobile_ivt.prototype.forceShow = function(){ var _this = this; if(typeof force_kf != "undefined" && typeof man_content != "undefined" && typeof acc_from_kf != "undefined"){ _this.force_kf = force_kf; _this.man_content = man_content; _this.acc_from_kf = acc_from_kf; force_kf = ""; man_content = ""; acc_from_kf = false; } if(_this.ivtElm.style.display == "none"){ _this.ivtElm.style.display = 'block'; _this.setPosition(); } } _53_mobile_ivt.prototype.hide = function(){ var _this = this; _this.force_kf = ""; _this.man_content = ""; _this.acc_from_kf = false; _this.ivtElm.style.display = 'none'; if(_this.fanfu_time>0 && _this.is_open == 'yes' && (_this.isOnline || (!_this.isOnline&&_this.invite_off == 'yes')) ){ setTimeout(function(){ _this.show(); },_this.fanfu_time*1000); } } _53_mobile_ivt.prototype.setPosition = function(){ var _this = this; var invite_left = _this.invite_left; var invite_bottom = 100-_this.invite_top; var ivtElm = _this.ivtElm; var ivt_width = ivtElm.offsetWidth==0?ivtElm.firstChild.offsetWidth:ivtElm.offsetWidth; var ivt_height = ivtElm.offsetHeight==0?ivtElm.firstChild.offsetHeight:ivtElm.offsetHeight; var w = window.innerWidth; var h= window.innerHeight; ivtElm.firstChild.style.marginLeft = '0px'; ivtElm.firstChild.style.marginTop = '0px'; ivtElm.style.height = ivt_height+'px'; ivtElm.style.left = (w-ivt_width)*(invite_left/100)+'px'; ivtElm.style.bottom = (h-ivt_height)*(invite_bottom/100)+'px'; } /****************************************手机邀请框类结束***********************************/ /****************************************手机菜单栏类开始***********************************/ function _53_mobile_chat(chat_set){ var _this = this; //if($53.data("is_update") == false) return; _this.isOnline = $53.data('is_online') === '1'?true:false; _this.params = ""; _this.kf_openurl = ""; _this.window_scroll_top = 0; _this.items = []; _this.item = 0; _this.audio = null; _this.chatElm = null; _this.is_open = chat_set.is_open;// 开启首次发起 _this.chat_type = chat_set.chat_type; // 主动发起方式 0对话框 1邀请框 _this.chat_window = chat_set.chat_window; _this.chat_pop_time = chat_set.chat_pop_time; // 首次发起时间 _this.chat_is_reauto = chat_set.chat_is_reauto; _this.chat_reauto_time = chat_set.chat_reauto_time; // 反复发起时间 _this.chat_pop_num = chat_set.chat_pop_num; _this.chat_bottom = chat_set.chat_bottom; _this.chat_air = chat_set.chat_air; _this.chat_content_color = chat_set.chat_content_color; _this.chat_air_bg_color = chat_set.chat_air_bg_color; _this.chat_num_show = chat_set.chat_num_show; _this.chat_auto_show = typeof chat_set.chat_auto_show == "undefined" ? 0 : chat_set.chat_auto_show; _this.open_sdk = chat_set.open_sdk; _this.chat_off = chat_set.chat_off; _this.chat_content = chat_set.content; _this.mobile_chat_data = eval('('+chat_set.mobile_chat_data+')'); _this.mobile_config = $53.data("mobileCompanyInfo"); _this.chat_pop_times = 0;//主动发起循环定时器 _this.force_kf = "";//强制对话信息 _this.card_worker_name = "客服咨询";//卡片模式客服名称 _this.is_handle_talk = false;//判断是否处理过主动发起未开有对话情况,防止kf_new后加载 _this.topOffset = ''; _this.open_time = new Date().getTime(); _this.mobile_icon_type = "";// 客服图标类型 _this.minimize_height = 0;// 窗口最小化高度 _this.mobile_chat_inited = 0; // 窗口正常加载过 _this.talk_count = 0; // 发起次数 _this.init(); } _53_mobile_chat.prototype = new handler(); //继承事件处理基类 _53_mobile_chat.prototype.init = function(){ var _this = this; _this.chat_content = _this.formatContent(_this.chat_content); // 最小化模式特殊处理 if($53.data("mobile_icon") !== null){ _this.mobile_icon_type = $53.data("mobile_icon").m_icon_type; }else if(window._53App){ _this.mobile_icon_type = window._53App.getApp("icon").m_icon_type; } // 新增首次发起规则:图标模式1展示菜单栏;图标模式4(最小化模式)默认发起 if((_this.is_open == 1 && _this.chat_type == 0 && (_this.isOnline||(!_this.isOnline && _this.chat_off == 1))) || !!_this.mobile_icon_type){ _this.createChat(); if(_this.chat_bottom != 2) _this.show(); if((_this.open_sdk == 0 && !_this.mobile_icon_type) || (!!_this.mobile_icon_type && _this.is_open != "0")){ // 老版 || 新版 if (_this.chat_pop_time>0) { setTimeout(function() { if(document.getElementById('mini_chat') && document.getElementById('mini_chat').style.display != 'block') { _this.talk(); } },_this.chat_pop_time * 1000); }else{ if(document.getElementById('mini_chat') && document.getElementById('mini_chat').style.display != 'block') { _this.talk(); } } } } _this.isTalkHandle(); window.acc_chattype = 3; //强制对话方式 1:覆盖当前窗口 2:弹出新窗口,如失败,则覆盖 3:悬浮对话窗口(pc端使用,手机端强制对话兼容) window.show_mobile_chat = function(){_this.talk()}; window.close_mobile_chat = function(){_this.hide()}; window.change_kf_openurl = function(param){ if(typeof param != "undefined" )_this.params = param; _this.openSdkUrl() }; window.get_location = function(){_this.forceOpen()};//强制对话 window.hide_chat_card = function(e){_this.hideCard(e)} window.talk_to_mobile_chat = function(msg){ var msg = 'send_opt_msg_lua:'+ msg; document.getElementById("iframe_mobile_chat").contentWindow.postMessage(msg, '*'); } window.addEventListener("message", function( event ) { try{ _this.handleEventlisten(event.data); }catch(e){} }, false ); window.handle_is_talk = function(){//防止kf_new后加载 _this.isTalkHandle(); } // 监听物理返回 if((_this.mobile_config["stop_back"] == 1) && window.history && window.history.pushState) { if(navigator.userAgent.toLowerCase().indexOf('baiduboxapp') < 0){ window.addEventListener("popstate", function(e) { if(_this.mobile_icon_type == "4"){ _this.postMinimizeState("1") }else{ try{ if(document.getElementById('mini_chat') && document.getElementById('mini_chat').style.display == 'block') { _this.hide() } }catch (e){} } }, false); } } } _53_mobile_chat.prototype.isTalkHandle = function(){//如果init先加载 var _this = this; if($53.data("is_talk") != null && $53.data("is_talk") != '' && _this.is_open != 1 && _this.is_handle_talk === false) {//有对话无 _this.is_handle_talk = true; _this.force_kf = $53.data("is_talk"); _this.changeSetting(); _this.createChat(); if(!!_this.mobile_icon_type && _this.chat_bottom != 2) _this.show(); } } _53_mobile_chat.prototype.handleEventlisten = function(data){ var _this = this; // 弹框初始化之前获取最小化信息 if(JSON.stringify(data).indexOf('minimize_info') != -1 ){ _this.mobileMinimize(JSON.parse(data.substring(14))); } // 最小化和展开 1: 最小化; 2: 还原; 3: 隐藏 if(JSON.stringify(data).indexOf('minimize_state') != -1){ var state = JSON.parse(data.substring(15)).state; _this.mobileRestore(state) } // 图标模式7 百度落地页图标头像替换 if(data.indexOf('head_url') != -1){ var head_url = data.substring(9); if(!!document.getElementById('kf-bd-df-logo')){ document.getElementById('kf-bd-df-logo').style.backgroundImage = "url("+head_url+")"; } } // 访客端加载成功 if(JSON.stringify(data).indexOf('after_mobile_chat_create') != -1){ if(_this.mobile_icon_type != "4" && document.getElementById('mini_chat') && document.getElementById('mini_chat').style.display == 'block' && !(_this.companyId == '72640381' && !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/))){ document.getElementsByTagName('body')[0].style.overflow = 'hidden'; document.getElementsByTagName('body')[0].style.position = 'fixed'; document.getElementsByTagName('body')[0].style.width="100%"; } _this.mobile_chat_inited = "1" if(!!document.getElementById("mini_chat")) document.getElementById("mini_chat").className = ''; } if(data.indexOf('53kf_new_msg') != -1){ if(document.getElementById('msg_tip')){ var msg_tip_dom = document.getElementById('msg_tip'); if(msg_tip_dom.innerHTML != 'x' || _this.chat_window != 1) { if(msg_tip_dom.innerHTML == "x") msg_tip_dom.innerHTML = 0; if(_this.chat_num_show != 0) msg_tip_dom.style.display='block'; msg_tip_dom.innerHTML = 1 + parseInt(msg_tip_dom.innerHTML); } } if(!document.getElementById('msg_tip') || msg_tip_dom.innerHTML != 'x' || _this.chat_window != 1 || _this.mobile_icon_type == "4" || _this.mobile_icon_type == "7"){ // 为1时卡片展示按钮和选项以及卡片按钮盒子初始化 var type = _this.chat_air == "2" ? "1" : "" var outside_box = document.getElementById("outside_row_check_box"); if(outside_box) outside_box.parentNode.removeChild(outside_box); _this.msgSlid(_this.contentCode(data.substring(13),type)); try{ if(_this.open_sdk == 0 && _this.mobile_config["mobile_music"] != "") _this.audio.play(); }catch(e){} } try{ $53.callMsg();//回调自定义来消息方法 }catch(e){} return } if(data.indexOf('53kf_fk_new_msg') != -1){ try{ $53.fkCallMsg(_this.contentCode(data.substring(16)));//回调访客发送消息方法 }catch(e){} return } if(data == "close"){ // 最小化模式容错 if(_this.mobile_icon_type != "4"){ _this.hide(); if(_this.mobile_config["stop_back"] == 1 && window.history.state == 'forwardLIII'){ window.history.go(-1); } } } if(data == "map_close"){ document.getElementById('bd_map').style.display='none'; } if(data == "windowCnt" && _this.chat_window != 1){ _this.chatPop(); } if(data.indexOf('tel:') != -1){ window.location.href = data; } if(data.indexOf('ios12.0_vx_float_blur') != -1){ document.activeElement.scrollIntoViewIfNeeded(true); } if(data.indexOf('worker_name') != -1){ _this.card_worker_name = data.substring(12); try{ document.getElementById("card_worker_name").innerHTML = _this.card_worker_name; }catch (e){} } if(data == "ios13_float_blur"){ document.documentElement.scrollTop = _this.topOffset; document.body.scrollTop = _this.topOffset; } if(data == "ios13_float_focus"){ _this.topOffset = document.documentElement.scrollTop || document.body.scrollTop; } if(data == "get_force"){ _this.forceOpenLnk(); } } // 最小化状态访客端交互 1: 最小化; 2: 还原; 3: 隐藏 _53_mobile_chat.prototype.postMinimizeState = function(state){ var obj = { cmd: "minimize_state_lua", state: state } var msg = 'minimize_state_lua:'+ JSON.stringify(obj); try{ document.getElementById("iframe_mobile_chat").contentWindow.postMessage(msg, '*'); }catch(e){console.log(e)} } // 窗口最小化高度计算 _53_mobile_chat.prototype.mobileMinimize = function(data){ var _this = this; // 弹框最小化类型: 1. 移动端客服最小化模式 ; 2. 移动端客服最小化模式加访客端输入框 var minimize_type_ = data.type; // 是否首次发起 0.否 1.是 var first_talk = data.first; // 最小化弹框的高度 var client_width = document.body.clientWidth || document.documentElement.clientWidth; // 计算rem系数 var ratio = client_width < 375 ? "10": 375 <= client_width < 384 ? "10.24": 384 <= client_width < 414 ? "10.987":414 <= client_width < 424 ? "11.04": 424 <= client_width < 600 ? "13.04": 600 <= client_width < 768 ? "20.48": client_width/375*10; // 窗口最小化高度 _this.minimize_height = ratio * data.rem + 2 +"px" // 监听minimize_info后talk初始化 if(first_talk == "1"){ _this.talk(); } } // 窗口最小化和还原 1: 最小化; 2: 还原; 3: 隐藏 _53_mobile_chat.prototype.mobileRestore = function(state){ var _this = this; var minchat_height = _this.mobile_config["minchat_height"] == "" ? "90%" : (_this.mobile_config["minchat_height"]+"%"); if(state == "1"){ document.getElementById("iframe_mobile_chat").style.height = _this.minimize_height; document.getElementById("mini_chat").style.backgroundColor = ""; document.getElementById("mini_chat").style.height = "auto"; document.getElementsByTagName('body')[0].style.overflow = ''; document.getElementsByTagName('body')[0].style.position = ''; if(_this.mobile_config["stop_back"] == 1 && window.history.state == 'forwardLIII'){ window.history.go(-1); } if(_this.is_open == "1"){ if(_this.talk_count == "1"){ _this.talk_count++; // 首次发起时间 if (_this.chat_pop_time>0) { setTimeout(function() { if(_this.is_open == "1"){ _this.postMinimizeState("2") } },_this.chat_pop_time * 1000); }else{ if(_this.is_open == "1"){ _this.postMinimizeState("2") } } }else{ _this.chatPop(); } } }else if(state == "2"){ document.getElementById("iframe_mobile_chat").style.height = minchat_height; document.getElementById("mini_chat").style.backgroundColor = "rgba(0,0,0,.4)"; document.getElementById("mini_chat").style.height = "100%"; document.getElementsByTagName('body')[0].style.overflow = 'hidden'; document.getElementsByTagName('body')[0].style.position = 'fixed'; document.getElementsByTagName('body')[0].style.width="100%"; if(_this.mobile_config["stop_back"] == 1 && navigator.userAgent.toLowerCase().indexOf('baiduboxapp') < 0){ window.history.pushState('forwardLIII', null, ''); } }else if(state == "3"){ try{ if(document.getElementById('mini_chat') && document.getElementById('mini_chat').style.display == 'block') { _this.hide() } }catch (e){} } } _53_mobile_chat.prototype.createChat = function(){ var _this = this; //增加样式类 $53.creElm({ 'innerHTML':'body{margin:0;}#scroll-wrapper{-webkit-overflow-scrolling: touch; overflow-y: scroll;}@-webkit-keyframes twinkling{0% {opacity:0;} 100%{ opacity:1;}}.face_twinkle{-webkit-animation: twinkling 0.5s infinite ease-in-out;}#toolbar img{display:inline;}#toolbar a{color:white;font-size:16px;}html{-webkit-tap-highlight-color: rgba(0,0,0,0);}' },'style'); $53.creElm({ 'style':'font-size: 0px; z-index: 1000000; position: fixed; bottom: 0px;height:50px;width: 100%;display:none;', 'id':'mobile_minchat_div', 'innerHTML':''+_this.chat_content },'div'); _this.chatElm = document.getElementById('mobile_minchat_div'); var is_uc = 0; var is_ios = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); if (is_ios && navigator.userAgent.indexOf("UCBrowser") != -1) { is_uc = 1; } _this.createMinChat(is_ios,is_uc); _this.audio = document.createElement("audio"); if (_this.mobile_config["mobile_music"] != "" && _this.audio != null && _this.audio.canPlayType && _this.audio.canPlayType("audio/mpeg") && _this.isOnline) { _this.audio.src = _this.talkHost+"/sound/"+_this.mobile_config["mobile_music"]+".mp3"; //IOS 不允许自动播放声音 需要用户触发 IOS 9以上需要先load才能播放 _this.audio.load(); var play_voice = function() { _this.audio.play(); } window.addEventListener('touchstart', play_voice, false); _this.audio.addEventListener('play', function() {window.removeEventListener('touchstart', play_voice, false);}, false); } } _53_mobile_chat.prototype.createMinChat = function(is_uc,is_ios,type){ var _this = this; if(!!document.getElementById("mini_chat")) return; $53.creElm({ 'innerHTML':'.mini-chat-beforeiframecreate{height:0 !important;}' },'style'); if((_this.is_open == 1 && _this.open_sdk == 0) || type != undefined || _this.mobile_icon_type == "1" || _this.mobile_icon_type == "4"){ //if(_this.chat_window == 1 ) _this.kf_openurl = _this.getOpenUrl() + _this.params + _this.force_kf + '&minchat=1#' + location.href; //else _this.kf_openurl = _this.getOpenUrl() + _this.params + _this.force_kf + '&is_minchat=1#' + location.href; var iframe_close_html = ''; var close_top = _this.mobile_config["minchat_height"] == "" ? "10%" : ((100-_this.mobile_config["minchat_height"])+"%"); if(_this.mobile_config["zdyurl"] != "" && _this.chat_window != 1){ iframe_close_html = '
'; } var minchat_height = _this.mobile_config["minchat_height"] == "" ? "90%" : (_this.mobile_config["minchat_height"]+"%"); // 最小化模式创建dom if(_this.mobile_icon_type == "4"){ $53.creElm({ 'id': 'mini_chat', 'style': 'display:none;z-index:1000001;font-size:0;position:fixed;left:0;top:0;height:auto;', 'innerHTML':'
'+iframe_close_html },'div'); }else{ if(is_ios && is_uc){//IOS浏览器src为空会导致重复请求 $53.creElm({ 'id': 'mini_chat', 'style': 'display:none;z-index:1000001;font-size:0;position:fixed;left:0;top:0;height:100%;background:rgba(0,0,0,.4);', 'innerHTML':'
'+iframe_close_html },'div'); }else if(is_ios){ $53.creElm({ 'id': 'mini_chat', 'style': 'display:none;z-index:1000001;font-size:0;position:fixed;left:0;top:0;height:100%;background:rgba(0,0,0,.4);', 'innerHTML':'
'+iframe_close_html },'div'); }else{ $53.creElm({ 'id': 'mini_chat', 'style': 'display:none;z-index:1000001;font-size:0;position:fixed;left:0;top:0;height:100%;background:rgba(0,0,0,.4);', 'innerHTML':'
'+iframe_close_html },'div'); } } // 灰色蒙版特殊处理 if(_this.mobile_icon_type != "4"){ _this.mobile_chat_inited = 0; document.getElementById("mini_chat").className = ' } /* FILE ARCHIVED ON 18:12:12 Jul 05, 2022 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 08:21:52 Oct 21, 2023. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 304.697 exclusion.robots: 0.068 exclusion.robots.policy: 0.059 cdx.remote: 0.056 esindex: 0.01 LoadShardBlock: 222.883 (3) PetaboxLoader3.datanode: 245.398 (4) load_resource: 794.23 PetaboxLoader3.resolve: 726.021 */