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");
//document.write("");
var LimtSiteSiteName=["chat.jc35.com","chat.hbzhan.com","chat.afzhan.com","chat.gkzhan.com","chat.ybzhan.cn","chat.a-bm.cn","chat.chem17.com"];//小框金色的
var PaddingTopLoad=115;
var ChatCompanyID=626733;
function OpenChatBox(url) {
var iHeight = 698;
var iWidth = 1230;
var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置;
var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置;
window.open(url, 'window1', 'height=' + iHeight + ', width=' + iWidth + ', top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no,resizable=no, location=no, status=no');
//window.open(url, window, 'dialogWidth:700px; dialogHeight:600px;help:1;status:1;resizeable:0;');
}
//获取窗口高度
function getWindowHeight() {
var windowHeight = 0;
if (typeof (window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
//获取窗口宽度
function getWindowWidth() {
var windowWidth = 0;
if (typeof (window.innerWidth) == 'number') {
windowWidth = window.innerWidth;
}
else {
if (document.documentElement && document.documentElement.clientWidth) {
windowWidth = document.documentElement.clientWidth;
}
else {
if (document.body && document.body.clientWidth) {
windowWidth = document.body.clientWidth;
}
}
}
return windowWidth;
}
function ResetLeftDivpostion()
{
var _move = false;
var _x, _y;
var index_x, index_y;
var _hadMove = false;
jQuery("#KFRightScreen").bind("mousedown", downIndex);
jQuery(document).bind("mousemove", mmove);
jQuery(document).bind("mouseup", mup);
jQuery("#KFRightScreen").css("cursor", "move");
//jQuery("#KFRightScreen").css("-moz-user-select", "none");
function mmove(event) {
_hadMove = true;
//console.log("mmove hadMove = true");
if (_move) {
var x = event.pageX - _x;
var y = event.pageY - _y;
if(x>getWindowWidth()-10)
x=getWindowWidth()-10
if(y>getWindowHeight()-10)
y=getWindowHeight()-10
jQuery("#KFRightScreen").css({ top: y, left: x });
showDiv(x, y);
}
var tishi=document.getElementById("KFBoxTitle");
//e = e||event;
event = event || window.event;
var obj = event.srcElement?event.srcElement:event.target;
var u = navigator.userAgent;//当前浏览器类型
while(obj) {
if(!!u.match(/AppleWebKit.*Mobile.*/)){//手机端隐藏注释
obj = obj.offsetParent;
tishi.style.display="none";
}
else{
if(obj.id=="KFCenterScreen"||obj.id=="KFRightScreen"){
tishi.style.display="block";
var clientLeft=event.clientX+10;
var clientTop=event.clientY+10+document.documentElement.scrollTop+document.body.scrollTop;
tishi.style.left=clientLeft+"px";
tishi.style.top=clientTop+"px";
obj = null;
}
else{
obj = obj.offsetParent;
tishi.style.display="none";
}
}
}
}
function mup() {
//console.log("父移动鼠标松开");
_move = false;
_hadMove = false;
//console.log("mup hadMove = false");
}
jQuery("#KFRightScreen a").bind("mouseup",function(){
//console.log("子移动鼠标松开");
//根据是否发生移动状态来模拟click事件和拖拽后释放鼠标事件
if(!_hadMove){
ChatBoxClick();
}
});
function downIndex(e) {
_hadMove = false;
//console.log("downIndex hadMove = false");
_move = true;
_x = e.pageX - parseInt(jQuery("#KFRightScreen").css("left"));
_y = e.pageY - parseInt(jQuery("#KFRightScreen").css("top"));
}
function showDiv(x, y) {
setCookie("KFLeftScreenLeft_626733", x, 365);
setCookie("KFLeftScreenTop_626733", y, 365);
}
}
function rightBoxShow(){
if ((jQuery("#KFRightScreen")==null||jQuery("#KFRightScreen").length < 1)&&typeof getCookie("KfCenterBox_626733") != "undefined") {
var imgWidth=168;
if('1'!='1')
imgWidth=178;
var TempHeight=0;
if(IsLimtSite('chat.hbzhan.com',LimtSiteSiteName)){
TempHeight=50;
}
else
{
TempHeight=88;
}
var topMargin = getWindowHeight() / 2 - imgWidth / 2;
var abc = "";
if(imgWidth==178){
abc += "
";
abc += "
";
abc += "采购热线 15158897711";
}else{
abc += "
";
abc += "
点住鼠标左键,可以拖动到任意位置
";
jQuery("body").prepend(abc);
if (jQuery("#KFRightScreen") != null) {
ResetLeftDivpostion();
if(typeof getCookie("KFLeftScreenLeft_626733") != "undefined")
{
var leftpx=getCookie("KFLeftScreenLeft_626733");
jQuery("#KFRightScreen").css("left", leftpx + "px");
}
else
{
jQuery("#KFRightScreen").css("left", 10 + "px");
}
if (!( /msie/.test(navigator.userAgent.toLowerCase())) || ( /msie/.test(navigator.userAgent.toLowerCase())) && ('undefined' == typeof(document.body.style.maxHeight))){
if(typeof getCookie("KFLeftScreenTop_626733") != "undefined")
{
var toppx=getCookie("KFLeftScreenTop_626733");
jQuery("#KFRightScreen").css("top", toppx + "px");
if(IsLimtSite('chat.hbzhan.com',LimtSiteSiteName)){
jQuery("#KFRightScreen").animate({ height: 50+'px' }, 1000);
}
else
{
jQuery("#KFRightScreen").animate({ height: imgWidth+'px' }, 1000);
}
}
else{
jQuery("#KFRightScreen").css("top", topMargin + "px");
if(IsLimtSite('chat.hbzhan.com',LimtSiteSiteName)){
jQuery("#KFRightScreen").animate({ height: 50+'px' }, 1000);
}
else
{
jQuery("#KFRightScreen").animate({ height: imgWidth+'px' }, 1000);
}
}
}
jQuery("#KFRightScreen").show();
jQuery(window).resize(function(){
DelCookies("KFLeftScreenLeft_626733");
DelCookies("KFLeftScreenTop_626733");
leftMargin = 10;
jQuery("#KFRightScreen").css("left", leftMargin + "px");
if (!(jQuery.browser.msie) || (jQuery.browser.msie) && (jQuery.browser.version != "6.0")){
topMargin = getWindowHeight() / 2 - imgWidth / 2;
jQuery("#KFRightScreen").css("top", topMargin + "px");
}
});
}
}
}
function ChatBoxClick(){
console.log("KFRightScreen a click");
var strUrlReferrer="";
var RealUrlReferrer=window.location.href;
if(RealUrlReferrer.indexOf("bdminiprogram")>-1||RealUrlReferrer.indexOf("miniprogram")>-1){
strUrlReferrer=RealUrlReferrer;
}
var u = navigator.userAgent;
var chatUrl="https://web.archive.org/web/20230716161327/https://chat.hbzhan.com/Chat/ChatIndex/637554?Weburl="+strUrlReferrer;
if(!!u.match(/AppleWebKit.*Mobile.*/)){
chatUrl="https://web.archive.org/web/20230716161327/https://chat.hbzhan.com/Chat/MobileChatIndex/637554?Weburl="+strUrlReferrer;
}
OpenChatBox(chatUrl);
callStopGet();
return false;
}
jQuery(document).ready(function () {
//if(window.location.host=="www.hbzhan.com" ||window.location.host=="www.gkzhan.com" ||window.location.host=="www.afzhan.com" ){
rightNewBoxShow();
//}
//else{
//rightBoxShow();
//}
});
var webDefinitionKey="";
var CustomerAppID="";
var CallDefinitionKey="";
var _timer=0;
var _ContactionSuccess=false;
jQuery(document).ready(function () {
if(parseInt(1)!=2)
return;
if(getCookie("KfRightBox"+626733)!=null)
{
return;
}
if(getCookie("MyDefinitionKey")!=null)
{
var temp=getCookie("MyDefinitionKey").split(',');
var uservice=626733;
for (var i = 0; i < temp.length; i++)
{
if (temp[i] == uservice)
{
//console.log("NoOprate");
setCookie("KfCenterBox_626733", 1, 1); //修改初始中间邀请框不显示
sttCall(); //先执行一遍
setInterval(sttCall, 5000);
return ;
}
}
}
setTimeout(BeginCtebvis,10000);
});
function BeginCtebvis(){
var randomSubStr="";
var exp = new Date();
var chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
for(var i = 0; i < 18 ; i ++) {
var id = Math.floor(Math.random()*35);
randomSubStr+= chars[id];
}
webDefinitionKey='Z'+626733+'Z'+randomSubStr;
var NowDataTime=exp.getTime();
var NowTitle=encodeURI(document.title);
var link = encodeURI(window.location.href);
if(link.indexOf('.aspx')>=0)//非静态页不发送
return;
//有用户不想要,临时关闭下
if('chat.hbzhan.com'.indexOf('.chem17.')>=0&&'626733'=='269363')
return;
var StrPostUrl="//web.archive.org/web/20230716161327/http://chat.hbzhan.com/Chat/Ctebvis?webDefinitionKey="+webDefinitionKey+"&CustomerUserId="+637554+"&Title="+NowTitle+"&link="+link+"&v="+NowDataTime;
var script = document.createElement("script");
script.src=StrPostUrl;
document.body.appendChild(script);
document.body.removeChild(script);
setInterval(sttCall, 5000);
}
function callNotContaction(k,u,r){
//未发起响应,或者阻止响应
//console.log(k+";"+u+";"+r);
}
function callSuccessPK(){
//响应成功,发起联系
doSuccessPK();
//如果通知游客成功 停止继续执行,直到页面被重新载入.
_ContactionSuccess=true;
}
function callContactionError(){
//参数异常,或者执行出错
// console.log("发生异常!");
}
function callStopGet(){
_ContactionSuccess=false;
_timer=10086;
// console.log("关闭动作");
}
function callResult(r,k,u){
switch (parseInt(r))
{
case 1:
callStopGet();
setCookie("cResult"+k+u,r,1);
break;
case 3:
callSuccessPK();
setCookie("cResult"+k+u,r,1);
break;
case 4:
callStopGet();
setCookie("cResult"+k+u,r,1);
break;
}
}
function sttCall() {
if(_ContactionSuccess==true)
return;
_timer++;
var cookDefinitionKey="";
var cookKeyAppId="";
if(getCookie("CookDefinitionKey")!=null)
{
cookDefinitionKey=getCookie("CookDefinitionKey");
}
else
{
//console.log("CookDefinitionKeyNULL!");
return;
}
if(getCookie("CookKeyAppId")!=null)
{
cookKeyAppId=getCookie("CookKeyAppId");
}
else
{
// console.log("CookKeyAppIdNull!");
return;
}
if(getCookie("cResult"+cookDefinitionKey+cookKeyAppId)!=null)
{
var value=getCookie("cResult"+cookDefinitionKey+cookKeyAppId);
switch (parseInt(value))
{
case 3:
callSuccessPK();
_ContactionSuccess=true;
break;
default:
_ContactionSuccess=true;
_timer=10086;
break;
}
return;
}
// 36*5=180s 超过3分钟无响应视为挂机,放弃接下来的接口操作.
if(_timer<36 && _timer>3)
{
var exp = new Date();
var NowDataTime=exp.getTime();
//创建标签(createElement)
var script = document.createElement("script");
//添加地址
var scriptUrl="https://web.archive.org/web/20230716161327/https://chat.hbzhan.com/Chat/GetKFpkVS?webDefinitionKey="+cookDefinitionKey+"&cusUserId="+cookKeyAppId+"&v="+NowDataTime;
script.src=scriptUrl;
//添加给body的(成为body包涵的孩子)
document.body.appendChild(script);
document.body.removeChild(script);
}
}
function cookieEnabledFalse(){
//console.log("用户禁用或拒绝 Cookie");
}
function cookEnableTrue(y,k,a){
CustomerAppID=y;
CallDefinitionKey=k;
if(getCookie("MyDefinitionKey")==null)
{
setCookie("MyDefinitionKey",y,1);
}
else
{
var newKey=getCookie("MyDefinitionKey");
DelCookies("MyDefinitionKey");
setCookie("MyDefinitionKey",newKey+","+y,1);
}
if(getCookie("CookDefinitionKey")==null)
{
setCookie("CookDefinitionKey",k,1);
}
if(getCookie("CookKeyAppId")==null)
{
setCookie("CookKeyAppId",a,1);
}
//console.log("Cookie正常;"+y+";"+k);
}
function setCookie(name, value, expireday) {
var exp = new Date();
exp.setTime(exp.getTime() + expireday*24*60*60*1000);
document.cookie = name+"="+escape(value)+"; expires"+"="+exp.toGMTString();
}
function getCookie(name) {
var cookieArr = document.cookie.match(new RegExp(name+"=[a-zA-Z0-9]*", "gi"));
if(cookieArr != null && cookieArr.length>0){
var cookieVal = cookieArr[0].split("=");
if(cookieVal[0] == name) {
return unescape(cookieVal[1]);
}
}
}
function DelCookies(name)
{
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval=getCookie(name);
if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString() + ";path=/";
}
function PostData(){
var cookDefinitionKey="";
var cookKeyAppId="";
if(getCookie("CookDefinitionKey")!=null)
{
cookDefinitionKey=getCookie("CookDefinitionKey");
}
else
{
//console.log("CookDefinitionKeyNULL!");
return;
}
if(getCookie("CookKeyAppId")!=null)
{
cookKeyAppId=getCookie("CookKeyAppId");
}
else
{
// console.log("CookKeyAppIdNull!");
return;
}
var PostURl="https://web.archive.org/web/20230716161327/http://chat.hbzhan.com/Chat/TempVistorSata?webDefinitionKey="+cookDefinitionKey+"&cusUserId="+cookKeyAppId;
DelCookies("cResult"+cookDefinitionKey+cookKeyAppId);
setCookie("cResult"+cookDefinitionKey+cookKeyAppId,1,1);
jQuery.post(PostURl);
}
function doSuccessPK(){
if(document.getElementById("KFCenterScreen"))
{
var element=document.getElementById("KFCenterScreen");
document.body.removeChild(element);
}
var abc = "";
abc += "
";
abc += "
";
abc += "
来自一条APP端客服的请求,是否会话?
";
abc += "
";
abc += "
";
var topMargin = getWindowHeight() / 2 - 140 / 2;
var leftMargin = getWindowWidth() / 2 - 359 / 2;
jQuery("body").prepend(abc);
if (jQuery("#KFCenterScreen") != null) {
jQuery("#KFCenterScreen .accept").click(function(){
var strUrlReferrer="";
PostData();
var u = navigator.userAgent;
if(/swan\//.test(window.navigator.userAgent)||/^webswan-/.test(window.name)){
strUrlReferrer+="?bdminiprogram=1";
}
var chatUrl="https://web.archive.org/web/20230716161327/https://chat.hbzhan.com/Chat/ChatIndex/637554?Weburl="+strUrlReferrer;
if(!!u.match(/AppleWebKit.*Mobile.*/)){
chatUrl="https://web.archive.org/web/20230716161327/https://chat.hbzhan.com/Chat/MobileChatIndex/637554?Weburl="+strUrlReferrer;
}
OpenChatBox(chatUrl);
// callStopGet();
});
}
jQuery("#KFCenterScreen").show();
leftMargin = getWindowWidth() / 2 - 359 / 2;
jQuery("#KFCenterScreen").css("left", leftMargin + "px");
if (!(jQuery.browser.msie) || (jQuery.browser.msie) && (jQuery.browser.version != "6.0")){
topMargin = getWindowHeight() / 2 - 140 / 2;
jQuery("#KFCenterScreen").css("top", topMargin + "px");
}
}
function CloseAPPKFCenter(){
jQuery("#KFCenterScreen").hide();
}
function rightNewBoxShow(){
rightBoxShow();//左边没要求要新框 应该会有样式影响,新的自定义金色链接框写死右边的 20200513
}
function IsLimtSite(BeSiteName,SiteName){
return true;
for(var i=0;i