184 lines
4.2 KiB
JavaScript
184 lines
4.2 KiB
JavaScript
![]() |
var pagecurrent=1;
|
||
|
var cityid="";
|
||
|
var areaid="";
|
||
|
var communityid="";
|
||
|
var adnum="";
|
||
|
var initcity="false";
|
||
|
|
||
|
$(document).ready(function(){
|
||
|
|
||
|
initcity="true";
|
||
|
var msg={"pagecurrent":pagecurrent,"initcity":initcity};
|
||
|
sendClientMsg(root+"Wap/adList",msg,"");
|
||
|
|
||
|
/*
|
||
|
提交编辑信息
|
||
|
*/
|
||
|
$("body").unbind('click');
|
||
|
$("body").click(function(event){
|
||
|
var _id=$(event.target).attr("id");
|
||
|
var arr=String(_id).split("_");
|
||
|
|
||
|
if (arr[0]=="search")
|
||
|
{
|
||
|
var cityid=$("#adcity").val();
|
||
|
var areaid=$("#adarea").val();
|
||
|
var adnum=$("[name=adnum]").val();
|
||
|
var communityid=$("#adcommunity").val();
|
||
|
|
||
|
var msg={"pagecurrent":pagecurrent,"cityid":cityid,"areaid":areaid,"communityid":communityid,"adnum":adnum};
|
||
|
sendClientMsg(root+"Wap/adList",msg,"");
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
});
|
||
|
|
||
|
function adList(msg)
|
||
|
{
|
||
|
var _total=msg[0];
|
||
|
|
||
|
$("#ad_list").hide();
|
||
|
$("#pageinfor").hide();
|
||
|
$("#tip").hide();
|
||
|
|
||
|
if (_total == 0)
|
||
|
{
|
||
|
$("#tip").show();
|
||
|
$("#tip").html("当前没有数据");
|
||
|
}else
|
||
|
{
|
||
|
var _totalpage=msg[1];
|
||
|
var _current=msg[2];
|
||
|
var _list=msg[3];
|
||
|
|
||
|
$("#ad_list").show();
|
||
|
$("#pageinfor").show();
|
||
|
$("#ad_list").html("");
|
||
|
|
||
|
$(".totalpage").html(_totalpage);
|
||
|
$(".currentpage").html(_current);
|
||
|
|
||
|
var str='';
|
||
|
|
||
|
for(var i in _list)
|
||
|
{
|
||
|
if (_list[i].img!="")
|
||
|
{
|
||
|
var _img=upload_url+_list[i].img;
|
||
|
}else
|
||
|
{
|
||
|
var _img='';
|
||
|
}
|
||
|
str+='<div class="novice_zs_f_in" style="margin-bottom: 6px;">'+
|
||
|
'<div class="novice_zs_f_in_l">'+
|
||
|
'<div class="novice_zs_f_in_l_top">'+
|
||
|
'<img src="../../home/images/biao5.png">'+
|
||
|
'<span>编号:'+_list[i].number+'</span>'+
|
||
|
'</div>'+
|
||
|
'<div class="novice_zs_f_in_l_bottom">'+
|
||
|
'<ul>'+
|
||
|
'<li class="mark5_f">'+
|
||
|
'<span class=""><img src="'+_img+'" width="50" height="50" border="0" alt=""></span>'+
|
||
|
'</li>'+
|
||
|
'<li class="mark6_f">'+
|
||
|
'<div class="novice_title">'+_list[i].community+'</div>'+
|
||
|
'<div class="novice_address">'+_list[i].city+'-'+_list[i].area+'</div>'+
|
||
|
'<div class="novice_num">空位:'+_list[i].free+'位</div>'+
|
||
|
'</li>'+
|
||
|
'</ul>'+
|
||
|
'</div>'+
|
||
|
'</div>'+
|
||
|
'<a id="buy_'+_list[i].id+'" class="buy" onclick="buyAd(this.id)" href="javascript:void(0);">'+
|
||
|
'<div class="novice_zs_f_in_r">'+
|
||
|
'<span style=" background:url(../../home/images/lijitoubiao.png) no-repeat center"></span>'+
|
||
|
'</div>'+
|
||
|
'</a>'+
|
||
|
'</div>';
|
||
|
}
|
||
|
|
||
|
if (initcity=="true")
|
||
|
{
|
||
|
setCity(msg);
|
||
|
}
|
||
|
|
||
|
var msg={"pagecurrent":pagecurrent,"cityid":cityid,"areaid":areaid,"communityid":communityid,"adnum":adnum};
|
||
|
|
||
|
previousPage(root+"Wap/adList",msg,"");
|
||
|
nextPage(root+"Wap/adList",msg,"");
|
||
|
numPage(root+"Wap/adList",msg,"");
|
||
|
|
||
|
$("#ad_list").append(str);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function buyAd(id)
|
||
|
{
|
||
|
var arr=String(id).split("_");
|
||
|
if (arr[0]=="buy")
|
||
|
{
|
||
|
adid=arr[1];
|
||
|
disAd();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function setCity(msg)
|
||
|
{
|
||
|
initcity="false";
|
||
|
//createSelect("#adcity",msg['citylist']);
|
||
|
//$("#adarea").html('<option value="">请选择</option>');
|
||
|
createTitleSelect("#adarea",msg['arealist'],"请选择所在街道");
|
||
|
$("#adcommunity").html('<option value="">请选择所在社区</option>');
|
||
|
|
||
|
/*$("#adcity").change(function(){
|
||
|
var str=$("#adcity").val();
|
||
|
if (str!="")
|
||
|
{
|
||
|
cityid=str;
|
||
|
var msg={"cityid":cityid};
|
||
|
sendClientMsg(root+"Wap/getArea",msg,"");
|
||
|
}else
|
||
|
{
|
||
|
areaid="";
|
||
|
communityid="";
|
||
|
$("#adarea").html('<option value="">请选择</option>');
|
||
|
$("#adcommunity").html('<option value="">请选择</option>');
|
||
|
}
|
||
|
});*/
|
||
|
|
||
|
$("#adarea").change(function(){
|
||
|
var str=$("#adarea").val();
|
||
|
if (str!="")
|
||
|
{
|
||
|
areaid=str;
|
||
|
var msg={"areaid":areaid};
|
||
|
sendClientMsg(root+"Wap/getCommunity",msg,"");
|
||
|
}else
|
||
|
{
|
||
|
communityid="";
|
||
|
$("#adcommunity").html('<option value="">请选择所在社区</option>');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$("#adcommunity").change(function(){
|
||
|
var str=$("#adcommunity").val();
|
||
|
if (str!="")
|
||
|
{
|
||
|
communityid=str;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function setArea(msg)
|
||
|
{
|
||
|
createSelect("#adarea", msg);
|
||
|
communityid="";
|
||
|
$("#adcommunity").html('<option value="">请选择所在社区</option>');
|
||
|
}
|
||
|
|
||
|
function setCommunity(msg)
|
||
|
{
|
||
|
createSelect("#adcommunity", msg);
|
||
|
}
|
||
|
|