top_footer.js 7.52 KB
/*! dili 2016-01-06 */
function replaceAll(str,sptr,sptr1){for(;str.indexOf(sptr)>=0;)str=str.replace(sptr,sptr1);return str}$(function(){var nav='<div class="responsive clearfix"><div class="left">欢迎来到农丰网! 请<a class="lay-in" href="#">登录</a> | <a href="#">免费注册</a></div><ul class="right"><li><a href="http://user.nong12.com/account/security.html"><span>账户中心</span></a></li><li class="more"><a href="http://user.nong12.com/"><span>我的农丰</span></a><span class="icon-more"></span><div class="mroe-list"><div class="list-a"><a href="http://user.nong12.com/purchase/order.html">已买到的商品</a><a href="http://user.nong12.com/purchase/favorite/product.html">我的收藏</a><a href="http://user.nong12.com/purchase/history.html">我的浏览</a></div></div></li><li class="more"><a href="http://shop.nong12.com/order/list.html"><span>销售中心 </span></a><span class="icon-more"></span><div class="mroe-list"><div class="list-a"><a href="http://shop.nong12.com/open/shop.html">我的店铺</a><a href="http://shop.nong12.com/order/list.html">已卖出的商品</a><a href="http://shop.nong12.com/seller/product/list/onsale.html">出售中的商品</a><a href="http://shop.nong12.com/seller/product/showCategory.html">免费发布商品</a></div></div></li><li><a href="http://www.nong12.com/purchase_list.html"><span>进货单</span><span class="num">(<span class="cart-num">0</span>)</span></a></li><li><a href="javascript:void(0)" onclick="IM.openWindow(\'农丰客服\',\'农丰客服\', \'\', \'\', \'\' , \'1\');"><span>客服服务</span></a></li><li><a href="http://www.nong12.com/helpcenter.html"><span>帮助中心</span></a></li></ul></div>',footer='<div class="bg-F9"><div class="footer-view clearfix"><div class="left"><ul id="footer_cms"></ul></div><div class="right"><span class="icon-shield"></span><ul class="clearfix"><li><span class="icon-f-phone"></span><p>服务热线:<span class="text-phone">400-645-5158</span></p></li><li><span class="icon-f-customerservice"></span><p>服务时间:<span class="text-time">上午8:00 - 下午16:00</span></p></li><li><span class="icon-f-im"></span><a class="dili-im" href="javascript:void(0)" onclick="IM.openWindow(\'农丰客服\',\'农丰客服\', \'\', \'\', \'\' , \'1\');"><i></i>联系客服</a></li></ul></div></div></div><div class="footer-end"><p><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=3&amp;articleId=9">关于我们</a> |<a href="http://www.nong12.com/helpcenter/articles.html?categoryId=3&amp;articleId=10">联系我们</a> |<a href="http://www.nong12.com/helpcenter/articles.html?categoryId=3&amp;articleId=11">人才招聘</a> |<a href="http://www.nong12.com/helpcenter.html">帮助中心</a></p><p class="col-999"> Copyright © 2013-2015 nong12.com,All Rights Reserved 京ICP备15030623号</p><p class="col-999"> 版权所有 北京农丰吉瑞网络科技有限公司 | 地址:北京市朝阳区光华路甲8号院1号楼5层6-501A室 | 电话:010-65816529 </p></div>';$(".pnr-top .nav").html(nav),$(".footer").html(footer),window.loginInfo=!0,jQuery.ajax({type:"GET",url:"https://passport.nong12.com/uc/ws/callHelloJSONP",dataType:"jsonp",cache:!1,success:function(data){data&&(data.isLogin?($(".responsive .left").remove(),$(".responsive .right").before("<div class='left'><a href='http://user.nong12.com/account/security.html' target='_blank'><span id='uname'>"+data.userName+"</span></a>&nbsp;欢迎来到农丰网! <a href='https://passport.nong12.com/uc/loginService?ltype=logout'>退出</a></div>"),$("#right-login .state-success").show(),$("#userName").html(data.userName),window.isRight&&(jQuery.ajax({type:"GET",url:"http://user.nong12.com/api/userservice/getUserName.do",dataType:"jsonp",cache:!1,success:function(data){$("#my-face").attr("src",data.face)}}),window.loginInfo=!0),$(".responsive .left").append('<a class="h-user-msg" href="javascript:void(0)" id="notify"></a>'),IM.notification($("#notify"))):($(".responsive .left a").first().attr("href",DiliPath.loginPath+"?ReturnUrl="+window.location.href),$(".responsive .left a").last().attr("href",DiliPath.registPath),window.loginInfo=!1)),window.passportcon=!0},error:function(){return window.loginInfo=!1,!1}}),$("#my-info").hover(function(){window.loginInfo||(window.loginInfo=!0,PassportPopupLogin.settings.callbackFn=function(){jQuery.ajax({type:"GET",url:"https://passport.nong12.com/uc/ws/callHelloJSONP",dataType:"jsonp",cache:!1,success:function(data){data&&(data.isLogin?($(".responsive .left").remove(),$(".responsive .right").before("<div class='left'><a href='http://user.nong12.com/account/security.html' target='_blank'><span id='uname'>"+data.userName+"</span></a>&nbsp;欢迎来到农丰网! <a href='https://passport.nong12.com/uc/loginService?ltype=logout'>退出</a></div>"),$("#right-login .state-success").show(),$("#userName").html(data.userName),window.isRight&&(jQuery.ajax({type:"GET",url:"http://user.nong12.com/api/userservice/getUserName.do",dataType:"jsonp",cache:!1,success:function(data){$("#my-face").attr("src",data.face)}}),window.loginInfo=!0),$(".responsive .left").append('<a class="h-user-msg" href="javascript:void(0)" id="notify"></a>'),IM.notification($("#notify")),window.location.href.indexOf("cartList")<0&&window.location.href.indexOf("purchase_list")<0&&cartTools.showCart()):($(".responsive .left a").first().attr("href",DiliPath.loginPath+"?ReturnUrl="+window.location.href),$(".responsive .left a").last().attr("href",DiliPath.registPath),window.loginInfo=!1))},error:function(){return window.loginInfo=!1,!1}}),$("#right-login").html(' <div id="right-login" class="floatinglayer f-login"> <div class="triangle"></div> <div class="state-success" style="display:none"> <div class="state-head"> <a href="http://user.nong12.com/account/security.html" target="_blank"><img id="my-face" src="http://static.nong12.com/static/newStatic/pnr/dist/images/t-default.png" alt=""></a> <span> <a href="http://user.nong12.com/account/security.html" target="_blank"><span id="userName"></span></a><span>欢迎回到农丰网!</span> </span> </div> </div> </div>')},PassportPopupLogin.init(),window.passportcon&&$("#right-login").html('<div class="triangle"></div><div class="f-hover-view"></div><iframe frameborder="0" scrolling="no" class="login-frame" src="https://passport.nong12.com/uc/newPopup/login.aspx?referUrl=http://www.nong12.com"></iframe>'))},function(){}),jQuery.ajax({type:"GET",url:DiliPath.homePath+"common/footerJson.html",dataType:"jsonp",jsonp:"callFn",jsonpCallback:"success_jsonpCallback1"+(new Date).getTime(),success:function(data){if(data){for(var html=[],iconArr=["icon-we","icon-aftersales","icon-shopping","icon-identity","icon-novice"],i=0;i<data.length;i++){var showIcon=data.length<=iconArr.length?iconArr[i]:iconArr[0];html.push("<li><span class='"+showIcon+"'></span><p>"+data[i].text+"</p><div class='f-list'>");for(var vc=data[i].subNodes,j=0;j<vc.length;j++)j==vc.length-1?html.push("<a href='"+vc[j].link+"'>"+vc[j].text+"</a></div></li>"):html.push("<a href='"+vc[j].link+"'>"+vc[j].text+"</a>")}$("#footer_cms").html(html.join(""))}}}),$("head").find("script[src*='jquery.lazyload']").size()>0&&$("body").find("img").each(function(){$(this).lazyload({effect:"fadeIn",skip_invisible:!1})})});var otherTools={imConnection:function(sellerType,sellerName){var type=2,name="农丰客服";30==sellerType&&(type=0,name=sellerName);var timestamp=(new Date).valueOf(),ht=(screen.height-500)/2,wt=(screen.width-800)/2,url="http://chat.nong12.com/launch/launch.action?uid="+name+"&type="+type+"&_t="+timestamp,param="height=555,width=800,resizable=yes,top="+ht+",left="+wt;window.open(url,name,param)}};