$(document).ready(function(){ $(".xsiqy_f_in .xsiqy_f_in_1").last().css({display:"none"}); $(".zslgxzx_f_in ul li").click(function(){ $(this).addClass("addys_f3").siblings().removeClass("addys_f3"); $(".xsiqy_f_in .xsiqy_f_in_1").eq($(this).index()).css({display:"block"}).siblings().css({display:"none"}); }); var msg={"adid":adid}; sendClientMsg(root+"Wap/getAd",msg,""); $("body").unbind('click'); $("body").click(function(event){ var _id=$(event.target).attr("id"); var arr=String(_id).split("_"); if (arr[0]=="selectBtn") { if (checkCbLen("id[]")>0) { select_arr=getCheckBox("id[]"); disMyBuy(); } }else if (arr[0]=="cb") { if ($("#"+_id).is(':checked')) { setTotalCost(); }else { setTotalCost(); } } }); }); function setTotalCost() { var total=0; $("input[name='id[]']").each(function(){ if (this.checked==true) { var _id=this.value; var num=parseInt($("#total_"+_id).html()); total=total+num; } }); $("#totalVacancyCost").html(total); } function setBuyAd(msg) { $("#slider").html(""); $("#vacancy_list").html(""); var _photo=msg.photo; var str=''; for(var i in _photo) { str+='
  • ' } $("#slider").append(str); $("#slider").responsiveSlides({ auto: true, pager: false, nav: true, speed: 500, timeout:4000, pager: true, pauseControls: true, namespace: "callbacks" }); var cityd=msg.cityd; console.log(msg); $(".novice_title").html(msg["community"]); $(".novice_address").html(msg["city"]+" - "+msg["area"]); $(".novice_add").html(msg["citydess"]); $(".novice_num").html("空位 : "+msg["free"]); $('#fenbutu').attr("src", upload_url+msg["img"]); var vstr=""; for(var i in msg["empty"]) { vstr+='
  • '+ '
    '+ '
    '+msg["empty"][i].number+'
    '+ '
    '+msg["empty"][i].cost+'元/天
    '+ '
    '+ '  天  '+ '
    '+ '
    '+parseInt(msg["empty"][i].cost*1)+'
    '+ '
  • '; } $("#vacancy_list").html(vstr); /*var vstr=""; for(var i in msg["appointment"]) { vstr+='
  • '+ '
     
    '+ '
    '+msg["appointment"][i].number+'
    '+ '
     
    '+ '
    '+msg["appointment"][i].cost+'元/天
    '+ '
    已预约
    '+ '
  • '; } $("#other_list").append(vstr);*/ var vstr=""; for(var i in msg["buy"]) { var _days=""; if (msg["buy"][i].surplus==0||msg["buy"][i].surplus=="") { _days="正在申请"; }else { _days='剩余'+msg["buy"][i].surplus+'天'; } vstr+='
  • '+ '
     
    '+ '
    '+msg["buy"][i].number+'
    '+ '
     
    '+ '
    '+msg["buy"][i].cost+'元/天
    '+ '
    '+_days+'
    '+ '
  • '; } $("#other_list").append(vstr); } function check(id) { var arr=String(id).split("_"); if (arr[0]=="day") { var num=$("[name=day_"+arr[1]+"]").val(); var bol=checkNum(num); var day=1; if (bol==true) { day=parseInt(num); }else if (bol==false) { $("[name=day_"+arr[1]+"]").val(day); } var _num=parseInt($("#cost_"+arr[1]).html())*parseInt(day); $("#total_"+arr[1]).html(_num); setTotalCost(); } }