123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- {template 'common/header'}
- <ul class="nav nav-tabs">
- <li{if $do == 'display'} class="active"{/if}><a href="{php echo url('mc/credit/display');}">积分列表</a></li>
- <li{if $do == 'strategy'} class="active"{/if}><a href="{php echo url('mc/credit/strategy');}">积分策略</a></li>
- </ul>
- {if $do == 'display'}
- <script type="text/javascript">
- $("#form1").submit(function(){
- var colarr=new Array();
- var col;
- var bool=true;
- $(":checkbox[name^=enabled]:checked").each(function(){
- var key=$(this).attr('name').substr(8,7);
- if($("#"+key).val().trim()==''){
- util.message('启用某个积分后,对应的积分名称不能为空.', '', 'error');
- bool = false;
- }
- })
-
- $(":text.form-control").each(function(index){
- value=$(this).val().trim();
- if(value !=""){
- for(col in colarr){
- if(colarr[col]==value){
- util.message('积分名称重复.', '', 'error');
- bool = false;
- }
- }
- colarr[index+1]=value;
- }
- })
- if(!bool) return false;
- });
- </script>
- <form action="" method="post" id="form1">
- <div class="panel panel-default">
- <div class="panel-body table-responsive">
- <table class="table table-hover">
- <thead class="navbar-inner">
- <tr>
- <th style="width:100px;">启用否?</th>
- <th>积分</th>
- <th style="min-width:120px;">积分名称</th>
- </tr>
- </thead>
- <tbody>
- {loop $credits $key $item}
- <tr>
- <td style="vertical-align:middle;">
- <input type="checkbox" value="1" name="enabled[{$key}]"{if $key == 'credit1' || $key == 'credit2'}disabled checked{/if} {if $item['enabled'] == '1'}checked{/if}/>
- </td>
- <td style="vertical-align:middle;">{$key}</td>
- <td><input type="text" class="form-control" style="width:150px;" id="{$key}" placeholder="" name="title[{$key}]" value="{$item['title']}"></td>
- </tr>
- {/loop}
- </tbody>
- </table>
- </div>
- </div>
- <div>
- <input name="token" type="hidden" value="{$_W['token']}" />
- <input type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交" />
- </div>
- </form>
- {/if}
- {if $do == 'strategy'}
- <div class="clearfix">
- <div class="alert alert-danger">
- 请谨慎修改积分行为参数
- </div>
- <div class="form-horizontal form">
- <form action="" method="post">
- <div class="panel panel-default">
- <div class="panel-heading">
- 积分行为参数
- </div>
- <div class="panel-body">
- <div class="form-group">
- <label class="col-xs-12 col-sm-3 col-md-3 col-lg-2 control-label">基本&营销</label>
- <div class="col-sm-9 col-xs-12">
- <select name="activity" class="form-control">
- {loop $credits $key $item}
- <option {if $creditbehaviors['activity']==$key} selected {/if} value="{$key}">{$item['title']}</option>
- {/loop}
- </select>
- <span class="help-block">请设置使用系统内置营销功能时, 默认关联的积分类型. (具体功能或模块可能会提供独立的设置选项, 这里设置的是没有特殊选项时系统的默认值)</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-3 col-md-3 col-lg-2 control-label">交易&支付(余额)</label>
- <div class="col-sm-9 col-xs-12">
- <select name="currency" class="form-control">
- {loop $credits $key $item}
- <option {if $creditbehaviors['currency']==$key} selected {/if} value="{$key}">{$item['title']}</option>
- {/loop}
- </select>
- <span class="help-block">请设置系统支付或者购买时使用的积分, 这个积分一般是使用实际货币购买(充值)的.</span>
- </div>
- </div>
- </div>
- </div>
- <div class="form-group col-sm-12">
- <input name="token" type="hidden" value="{$_W['token']}" />
- <input type="submit" class="btn btn-primary col-lg-1" onclick="return confirm('您确定修改积分行为参数吗?');" name="submit" value="提交" />
- </div>
- </form>
- </div>
- </div>
- {/if}
- {template 'common/footer'}
|