/**
 * @Statement: [ An Ordinary Person ]
 * @Author: 闻子 < QQ：270988107 >
 * @Copyright: 闻子 2016-2019 All rights reserved.
 */

layui.define(function(exports){
  var windowWidth = $(window).width()
	var self = {}
    self.modal = {}
    self.modal.info = function(msg, params) {
      params = params || {}
      params.titleIcoColor = params.titleIcoColor || '#5a8bff'
      params.titleIco = params.titleIco || 'exclaimination'
      params.title = [
        '<i class="layui-icon layui-icon-' +
          params.titleIco +
          '" style="font-size:12px;background:' +
          params.titleIcoColor +
          ';display:inline-block;position:relative;top:-2px;height:24px;line-height:24px;text-align:center;width:24px;color:#fff;border-radius:50%;margin-right:10px;"></i>' +
          (params.title || '提醒'),
        'background:#fff;border:none;font-weight:bold;font-size:18px;color:#08132b;padding-top:20px;height:46px;line-height:46px;padding-bottom:0;'
      ]
      params = $.extend(
        {
          btn: ['我知道了'],
          skin: 'layui-layer-admin-modal',
          area: [windowWidth <= 750 ? '90%' : '50%'],
          closeBtn: 0,
          shadeClose: true
        },
        params
      )
      layer.alert(msg, params)
    }
    self.modal.success = function(msg, params) {
      params = params || {}
      params.titleIco = 'ok'
      params.titleIcoColor = '#30d180'
      self.modal.info(msg, params)
    }
    self.modal.warn = function(msg, params) {
      params = params || {}
      params.titleIco = 'exclaimination'
      params.titleIcoColor = '#ff9900'
      self.modal.info(msg, params)
    }
    self.modal.error = function(msg, params) {
      params = params || {}
      params.titleIco = 'close'
      params.titleIcoColor = '#ed4014'
      self.modal.info(msg, params)
    }
  
  //输出test接口
  exports('wz', self);
});    