head.js 8.57 KB
$(function () {
    var headerTop = '<div class="top auto-w">' +
        '<span class="left">欢迎来到地利批发! 请<a href="#" class="lay-in">登录</a> | <a href="#">免费注册</a></span>' +
        '<ul class="right">' +
        '<li><a href="http://user.nong12.com/account/security.html">我的地利</a></li>' +
        '<li><a href="http://user.nong12.com/">采购中心</a><b></b>' +
        '<dd>' +
        '<a href="http://user.nong12.com/purchase/order.html">我的采购单</a>' +
        '<a href="http://user.nong12.com/purchase/agencybuy/list.html">采购服务</a>' +
        '<a href="http://user.nong12.com/purchase/agencybuy/write.html">申请代购</a>' +
        '<a href="http://user.nong12.com/purchase/favorite/product.html">我的收藏</a>' +
        '</dd>' +
        '</li>' +
        '<li><a href="http://user.nong12.com/seller/shop/setting_shop.html">销售中心</a><b></b>' +
        '<dd>' +
        '<a href="http://user.nong12.com/seller/shop/setting_shop.html">我的店铺</a>' +
        '<a href="http://user.nong12.com/seller/product/onsale.html">出售中商品</a>' +
        '<a href="http://user.nong12.com/seller/sale/list.html">销售服务</a>' +
        '<a href="http://user.nong12.com/seller/sale/write.html">申请代销</a>' +
        '</dd>' +
        '</li>' +
        '<li class="top-jinghuo"><a href="http://www.nong12.com/purchase_list.html">进货单</a><span class="receipt-icon">0</span></li>' +
        '<li onclick="IM.openWindow(\'地利客服\', \'\', \'\', \'\' , \'1\');"><a href="javascript:void(0);">客服服务</a><span class="u-me"></span></li>' +
        '<li><a href="http://www.nong12.com/helpcenter.html">帮助中心</a></li>' +
        '</ul>' +
        '</div>';
    var footer = '<div class="footer"><div class="bg-F9"><div class="footer-view responsive clearfix"><div class="left"><ul id="footer_cms"><li><span class="icon-we"></span><p>关于我们</p><div class="f-list"><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=3&amp;articleId=9">关于地利</a></div><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=3&amp;articleId=11">诚聘英才</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=19&amp;articleId=32">地利服务</a></li><li><span class="icon-aftersales"></span><p>售后服务</p><div class="f-list"><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=18&amp;articleId=31">纠纷处理</a></div><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=18&amp;articleId=29">退款流程</a><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=18&amp;articleId=30">退款政策</a></li><li><span class="icon-shopping"></span><p>购物指南</p><div class="f-list"><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=13&amp;articleId=16">交易规则</a></div><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=13&amp;articleId=17">购物流程</a><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=13&amp;articleId=27">订单结算</a><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=13&amp;articleId=28">支付方式</a></li><li><span class="icon-identity"></span><p>身份认证</p><div class="f-list"><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=23">邮箱验证</a></div><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=24">企业验证</a><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=25">实名认证</a><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=26">修改密码</a></li><li><span class="icon-novice"></span><p>新手指南</p><div class="f-list"><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=15">个人注册</a></div><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=14">企业注册</a><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=21">会员须知</a><a href="http://www.nong12.com/helpcenter/articles.html?categoryId=12&amp;articleId=22">会员登陆</a></li></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">0451-86668574</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/articles.html?categoryId=19&amp;articleId=32">地利服务</a> |<a href="http://www.nong12.com/helpcenter.html">帮助中心</a></p><p class="col-999"> Copyright © 2013-2015 nong12.com,All Rights Reserved 陕ICP备14002958号</p><p class="col-999">版权所有 地利网络农业有限公司</p></div></div>';
    $('.h-top-end').html(headerTop);
    $('.footer').html(footer);

    var trigger = null;
    $(".top ul li").hover(
        function (event) {
            var _this = $(this);                    // 把$(this)对象赋给一个变量
            trigger = setTimeout(function () {
                _this.addClass("hover");
                _this.children("dd").slideDown(150);
            }, 200);
            return false;
        },
        function (event) {
            clearTimeout(trigger);
            $(this).removeClass("hover");
            $(this).children("dd").slideUp(150);
            return false;
        }
    );//top下拉

    $(".mo-fn3").hover(
        function () {
            $(this).addClass("hover");
            $(this).children(".hover-bill").show();
        },
        function () {
            $(this).removeClass("hover");
            $(this).children(".hover-bill").hide();
        }
    );//进货单

    $(".nav-h2 ul li").live({
        mouseenter: function () {
            $(this).addClass("hover").addClass("hover-" + $(this).index());
            $(this).children("em").addClass("no");
            $(this).children(".nav-box").show();
            $(this).children(".vn").addClass("none b-no");
            $(this).prev().children(".vn").addClass("none");
        },
        mouseleave: function () {
            $(this).removeClass("hover").removeClass("hover-" + $(this).index());
            $(this).children("em").removeClass("no");
            $(this).children(".nav-box").hide();
            $(this).children(".vn").removeClass("none b-no");
            $(this).prev().children(".vn").removeClass("none");
        }
    });//整体导航

    $(".sea-tab").hover(
        function () {
            $(".sea-tab b").addClass("hover");
            $(this).children(".sea-tab-ul2").show();
        },
        function () {
            $(".sea-tab b").removeClass("hover");
            $(this).children(".sea-tab-ul2").hide();

        }
    );


    var timer, sear_trigger, _objInput = $("#sear-input");
    $(".inputbox").hover(function () {
        _objInput.click(function () {
            var _this = $(this);

            sear_trigger = setTimeout(function () {
                _this.val('');
                //$('.g-sear-listbox').addClass("listboxhide");
                $('.g-sear-listbox').removeClass("listboxhide").children('ul.sear-goods').show();
                $('.g-sear-listbox').children('ul.sear-history').hide();
            }, 200);
            timer = setInterval('indexSearchTs(_objInput)', 200);
        });

    }, function () {
        clearTimeout(sear_trigger);
        clearInterval(timer);
        $('.g-sear-listbox').addClass("listboxhide");
        var sear_data = $("#sear-input").val();
        if (sear_data != '' && sear_data != tipsname) {
            $.noop();
        } else {
            _objInput.val(tipsname);
        }
    });


});
var tipsname = '请输入商品关键字';
function indexSearchTs() {
    var inputData = $("#sear-input").val();
    if (inputData != '' && inputData != tipsname) {
        $('.g-sear-listbox').removeClass("listboxhide");
        $('.g-sear-listbox .sear-goods').hide();
        $('.g-sear-listbox .sear-history').show();
    }
};