kefu233Utils = { getCookie: function(name) { var cookieValue = ""; var search = name + "="; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) { end = document.cookie.length } cookieValue = document.cookie.substring(offset, end) } } return cookieValue }, getSubCookie: function(name, subname) { var allcookie = this.getCookie(name); var cookieValue = ""; var search = subname + "="; if (allcookie.length > 0) { offset = allcookie.indexOf(search); if (offset != -1) { offset += search.length; end = allcookie.indexOf("&", offset); if (end == -1) { end = allcookie.length } cookieValue = allcookie.substring(offset, end) } } return cookieValue }, user: function() { var uname = this.getSubCookie("wxuserinforset", "username"), uid = this.getSubCookie("wxuserinforset", "userID"); if (uname != null && uname != "") { return { "uid": uid, "uname": unescape(uname) } } else { return "" } }, param: function() { var user = this.user(); if (typeof user == "object") { NTKF_PARAM.uid = user.uid; NTKF_PARAM.uname = user.uname } else { NTKF_PARAM.uid = ""; NTKF_PARAM.uname = "" } }, paramstr: function() { var user = this.user(); if (typeof user == "object") { return "&uid=" + user.uid + "&uname=" + user.uname } return "" }, hostname: function() { return window.location.hostname; }(), scriptReady: function(a, b) { var c = "object" == typeof a ? a : window.document.getElementById(a); c.readyState ? c.onreadystatechange = function() { (c.attachEvent ? "complete" === c.readyState : "loading" !== c.readyState) && (c.onreadystatechange = null, b && b()); } : c.onload = function() { b && b(); }; }, getScript: function(a, b, c) { var d, e = window.document.createElement("script"); if (e.type = "text/javascript", e.charset = "utf-8", e.defer = "defer", e.async = "async", e.src = a, b) for (d in b) e[d] = b[d]; window.document.getElementsByTagName("head")[0].appendChild(e), c && this.scriptReady(e, c); }, growingioTrack: function() { var url = window.location.href; var pathname = window.location.pathname.toLowerCase(); var advisory_service_offer_var = "其他"; if (url.toLowerCase().indexOf("233.com/tiku") > -1) { advisory_service_offer_var = "题库"; } else if (url.toLowerCase().indexOf("233.com/vip") > -1) { advisory_service_offer_var = "vip题库"; } else if (url.toLowerCase().indexOf("233.com/uc") > -1 || url.toLowerCase().indexOf("/account") > -1) { advisory_service_offer_var = "会员中心"; } else if (url.toLowerCase().indexOf("233.com/search/") > -1) { advisory_service_offer_var = "课程试听"; } else if (pathname.indexOf("/shop/home/pay/") == 0) { advisory_service_offer_var = "收银台"; } else if (pathname == '/cuxiao/') { advisory_service_offer_var = "常规营销促销页"; } else if (url.toLowerCase().indexOf("www.233.com/about/kf.html") > -1) { advisory_service_offer_var = "客服中心"; } else if (url.toLowerCase().indexOf("233.com/shop/") > -1) { advisory_service_offer_var = "结算中心"; } else if (pathname == '/') { advisory_service_offer_var = "网站首页"; } else if (url.toLowerCase().indexOf("wx.233.com") > -1 || url.toLowerCase().indexOf("v.233.com") > -1) { advisory_service_offer_var = "课程"; } else if (url.toLowerCase().indexOf("www.233.com") > -1 || url.toLowerCase().indexOf("m.233.com") > -1) { advisory_service_offer_var = "资讯"; } else if (url.toLowerCase().indexOf("zb.233.com") > -1) { advisory_service_offer_var = "直播"; } else if (url.toLowerCase().indexOf("t.233.com") > -1) { advisory_service_offer_var = "测试"; }; gio('track', 'advisory_service', { 'advisory_service_page_var': url, 'advisory_service_offer_var': advisory_service_offer_var }); }, dm: function() { var path = window.location.pathname, hostname = window.location.hostname; if (path == '') return ''; var arr = path.split("/"); if (hostname == 'www.233.com') { return arr.length > 2 ? "chengkao" == arr[1] && "xwyy" == arr[2] ? "xwyy" : arr[1] : arr[1]; } if (hostname == 'wx.233.com') { return arr[1]; } if (hostname == 'm.233.com') { return arr[1]; } return arr[1]; }(), filename: function() { if (parseInt(this.ksClassId) > 0) { return 'ks/' + this.ksClassId; } if ("string" == typeof _siteDoMain) { return _siteDoMain; } if ("undefined" != typeof _siteKsClassId) { return 'ks/' + _siteKsClassId; } if ("undefined" != typeof _siteWxClassId) { return 'wx/' + _siteWxClassId; } return this.dm; }, kfid: 'kf_9278_1464743622579', isid: false, ksClassId: 0, getKfId: function(res) { var self = this; if (res.s == 10006) { self.ksClassId = res.list; } else { self.ksClassId = -1; } kefu233.presale(); }, /** * 233网校App版本 * @param {*} options 参数对象 */ appVer: function(options) { var wxua = navigator.userAgent.toLowerCase(), app = { 'platform': '', 'version': 0 }; if (wxua.match(/wx233/i) != null && wxua.match(/wx233/i)[0] === "wx233") { app.version = parseInt(wxua.match(/wx233\/\d+\.\d+\.\d+/).toString().replace(/wx233\//g, '').replace(/\./g, '')); if (wxua.indexOf('android') > -1 || wxua.indexOf('adr') > -1) { //Android app.platform = "ADR" } else { //!!wxua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) app.platform = "IOS" } } return app; }, kefu2: function(filename, callBack) { var self = this, sites = [], site = null; if (filename.indexOf('wx/') != -1) { sites = _gulpConfig18.getSitesByWxClassId(filename.replace('wx/', '')); if (sites.length > 0) { site = sites[0]; } } else if (filename.indexOf('ks/') != -1) { sites = _gulpConfig18.getSitesByKsClassId(filename.replace('ks/', '')); if (sites.length > 0) { site = sites[0]; } } else { sites = _gulpConfig18.hostname == 'wx.233.com' ? _gulpConfig18.getSitesByWxDomain(filename) : _gulpConfig18.getSitesByDomain(filename); if (sites.length > 0) { site = sites[0]; } } self.isid = true, site != null && (self.kfid = site.kfId), callBack && callBack(); }, kefu: function(callBack) { if (this.isid) { callBack && callBack(); return; } var self = this, user = self.user(), app = self.appVer(); // if ((typeof user == "object" || app.platform == 'ADR' || app.platform == 'IOS') && self.ksClassId == 0) { // self.getScript('https://api.233.com/v1/sitenews/activity/eleven/eleven18/mylable?callback=kefu233Utils.getKfId', {}); // return; // } var filename = self.filename(); if ("object" == typeof _gulpConfig18) { self.kefu2(filename, callBack); } else { self.getScript('https://img.233.com/x/plus/cf/2.0.0/config.js?v=2.0.0', {}, function() { self.kefu2(filename, callBack); }); } } }; if ((/AppleWebKit.*Mobile/i.test(navigator.userAgent) || /Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) || /MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent)) && !/iPad/i.test(navigator.userAgent) && location.hash != "#m") { NTKF_PARAM = { siteid: "kf_9278", settingid: "kf_9278_1464743622579", uid: "", uname: "", isvip: "0", userlevel: "1", erpparam: "" }, kefu233 = { presale: function() { kefu233Utils.param(), kefu233Utils.kefu(function() { NTKF.im_openInPageChat(kefu233Utils.kfid); }); typeof gio != "undefined" && kefu233Utils.growingioTrack(); }, aftersale: function() { kefu233Utils.param(), kefu233Utils.kefu(function() { NTKF.im_openInPageChat(kefu233Utils.kfid); }); typeof zhuge != "undefined" && zhuge.track("报名咨询"); // kefu233Utils.param(), // NTKF.im_openInPageChat("kf_9278_1464680771480"); // typeof zhuge != "undefined" && zhuge.track("售后咨询"); }, group: function() { kefu233Utils.param(), NTKF.im_openInPageChat("kf_9278_1531963707284"); typeof gio != "undefined" && kefu233Utils.growingioTrack(); } }, ! function(a, b, c) { var d = { scriptReady: function(a, b) { var c = "object" == typeof a ? a : window.document.getElementById(a); c.readyState ? c.onreadystatechange = function() { (c.attachEvent ? "complete" === c.readyState : "loading" !== c.readyState) && (c.onreadystatechange = null, b && b()) } : c.onload = function() { b && b() } }, getScript: function(a, b, c) { var d, e = window.document.createElement("script"); if (e.type = "text/javascript", e.charset = "utf-8", e.defer = "defer", e.async = "async", e.src = a, b) { for (d in b) { e[d] = b[d] } } window.document.getElementsByTagName("head")[0].appendChild(e), c && this.scriptReady(e, c) } }; d.getScript(a, b, c) }("//dl.ntalker.com/js/xn6/ntkfstat.js?siteid=kf_9278") } else { kefu233 = { presale: function() { kefu233Utils.kefu(function() { window.open("http://downt.ntalker.com/t2d/chat.php?siteid=kf_9278&settingid=" + kefu233Utils.kfid + "&baseuri=http%3A%2F%2Fdl.ntalker.com%2Fjs%2Fxn6%2F" + kefu233Utils.paramstr(), "_blank", "height=660,width=625,fullscreen=3,top=" + (screen.availHeight - 660) / 2 + ",left=" + (screen.availWidth - 625) / 2 + ",status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no,fullscreen=no") }); typeof gio != "undefined" && kefu233Utils.growingioTrack(); }, aftersale: function() { this.presale(); // window.open("http://downt.ntalker.com/t2d/chat.php?siteid=kf_9278&settingid=kf_9278_1464680771480&baseuri=http%3A%2F%2Fdl.ntalker.com%2Fjs%2Fxn6%2F" + kefu233Utils.paramstr(), "_blank", "height=660,width=625,fullscreen=3,top=" + (screen.availHeight - 660) / 2 + ",left=" + (screen.availWidth - 625) / 2 + ",status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no,fullscreen=no") // typeof zhuge != "undefined" && zhuge.track("售后咨询"); }, group: function() { window.open("http://downt.ntalker.com/t2d/chat.php?siteid=kf_9278&settingid=kf_9278_1531963707284&baseuri=http%3A%2F%2Fdl.ntalker.com%2Fjs%2Fxn6%2F" + kefu233Utils.paramstr(), "_blank", "height=660,width=625,fullscreen=3,top=" + (screen.availHeight - 660) / 2 + ",left=" + (screen.availWidth - 625) / 2 + ",status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no,fullscreen=no") typeof gio != "undefined" && kefu233Utils.growingioTrack(); } } }; /*kefu233={presale:function(){window.open("//www.53kf.com/company.php?arg=examda123&style=1&kflist=off&kf=&zdkf_type=2&language=zh-cn&charset=gbk&lytype=0&referer={hz6d_referer}&keyword=http%3A//wx.233.com/account/home/&tfrom=1&tpl=crystal_blue","_blank","height=473,width=703,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=no,location=no,titlebar=no")},aftersale:function(){window.open("//www.53kf.com/company.php?arg=examda123&style=1&kflist=off&kf=&zdkf_type=2&language=zh-cn&charset=gbk&lytype=0&referer={hz6d_referer}&keyword=http%3A//wx.233.com/account/home/&tfrom=1&tpl=crystal_blue","_blank","height=473,width=703,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=no,location=no,titlebar=no")}};*/