68 lines
1.6 KiB
JavaScript
68 lines
1.6 KiB
JavaScript
$(document).ready(function(){
|
|
|
|
var msg={"id":communityid,"citytype":3};
|
|
|
|
clearErrorTips("tip","errorTips");
|
|
sendClientMsg(root+"City/cityInfor",msg,"");
|
|
|
|
$("body").click(function(event){
|
|
var _id=$(event.target).attr("id");
|
|
var arr=String(_id).split("_");
|
|
|
|
if (arr[0]=="editCommunity")
|
|
{
|
|
clearErrorTips("tip","errorTips");
|
|
var city=trimAll($("[name=city]").val(),"g");
|
|
var cityd=trimAll($("[name=cityd]").val(),"g");
|
|
if (city=="")
|
|
{
|
|
setErrorTips("city_tip","errorTips",message[6]);
|
|
return false;
|
|
}
|
|
if (cityd=="")
|
|
{
|
|
setErrorTips("city_dess","errorTips",message[6]);
|
|
return false;
|
|
}
|
|
|
|
var msg={"id":communityid,"name":city,"citydess":cityd,"citytype":3};
|
|
sendClientMsg(root+"City/editCity",msg,"");
|
|
}
|
|
// else if (arr[0]=="editImg")
|
|
// {
|
|
// var msg={"id":communityid};
|
|
// sendClientMsg(root+"City/editImg",msg,"");
|
|
// }else if (arr[0]=="delImg")
|
|
// {
|
|
// imgname=arr[1];
|
|
// tip(message[10],sendDelImg);
|
|
// }
|
|
})
|
|
|
|
});
|
|
|
|
var imgname="";
|
|
|
|
//function sendDelImg()
|
|
//{
|
|
// var msg={"id":communityid,"img":imgname};
|
|
// sendClientMsg(root+"City/delImg",msg,"");
|
|
//}
|
|
|
|
function communityInfor(msg)
|
|
{
|
|
$("[name=city]").val(msg["name"]);
|
|
// if (msg["img"]!="")
|
|
// {
|
|
// var imgarr = msg["img"].split('|');
|
|
// var title='<tr><th>图片</th><th>操作</th></tr>';
|
|
// var str='';
|
|
//
|
|
// for(var i in imgarr)
|
|
// {
|
|
// str+='<tr><td class="center"><img src="'+upload_url+imgarr[i]+'" /></td><td class="center"><a href="javascript:void(0);" id="delImg_'+imgarr[i]+'" class="inner_btn">删除</a></td></tr>';
|
|
// }
|
|
//
|
|
// $(".img_list").append(title+str);
|
|
// }
|
|
} |