public function FootDelAction(){ $db = new \Admin\Model\Foot\footModel(); $result = $db->footDel(); if($result>0){$this->ajaxReturn(array('success'=>true,'msg'=>'删除成功'));}else{$this->ajaxReturn(array('success'=>false,'msg'=>'删除失败'));}}删除layui.use('layer',function(){
$('a[data-toggle="delete"]').on('click',function(){
var layer = layui.layer;
var incid = $(this).attr('data-id');
layer.confirm('您确定要删除吗?',function(index){
$.ajax(
{
type:'post',
url:'{:U("Foot/FootDel")}',
dataType:'json',
data:{id:incid},
success:function(res){
if(!res.success){
layer.msg(res.msg);
return;
}
layer.msg('删除成功');
setTimeout(function(){
return layer.close(index);
},1000);
}
}
);
});
});
});
网友评论