layui.define(['layer', 'jquery', 'element'], function (exports) {
    "use strict";

    var MOD_NAME = 'popup',
        $ = layui.jquery,
        layer = layui.layer,
        element = layui.element;

    var popup = new function () {

        this.success = function (msg, callback) {
            layer.msg('<i class="pear-icon pear-icon-success" style="margin-right:5px;color:#2bb353;"></i>' + msg, {
                time: 2000,
                shade:[0.3,'#000'],
                success: function(layero) {
                    layero
                        .css('background-color','#fff').css('min-width','130px');
                    layero.find('.layui-layer-content')
                        .css('border','1px solid #ebeef5')
                        .css('background-color','#fff')
                        .css('color','#4c596e')
                        .css('border-radius','4px')
                        .css('border-color','transparent')
                        .css('-webkit-filter','drop-shadow(0 2px 6px rgba(0,19,48,.2)')
                        .css('filter','drop-shadow(0 2px 6px rgba(0,19,48,.2)')
                        .css('padding','9px 16px')
                        .css('text-align','left');
                }
            }, callback);
        };

        this.warning = function (msg, callback) {
            layer.msg('<i class="pear-icon pear-icon-prompt" style="margin-right:5px;font-size:14px;color:#e6a23c;"></i>' + msg, {
                time: 2000,
                shade:[0.3,'#000'],
                success: function(layero) {
                    layero
                        .css('background-color','#fff')
                        .css('min-width','130px');
                    layero.find('.layui-layer-content')
                        .css('border','1px solid #ebeef5')
                        .css('background-color','#fff')
                        .css('color','#4c596e')
                        .css('border-radius','4px')
                        .css('border-color','transparent')
                        .css('-webkit-filter','drop-shadow(0 2px 6px rgba(0,19,48,.2)')
                        .css('filter','drop-shadow(0 2px 6px rgba(0,19,48,.2)')
                        .css('padding','9px 30px 9px 16px')
                        .css('text-align','left');
                }
            }, callback);
        };

        this.failure = function (msg, callback) {
            layer.msg('<i class="layui-icon layui-icon-close-fill" style="margin-right:5px;color:#f56c6c;vertical-align: middle;"></i>' + msg, {
                time: 3000,
                shade:[0.3,'#000'],
                success: function(layero) {
                    layero
                        .css('background-color','#fff')
                        .css('min-width','130px');
                    layero.find('.layui-layer-content')
                        .css('border','1px solid #ebeef5')
                        .css('background-color','#fff')
                        .css('color','#4c596e')
                        .css('border-radius','4px')
                        .css('border-color','transparent')
                        .css('-webkit-filter','drop-shadow(0 2px 6px rgba(0,19,48,.2)')
                        .css('filter','drop-shadow(0 2px 6px rgba(0,19,48,.2)')
                        .css('padding','9px 16px')
                        .css('text-align','left');
                }
            }, callback);
        };
    };

    exports(MOD_NAME, popup);
});
