layer 模版使用

function doReply(id){
    var url = "/Feedback/Feedback/reply";
    var content = $("#reply_content").val();
    var status = $("input[name='status']:checked").val();
    if (content == "") {
        layer.close(replyTempLayer);
        layer.msg("客官不要着急哦,请耐心的给客户回复内容");
        return false;
    }
    $.ajax({
        type: "POST",
        url: url ,
        data: {id:id,content:content,status:status},
        cache:false,
        dataType:"json",
        async:true,
        success: function(msg){
            layer.close(replyTempLayer);
            layer.closeAll('loading');
            if(msg.status != 1){
                layer.msg(msg.info);
            }else{
                layer.msg(msg.info);
                //成功处理之后对前端展示的数据进行更改
                var data = id.split(",");
                console.log(data);
                $(data).each(function(){
                    $("#reply_msg_"+this).html($("#reply_content").val());
                  })
            }
        },
        beforeSend:function(){
            layer.load(1, {
              shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
        },
        error:function(e){
            console.log(e);
            alert("网络繁忙请稍后");
        }
        });
}

 

posted @ 2016-12-08 12:19  小军的代码库  阅读(1343)  评论(0编辑  收藏  举报