// JavaScript Document var BROWSER = {}; var USERAGENT = navigator.userAgent.toLowerCase(); browserVersion({'ie':'msie','firefox':'','chrome':'','opera':'','safari':'','mozilla':'','webkit':'','maxthon':'','qq':'qqbrowser'}); if(BROWSER.safari) { BROWSER.firefox = true; } BROWSER.opera = BROWSER.opera ? opera.version() : 0; HTMLNODE = document.getElementsByTagName('head')[0].parentNode; if(BROWSER.ie) { BROWSER.iemode = parseInt(typeof document.documentMode != 'undefined' ? document.documentMode : BROWSER.ie); HTMLNODE.className = 'ie_all ie' + BROWSER.iemode; } var lang1='请输入商家关键词'; var lang2='抱歉,你的浏览器不支持此操作。\n请使用按键 Ctrl+D 收藏拉手。'; function browserVersion(types) { var other = 1; for(i in types) { var v = types[i] ? types[i] : i; if(USERAGENT.indexOf(v) != -1) { var re = new RegExp(v + '(\\/|\\s)([\\d\\.]+)', 'ig'); var matches = re.exec(USERAGENT); var ver = matches != null ? matches[2] : 0; other = ver !== 0 && v != 'mozilla' ? 0 : other; }else { var ver = 0; } eval('BROWSER.' + i + '= ver'); } BROWSER.other = other; } function check_all(obj,id,n) { for(var i=0;i请选择二级地区'); IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&it618_area_id="+it618_area_id+""+"&formhash=f731245c", {ac:"getwaimaiarea"},function (data, textStatus){ IT618_WAIMAI("#it618_area_id1").html(data); }, "html"); } function getwaimaiclass(it618_class_id){ IT618_WAIMAI("#it618_class_id1").html(''); IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&it618_class_id="+it618_class_id+"&formhash=f731245c", {ac:"getwaimaiclass"},function (data, textStatus){ IT618_WAIMAI("#it618_class_id1").html(data); }, "html"); } IT618_WAIMAI.ajaxSetup({cache:false}); var dialog_renzheng; KindEditor.ready(function(K) {K('.renzheng').click(function() { IT618_WAIMAI(".it618_members_login").click();return; getrenzheng(K); });}); var dialog_mysale; KindEditor.ready(function(K) {K('#mysale').click(function() { getmysale(K); });}); var dialog_mysale1; KindEditor.ready(function(K) {K('#mysale1').click(function() { getmysale1(K); });}); KindEditor.ready(function(K) {K('#tmprwbtn').click(function() { IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:showrw&gwcid="+salegwcid, {ac:"it618"},function (data, textStatus){ if(data=="1"){ alert("抱歉,参数有误!"); return; } var tmparr=data.split("it618_split"); dialog_rw = K.dialog({ width : 580, title : tmparr[0], body : '
'+tmparr[1]+'
', closeBtn : { name : '关闭', click : function(e) { dialog_rw.remove(); } } }); }, "html"); });}); var salegwcid; function rw(gwcid){ salegwcid=gwcid; document.getElementById("tmprwbtn").click(); } var dialog_mycollect; KindEditor.ready(function(K) {K('#mycollect').click(function() { getmycollect(K); });}); var dialog_saletui,saletuiid=0; KindEditor.ready(function(K) {K('#saletui').click(function() { getsaletui(K); });}); var dialog_salepj,salepjid=0; KindEditor.ready(function(K) {K('#salepj').click(function() { getsalepj(K); });}); KindEditor.ready(function(K) {K('.a-2').click(function() { getrenzheng(K); });}); var dialog_map; KindEditor.ready(function(K) {K('.waimaimap').click(function() { getwaimaimap(K,this); });}); KindEditor.ready(function(K) {K('.tmpwaimaimap').click(function() { getwaimaimap(K,this); });}); var dialog_share; KindEditor.ready(function(K) {K('.getshare').click(function() { getshare(K,this); });}); function getrenzheng(K){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:showrenzheng", {ac:"add"},function (data, textStatus){ var tmparr=data.split("it618_split"); dialog_renzheng = K.dialog({ width : 1100, height: 520, title : tmparr[0], body : '
'+tmparr[1]+'
', closeBtn : { name : '关闭', click : function(e) { dialog_renzheng.remove(); } } }); }, "html"); } function getmycollect(K){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:mycollect", {ac:"add"},function (data, textStatus){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&formhash=f731245c", {ac:"collectlist_get",ac1:"pcmycollect"},function (data1, textStatus){ var tmparr=data.split("it618_split"); var tmparr1=data1.split("it618_split"); var bodytmp=tmparr[1]; bodytmp=bodytmp.replace("it618mycollectsum",tmparr1[0]); bodytmp=bodytmp.replace("it618mycollectlist",tmparr1[1]); dialog_mycollect = K.dialog({ width : 980, height: 668, title : tmparr[0], body : bodytmp, closeBtn : { name : '关闭', click : function(e) { dialog_mycollect.remove(); } } }); }, "html"); }, "html"); } function getmysale(K){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:mysale", {ac:"it618"},function (data, textStatus){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&formhash=f731245c", {ac:"mysalelist_get",ac1:"pcmysale"},function (data1, textStatus){ var tmparr=data.split("it618_split"); var tmparr1=data1.split("it618_split"); var bodytmp=tmparr[1]; bodytmp=bodytmp.replace("it618_mysalesum",tmparr1[0]); bodytmp=bodytmp.replace("it618_mysalelist",tmparr1[1]); bodytmp=bodytmp.replace("it618_mysalepage",tmparr1[2]); dialog_mysale = K.dialog({ width : 1200, height: 630, title : tmparr[0], body : bodytmp, closeBtn : { name : '关闭', click : function(e) { dialog_mysale.remove(); } } }); }, "html"); }, "html"); } function getmysale1(K){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:mysale1", {ac:"it618"},function (data, textStatus){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&formhash=f731245c", {ac:"moneylist_get"},function (data1, textStatus){ var tmparr=data.split("it618_split"); var tmparr1=data1.split("it618_split"); var bodytmp=tmparr[1]; bodytmp=bodytmp.replace("it618_mysalesum",tmparr1[0]); bodytmp=bodytmp.replace("it618_mysalelist",tmparr1[1]); bodytmp=bodytmp.replace("it618_mysalepage",tmparr1[2]); dialog_mysale1 = K.dialog({ width : 900, height: 580, title : tmparr[0], body : bodytmp, closeBtn : { name : '关闭', click : function(e) { dialog_mysale1.remove(); } } }); }, "html"); }, "html"); } var sqlurl="";sqlurl1="";sqlurl2=""; function getmysale1list(url){ IT618_WAIMAI.get(url+sqlurl1+"&formhash=f731245c", {ac:"moneylist_get"},function (data, textStatus){ var tmparr=data.split("it618_split"); IT618_WAIMAI("#mysalesum").html(tmparr[0]); IT618_WAIMAI("#mysalelist").html(tmparr[1]); IT618_WAIMAI("#mysalepage").html(tmparr[2]); document.getElementById("mysaleurl").value=url; }, "html"); } function searchmysale1(){ if(parseInt(document.getElementById("it618_time1").value.replace(/-/g,""))>parseInt(document.getElementById("it618_time2").value.replace(/-/g,""))){ alert("开始日期不能大于截止日期!"); return false; } var it618_shopid=document.getElementById("it618_shopid").value; var it618_time1=document.getElementById("it618_time1").value; var it618_time2=document.getElementById("it618_time2").value; url="https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"; sqlurl1="&it618_shopid="+it618_shopid+"&it618_time1="+it618_time1+"&it618_time2="+it618_time2; getmysale1list(url); document.getElementById("mysaleurl").value=url; } function getmycollectlist(url){ document.getElementById("img_loading").style.display=""; document.getElementById("mycollectlist").style.display="none"; IT618_WAIMAI.get(url+"&formhash=f731245c", {ac:"collectlist_get",ac1:"pcmycollect"},function (data, textStatus){ var tmparr=data.split("it618_split"); IT618_WAIMAI("#mycollectsum").html(tmparr[0]); IT618_WAIMAI("#mycollectlist").html(tmparr[1]); document.getElementById("img_loading").style.display="none"; document.getElementById("mycollectlist").style.display=""; document.getElementById("mycollecurl").value=url; }, "html"); } function delcollect(){ IT618_WAIMAI.post("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&ac=delcollect"+"&formhash=f731245c",IT618_WAIMAI("#mycollectids").serialize(),function (data, textStatus){ var tmparr=data.split("it618_split"); if(tmparr[0]=="ok"){ alert(tmparr[1]); getmycollectlist(document.getElementById("mycollecurl").value); }else{ alert(data); } }, "html"); } function getmysalelist(url){ document.getElementById("img_loading").style.display=""; document.getElementById("mysalelist").style.display="none"; IT618_WAIMAI.get(url+sqlurl+"&formhash=f731245c", {ac:"mysalelist_get",ac1:"pcmysale"},function (data, textStatus){ var tmparr=data.split("it618_split"); IT618_WAIMAI("#mysalesum").html(tmparr[0]); IT618_WAIMAI("#mysalelist").html(tmparr[1]); IT618_WAIMAI("#mysalepage").html(tmparr[2]); document.getElementById("img_loading").style.display="none"; document.getElementById("mysalelist").style.display=""; document.getElementById("mysaleurl").value=url; }, "html"); } function searchmysale(){ if(parseInt(document.getElementById("it618_time1").value.replace(/-/g,""))>parseInt(document.getElementById("it618_time2").value.replace(/-/g,""))){ alert("开始日期不能大于截止日期!"); return false; } var mysalepname=document.getElementById("mysalepname").value; var mysalestate=document.getElementById("mysalestate").value; var it618_time1=document.getElementById("it618_time1").value; var it618_time2=document.getElementById("it618_time2").value; url="https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"; sqlurl="&pname="+mysalepname+"&state="+mysalestate+"&it618_time1="+it618_time1+"&it618_time2="+it618_time2; getmysalelist(url); document.getElementById("mysaleurl").value=url; } function tuikuan(saleid){ if(confirm("")){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&saleid="+saleid+"&formhash=f731245c", {ac:"tuikuan"},function (data, textStatus){ var tmparr=data.split("it618_split"); if(tmparr[0]=="ok"){ alert(tmparr[1]); getmysalelist(document.getElementById("mysaleurl").value); }else{ alert(data); } }, "html"); } } function shouhuo(saleid){ if(confirm("")){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&saleid="+saleid+"&formhash=f731245c", {ac:"shouhuo"},function (data, textStatus){ var tmparr=data.split("it618_split"); if(tmparr[0]=="ok"){ alert(tmparr[1]); getmysalelist(document.getElementById("mysaleurl").value); }else{ alert(data); } }, "html"); } } function setsaletui(saleid){ if(saletuiid==0){ saletuiid=saleid; IT618_WAIMAI("#saletui").click(); } } function setsalepj(saleid){ if(salepjid==0){ salepjid=saleid; IT618_WAIMAI("#salepj").click(); } } function getsaletui(K){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:saletui"+"&saleid="+saletuiid, {ac:"it618"},function (data, textStatus){ var tmparr=data.split("it618_split"); dialog_saletui = K.dialog({ width : 550, title : tmparr[0], body : '
'+tmparr[1]+'
', closeBtn : { name : '关闭', click : function(e) { dialog_saletui.remove(); saletuiid=0; } } }); IT618_WAIMAI('.ns-sub-a').click(function(){ if(document.getElementById("tuivalue").value==''){ alert(""); document.getElementById("tuivalue").focus(); return; } if(confirm("")){ IT618_WAIMAI.post("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&ac=saletui"+"&saleid="+saletuiid+"&formhash=f731245c",IT618_WAIMAI("#it618_saletui").serialize(),function (data, textStatus){ var tmparr=data.split("it618_split"); if(tmparr[0]=="ok"){ alert(tmparr[1]); dialog_saletui.remove(); getmysalelist(document.getElementById("mysaleurl").value); saletuiid=0; }else{ alert(data); } }, "html"); } }) IT618_WAIMAI('.ns-sub-b').click(function(){ dialog_saletui.remove(); saletuiid=0; }) }, "html"); } function getsalepj(K){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:salepj"+"&saleid="+salepjid, {ac:"it618"},function (data, textStatus){ var tmparr=data.split("it618_split"); dialog_salepj = K.dialog({ width : 533, title : tmparr[0], body : '
'+tmparr[1]+'
', closeBtn : { name : '关闭', click : function(e) { dialog_salepj.remove(); salepjid=0; } } }); IT618_WAIMAI('.ns-sub-a').click(function(){ if(getstrlen1(document.getElementById("pjvalue").value)<5){ alert("评价内容字数不能少于5个!"); return; } document.getElementById("pjvalue").value=document.getElementById("pjvalue").value.replace(/\n/g,"[br]"); if(confirm(tmparr[2])){ IT618_WAIMAI.post("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:ajax"+"&ac=salepj"+"&saleid="+salepjid+"&formhash=f731245c",IT618_WAIMAI("#it618_salepj").serialize(),function (data, textStatus){ var tmparr=data.split("it618_split"); if(tmparr[0]=="ok"){ alert(tmparr[1]); dialog_salepj.remove(); getmysalelist(document.getElementById("mysaleurl").value); salepjid=0; }else if(tmparr[0]=="editok"){ alert(tmparr[1]); dialog_salepj.remove(); getpjlist(pjurl); salepjid=0; }else{ alert(data); } }, "html"); } }) IT618_WAIMAI('.ns-sub-b').click(function(){ dialog_salepj.remove(); salepjid=0; }) }, "html"); } function getstrlen1(str) { ///鑾峰緱瀛楃涓插疄闄呴暱搴︼紝涓枃2锛岃嫳鏂1 ///瑕佽幏寰楅暱搴︾殑瀛楃涓 var realLength = 0, len = str.length, charCode = -1; for (var i = 0; i < len; i++) { charCode = str.charCodeAt(i); if (charCode >= 0 && charCode <= 128) realLength += 1; else realLength += 2; } return realLength; } function setpjcolor1(id){ document.getElementById("lab1").style.color="#000"; document.getElementById("lab2").style.color="#000"; document.getElementById("lab3").style.color="#000"; document.getElementById("lab"+id).style.color="#FF6600"; } function getwaimaimap(K,obj){ IT618_WAIMAI.get("https://cpfw.sseuu.com/plugin.php?id=it618_waimai:showmap"+"&sid="+obj.name, {ac:"it618"},function (data, textStatus){ var tmparr=data.split("it618_split"); dialog_map = K.dialog({ width : 980, height: 580, title : tmparr[0], body : '
'+tmparr[1]+'
', closeBtn : { name : '关闭', click : function(e) { dialog_map.remove(); } } }); }, "html"); } function getwaimaimapbtn(sid){ IT618_WAIMAI(".tmpwaimaimap").attr("name",sid); IT618_WAIMAI(".tmpwaimaimap").click(); } function getshare(K,obj){ var tmparr=obj.id.split("it618_split"); dialog_share = K.dialog({ width : 430, height: 580, title : '分享', body : '', closeBtn : { name : '关闭', click : function(e) { dialog_share.remove(); } } }); } function _attachEvent(obj, evt, func, eventobj) { eventobj = !eventobj ? obj : eventobj; if(obj.addEventListener) { obj.addEventListener(evt, func, false); } else if(eventobj.attachEvent) { obj.attachEvent('on' + evt, func); } } function showTopLink() { if(document.getElementById('body_wrap')){ var viewPortHeight = parseInt(document.documentElement.clientHeight); var scrollHeight = parseInt(document.body.getBoundingClientRect().top); var basew = parseInt(document.getElementById('body_wrap').clientWidth); var sw = document.getElementById('scrolltop').clientWidth; if (basew < 1000) { var left = parseInt(fetchOffset(document.getElementById('body_wrap'))['left']); left = left < sw ? left * 2 - sw : left; document.getElementById('scrolltop').style.left = ( basew + left ) + 'px'; } else { document.getElementById('scrolltop').style.left = 'auto'; document.getElementById('scrolltop').style.right = 0; } if (BROWSER.ie && BROWSER.ie < 7) { document.getElementById('scrolltop').style.top = viewPortHeight - scrollHeight - 150 + 'px'; } if (scrollHeight < -100) { document.getElementById('scrolltop').style.visibility = 'visible'; } else { document.getElementById('scrolltop').style.visibility = 'hidden'; } } } function fetchOffset(obj, mode) { var left_offset = 0, top_offset = 0, mode = !mode ? 0 : mode; if(obj.getBoundingClientRect && !mode) { var rect = obj.getBoundingClientRect(); var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); if(document.documentElement.dir == 'rtl') { scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth; } left_offset = rect.left + scrollLeft - document.documentElement.clientLeft; top_offset = rect.top + scrollTop - document.documentElement.clientTop; } if(left_offset <= 0 || top_offset <= 0) { left_offset = obj.offsetLeft; top_offset = obj.offsetTop; while((obj = obj.offsetParent) != null) { position = getCurrentStyle(obj, 'position', 'position'); if(position == 'relative') { continue; } left_offset += obj.offsetLeft; top_offset += obj.offsetTop; } } return {'left' : left_offset, 'top' : top_offset}; }