headlevel.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style>
  45. tbody tr td{
  46. position: relative;
  47. }
  48. tbody tr .icow-weibiaoti--{
  49. visibility: hidden;
  50. display: inline-block;
  51. color: #fff;
  52. height:18px;
  53. width:18px;
  54. background: #e0e0e0;
  55. text-align: center;
  56. line-height: 18px;
  57. vertical-align: middle;
  58. }
  59. tbody tr:hover .icow-weibiaoti--{
  60. visibility: visible;
  61. }
  62. tbody tr .icow-weibiaoti--.hidden{
  63. visibility: hidden !important;
  64. }
  65. .full .icow-weibiaoti--{
  66. margin-left:10px;
  67. }
  68. .full>span{
  69. display: -webkit-box;
  70. display: -webkit-flex;
  71. display: -ms-flexbox;
  72. display: flex;
  73. vertical-align: middle;
  74. align-items: center;
  75. }
  76. tbody tr .label{
  77. margin: 5px 0;
  78. }
  79. .goods_attribute a{
  80. cursor: pointer;
  81. }
  82. .newgoodsflag{
  83. width: 22px;height: 16px;
  84. background-color: #ff0000;
  85. color: #fff;
  86. text-align: center;
  87. position: absolute;
  88. bottom: 70px;
  89. left: 57px;
  90. font-size: 12px;
  91. }
  92. .a{cursor: pointer;}
  93. </style>
  94. </head>
  95. <body layadmin-themealias="default">
  96. <table id="demo" lay-filter="test"></table>
  97. <div class="layui-fluid">
  98. <div class="layui-card">
  99. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">团长等级</span></div>
  100. <div class="layui-card-body" style="padding:15px;">
  101. <form action="" class="layui-form" lay-filter="example" method="post" >
  102. <div class="row">
  103. <div class="col-md-12">
  104. <div class="page-table-header">
  105. <span class="pull-right">
  106. <a href="javascript:;" data-href="{:U('communityhead/addlevel' , array('ok' => 1))}" class="layui-btn layui-btn-sm ajaxModal"><i class="fa fa-plus"></i> 添加新等级</a>
  107. </span>
  108. </div>
  109. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  110. <thead>
  111. <tr>
  112. <th style='width:160px;'>等级名称</th>
  113. <?php if(!empty($community_money_type) && $community_money_type ==1){ ?>
  114. <th>团长提成金额</th>
  115. <?php }else{ ?>
  116. <th>团长提成比例</th>
  117. <?php } ?>
  118. <th style="display:none;">升级条件</th>
  119. <th style="width: 265px;">操作</th>
  120. </tr>
  121. </thead>
  122. <tbody>
  123. <?php foreach( $list as $row ){ ?>
  124. <tr <?php if( $row['id']=='default'){ ?>style='background:#f2f2f2'<?php } ?>>
  125. <td>{$row['levelname']}<?php if( $row['id']=='default'){ ?>【默认等级】<?php } ?></td>
  126. <?php if(!empty($community_money_type) && $community_money_type ==1){ ?>
  127. <td>{:round((float)$row['commission'],2)}元</td>
  128. <?php }else{ ?>
  129. <td>{:round((float)$row['commission'],2)}%</td>
  130. <?php } ?>
  131. <td style="display:none;">
  132. <?php if( $row['id']!='default'){ ?>
  133. <?php if( $row['ordermoney']>0){ ?>分销订单金额满 {$row['ordermoney']} 元 <?php }else{ ?>不自动升级<?php } ?>
  134. <?php }else{ ?>
  135. 默认等级
  136. <?php } ?>
  137. </td>
  138. <td>
  139. <a class='layui-btn layui-btn-xs ajaxModal' href="javascript:;" data-href="{:U('communityhead/editlevel', array('id' => $row['id']))}" >
  140. <i class="layui-icon layui-icon-edit"></i>编辑
  141. </a>
  142. <?php if( $row['id']!='default'){ ?>
  143. <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="{:U('communityhead/deletelevel', array('id' => $row['id']))}" data-confirm='<p >删除等级可能会对已设置的商品独立团长提成比例产生影响,确认删除?</p><br /><p style="color:red;">该等级涉及的所有团长都会变成默认等级</p>'>
  144. <i class="layui-icon">&#xe640;</i>删除
  145. </a>
  146. <?php } ?>
  147. </td>
  148. </tr>
  149. <?php } ?>
  150. </tbody>
  151. <tfoot>
  152. </tfoot>
  153. </table>
  154. </div>
  155. </div>
  156. </form>
  157. </div>
  158. </div>
  159. </div>
  160. <script src="/layuiadmin/layui/layui.js"></script>
  161. <script>
  162. layui.config({
  163. base: '/layuiadmin/' //静态资源所在路径
  164. }).extend({
  165. index: 'lib/index' //主入口模块
  166. }).use('index');
  167. </script>
  168. <script>
  169. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  170. var layer = layui.layer;
  171. var $;
  172. layui.use(['jquery', 'layer','form'], function(){
  173. $ = layui.$;
  174. var form = layui.form;
  175. $('.deldom').click(function(){
  176. var s_url = $(this).attr('data-href');
  177. layer.confirm($(this).attr('data-confirm'), function(index){
  178. $.ajax({
  179. url:s_url,
  180. type:'post',
  181. dataType:'json',
  182. success:function(info){
  183. if(info.status == 0)
  184. {
  185. layer.msg(info.result.message,{icon: 1,time: 2000});
  186. }else if(info.status == 1){
  187. var go_url = location.href;
  188. if( info.result.hasOwnProperty("url") )
  189. {
  190. go_url = info.result.url;
  191. }
  192. layer.msg('操作成功',{time: 1000,
  193. end:function(){
  194. location.href = info.result.url;
  195. }
  196. });
  197. }
  198. }
  199. })
  200. });
  201. })
  202. $('.btn-operation').click(function(){
  203. var ids_arr = [];
  204. var obj = $(this);
  205. var s_toggle = $(this).attr('data-toggle');
  206. var s_url = $(this).attr('data-href');
  207. $("input[name=item_checkbox]").each(function() {
  208. if( $(this).prop('checked') )
  209. {
  210. ids_arr.push( $(this).val() );
  211. }
  212. })
  213. if(ids_arr.length < 1)
  214. {
  215. layer.msg('请选择要操作的内容');
  216. }else{
  217. var can_sub = true;
  218. if( s_toggle == 'batch-remove' )
  219. {
  220. can_sub = false;
  221. layer.confirm($(obj).attr('data-confirm'), function(index){
  222. $.ajax({
  223. url:s_url,
  224. type:'post',
  225. dataType:'json',
  226. data:{ids:ids_arr},
  227. success:function(info){
  228. if(info.status == 0)
  229. {
  230. layer.msg(info.result.message,{icon: 1,time: 2000});
  231. }else if(info.status == 1){
  232. var go_url = location.href;
  233. if( info.result.hasOwnProperty("url") )
  234. {
  235. go_url = info.result.url;
  236. }
  237. layer.msg('操作成功',{time: 1000,
  238. end:function(){
  239. location.href = info.result.url;
  240. }
  241. });
  242. }
  243. }
  244. })
  245. });
  246. }else{
  247. $.ajax({
  248. url:s_url,
  249. type:'post',
  250. dataType:'json',
  251. data:{ids:ids_arr},
  252. success:function(info){
  253. if(info.status == 0)
  254. {
  255. layer.msg(info.result.message,{icon: 1,time: 2000});
  256. }else if(info.status == 1){
  257. var go_url = location.href;
  258. if( info.result.hasOwnProperty("url") )
  259. {
  260. go_url = info.result.url;
  261. }
  262. layer.msg('操作成功',{time: 1000,
  263. end:function(){
  264. location.href = info.result.url;
  265. }
  266. });
  267. }
  268. }
  269. })
  270. }
  271. }
  272. })
  273. form.on('switch(statewsitch)', function(data){
  274. var s_url = $(this).attr('data-href')
  275. var s_value = 1;
  276. if(data.elem.checked)
  277. {
  278. s_value = 1;
  279. }else{
  280. s_value = 0;
  281. }
  282. $.ajax({
  283. url:s_url,
  284. type:'post',
  285. dataType:'json',
  286. data:{value:s_value},
  287. success:function(info){
  288. if(info.status == 0)
  289. {
  290. layer.msg(info.result.message,{icon: 1,time: 2000});
  291. }else if(info.status == 1){
  292. var go_url = location.href;
  293. if( info.result.hasOwnProperty("url") )
  294. {
  295. go_url = info.result.url;
  296. }
  297. layer.msg('操作成功',{time: 1000,
  298. end:function(){
  299. location.href = info.result.url;
  300. }
  301. });
  302. }
  303. }
  304. })
  305. });
  306. form.on('checkbox(checkboxall)', function(data){
  307. if(data.elem.checked)
  308. {
  309. $("input[name=item_checkbox]").each(function() {
  310. $(this).prop("checked", true);
  311. });
  312. $("input[name=checkall]").each(function() {
  313. $(this).prop("checked", true);
  314. });
  315. }else{
  316. $("input[name=item_checkbox]").each(function() {
  317. $(this).prop("checked", false);
  318. });
  319. $("input[name=checkall]").each(function() {
  320. $(this).prop("checked", false);
  321. });
  322. }
  323. form.render('checkbox');
  324. });
  325. //监听提交
  326. form.on('submit(formDemo)', function(data){
  327. $.ajax({
  328. url: data.form.action,
  329. type: data.form.method,
  330. data: data.field,
  331. dataType:'json',
  332. success: function (info) {
  333. if(info.status == 0)
  334. {
  335. layer.msg(info.result.message,{icon: 1,time: 2000});
  336. }else if(info.status == 1){
  337. var go_url = location.href;
  338. if( info.result.hasOwnProperty("url") )
  339. {
  340. go_url = info.result.url;
  341. }
  342. layer.msg('操作成功',{time: 1000,
  343. end:function(){
  344. location.href = info.result.url;
  345. }
  346. });
  347. }
  348. }
  349. });
  350. return false;
  351. });
  352. })
  353. </script>
  354. <script>
  355. var ajax_url = "";
  356. $(function(){
  357. $(".ajaxModal").click(function () {
  358. var s_url = $(this).attr('data-href');
  359. ajax_url = s_url;
  360. $.ajax({
  361. url:s_url,
  362. type:"get",
  363. success:function(shtml){
  364. $('#ajaxModal').html(shtml);
  365. $("#ajaxModal").modal();
  366. }
  367. })
  368. });
  369. $(document).delegate(".modal-footer .btn-primary","click",function(){
  370. var s_data = $('#ajaxModal form').serialize();
  371. $.ajax({
  372. url:ajax_url,
  373. type:'post',
  374. dataType:'json',
  375. data:s_data,
  376. success:function(info){
  377. if(info.status == 0)
  378. {
  379. layer.msg(info.result.message,{icon: 1,time: 2000});
  380. }else if(info.status == 1){
  381. var go_url = location.href;
  382. if( info.result.hasOwnProperty("url") )
  383. {
  384. go_url = info.result.url;
  385. }
  386. layer.msg('操作成功',{time: 1000,
  387. end:function(){
  388. location.href = info.result.url;
  389. }
  390. });
  391. }
  392. }
  393. })
  394. return false;
  395. })
  396. })
  397. </script>
  398. <div id="ajaxModal" class="modal fade" style="display: none;">
  399. </div>
  400. </body>