var productPriceSp1=0;var productPriceSp2=0;jQuery(".buyinglist").slide({mainCell:"ul",autoPage:true,effect:"top",autoPlay:true});$("#SaleComplter div").addClass("thisLeft");$(".line-jd-more-btn").click(function(){$(".line-jd-more").slideToggle()});$(function(){LoadPrice();$(".overtimes").timer();$.ajax({url:"/JqAjax/GetPromoUrlHandler.ashx",success:function(b){$("#txtUrl").val(b);var a=new ZeroClipboard.Client();a.setHandCursor(true);a.setText(b);a.addEventListener("complete",function(){alert("复制成功")});a.glue("lnkCopy","spUrl")}})});jQuery(".slides").slide({titCell:".hd ul",mainCell:".bd ul",effect:"fold",autoPlay:true,autoPage:true,trigger:"click"});function cursorHove(){$(".limit-bd-list-item").hover(function(){$(this).addClass("cur")},function(){$(this).removeClass("cur")})}function saleProduct_Ajax_Error(a){if(a.responseText!=null&&a.responseText.indexOf("超过了限购数量")>-1){alert("超过了限购数量");return}if(a.responseText!=null&&a.responseText.indexOf("会员不存在")>-1){alert("会员不存在");return}if(a.responseText!=null&&a.responseText.indexOf("抢购产品不存在")>-1){alert("抢购产品不存在");return}if(a.responseText!=null&&a.responseText.indexOf("抢购产品尚未开始或已经结束")>-1){alert("抢购产品尚未开始或已经结束");return}if(a.responseText!=null&&a.responseText.indexOf("剩余数量不足")>-1){alert("剩余数量不足");return}if(a.responseText!=null){alert(a.responseText)}}function LoadPrice(){var a=$("#priceCost").text();var b=$("#newPrice").text();var c=a.substring(1,a.length);var d=b.substring(1,b.length);productPriceSp1=c;productPriceSp2=d}var count="1";function changeNumPrice(c){count=$(c).val();var b=$(c).parent().parent().find("#priceCost").attr("name");var a=$(c).parent().parent().find("#newPrice").attr("name");$(c).parent().parent().find("#priceCost").text("￥"+b*count);$(c).parent().parent().find("#newPrice").text("￥"+a*count)}function goPage(){var a=$("#pageCount_Sel_Go").val();if(!Number(a)){alert("跳转页数必须为数字")}if(currentIndex==a){return}if(a>pageCount){alert("超出页数,系统自动为您转入最后一页");currentIndex=pageCount}else{currentIndex=a}saleProduct_Ajax()}function fnRemove(a){$(a).children().each(function(){$(this).remove()})}$(document).ready(function(){ajaxSubmitForPostAndText("/JqAjax/GetLoginHandler.ashx","",Login_Success)});function Login_Success(a){if(a!="null"){$(".login-error").css("display","none")}}var num="";var $button;function saleProduct_Ajax_StartBuying(b,a){$button=$(a);if($button.attr("state")=="1"){alert("请勿重复提交");return}$button.attr("state","1");num=b;ajaxSubmitForPostAndText("/JqAjax/GetLoginHandler.ashx","",saleProduct_Ajax_StartBuying_Success,function(){$button.attr("state","0")})}function saleProduct_Ajax_StartBuying_Success(l){var h=l;if(h=="null"){alert("请登录网站");window.location.href="/login/?ReturnUrl="+encodeURIComponent("/qianggou/")}else{var c=$("#div"+num);var j=c.find("select[name='teamDate']").val();var b=c.find("select[name='quoteObject']");var k=0;var g="";for(var f=0;f<b.length;f++){var a=$(b[f]);var e=parseInt(a.val(),10);var i=a.attr("detail");k+=e;if(f>0){g+=";"}g+=i+","+e}if(k==0){alert("请选择数量");return}ajaxSubmitForPostAndJson("/JqAjax/InsertSaleProductOrder.ashx","num="+num+"&teamDateId="+j+"&detail="+g,StartBuying_Success,function(){$button.attr("state","0")})}}var salNum="";function StartBuying_Success(a){$button.attr("state","0");if(a.isSuccess){alert("抢购成功！");document.location="/paymentmethod/"+a.message+"/"}else{alert(a.message)}}$(document).ready(function(){$(".i-mail").click(function(){$("#mengban").show()});$(".cover_layer_close").click(function(){$("#mengban").hide()})});function OpenDetailPage(b){var a=new Date();a.setTime(a.getTime()+3000);document.cookie="help=true;expires="+a.toGMTString();window.open("/qianggou/"+b+"/","_blank")};