var global_Auction_ID = 566; if (global_Auction_ID==0){ global_Auction_ID=$("#global_Auction_ID").val(); } var ITEMSTATE1 = 101; var HuiLv1 = 1.2658; var HuiLv2 = 0.1633; var StrImgURL="http://imgsh1.cloud.pmerp.com/"; function fn_Catelog_State(fnValue){ var Catelog_State = Number(fnValue); switch (Catelog_State){ case ITEMSTATE1-6: $('#Catelog_Show_State').html("撤拍"); break; case ITEMSTATE1-5: $('#Catelog_Show_State').html("缓拍"); break; case ITEMSTATE1-4: $('#Catelog_Show_State').html("成撤"); break; case ITEMSTATE1-1: $('#Catelog_Show_State').html("暂停拍卖"); break; case ITEMSTATE1+2: $("#countdown").text("待拍"); $("#countdown").removeClass("fade"); $('#Catelog_Show_State').html("待拍"); //$("#_bidtype").html('尚未出价'); break; case ITEMSTATE1+6: $("#countdown").text("待拍"); $('#Catelog_Show_State').html("尚未开始"); //$("#_bidtype").html('尚未出价'); break; case ITEMSTATE1+8: $('#Catelog_Show_State').html("正在拍卖"); //$("#Btn_Item_CountBegin").prop("disabled",false) $("#countdown").text(""); $("#countdown").addClass("fade"); break; case ITEMSTATE1+9: $('#Catelog_Show_State').html("倒计时"); $("#Btn_Item_CountBegin").prop("disabled",true) $("#countdown").removeClass("fade"); break; case ITEMSTATE1+10: $("#countdown").text("网络关闭"); if ($('#ClientType').val()=="zhibo"){ $('#Catelog_Show_State').html("正在拍卖"); }else{ $('#Catelog_Show_State').html("网络关闭"); } //$("#_bidtype").html('网络关闭'); break; case ITEMSTATE1+12: $('#Catelog_Show_State').html("流标"); break; case ITEMSTATE1+13: $('#Catelog_Show_State').html("成交"); break; default: $('#Catelog_Show_State').html("-"+Catelog_State); break; } } function fn_CSCHECK(fnValue){ var ajax_data_str="Action=CHECKCATELOGSTATE&global_Item_ID=" + fnValue + "&r="+Math.random(); $.ajax({ async:"false", url: "Item_Ajax.do", data: ajax_data_str, type: 'GET', dataType: 'text', //这里可以不写,但千万别写text或者xml!!! timeout: 10000, error: function(msg){ $("#jsbug").val("重新载入数据,请稍候...ajax_data_str=" + ajax_data_str); setTimeout(function(){window.location.reload();},3000); }, success: function(msg){ return msg; } }); } function JS_Catelog_State(fnValue){ var Catelog_State = Number(fnValue); var Catelog_Name; switch (Catelog_State){ case ITEMSTATE1-6: Catelog_Name="撤拍"; break; case ITEMSTATE1-5: Catelog_Name="缓拍"; break; case ITEMSTATE1-4: Catelog_Name="成撤"; break; case ITEMSTATE1-1: Catelog_Name="暂停拍卖"; break; case ITEMSTATE1+2: Catelog_Name="待拍"; break; case ITEMSTATE1+6: Catelog_Name="待转"; break; case ITEMSTATE1+8: Catelog_Name="正在拍卖"; break; case ITEMSTATE1+9: Catelog_Name="倒计时"; break; case ITEMSTATE1+10: if ($('#ClientType').val()=="zhibo"){ Catelog_Name="正在拍卖"; }else{ Catelog_Name="网络关闭"; } break; case ITEMSTATE1+12: Catelog_Name="流标"; break; case ITEMSTATE1+13: Catelog_Name="成交"; break; default: Catelog_Name=""; break; } return Catelog_Name; } function fn_SocketData(ClientType,fnType){ var Now_Refresh = Number(fnType); if (isNaN(fnType)){ Now_Refresh = 1000; }else{ Now_Refresh = fnType; } if (Now_Refresh<300){ Now_Refresh = 300; } if (global_Auction_ID==0){ global_Auction_ID=$("#global_Auction_ID").val(); } var global_Item_ID = $("#Live_Item_ID").val(); var ajax_data_str="Action=gd&global_Item_ID=" + global_Item_ID + "&KeyWord=" + fnType ; ajax_data_str += "&global_Auction_ID=" + global_Auction_ID + "&r="+Math.random(); //$("#jsdebug").append(ajax_data_str + "global_Item_ID:" + global_Item_ID +",Now_Refresh:" +Now_Refresh+"
"); //$("#jsdebug").append(global_Item_ID); $.ajax({ async:"false", url: "/global_live/ajax1.aspx", data: ajax_data_str, type: 'GET', dataType: 'text', //这里可以不写,但千万别写text或者xml!!! timeout: 10000, error: function(msg){ $("#jsbug").val("重新载入数据,请稍候...ajax_data_str=" + ajax_data_str); setTimeout(function(){window.location.reload();},3000); }, success: function(msg){ var reloadType = 0; var objStatus = eval('(' + msg + ')'); //$("#jsbug").append(fnType+"____ID:"+objStatus.global_Item_ID+"_"+$("#Live_Item_ID").val()+"\n"); var Price_New = Math.round(objStatus["Price_New"]*100)/100; if (fnType =="LONG"){ reloadType = 5; $("#Live_Users_ID").val(objStatus.Web_Users_ID); if (objStatus.global_Auction_State =="19"){ $('#Catelog_Show_State').html("拍卖会已结束"); return; } }else{ if (objStatus.global_Item_ID != $("#Live_Item_ID").val()){ $("#Live_Item_ID").val(objStatus.global_Item_ID); $("#Live_Users_ID").val(objStatus.Web_Users_ID); fn_SocketData(ClientType,"LONG"); return; }else if (objStatus.Web_Users_ID != $("#Live_Users_ID").val() || $("#Catelog_State").val()!=objStatus.Catelog_State || Price_New!=$("#Price_New").text() || $("#Bid_Shu").text()!=objStatus.Bid_Shu ){ reloadType = 5; $("#Live_Users_ID").val(objStatus.Web_Users_ID); }else if ($("#Price_Step").text()!=objStatus.Price_Step || $("#AutoPriceStep").val()!=objStatus.AutoPriceStep){ reloadType = 1; //$("#jsdebug").append("____"+(objStatus.Web_Users_ID != $("#Live_Users_ID").val())+"__"+( $("#Catelog_State").val()!=objStatus.Catelog_State)+"__"+( $("#Price_New").text()!=Price_New)+"__"+( $("#Bid_Shu").text()!=objStatus.Bid_Shu)+"__"+( $("#Price_Step").text()!=objStatus.Price_Step)+"__"+( $("#AutoPriceStep").val()!=objStatus.AutoPriceStep)+$("#Price_New").text()+"____"+objStatus.Price_New+"____"+objStatus.Price_Step+"
\n"); } } for (var k in objStatus) { switch (k){ case "countdown": $("#Live_countdown").val(objStatus[k]); break; case "Catelog_State":case "Price_Type":case "ITEMTYPE":case "AutoPriceStep":case "global_Auction_State": $("#"+k).val(objStatus[k]); break; case "Price_Step": var fnTemp = objStatus[k]; $('#'+k).text(Math.round(objStatus[k]*1000)/1000); //alert(k); break; case "Bid_Shu":case "Price_New": $('#'+k).text(parseInt(objStatus[k])); //alert(k); break; case "Item_Buyer_Code": $('#'+k).text(objStatus[k]); break; case "LiveTxt": $('#'+k).html(objStatus[k]); break; case "global_Item_ID":case "Web_Users_ID": //本字段不操作,因为转化为Live break; //=============全量 case "Second_Bid":case "Catelog_Code":case "global_Commision":case "Item_COMMISION2": $("#"+k).val(objStatus[k]); break; case "Price_Start":case "Item_Name":case "NextName":case "Item_Number":case "Item_Unit":case "Deposit_Shu": $('#'+k).text(objStatus[k]); break; case "ItemImg": if (objStatus[k] !=""){ $('#'+k).attr("src", StrImgURL + objStatus[k]); } break; case "Catelog_Show": $("#Catelog_Show").html("拍品号:"+objStatus.Catelog_Show+"号"); break; case "ChangePro_code": break; default: //$("#jsbug").val(k+":" + objStatus[k]); break; } //alert(k + '=' + objStatus[k]); } if (reloadType>=1){ for (var index in objStatus.BidBtnArray){ //alert($("#addPrice button").eq(index).attr("data-num") + "__" + objStatus.BidBtnArray[index]+"__"+index); $("#addPrice button span").eq(index).text(objStatus.BidBtnArray[index]); $("#addPrice button").eq(index).attr("data-num", objStatus.BidBtnArray[(index)]); } $("#Btn_Buyer_First2 span").text(objStatus.Price_New); if (objStatus.Web_Users_ID=="0" || objStatus.Web_Users_ID==""){ $("#Price_New").attr("Class","black"); $("#Price_BidType").hide(); $("#Item_Buyer_Code").hide(); $("#Price_BidType").text(""); }else if (objStatus.Web_Users_ID=="1") { $("#Btn_Buyer_First2").prop("disabled",true); $("#Price_New").attr("Class","blue"); $("#Price_BidType").show(); $("#Price_BidType").text("现场出价"); $("#Price_BidType").attr("class","bluebg"); $("#Item_Buyer_Code").hide(); }else{ $("#Btn_Buyer_First2").prop("disabled",false); $("#Price_New").attr("Class","red"); $("#Price_BidType").show(); $("#Price_BidType").text("网络出价"); $("#Price_BidType").attr("class","redbg"); $("#Item_Buyer_Code").show(); $("#Item_Buyer_Code").text(objStatus.Item_Buyer_Code); } var Price_Total = 0; if ($("#Price_Type").val()=="1"){ $("#Btn_PriceType_Change").text("当前:按单价拍卖"); $("#Price_Line_2").show(); Price_Total = ($("#Item_Number").text()*$("#Price_New").text()).toFixed(2); $("#Price_Line_2").html("总价:" + Price_Total ); }else{ Price_Total = $("#Price_New").text(); $("#Btn_PriceType_Change").text("当前:按总价拍卖"); $("#Price_Line_2").hide(); if(!isNaN(Price_Total)){ $("#Price_Single").html(($("#Price_New").text()/$("#Item_Number").text()).toFixed(2) ); }else{ $("#Price_Single").text(""); } } fn_Catelog_State($("#Catelog_State").val()); $("#_bidtype").html(''+objStatus.Item_Buyer_Code+''); if ($("#AutoPriceStep").val()=="0"){ $('#AutoPriceStep_text').html("手动调整加价幅度"); }else{ $('#AutoPriceStep_text').html($("#AutoPriceStep").val()+"方案"); } if ($("#global_Commision").val()=="SIFA"){ $("#commissionType").text("执行司法") var Price_Commision=0; if(Price_Total >= 0 && Price_Total < 2000000){ Price_Commision = Price_Total * 5 / 100; }else if(Price_Total >= 2000000 && Price_Total < 10000000){ Price_Commision = ((Price_Total - 2000000) * 3 / 100) + 100000; }else if(Price_Total >= 10000000 && Price_Total < 50000000){ Price_Commision = ((Price_Total - 10000000) * 2 / 100) + 340000; }else if(Price_Total >= 50000000 && Price_Total < 100000000){ Price_Commision = ((Price_Total - 50000000) * 1 / 100) + 1140000; }else if(Price_Total >= 100000000){ Price_Commision = ((Price_Total - 100000000) * 5 / 1000) + 1640000; } }else if ($("#global_Commision").val()=="DINGE"){ $("#commissionType").text("定额") Price_Commision = $("#Item_COMMISION2").val(); }else{ $("#commissionType").text($("#Item_COMMISION2").val() + "%") Price_Commision = Price_Total * $("#Item_COMMISION2").val() / 100; } if(!isNaN(Price_Total)){ $("#Price_Commision").text(Price_Commision+"元"); $("#Price_Pay").text((Price_Total*1+Price_Commision)); }else{ $("#Price_Commision").text("-"); $("#Price_Pay").text("-"); } } if (reloadType>=5){ fn_Self_Test(""); fn_Count2016(ClientType,objStatus["countdown"]); } if ($("#Price_Type").val()=="0"){ $("#Price_Type_1").html("单价" ); var Price_Value_2 = ($("#Price_New").text()/$("#Item_Number").text()).toFixed(2); if (Price_Value_2=="NaN"){Price_Value_2 = "";} $("#Price_Type_2").html(Price_Value_2); //按总价拍卖 }else{ //按单价拍卖 $("#Price_Type_1").html("总价" ); $("#Price_Type_2").html(($("#Price_New").text()*$("#Item_Number").text()).toFixed(2)); } //$("#Price_Line_3").html("港币:" + ($("#Price_New").text()*HuiLv1).toFixed(2) + "
美元:" + ($("#Price_New").text()*HuiLv2).toFixed(2)); var Price_New = objStatus["Price_New"]; var Price_New_B = parseInt(Price_New).toString(); var pnLength = Price_New_B.length; if (pnLength>5){ if (Price_New_B==Price_New) { $("#Price_New").html(""+Price_New.substr(0,pnLength-4) + ""+ Price_New.substr(pnLength-4) +"") }else{ var Price_New_BB = Price_New_B.substr(0,pnLength-4); var Price_New_Small = Price_New - Price_New_BB*10000; var Bu0Str = ""; if (Price_New_Small<1){ Bu0Str = "000"; }else if (Price_New_Small<10){ Bu0Str = "000"; }else if (Price_New_Small<100){ Bu0Str = "00"; }else if (Price_New_Small<1000){ Bu0Str = "0"; } //var fn_PS = objStatus["Price_Step"].toString().split(".")[1]; //var fn_PSLen = 2; //if (fn_PS !=null){ // fn_PSLen =fn_PS.length //} //如果拍到小数点后3位需要开放此段,或者更改后面的toFixed $("#Price_New").html("" + Price_New_BB + ""+ Bu0Str +"" + Price_New_Small.toFixed(2) +"") } }else{ $("#Price_New").html("" + Price_New + "") } //var d = new Date(); //$("#jsdebug").append("__C__fnType:"+fnType+"____Now_Refresh"+Now_Refresh+"____"____"+objStatus.refreshTime+"___"+d.getSeconds()+"\n"); if (!isNaN(objStatus.refreshTime)){ Now_Refresh = objStatus.refreshTime; } if (fnType!="ONCE"){ setTimeout(function(){fn_SocketData(ClientType,"EASY");},Now_Refresh); } try{ }catch(e){ alert("代码执行错误!2001"); } } }); } function fn_Count2016(ClientType,fnVal){ var Catelog_State=$("#Catelog_State").val(); if (Catelog_State==(ITEMSTATE1+9)){ var Live_countdown=fnVal - 0.1; //var Live_countdown=$("#Live_countdown").val(); //var Live_countdown=fnVal; //var re=/^\d+(\.\d+)?$/; //if (re.test(Live_countdown)){ //Live_countdown=Number(Live_countdown)-0.1; //} //$("#jsbug").html(Catelog_State+"
"+Live_countdown); //$('#countdown').html(Live_countdown.toFixed(0)); //Live_countdown=Math.floor(Live_countdown); try{ Live_countdown=Live_countdown.toFixed(1); }catch(e){ Live_countdown=Math.floor(Live_countdown); } //Live_countdown=Live_countdown.toFixed(1); //Live_countdown=Live_countdown.toFixed(1); if (Live_countdown<0){ Live_countdown=0; fn_SocketData(ClientType,"ONCE"); return; } $('#countdown').text(Live_countdown); //$(".count").text(Live_countdown); setTimeout(function(){fn_Count2016(ClientType,Live_countdown);},100); } }