JS报错误 undefined is not a function
eval(function(p,a,c,k,e,d)代码如下 eval(function(p,a,c,k,e,d)
{e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};
if(!''.replace(/^/,String))
{while(c--)
{d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];
e=function(){return'\\w+'};c=1};
while(c--)
{if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}
('4 7={\'3\':1,\'6\':1L,\'Z\':2i};7.w=$(\'.3 .H f\').1c;7.18=$(\'#1K\');7.h=a(3){4 1d=E(7.18.2d().1d());4 1J=-1d*E(3);$(\'.3 .H f\').N(\'m\');$(\'.3 .H p\').o();$(\'.3 .H f[3=\'+3+\']\').L(\'m\');$(\'.3 .H p[3=\'+3+\']\').h();7.18.2e(Y,Q).2j({R:1J},12);b(3==7.w){$(\'.3 .H f[3=0]\').L(\'m\');$(\'.3 .H p[3=0]\').h();2a(a(){7.3=1;$(\'#1K\').2k(\'R\',\'2n\')},2l)}7.18.g(\'3\',7.3)};7.1m=a(){7.h(7.3);7.3++;b(7.3>=5){7.3=1}};7.1U=a(){7.Z=15(7.1m,7.6);$(\'.3 .H f\').G(a(){1j(7.Z);7.3=$(k).g(\'3\');7.h(7.3)}).2m(a(){7.Z=15(7.1m,7.6)});7.18.2p(a(){1j(7.Z)},a(){7.Z=15(7.1m,1L)})};a 1Z(){4 r=$(\'#1x\').v();b($.q(r)){4 C=1H.1t+\'/3/2o\';$.1w({1a:\'1v\',C:C,1u:Q,1B:a(D){1A{b(!$.q(D)){4 s=$.1z(D,Y);b(s.1C==\'1\'){b(!$.q(s.1b)){$(\'#1x\').v(s.1b);1y(s.1b);b(!$.q($(\'.i .l y.O c[n=\'+r+\']\')))$(\'.i .l y.O c[n=\'+r+\']\').G()}I{$(\'.i 1M W\').2q()}}}}1F(e){}}})}I{1y(r);b(!$.q($(\'.i .l y.O c[n=\'+r+\']\')))$(\'.i .l y.O c[n=\'+r+\']\').G()}}a 1y(r){b($.q(r))13;$(\'.i 1M W c[n=\'+r+\']\').h();$(\'.i .l y.O c[n=\'+r+\']\').G();$(\'#1S\').h();$(\'#1S\').17(a(r){4 j=\'<y 14="1p">\';j+=\'</y><1P A="2F"></1P?\';2H({\'2D\':\'\',\'2B\':j,\'2v\':\'发送信息\',\'1d\':2u});$(\'#1e\').17(a(){$(\'#19\').o();$(\'#16\').o()});$(\'#1n\').17(a(){$(\'#19\').o();$(\'#16\').o();4 z=$(\'#1e\').v();4 V=$(\'#1x\').v();b($.q(z)){$(\'#19\').h().M(\'<B>号码不能为空。</B>\');13}b(z.1c!=11||!/^1[22][0-9]\\d{8}$/.25(z)){$(\'#19\').h().M(\'<B>请核对手机号码。</B>\');13}$.26(\'1p\');4 C=1H.1t+\'/3/27\';$.1w({1a:\'1v\',C:C,1u:Q,21:{\'1o\':z,\'1X\':V},1B:a(D){1A{$(\'#1W\').1Y();$(\'#1p\').2c();b(!$.q(D)){4 s=$.1z(D,Y);b(s.1C==\'1\'){$(\'#16\').h();1r(\'1n\',J,\'可再次发送\')}I{$(\'#16\').M(s.1b).h();1r(\'1n\',J,\'可再次发送\')}}}1F(e){}}})});a 1r(T,t,S){4 w=t;4 X=a(){4 x=$(\'#\'+T);x.g("1i",Y);x.v("("+w+")秒后"+S);w--;b(w==-1){x.v(S);x.g("1i",Q);1k.1j(6)}};4 6;X();6=1k.15(X,12)}})}$(2A).2z(a(){7.1U();4 U=$(\'.2y p\');b(U.1c>0&&!$.q(U.g(\'6\'))){4 F=U.g(\'6\');4 F=F.1s(" ");4 1g=F[0].1s("-");4 6=F[1].1s(":");4 F=1I 1T(1g[0],1g[1]-1,1g[2],6[0],6[1],6[2]);4 F=F.23();4 1q=a(){4 6=E((F-1I 1T().23())/12);b(6<=0){U.M(\'已结束\')}I{4 j=\'剩余 \';b(6>=24*K){j+=\'<f>\'+E(6/(24*K))+\'</f>天\';6=6-E(6/(24*K))*(24*K)}b(6>K){j+=\'<f>\'+E(6/K)+\'</f>时\';6=6-E(6/K)*K}I{j+=\'<f>0</f>时\'}b(6>J){j+=\'<f>\'+E(6/J)+\'</f>分\';6=6-E(6/J)*J}I{j+=\'<f>0</f>分\'}b(6>=10){j+=\'<f>\'+6+\'</f>秒\'}I{j+=\'<f>0\'+6+\'</f>秒\'}U.M(j)}2a(1q,12)};1q()}$(\'.3 .1f p\').G(a(){$(\'.3 .1f p\').N(\'m\');$(\'.3 .1f W\').o();$(k).L(\'m\');$(\'.3 .1f W[u=\'+$(k).g(\'u\')+\']\').h()});$(\'.3 .2b W\').G(a(){$(\'.3 .2b W\').N(\'m\').L(\'P\');$(k).N(\'P\').L(\'m\')});4 1E=a(){4 n=$(\'.i .l y c[A=m]\').g(\'n\');4 u=$(\'.i .l .R c[A=m]\').g(\'P\');$(\'.i .l .R c\').29(a(){b($(k).g(\'A\')==$(k).g(\'m\'))u=$(k).g(\'P\')});b(!$.q(n)&&!(u==\'2x\'||u==\'2w\'))u+=\'2t\'+n;$(\'.i .l .20\').2C().o();$(\'.i .l .20 c[u=\'+u+\']\').h();$(\'#V\').v(n)};$(\'.i .l y.O c\').G(a(){$(\'.i .l y.O c\').N(\'m\');$(k).L(\'m\');$(\'.i f[u=1V]\').o();$(\'.i f[u=1V][n=\'+$(k).g(\'n\')+\']\').h();1E()});$(\'.i .l .R c\').G(a(){4 T=$(k);$(\'.i .l .R c\').29(a(){$(k).N($(k).g(\'m\')).L($(k).g(\'P\'))});T.N($(k).g(\'P\')).L($(k).g(\'m\'));1E()});1Z();$(\'#1o\').17(a(){$(\'#1l\').o();$(\'#1h\').o()});$(\'#1D\').17(a(){$(\'#1l\').o();$(\'#1h\').o();4 z=$(\'#1o\').v();4 V=$(\'#V\').v();b($.q(z)){$(\'#1l\').h().M(\'<B>号码不能为空。</B>\');13}b(z.1c!=11||!/^1[22][0-9]\\d{8}$/.25(z)){$(\'#1l\').h().M(\'<B>请核对手机号码。</B>\');13}$.26(\'28\');4 C=1H.1t+\'/3/27\';$.1w({1a:\'1v\',C:C,1u:Q,21:{\'1o\':z,\'1X\':V},1B:a(D){1A{$(\'#1W\').1Y();$(\'#28\').2c();b(!$.q(D)){4 s=$.1z(D,Y);b(s.1C==\'1\'){$(\'#1h\').h();1G(\'1D\',J,\'可再次发送\')}I{$(\'#1h\').M(s.1b).h();1G(\'1D\',J,\'可再次发送\')}}}1F(e){}}})});a 1G(T,t,S){4 w=t;4 X=a(){4 x=$(\'#\'+T);x.g("1i",Y);x.v("("+w+")秒后"+S);w--;b(w==-1){x.v(S);x.g("1i",Q);1k.1j(6)}};4 6;X();6=1k.15(X,12)}});',62,168,'|||index|var||time|bannerCfg|||function|if|li|||span|attr|show|index_shop|str|this|shop|on|key|hide||isempty|shop_key|retcode||rel|val|count|butNode|ol|u_phone|class|label|url|resp|parseInt|endTime|mouseover|banner|else|60|3600|addClass|html|removeClass|tab|off|false|left|txt|obj|objLeftTime|exp_key|ul|butTime|true|interval|||1000|return|id|setInterval|msg_done1|click|object|err_msg1|type|info|length|width|user_phone1|news|date|msg_done|disabled|clearInterval|window|err_msg|slider|do_msgsend1|user_phone|phone_msg1|leftTime|timeover1|split|base|cache|get|ajax|expeshop_key|show_shop|dealWithRetInDialog|try|success|code|do_msgsend|showShopInfo|catch|timeover|g_baseUrls|new|position|bannerSlider|5000|dt|input|btn|div|font|text|expeshop_btn|Date|bind|send_info|responsebar|dept_name|empty|get_show_shop|right|data|358|getTime||test|processBlock|getaddress|phone_msg|each|setTimeout|recommend|unblock|parent|stop|name|errorAlert|tips|null|animate|css|2000|mouseout|0px|getshopkey|hover|remove|floatL|button|_|300|title|send|trust|top_recommend|ready|document|promptMsg|children|parentId|value|resetClear|pointer|commonPromptPop'.split('|'),0,{}))

解决方案 »

  1.   

    楼主试下
    var bannerCfg = {
        'index': 1,
        'time': 5000,
        'interval': null};
    bannerCfg.count = $('.index .banner span').length;
    bannerCfg.object = $('#bannerSlider');
    bannerCfg.show = function(index) {
        var width = parseInt(bannerCfg.object.parent().width());
        var position = -width * parseInt(index);
        $('.index .banner span').removeClass('on');
        $('.index .banner p').hide();
        $('.index .banner span[index=' + index + ']').addClass('on');
        $('.index .banner p[index=' + index + ']').show();
        bannerCfg.object.stop(true, false).animate({
            left: position    },
        1000);
        if (index == bannerCfg.count) {
            $('.index .banner span[index=0]').addClass('on');
            $('.index .banner p[index=0]').show();
            setTimeout(function() {
                bannerCfg.index = 1;
                $('#bannerSlider').css('left', '0px')        },
            2000)    }
        bannerCfg.object.attr('index', bannerCfg.index)};
    bannerCfg.slider = function() {
        bannerCfg.show(bannerCfg.index);
        bannerCfg.index++;
        if (bannerCfg.index >= 5) {
            bannerCfg.index = 1    }};
    bannerCfg.bind = function() {
        bannerCfg.interval = setInterval(bannerCfg.slider, bannerCfg.time);
        $('.index .banner span').mouseover(function() {
            clearInterval(bannerCfg.interval);
            bannerCfg.index = $(this).attr('index');
            bannerCfg.show(bannerCfg.index)    }).mouseout(function() {
            bannerCfg.interval = setInterval(bannerCfg.slider, bannerCfg.time)    });
        bannerCfg.object.hover(function() {
            clearInterval(bannerCfg.interval)    },
        function() {
            bannerCfg.interval = setInterval(bannerCfg.slider, 5000)    })};
    function get_show_shop() {
        var shop_key = $('#expeshop_key').val();
        if ($.isempty(shop_key)) {
            var url = g_baseUrls.base + '/index/getshopkey';
            $.ajax({
                type: 'get',
                url: url,
                cache: false,
                success: function(resp) {
                    try {
                        if (!$.isempty(resp)) {
                            var retcode = $.dealWithRetInDialog(resp, true);
                            if (retcode.code == '1') {
                                if (!$.isempty(retcode.info)) {
                                    $('#expeshop_key').val(retcode.info);
                                    show_shop(retcode.info);
                                    if (!$.isempty($('.index_shop .shop ol.tab li[key=' + shop_key + ']'))) $('.index_shop .shop ol.tab li[key=' + shop_key + ']').mouseover()                            } else {
                                    $('.index_shop dt ul').remove()                            }                        }                    }                } catch(e) {}            }        })    } else {
            show_shop(shop_key);
            if (!$.isempty($('.index_shop .shop ol.tab li[key=' + shop_key + ']'))) $('.index_shop .shop ol.tab li[key=' + shop_key + ']').mouseover()    }}
      

  2.   

    接上function show_shop(shop_key) {
        if ($.isempty(shop_key)) return;
        $('.index_shop dt ul li[key=' + shop_key + ']').show();
        $('.index_shop .shop ol.tab li[key=' + shop_key + ']').mouseover();
        $('#expeshop_btn').show();
        $('#expeshop_btn').click(function(shop_key) {
            var str = '<ol id="phone_msg1">';
            str += '</ol><div class="resetClear"></div?';
            commonPromptPop({
                'parentId': '',
                'promptMsg': str,
                'title': '发送信息',
                'width': 300        });
            $('#user_phone1').click(function() {
                $('#err_msg1').hide();
                $('#msg_done1').hide()        });
            $('#do_msgsend1').click(function() {
                $('#err_msg1').hide();
                $('#msg_done1').hide();
                var u_phone = $('#user_phone1').val();
                var exp_key = $('#expeshop_key').val();
                if ($.isempty(u_phone)) {
                    $('#err_msg1').show().html('<label>号码不能为空。</label>');
                    return            }
                if (u_phone.length != 11 || !/^1[358][0-9]\d{8}$/.test(u_phone)) {
                    $('#err_msg1').show().html('<label>请核对手机号码。</label>');
                    return            }
                $.processBlock('phone_msg1');
                var url = g_baseUrls.base + '/index/getaddress';
                $.ajax({
                    type: 'get',
                    url: url,
                    cache: false,
                    data: {
                        'user_phone': u_phone,
                        'dept_name': exp_key                },
                    success: function(resp) {
                        try {
                            $('#responsebar').empty();
                            $('#phone_msg1').unblock();
                            if (!$.isempty(resp)) {
                                var retcode = $.dealWithRetInDialog(resp, true);
                                if (retcode.code == '1') {
                                    $('#msg_done1').show();
                                    timeover1('do_msgsend1', 60, '可再次发送')                            } else {
                                    $('#msg_done1').html(retcode.info).show();
                                    timeover1('do_msgsend1', 60, '可再次发送')                            }                        }                    } catch(e) {}                }            })        });
            function timeover1(obj, t, txt) {
                var count = t;
                var butTime = function() {
                    var butNode = $('#' + obj);
                    butNode.attr("disabled", true);
                    butNode.val("(" + count + ")秒后" + txt);
                    count--;
                    if (count == -1) {
                        butNode.val(txt);
                        butNode.attr("disabled", false);
                        window.clearInterval(time)                }            };
                var time;
                butTime();
                time = window.setInterval(butTime, 1000)        }    })}
    $(document).ready(function() {
        bannerCfg.bind();
        var objLeftTime = $('.top_recommend p');
        if (objLeftTime.length > 0 && !$.isempty(objLeftTime.attr('time'))) {
            var endTime = objLeftTime.attr('time');
            var endTime = endTime.split(" ");
            var date = endTime[0].split("-");
            var time = endTime[1].split(":");
            var endTime = new Date(date[0], date[1] - 1, date[2], time[0], time[1], time[2]);
            var endTime = endTime.getTime();
            var leftTime = function() {
                var time = parseInt((endTime - new Date().getTime()) / 1000);
                if (time <= 0) {
                    objLeftTime.html('已结束')            } else {
                    var str = '剩余 ';
                    if (time >= 24 * 3600) {
                        str += '<span>' + parseInt(time / (24 * 3600)) + '</span>天';
                        time = time - parseInt(time / (24 * 3600)) * (24 * 3600)                }
                    if (time > 3600) {
                        str += '<span>' + parseInt(time / 3600) + '</span>时';
                        time = time - parseInt(time / 3600) * 3600                } else {
                        str += '<span>0</span>时'                }
                    if (time > 60) {
                        str += '<span>' + parseInt(time / 60) + '</span>分';
                        time = time - parseInt(time / 60) * 60                } else {
                        str += '<span>0</span>分'                }
                    if (time >= 10) {
                        str += '<span>' + time + '</span>秒'                } else {
                        str += '<span>0' + time + '</span>秒'                }
                    objLeftTime.html(str)            }
                setTimeout(leftTime, 1000)        };
            leftTime()    }
        $('.index .news p').mouseover(function() {
            $('.index .news p').removeClass('on');
            $('.index .news ul').hide();
            $(this).addClass('on');
            $('.index .news ul[rel=' + $(this).attr('rel') + ']').show()    });
        $('.index .recommend ul').mouseover(function() {
            $('.index .recommend ul').removeClass('on').addClass('off');
            $(this).removeClass('off').addClass('on')    });
        var showShopInfo = function() {
            var key = $('.index_shop .shop ol li[class=on]').attr('key');
            var rel = $('.index_shop .shop .left li[class=on]').attr('off');
            $('.index_shop .shop .left li').each(function() {
                if ($(this).attr('class') == $(this).attr('on')) rel = $(this).attr('off')        });
            if (!$.isempty(key) && !(rel == 'trust' || rel == 'send')) rel += '_' + key;
            $('.index_shop .shop .right').children().hide();
            $('.index_shop .shop .right li[rel=' + rel + ']').show();
            $('#exp_key').val(key)    };
        $('.index_shop .shop ol.tab li').mouseover(function() {
            $('.index_shop .shop ol.tab li').removeClass('on');
            $(this).addClass('on');
            $('.index_shop span[rel=send_info]').hide();
            $('.index_shop span[rel=send_info][key=' + $(this).attr('key') + ']').show();
            showShopInfo()    });
        $('.index_shop .shop .left li').mouseover(function() {
            var obj = $(this);
            $('.index_shop .shop .left li').each(function() {
                $(this).removeClass($(this).attr('on')).addClass($(this).attr('off'))        });
            obj.removeClass($(this).attr('off')).addClass($(this).attr('on'));
            showShopInfo()    });
        get_show_shop();
        $('#user_phone').click(function() {
            $('#err_msg').hide();
            $('#msg_done').hide()    });
        $('#do_msgsend').click(function() {
            $('#err_msg').hide();
            $('#msg_done').hide();
            var u_phone = $('#user_phone').val();
            var exp_key = $('#exp_key').val();
            if ($.isempty(u_phone)) {
                $('#err_msg').show().html('<label>号码不能为空。</label>');
                return        }
            if (u_phone.length != 11 || !/^1[358][0-9]\d{8}$/.test(u_phone)) {
                $('#err_msg').show().html('<label>请核对手机号码。</label>');
                return        }
            $.processBlock('phone_msg');
            var url = g_baseUrls.base + '/index/getaddress';
            $.ajax({
                type: 'get',
                url: url,
                cache: false,
                data: {
                    'user_phone': u_phone,
                    'dept_name': exp_key            },
                success: function(resp) {
                    try {
                        $('#responsebar').empty();
                        $('#phone_msg').unblock();
                        if (!$.isempty(resp)) {
                            var retcode = $.dealWithRetInDialog(resp, true);
                            if (retcode.code == '1') {
                                $('#msg_done').show();
                                timeover('do_msgsend', 60, '可再次发送')                        } else {
                                $('#msg_done').html(retcode.info).show();
                                timeover('do_msgsend', 60, '可再次发送')                        }                    }                } catch(e) {}            }        })    });
        function timeover(obj, t, txt) {
            var count = t;
            var butTime = function() {
                var butNode = $('#' + obj);
                butNode.attr("disabled", true);
                butNode.val("(" + count + ")秒后" + txt);
                count--;
                if (count == -1) {
                    butNode.val(txt);
                    butNode.attr("disabled", false);
                    window.clearInterval(time)            }        };
            var time;
            butTime();
            time = window.setInterval(butTime, 1000)    }});