123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516 |
- {eq name="'Index@theme_conf'|is_check_access" value="1"}
- <style type="text/css">
- #theme_main_color,#theme_assist_color {
- /*margin:0;*/
- /*padding:0;*/
- border:solid 1px #ccc;
- width:70px;
- height:20px;
- border-right:40px solid green;
- /*line-height:20px;*/
- }
- </style>
- <form class="form-horizontal" id="postForm1" action="{:url('Index/theme_conf')}" method="post">
- <div class="hDiv">
- <div class="hDivBox">
- <table cellspacing="0" cellpadding="0" style="width: 100%">
- <thead>
- <tr>
- <th class="sign w10" axis="col0">
- <div class="tc"></div>
- </th>
- <th abbr="article_title" axis="col3" class="w10">
- <div class="tc">主题设置</div>
- </th>
- <th abbr="ac_id" axis="col4">
- <div class=""></div>
- </th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- <div class="ncap-form-default">
- <!-- <dl class="row">
- <dt class="tit">
- <label for="theme_id">主题风格</label>
- </dt>
- <dd class="opt">
- <div class="theme_style" id="theme_login_style">
- <ul>
- {volist name="$list" id="vo"}
- <li>
- <img src="{$vo.theme_pic|get_default_pic=###}" {if condition="$vo['theme_id'] == $global['web_theme_styleid']"} class="active" {/if}>
- <span><input name="theme_id" value="{$vo.theme_id}" type="radio" {if condition="$vo['theme_id'] == $global['web_theme_styleid']"} checked="checked" {/if}>{$vo.theme_title}</span>
- </li>
- {/volist}
- </ul>
- </div>
- </dd>
- </dl> -->
- {eq name='$main_lang' value='$admin_lang'}
- <dl class="row"><dt class="tit"><label><b>登录页设置</b></label></dt></dl>
- <dl class="row">
- <dt class="tit">
- <label for="login_tplname">模板选择</label>
- </dt>
- <dd class="opt">
- <select name="login_tplname" id="login_tplname">
- <option value="">系统默认</option>
- {volist name="$login_tplist" id="vo"}
- <option value="{$vo}" {if condition="$global['web_theme_login_tplname'] == $vo"} selected="true" {/if}>{$vo}</option>
- {/volist}
- </select>
- <p class="notic">模板格式:login_自定义.htm<br/>模板目录:__ROOT_DIR__/application/admin/template/theme/</p>
- <a href="javascript:void(0);" onclick="login_tplname_add();" class="ncap-btn ncap-btn-green">新建模板</a>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="login_logo">登录logo</label>
- </dt>
- <dd class="opt">
- <div class="input-file-show">
- <span class="show">
- <a id="img_a_login_logo" class="nyroModal" rel="gal" href="{$global.web_loginlogo|default='javascript:void(0);'}?t={php}echo getTime();{/php}" target="_blank">
- <i id="img_i_login_logo" class="fa fa-picture-o" {notempty name="$global.web_loginlogo"}onmouseover="layer_tips=layer.tips('<img src={$global.web_loginlogo|default=''} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
- </a>
- </span>
- <span class="type-file-box">
- <input type="text" id="login_logo" name="login_logo" value="{$global.web_loginlogo|default=''}" class="type-file-text" autocomplete="off">
- <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
- <input class="type-file-file" onClick="GetUploadify(1,'','loginlogo','login_logo_call_back','{:url('Uploadify/upload_full')}');" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
- </span>
- </div>
- <span class="err"></span>
- <p class="notic"></p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="login_bgimg_model">背景图</label>
- </dt>
- <dd class="opt">
- <input type="hidden" name="login_bgimg_model" value="{$global['web_loginbgimg_model']|default='1'}" id="login_bgimg_model"/>
- <div class="theme_bg div_login_bgimg_model">
- <ul>
- <li id="login_bgimg_model_1" {if condition="$global['web_loginbgimg_model'] == 1"} class="active" {/if} data-model="1"><img src="__SKIN__/loginbg/login-bg-1.png"></li>
- <li id="login_bgimg_model_2" {if condition="$global['web_loginbgimg_model'] == 2"} class="active" {/if} data-model="2"><img src="__SKIN__/loginbg/login-bg-2.png"></li>
- {if condition="$php_servicemeal >= 2"}
- <li id="login_bgimg_model_3" {if condition="$global['web_loginbgimg_model'] == 3"} class="active" {/if} data-model="3"><img src="__SKIN__/loginbg/login-bg-3.png"></li>
- {/if}
- <li id="login_bgimg_model_custom" {if condition="$global['web_loginbgimg_model'] == 'custom'"} class="active" {/if} data-model="custom"><img src="__SKIN__/images/login-bg-empty.png" title="自定义背景"></li>
- </ul>
- </div>
- </dd>
- </dl>
- <dl class="row" id="div_custom_login_bgimg" {if condition="$global['web_loginbgimg_model'] != 'custom'"} style="display: none;" {/if}>
- <dt class="tit">
- <label for="login_bgimg"> </label>
- </dt>
- <dd class="opt">
- <div class="input-file-show">
- <span class="show">
- <a id="img_a_login_bgimg" class="nyroModal" rel="gal" href="{$global.web_loginbgimg|default='javascript:void(0);'}" target="_blank">
- <i id="img_i_login_bgimg" class="fa fa-picture-o" {notempty name="$global.web_loginbgimg"}onmouseover="layer_tips=layer.tips('<img src={$global.web_loginbgimg|default=''} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
- </a>
- </span>
- <span class="type-file-box">
- <input type="text" id="login_bgimg" name="login_bgimg" value="{$global.web_loginbgimg|default=''}" class="type-file-text" autocomplete="off">
- <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
- <input class="type-file-file" onClick="GetUploadify(1,'','loginbgimg','login_bgimg_call_back','{:url('Uploadify/upload_full')}');" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
- </span>
- </div>
- <span class="err"></span>
- <p class="notic"></p>
- </dd>
- </dl>
- {/eq}
- <dl class="row"><dt class="tit"><label><b>主题元素设置</b></label></dt></dl>
- <dl class="row">
- <dt class="tit">
- <label for="theme_color_model">主题色</label>
- </dt>
- <dd class="opt">
- <div class="theme-color div_theme_color_model">
- <input type="hidden" name="theme_color_model" value="{$global['web_theme_color_model']|default='1'}" id="theme_color_model"/>
- <ul>
- <li id="theme_color_model_1" {if condition="empty($global['web_theme_color_model']) || $global['web_theme_color_model'] == 1"} class="active" {/if} data-model="1">
- <span class="main_color" style="background-color: #3398cc;"></span>
- <span class="assist_color" style="background-color: #2189be;"></span>
- </li>
- <li id="theme_color_model_2" {if condition="$global['web_theme_color_model'] == 2"} class="active" {/if} data-model="2">
- <span class="main_color" style="background-color: #1e9fff;"></span>
- <span class="assist_color" style="background-color: #0069b7;"></span>
- </li>
- <li id="theme_color_model_3" {if condition="$global['web_theme_color_model'] == 3"} class="active" {/if} data-model="3">
- <span class="main_color" style="background-color: #1aa094;"></span>
- <span class="assist_color" style="background-color: #197971;"></span>
- </li>
- <li id="theme_color_model_4" {if condition="$global['web_theme_color_model'] == 4"} class="active" {/if} data-model="4">
- <span class="main_color" style="background-color: #e82121;"></span>
- <span class="assist_color" style="background-color: #ae1919;"></span>
- </li>
- <li id="theme_color_model_5" {if condition="$global['web_theme_color_model'] == 5"} class="active" {/if} data-model="5">
- <span class="main_color" style="background-color:#197971;"></span>
- <span class="assist_color" style="background-color: #fa921b;"></span>
- </li>
- <li id="theme_color_model_6" {if condition="$global['web_theme_color_model'] == 6"} class="active" {/if} data-model="6">
- <span class="main_color" style="background-color:#963885;"></span>
- <span class="assist_color" style="background-color: #772c6a;"></span>
- </li>
- <li id="theme_color_model_custom" {if condition="$global['web_theme_color_model'] == 'custom'"} class="active" {/if} data-model="custom">
- <span style="background-color:#ffffff;">
- <img src="__STATIC__/admin/images/empty-color.png?v={$version|default='v1.6.2'}">
- </span>
- <span style="background-color:#ffffff;">
- <img src="__STATIC__/admin/images/empty-color.png?v={$version|default='v1.6.2'}">
- </span>
- </li>
- </ul>
- </div>
- </dd>
- </dl>
- <div id="div_custom_theme_color" class="{if condition="$global['web_theme_color_model'] != 'custom'"} none {/if}">
- <dl class="row">
- <dt class="tit">
- <label for="theme_main_color">自定义主色</label>
- </dt>
- <dd class="opt">
- <input type="text" name="theme_main_color" value="{$global.web_theme_color|default='#3398cc'}" id="theme_main_color" style="border-color: {$global.web_theme_color|default='#3398cc'};" />
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="theme_assist_color">自定义辅色</label>
- </dt>
- <dd class="opt">
- <input type="text" name="theme_assist_color" value="{$global.web_assist_color|default='#2189be'}" id="theme_assist_color" style="border-color: {$global.web_assist_color|default='#2189be'};" />
- </dd>
- </dl>
- </div>
- {eq name='$main_lang' value='$admin_lang'}
- <dl class="row">
- <dt class="tit">
- <label for="admin_logo">后台logo</label>
- </dt>
- <dd class="opt">
- <div class="input-file-show">
- <span class="show">
- <a id="img_a_admin_logo" class="nyroModal" rel="gal" href="{$global.web_adminlogo|default='javascript:void(0);'}?t={php}echo getTime();{/php}" target="_blank">
- <i id="img_i_admin_logo" class="fa fa-picture-o" {notempty name="$global.web_adminlogo"}onmouseover="layer_tips=layer.tips('<img src={$global.web_adminlogo|default=''} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
- </a>
- </span>
- <span class="type-file-box">
- <input type="text" id="admin_logo" name="admin_logo" value="{$global.web_adminlogo|default=''}" class="type-file-text" autocomplete="off">
- <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
- <input class="type-file-file" onClick="GetUploadify(1,'','adminlogo','admin_logo_call_back','{:url('Uploadify/upload_full')}');" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
- </span>
- </div>
- <span class="err"></span>
- <p class="notic"></p>
- </dd>
- </dl>
- {/eq}
- <dl class="row">
- <div class="bot">
- <!-- <input type="hidden" name="theme_title" value=""> -->
- <!-- <input type="hidden" name="is_select_theme" value="0"> -->
- <a href="JavaScript:void(0);" onclick="checkSubmit1();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
- </div>
- </dl>
- </div>
- </form>
-
- <script>
-
- $(document).ready(function(){
-
- // 主题风格切换
- /*$('#theme_login_style').find('li').click(function(){
- $('#theme_login_style').find('li>img').removeClass('active');
- $(this).find('img').addClass('active');
- $(this).find('input[type=radio]').attr('checked', true);
- var theme_id = $(this).find('input[type=radio]').val();
- $.ajax({
- type: "GET",
- url: "{:url('Index/ajax_get_theme_info', ['_ajax'=>1])}",
- data: {theme_id:theme_id},
- dataType: 'json',
- success: function (res) {
- layer.closeAll();
- if (res.code == 1) {
- $('input[name=is_select_theme]').val(1);
- var info = res.data.info;
- $('input[name=theme_title]').val(info.theme_title);
- login_logo_call_back(info.login_logo);
- $('#login_bgimg_model_'+info.login_bgimg_model).click();
- login_bgimg_call_back(info.login_bgimg);
- $('input[name=login_tplname]').val('');
- $('#theme_color_model_'+info.theme_color_model).click();
- if (info.theme_color_model == 'custom') {
- $('input[name=theme_main_color]').val(info.theme_main_color).css('border-color',info.theme_main_color);
- $('input[name=theme_assist_color]').val(info.theme_assist_color).css('border-color',info.theme_assist_color);
- }
- admin_logo_call_back(info.admin_logo);
- } else {
- showErrorAlert(res.msg);
- }
- },
- error:function(e){
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- });*/
-
- // 登录背景图切换
- $('.div_login_bgimg_model').find('li').click(function(){
- $('.div_login_bgimg_model').find('li').removeClass('active');
- $(this).addClass('active');
- var data_model = $(this).attr('data-model');
- $('#login_bgimg_model').val(data_model);
- if ('custom' == data_model) {
- $('#div_custom_login_bgimg').show();
- } else {
- $('#div_custom_login_bgimg').hide();
- // 登录背景图
- var loginbgimg = $(this).find('img').attr('src');
- $('#login_bgimg').val(loginbgimg);
- }
- });
-
- // 主题色切换
- $('.div_theme_color_model').find('li').click(function(){
- $('.div_theme_color_model').find('li').removeClass('active');
- $(this).addClass('active');
- var data_model = $(this).attr('data-model');
- $('#theme_color_model').val(data_model);
- if ('custom' == data_model) {
- $('#div_custom_theme_color').show();
- } else {
- $('#div_custom_theme_color').hide();
- // 主题色
- var main_color = $(this).find('span.main_color').css('background-color');
- main_color = main_color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
- main_color= "#" + hex(main_color[1]) + hex(main_color[2]) + hex(main_color[3]);
- $('#theme_main_color').val(main_color);
- // 辅助色
- var assist_color = $(this).find('span.assist_color').css('background-color');
- assist_color = assist_color.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
- assist_color= "#" + hex(assist_color[1]) + hex(assist_color[2]) + hex(assist_color[3]);
- $('#theme_assist_color').val(assist_color);
- }
- });
-
- // 10进制转为16进制
- function hex(x) {
- return ("0" + parseInt(x).toString(16)).slice(-2);
- }
-
- // 自定义 - 主题颜色选择
- $('#theme_main_color').colpick({
- flat:false,
- layout:'rgbhex',
- submit:0,
- colorScheme:'light',
- color:$('#theme_main_color').val(),
- onChange:function(hsb,hex,rgb,el,bySetColor) {
- $(el).css('border-color','#'+hex);
- // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
- if(!bySetColor) $(el).val('#'+hex);
- }
- }).keyup(function(){
- $(this).colpickSetColor('#'+this.value);
- });
-
- // 自定义 - 辅助颜色选择
- $('#theme_assist_color').colpick({
- flat:false,
- layout:'rgbhex',
- submit:0,
- colorScheme:'light',
- color:$('#theme_assist_color').val(),
- onChange:function(hsb,hex,rgb,el,bySetColor) {
- $(el).css('border-color','#'+hex);
- // Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
- if(!bySetColor) $(el).val('#'+hex);
- }
- }).keyup(function(){
- $(this).colpickSetColor('#'+this.value);
- });
- });
-
- function checkSubmit1(){
- layer_loading('正在处理');
- $.ajax({
- type : 'POST',
- url : "{:url('Index/theme_conf', ['_ajax'=>1])}",
- data : $('#postForm1').serialize(),
- dataType : 'json',
- success : function(res){
- if(res.code == 1){
- if (res.data.is_change == 1) {
- /*layer.confirm('已保存,确认要新建主题风格?', {
- shade: layer_shade,
- area: ['480px', '190px'],
- move: false,
- title: '提示',
- btnAlign:'r',
- closeBtn: 3,
- btn: ['新建主题','关闭'], //按钮
- success: function () {
- $(".layui-layer-content").css('text-align', 'left');
- $(".layui-layer-btn").find('a.layui-layer-btn1').removeClass('layui-layer-btn1').addClass('layui-layer-btn2');
- $(".layui-layer-btn").find('a.layui-layer-btn0').removeClass('layui-layer-btn0').addClass('layui-layer-btn1');
- $(".layui-layer-btn").find('a.layui-layer-btn2').removeClass('layui-layer-btn2').addClass('layui-layer-btn0');
- },
- cancel: function(index, layero){
- layer.closeAll();
- window.location.reload();
- return false;
- }
- }, function () {
- layer.closeAll();
- layer.prompt({
- title: '新建主题风格',
- id: 'layerid_1645598368',
- btn: ['确定','取消'],
- shade: layer_shade,
- closeBtn: 0,
- success: function(layero, index) {
- $("#layerid_1645598368").find('input').attr('placeholder', '请输入主题名称');
- $("#layerid_1645598368").find('input').bind('keydown', function(event) {
- if (event.keyCode == 13) {
- theme_add_login($(this).val());
- }
- });
- },
- btn2: function(index, layero){
- window.location.reload();
- return false;
- }
- }, function(value, index) {
- theme_add_login(value);
- });
- }, function (index) {
- layer.closeAll();
- window.location.reload();
- });*/
- } else {
- layer.closeAll();
- layer.alert(res.msg, {
- shade: layer_shade,
- area: ['480px', '190px'],
- move: false,
- title: '提示',
- btnAlign:'r',
- closeBtn: 3,
- btn: ['确定','取消'],
- success: function () {
- $(".layui-layer-content").css('text-align', 'left');
- },
- cancel: function(index, layero){
- window.location.reload();
- return false;
- },
- btn2: function(index, layero){
- window.location.reload();
- }
- },function(){
- top.window.location.reload();
- });
- }
- }else{
- layer.closeAll();
- showErrorMsg(res.msg);
- }
- },
- error: function(e){
- layer.closeAll();
- layer.alert(e.responseText, {icon: 5, title:false});
- }
- });
- }
-
- /*function theme_add_login(theme_title)
- {
- $('input[name=theme_title]').val(theme_title);
- $.ajax({
- type: "POST",
- url: "{:url('Index/theme_add_login', ['_ajax'=>1])}",
- data: $('#postForm1').serialize(),
- dataType: 'json',
- success: function (res1) {
- layer.closeAll();
- if (res1.code == 1) {
- layer.alert(res1.msg, {
- shade: layer_shade,
- area: ['480px', '190px'],
- move: false,
- title: '提示',
- btnAlign:'r',
- closeBtn: 3,
- btn: ['关闭','刷新后台'],
- success: function () {
- $(".layui-layer-content").css('text-align', 'left');
- },
- cancel: function(index, layero){
- window.location.reload();
- return false;
- },
- btn2: function(index, layero){
- top.window.location.reload();
- }
- },function(){
- window.location.reload();
- });
- } else {
- showErrorAlert(res1.msg);
- }
- },
- error:function(e){
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- }*/
-
- function admin_logo_call_back(fileurl_tmp)
- {
- $("#admin_logo").val(fileurl_tmp);
- $("#img_a_admin_logo").attr('href', fileurl_tmp);
- $("#img_i_admin_logo").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
- }
-
- function login_logo_call_back(fileurl_tmp)
- {
- $("#login_logo").val(fileurl_tmp);
- $("#img_a_login_logo").attr('href', fileurl_tmp);
- $("#img_i_login_logo").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
- }
-
- function login_bgimg_call_back(fileurl_tmp)
- {
- $("#login_bgimg").val(fileurl_tmp);
- $("#img_a_login_bgimg").attr('href', fileurl_tmp);
- $("#img_i_login_bgimg").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
- }
-
- function login_tplname_add()
- {
- var url = "{:url('Index/ajax_theme_tplfile_add',['type'=>'login'])}";
- //iframe窗
- layer.open({
- type: 2,
- title: '新建登录页模板',
- fixed: true, //不固定
- shadeClose: false,
- shade: layer_shade,
- maxmin: false, //开启最大化最小化按钮
- area: ['100%', '100%'],
- content: url
- });
- }
- </script>
- {/eq}
|