$('.label-error').live("click",function(){
obj=$(this).parent();
id=obj.parent().find('td').eq(0).html();
$.post("{php echo $this->createWeburl('setcheck')}", { "id":id ,'ischeck':1,'type':'photo'},
function(data){
if(data.type='success'){
{if $_GPC['ischeck']==-1}
obj.parent().remove();
{else}
obj.html('<span class="label label-success">已审核</span>');
{/if}
}else{
alert(data.massage);
}
}, "json");
});
$('.label-success').live("click",function(){
obj=$(this).parent();
id=obj.parent().find('td').eq(0).html();
$.post("{php echo $this->createWeburl('setcheck')}", { "id":id ,'ischeck':0,'type':'photo'},
function(data){
if(data.type='success'){
obj.html('<span class="label label-error">未审核</span>');
}else{
alert(data.massage);
}
}, "json");
});
{if $_GPC['ischeck']==-1}
$('tbody tr').dblclick(function() {
obj=$(this);
_id=$(this).find('td').eq(0).html();
$.post("{php echo $this->createWeburl('delphoto')}", { "id":_id ,'type':'photo'},
function(data){
if(data.type='success'){
obj.remove();
}else{
alert(data.massage);
}
})
});
{/if}
function del(_id,obj){
if (confirm("确认删除此照片吗?")) {
$.post("{php echo $this->createWeburl('delphoto')}", { "id":_id ,'type':'photo'},
function(data){
if(data.type='success'){
obj.parent().parent().remove();
}else{
alert(data.massage);
}
})
}
return false;
};
Js直接处理状态,包括双击删除这条数据,并移除
最新推荐文章于 2022-06-15 11:03:28 发布