No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

level_index.htm 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit; height: calc( 100% - 40px );">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. {include file="member/left" /}
  6. <div class="page min-hg-c-20" style="min-width:auto;margin-left:100px;">
  7. <!-- <div class="fixed-bar">
  8. <div class="item-title">
  9. <ul class="tab-base nc-row">
  10. {eq name="'Member@level_index'|is_check_access" value="1"}
  11. <li>
  12. <a {if condition="in_array($Request.action, ['level_index','level_add','level_edit'])"}class="current"{/if} href='{:url("Member/level_index")}'>
  13. <span>会员级别</span>
  14. </a>
  15. </li>
  16. {/eq}
  17. </ul>
  18. </div>
  19. </div> -->
  20. <div class="flexigrid">
  21. <!-- 操作说明 -->
  22. <div id="explanation" class="explanation">
  23. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  24. <h4 title="提示相关设置操作时应注意的要点">提示</h4>
  25. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  26. </div>
  27. <ul>
  28. <li>等级值越高权根越高</li>
  29. </ul>
  30. </div>
  31. <br/>
  32. <div class="hDiv">
  33. <div class="hDivBox">
  34. <table cellspacing="0" cellpadding="0" style="width: 100%">
  35. <thead>
  36. <tr>
  37. <th class="sign w20 none" axis="col0">
  38. <div class="tc"></div>
  39. </th>
  40. <th abbr="ac_id" axis="col4">
  41. <div style="padding-left: 15px;">级别名称</div>
  42. </th>
  43. <th abbr="article_time" axis="col4" class="w160">
  44. <div class="tc">会员等级值</div>
  45. </th>
  46. {eq name='$isShowDownCount' value='1'}
  47. <th abbr="article_time" axis="col4" class="w100">
  48. <div class="tc">下载次数(天)</div>
  49. </th>
  50. {/eq}
  51. <th abbr="article_time" axis="col4" class="w160">
  52. <div class="tc">折扣率(%)</div>
  53. </th>
  54. <th axis="col1" class="w150">
  55. <div class="tc">操作</div>
  56. </th>
  57. </tr>
  58. </thead>
  59. </table>
  60. </div>
  61. </div>
  62. <div class="bDiv" style="height: auto; min-height: auto;">
  63. <form id="PostForm">
  64. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  65. <table style="width: 100%">
  66. <tbody id="Template">
  67. {empty name="list"}
  68. <tr>
  69. <div class="">
  70. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  71. </div>
  72. </tr>
  73. {else/}
  74. {foreach name="list" item="vo" key="k" }
  75. <tr class="tr">
  76. <td class="sign none">
  77. <div class="w20 tc">
  78. <input type="hidden" name="level_id[]" value="{$vo.level_id}">
  79. </div>
  80. </td>
  81. <td style="width: 100%">
  82. <div style="padding-left: 10px;">
  83. {eq name="'Member@level_add'|is_check_access" value="1"}
  84. <input type="text" name="level_name[]" value="{$vo.level_name}" class="w180">
  85. {else /}
  86. {$vo.level_name}
  87. {/eq}
  88. </div>
  89. </td>
  90. <td>
  91. <div class="w160 tc">
  92. {eq name="'Member@level_add'|is_check_access" value="1"}
  93. <input type="text" name="level_value[]" value="{$vo.level_value}" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" class="tc w80">
  94. {else /}
  95. {$vo.level_value}
  96. {/eq}
  97. </div>
  98. </td>
  99. {eq name='$isShowDownCount' value='1'}
  100. <td>
  101. <div class="w100 tc">
  102. {eq name="'Member@level_add'|is_check_access" value="1"}
  103. <input type="text" name="down_count[]" value="{$vo.down_count}" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'')" class="tc w80">
  104. {else /}
  105. {$vo.down_count}
  106. {/eq}
  107. </div>
  108. </td>
  109. {/eq}
  110. <td>
  111. <div class="w160 tc">
  112. {eq name="'Member@level_add'|is_check_access" value="1"}
  113. <input type="text" name="discount[]" value="{$vo.discount}" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'')" class="tc w80">
  114. {else /}
  115. {$vo.discount}
  116. {/eq}
  117. </div>
  118. </td>
  119. <td class="operation">
  120. <div class="w150 tc">
  121. {eq name="'Member@level_del'|is_check_access" value="1"}
  122. <!-- 判断是否属于系统定义级别,0为会员级别 -->
  123. {eq name="$vo.is_system" value="0"}
  124. <!-- 判断是否级别下是否存在会员,是否可以删除。0可删除 -->
  125. {if condition="empty($levelgroup[$vo['level_id']])"}
  126. <a class="btn red" href="javascript:void(0);" data-url="{:url('Member/level_del')}" data-level_name="{$vo.level_name}" data-id="{$vo.level_id}" onClick="usersdel(this);">删除</a>
  127. {else/}
  128. 正在使用
  129. {/if}
  130. {else /}
  131. 系统内置
  132. {/eq}
  133. {/eq}
  134. </div>
  135. </td>
  136. </tr>
  137. {/foreach}
  138. {/empty}
  139. </tbody>
  140. </table>
  141. </div>
  142. </form>
  143. <div class="iDiv" style="display: none;"></div>
  144. </div>
  145. <div class="footer-oper">
  146. {eq name="$Think.const.CONTROLLER_NAME.'@level_add'|is_check_access" value="1"}
  147. <div class="fbutton">
  148. <a href="javascript:void(0);" data-url="{:url('Member/level_add', ['_ajax'=>1])}" onclick="AddLevelData(this);" class="layui-btn layui-btn-primary">
  149. <span class="">保存</span>
  150. </a>
  151. </div>
  152. <div class="fbutton">
  153. <a href="javascript:void(0);" onclick="AddLevelType();" class="layui-btn layui-btn-primary">
  154. <span>新增级别</span>
  155. </a>
  156. </div>
  157. {/eq}
  158. {eq name="'Level@index'|is_check_access" value="1"}
  159. <div class="fbutton">
  160. <a href="javascript:void(0);" data-href="{:U('Level/index')}" onclick="openFullframe(this, '升级套餐管理', '80%', '80%');" class="layui-btn layui-btn-primary">
  161. <span class="red">升级套餐管理</span>
  162. </a>
  163. </div>
  164. {/eq}
  165. {include file="public/page" /}
  166. </div>
  167. <div style="clear:both"></div>
  168. </div>
  169. </div>
  170. <script>
  171. $(document).ready(function(){
  172. // 表格行点击选中切换
  173. $('#flexigrid > table>tbody >tr').click(function(){
  174. $(this).toggleClass('trSelected');
  175. });
  176. // 点击刷新数据
  177. $('.fa-refresh').click(function(){
  178. location.href = location.href;
  179. });
  180. });
  181. // tr数,取唯一标识
  182. var tr_id = $('#Template .tr').length;
  183. function AddLevelType(){
  184. var isShowDownCount = {$isShowDownCount};
  185. var AddHtml = [];
  186. AddHtml +=
  187. '<tr class="tr" id="tr_'+tr_id+'">'+
  188. '<td class="sign none">'+
  189. '<div class="w20 tc"><input type="hidden" name="level_id[]"></div>'+
  190. '</td>'+
  191. '<td style="width: 100%">'+
  192. '<div style="padding-left: 10px;">'+
  193. '<input type="text" name="level_name[]" class="w180">'+
  194. '</div>'+
  195. '</td>'+
  196. '<td>'+
  197. '<div class="w160 tc">'+
  198. '<input type="text" name="level_value[]" onkeyup="this.value=this.value.replace(/[^0-9]/g,\'\')" class="tc w80">'+
  199. '</div>'+
  200. '</td>';
  201. if (isShowDownCount == 1) {
  202. AddHtml +=
  203. '<td>'+
  204. '<div class="w100 tc">'+
  205. '<input type="text" name="down_count[]" class="tc w80" value="100">'+
  206. '</div>'+
  207. '</td>';
  208. }
  209. AddHtml +=
  210. '<td>'+
  211. '<div class="w160 tc">'+
  212. '<input type="text" name="discount[]" class="tc w80" value="100">'+
  213. '</div>'+
  214. '</td>'+
  215. '<td class="">'+
  216. '<div class="w150 tc">'+
  217. '<a class="btn red" href="javascript:void(0);" data-trid="tr_'+tr_id+'" onclick="DelHtml(this)"><i class="fa fa-trash-o"></i>删除</a>'+
  218. '</div>'+
  219. '</td>'+
  220. '</tr>';
  221. $('#Template').append(AddHtml);
  222. tr_id += 1;
  223. }
  224. // 删除未保存的级别
  225. function DelHtml(obj){
  226. $('#'+$(obj).attr('data-trid')).remove();
  227. }
  228. // 提交
  229. function AddLevelData(obj){
  230. layer_loading('正在处理');
  231. $.ajax({
  232. type : 'post',
  233. url : $(obj).attr('data-url'),
  234. data : $('#PostForm').serialize(),
  235. dataType : 'json',
  236. success : function(data){
  237. layer.closeAll();
  238. if(data.code == 1){
  239. layer.msg(data.msg, {icon: 1, time:1000},function(){
  240. window.location.reload();
  241. });
  242. }else{
  243. layer.alert(data.msg, {icon: 2, title:false});
  244. }
  245. }
  246. })
  247. }
  248. // 删除
  249. function usersdel(obj){
  250. layer.confirm('确认彻底删除<span style="color:red;">'+$(obj).attr('data-level_name')+'</span>?', {
  251. shade: layer_shade,
  252. area: ['480px', '190px'],
  253. move: false,
  254. title: '提示',
  255. btnAlign:'r',
  256. closeBtn: 3,
  257. btn: ['确定','取消'] ,//按钮
  258. success: function () {
  259. $(".layui-layer-content").css('text-align', 'left');
  260. }
  261. }, function(){
  262. layer_loading('正在处理');
  263. // 确定
  264. $.ajax({
  265. type : 'post',
  266. url : $(obj).attr('data-url'),
  267. data : {del_id:$(obj).attr('data-id'), _ajax:1},
  268. dataType : 'json',
  269. success : function(data){
  270. layer.closeAll();
  271. if(data.code == 1){
  272. layer.msg(data.msg, {icon: 1});
  273. window.location.reload();
  274. }else{
  275. layer.alert(data.msg, {icon: 2, title:false});
  276. }
  277. }
  278. })
  279. }, function(index){
  280. layer.close(index);
  281. });
  282. return false;
  283. }
  284. </script>
  285. {include file="public/footer" /}