var v =0; var v =0; $(document).ready(function () { $(".tempbtn").click(function(){ $("#orderBox").OpenDiv(); }); jQuery.jqtab = function (tabtit, tab_conbox, shijian) { $(tab_conbox).find("li").hide(); $(tabtit).find("li:first").addClass("thistab").show(); $(tab_conbox).find("li:first").show(); $(tabtit).find("li").bind(shijian, function () { $(this).addClass("thistab").siblings("li").removeClass("thistab"); var activeindex = $(tabtit).find("li").index(this); $(tab_conbox).children().eq(activeindex).show().siblings().hide(); return false; }); }; /*调用方法如下:*/ $.jqtab("#tabs", "#tab_conbox", "click"); }); /*$("div.data").each(function(){ if ($(this).attr("data-id")!=1)$(this).hide(); }); */ $(".markdh").click(function(){ if ($("#data"+$(this).attr("data-id")).css("display")=="none") $("#data"+$(this).attr("data-id")).show(); else $("#data"+$(this).attr("data-id")).hide(); }); //////////////////////// $(document).on("click",".submitorder",function(){ var patrn_phone=/^(13[0-9]{9})| (18[0-9]{9}) |(15[89][0-9]{8})$/; $("input").css("border-color",""); if (!patrn_phone.exec($("#phone").val())){ alert("请填写正确的手机号码"); $("#phone").focus(); shake($("#phone"),"selectshake",4); }else if($("#name").val().length<2){ alert("请输入正确的姓名"); $("#name").focus(); shake($("#name"),"selectshake",4); }else{ var paytype=$("input[name='paytype']:checked").val(); $(this).addClass("submitdis"); $(this).val("正在提交......"); $(this).attr("disabled","disabled"); var params = $('form').serialize(); var url='CURHOSTordersingle.do'; if (paytype==1){ $.ajax({ url: url, type: 'post', data: params, dataType:'json', success: function (data){ if (data.success==1){ $("#orderBox").CloseDiv(); $(".submitnotice").html(data.html); } } }); } if (paytype==2){ $.ajax({ url: url, type: 'post', data: params, dataType:'json', success: function (data){ if (data.success==1){ $("#orderBox").CloseDiv(); //$(".ordercode").html(data.ordercode); $(".submitnotice").html(data.html); } } }); } $(".buybtn").hide(); /*$(this).removeClass("submitdis"); $(this).val("提交申请"); $(this).removeAttr("disabled");*/ } }); $(document).on("click","input[name='paytype']",function(){ var val=$("input[name='paytype']:checked").val(); var loginstatus=$("#loginstatus").val(); if (val==2 && loginstatus==''){ $("#orderBox").CloseDiv(); $("#buybtn").hide(); var html = '
\
\
\
    \
  • 用户名:
  • \
  • \ \
    \
  • \
\
    \
  • 密码:
  • \
  • \
\
\ \
\
\ 如果您还不是会员请注册
\
\
\
'; $.jBox.open(html,'登录',340,370, {buttons: {'关闭': true},opacity:0.7,top:'5%'}); }else if(val==1){ $("#buybtn").show(); } }); $(document).on("click",".loginbtnin",function(){ var dataevent=$(this).attr("data-event"); var params = $('form').serialize(); var url="CURHOSTlineshow"+(dataevent?("-"+dataevent):'')+".do"; $.ajax({ url: url, type: 'post', data: params, dataType:'json', success: function (data) { if (data.html==1){ $("header .li2").html('个人中心退出'); $("#ContactFooter .user").html('个人中心退出'); $(".jbox-body").fadeOut("fast"); $(".jbox-body").html(""); $("#orderBox").OpenDiv(); $("#orderBox").html(data.orderboxhtml); }else{ $('.loginnotice').html(dataevent=='login'?'帐号或密码错误':(data.html==2?'该号码已被注册,请重新填写':'')); } } }); }); $(".close b").click(function(){$("#orderBox").CloseDiv();});