layui 电脑版 和手机版弹窗

电脑版弹窗

layer.open({
                content: '您确定要删除吗?删除后无法恢复'
                ,btn: ['确定', '取消']
                ,yes: function(index){
                  //location.reload();
                  
                  ///
                    $.ajax({
                        
                        url:'/school/student/del/',
                        type:"post",
                        datatype:"json",
                        data:{"id":id},
                        success:function(res){
                                      
                              if(typeof res != 'object')
                              {
                                res = JSON.parse(res);  
                              }
                              if(res.status==1)
                              {
                                layer.open({
                                    content: '删除成功'
                                    ,btn: '我知道了'
                                    ,end:function(){
                                        
                                        window.location.href = "/school/student/";
                                        
                                    }
                                });
                                
                              }else if(res.status==0)
                              {
        
                                layer.open({
                                    content: res.msg
                                    ,btn: '我知道了'
                                });
            
                              }  
                                      
                        },
                        error:function(){
                            
                            layer.open({
                                content: "操作错误,请稍后再试"
                                ,btn: '我知道了'
                            });
                                
                        }
                    });
                  
                  ///
                  
                  layer.close(index);
                }
            });

手机版弹窗

layer.open({
content: '你是想确认呢,还是想取消呢?',
btn: ['确认', '取消'],
shadeClose: false,
yes: function(){
layer.open({content: '你点了确认', time: 1});
}, no: function(){
layer.open({content: '你选择了取消', time: 1});
}
});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值