123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- {eq name="'Index@theme_welcome_conf'|is_check_access" value="1"}
- {eq name='$main_lang' value='$admin_lang'}
- <form class="form-horizontal" id="postForm2" action="{:url('Index/theme_welcome_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="welcome_tplname">模板选择</label>
- </dt>
- <dd class="opt">
- <span class="theme_style" id="welcome_tplname">
- {volist name="$welcome_list" id="vo"}
- <span id="per_welcome_tplname_{$vo.theme_id}">
- <label class="theme_style_li curpoin" {$vo.disabled_tips}><input name="welcome_tplname" value="{$vo.welcome_tplname}" data-theme_id="{$vo.theme_id}" type="radio" {if condition="$vo['welcome_tplname'] == $global['web_theme_welcome_tplname']"} checked="checked" {/if} {$vo.disabled}><span id="welcome_tplname_{$vo.theme_id}">{$vo.theme_title}</span></label> {if condition="empty($vo['is_system'])"}<a class="curpoin" title="编辑" href="javascript:void(0);" onclick="welcome_tplname_edit(this);" data-theme_id="{$vo.theme_id}"><i class="iconfont e-bianji"></i></a>{/if}
- </span>
- {/volist}
- </span>
- <p class="notic">模板格式:welcome_自定义.htm<br/>模板目录:__ROOT_DIR__/application/admin/template/theme/</p>
- <a href="javascript:void(0);" onclick="welcome_tplname_add();" class="ncap-btn ncap-btn-green">新建模板</a>
- </dd>
- </dl>
- <dl class="row">
- <div class="bot">
- <a href="JavaScript:void(0);" onclick="checkSubmit2();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
- </div>
- </dl>
- </div>
- </form>
- {/eq}
- <script type="text/javascript">
-
- $(document).ready(function(){
- // 主题风格切换
- $('#welcome_tplname label.theme_style_li').on('click',function(){
- var disabled = $(this).find('input[type=radio]').attr('disabled');
- if (disabled == 'disabled') {
- var msg = $(this).attr('title');
- showErrorMsg(msg);
- return false;
- }
- $(this).find('input[type=radio]').attr('checked', true);
- var theme_id = $(this).find('input[type=radio]').attr('data-theme_id');
- $.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) {
- var info = res.data.info;
- $('input[name=welcome_tplname]').val(info.welcome_tplname);
- } else {
- showErrorAlert(res.msg);
- }
- },
- error:function(e){
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- });
- });
-
- function welcome_tplname_add()
- {
- var url = "{:url('Index/ajax_theme_tplfile_add',['type'=>'welcome'])}";
- //iframe窗
- layer.open({
- type: 2,
- title: '新建欢迎页模板',
- fixed: true, //不固定
- shadeClose: false,
- shade: layer_shade,
- maxmin: false, //开启最大化最小化按钮
- area: ['100%', '100%'],
- content: url
- });
- }
-
- function welcome_tplname_edit(obj)
- {
- var theme_id = $(obj).data('theme_id');
- var url = "{:url('Index/ajax_theme_tplfile_edit',['type'=>'welcome'])}";
- if (url.indexOf('?') > -1) {
- url += '&';
- } else {
- url += '?';
- }
- url += 'theme_id='+theme_id;
- //iframe窗
- layer.open({
- type: 2,
- title: '编辑欢迎页模板',
- fixed: true, //不固定
- shadeClose: false,
- shade: layer_shade,
- maxmin: false, //开启最大化最小化按钮
- area: ['100%', '100%'],
- content: url
- });
- }
-
- function checkSubmit2(){
- layer_loading('正在处理');
- $.ajax({
- type : 'post',
- url : "{:url('Index/theme_welcome_conf', ['_ajax'=>1])}",
- data : $('#postForm2').serialize(),
- dataType : 'json',
- success : function(res){
- layer.closeAll();
- if(res.code == 1){
- layer.msg(res.msg, {shade: layer_shade, time: 1000});
- }else{
- showErrorMsg(res.msg);
- }
- },
- error: function(e){
- layer.closeAll();
- layer.alert(e.responseText, {icon: 5, title:false});
- }
- });
- }
- </script>
- {/eq}
|