Js直接处理状态,包括双击删除这条数据,并移除

本文介绍了一个后台管理系统,用于批量操作和删除照片,包括审核、设置审核状态及直接删除照片的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

$('.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;
};


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值