<script src="/layui/layui.js"></script>
<script>
var message;
layui.config({
    base: '/2019newui/houtai/js/',
    version: '1.0.1'
}).use(['app', 'message'], function() {
    var app = layui.app,
$ = layui.jquery,
layer = layui.layer;
    //将message设置为全局以便子页面调用
    message = layui.message;
    //主入口
    app.set({
type: 'iframe'
    }).init();
    
    $('dl.skin > dd').on('click', function() {
var $that = $(this);
var skin = $that.children('a').data('skin');
switchSkin(skin);
    });
    var setSkin = function(value) {
    layui.data('kit_skin', {
key: 'skin',
value: value
    });
},
getSkinName = function() {
    return layui.data('kit_skin').skin;
},
switchSkin = function(value) {
    var _target = $('link[kit-skin]')[0];
    _target.href = _target.href.substring(0, _target.href.lastIndexOf('/') + 1) + value + _target.href.substring(_target.href.lastIndexOf('.'));
    setSkin(value);
},
initSkin = function() {
    var skin = getSkinName();
    switchSkin(skin === undefined ? 'default' : skin);
}();

$('#color').click(function(){
layer.open({
type:1,
title:'配色方案',
area: ['290px', 'calc(100% - 52px)'],
offset: 'rb',
shadeClose:true,
id:'colors',
anim: 2,
shade:0.2,
closeBtn:0,
isOutAnim:false,
resize:false,
move: false,
skin: 'color-class',
btn:['黑白格','橘子橙','原谅绿','少女粉','天空蓝','枫叶红','道奇蓝','兰花紫','卡其布'],
yes: function(index, layero){
switchSkin('default');
}
,btn2: function(index, layero){
switchSkin('orange');
return false;
}
,btn3: function(index, layero){
switchSkin('green');
return false;
}
,btn4: function(index, layero){
switchSkin('pink');
return false;
}
,btn5: function(index, layero){
switchSkin('blue.1');
return false;
}
,btn6: function(index, layero){
switchSkin('red');
return false;
}
,btn7: function(index, layero){
switchSkin('lan');
return false;
}
,btn8: function(index, layero){
switchSkin('zi');
return false;
}
,btn9: function(index, layero){
switchSkin('qi');
return false;
}
});
})
});
</script>