人人商城

credit.html 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {template 'common/header'}
  2. <ul class="nav nav-tabs">
  3. <li{if $do == 'display'} class="active"{/if}><a href="{php echo url('mc/credit/display');}">积分列表</a></li>
  4. <li{if $do == 'strategy'} class="active"{/if}><a href="{php echo url('mc/credit/strategy');}">积分策略</a></li>
  5. </ul>
  6. {if $do == 'display'}
  7. <script type="text/javascript">
  8. $("#form1").submit(function(){
  9. var colarr=new Array();
  10. var col;
  11. var bool=true;
  12. $(":checkbox[name^=enabled]:checked").each(function(){
  13. var key=$(this).attr('name').substr(8,7);
  14. if($("#"+key).val().trim()==''){
  15. util.message('启用某个积分后,对应的积分名称不能为空.', '', 'error');
  16. bool = false;
  17. }
  18. })
  19. $(":text.form-control").each(function(index){
  20. value=$(this).val().trim();
  21. if(value !=""){
  22. for(col in colarr){
  23. if(colarr[col]==value){
  24. util.message('积分名称重复.', '', 'error');
  25. bool = false;
  26. }
  27. }
  28. colarr[index+1]=value;
  29. }
  30. })
  31. if(!bool) return false;
  32. });
  33. </script>
  34. <form action="" method="post" id="form1">
  35. <div class="panel panel-default">
  36. <div class="panel-body table-responsive">
  37. <table class="table table-hover">
  38. <thead class="navbar-inner">
  39. <tr>
  40. <th style="width:100px;">启用否?</th>
  41. <th>积分</th>
  42. <th style="min-width:120px;">积分名称</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. {loop $credits $key $item}
  47. <tr>
  48. <td style="vertical-align:middle;">
  49. <input type="checkbox" value="1" name="enabled[{$key}]"{if $key == 'credit1' || $key == 'credit2'}disabled checked{/if} {if $item['enabled'] == '1'}checked{/if}/>
  50. </td>
  51. <td style="vertical-align:middle;">{$key}</td>
  52. <td><input type="text" class="form-control" style="width:150px;" id="{$key}" placeholder="" name="title[{$key}]" value="{$item['title']}"></td>
  53. </tr>
  54. {/loop}
  55. </tbody>
  56. </table>
  57. </div>
  58. </div>
  59. <div>
  60. <input name="token" type="hidden" value="{$_W['token']}" />
  61. <input type="submit" class="btn btn-primary col-lg-1" name="submit" value="提交" />
  62. </div>
  63. </form>
  64. {/if}
  65. {if $do == 'strategy'}
  66. <div class="clearfix">
  67. <div class="alert alert-danger">
  68. 请谨慎修改积分行为参数
  69. </div>
  70. <div class="form-horizontal form">
  71. <form action="" method="post">
  72. <div class="panel panel-default">
  73. <div class="panel-heading">
  74. 积分行为参数
  75. </div>
  76. <div class="panel-body">
  77. <div class="form-group">
  78. <label class="col-xs-12 col-sm-3 col-md-3 col-lg-2 control-label">基本&营销</label>
  79. <div class="col-sm-9 col-xs-12">
  80. <select name="activity" class="form-control">
  81. {loop $credits $key $item}
  82. <option {if $creditbehaviors['activity']==$key} selected {/if} value="{$key}">{$item['title']}</option>
  83. {/loop}
  84. </select>
  85. <span class="help-block">请设置使用系统内置营销功能时, 默认关联的积分类型. (具体功能或模块可能会提供独立的设置选项, 这里设置的是没有特殊选项时系统的默认值)</span>
  86. </div>
  87. </div>
  88. <div class="form-group">
  89. <label class="col-xs-12 col-sm-3 col-md-3 col-lg-2 control-label">交易&支付(余额)</label>
  90. <div class="col-sm-9 col-xs-12">
  91. <select name="currency" class="form-control">
  92. {loop $credits $key $item}
  93. <option {if $creditbehaviors['currency']==$key} selected {/if} value="{$key}">{$item['title']}</option>
  94. {/loop}
  95. </select>
  96. <span class="help-block">请设置系统支付或者购买时使用的积分, 这个积分一般是使用实际货币购买(充值)的.</span>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="form-group col-sm-12">
  102. <input name="token" type="hidden" value="{$_W['token']}" />
  103. <input type="submit" class="btn btn-primary col-lg-1" onclick="return confirm('您确定修改积分行为参数吗?');" name="submit" value="提交" />
  104. </div>
  105. </form>
  106. </div>
  107. </div>
  108. {/if}
  109. {template 'common/footer'}