distribution.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  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. .img-40{width:40px;height:40px;}
  46. </style>
  47. </head>
  48. <body layadmin-themealias="default">
  49. <div class="layui-fluid">
  50. <div class="layui-card">
  51. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">分销管理</span></div>
  52. <div class="layui-tab layui-tab-brief" >
  53. <ul class="layui-tab-title">
  54. <li <?php if(empty($type) || $type=='0'){ ?> class="layui-this"<?php } ?>>
  55. <a href="{:U('distribution/distribution', array('type' => 0))}">全部</a>
  56. </li>
  57. <li <?php if($type==1){ ?> class="layui-this"<?php } ?> >
  58. <a href="{:U('distribution/distribution', array('type' => 1))}">已审核</a>
  59. </li>
  60. <li <?php if($type==2){ ?>class="layui-this"<?php } ?> >
  61. <a href="{:U('distribution/distribution', array('type' => 2))}">未审核</a>
  62. </li>
  63. </ul>
  64. </div>
  65. <div class="layui-card-body" style="padding:15px;">
  66. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  67. <input type="hidden" name="c" value="distribution" />
  68. <input type="hidden" name="a" value="distribution" />
  69. <div class="layui-form-item">
  70. <div class="layui-inline">
  71. <div class="layui-input-inline">
  72. <select name='searchtime' class='form-control' style="width:100px;padding:0 5px;" id="searchtime">
  73. <option value=''>不按时间</option>
  74. <option value='create_time' <?php if( $_GPC['searchtime']=='create_time' ){ ?>selected<?php } ?>>审核时间</option>
  75. </select>
  76. </div>
  77. <div class="layui-input-inline" style="width: 285px;">
  78. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
  79. </div>
  80. <div class="layui-input-inline" >
  81. <select name="comsiss_state" class='layui-input layui-unselect' data-placeholder="状态">
  82. <option value=''>状态</option>
  83. <option value='0' <?php if($_GPC['comsiss_state']=='0'){ ?>selected<?php } ?>>未审核</option>
  84. <option value='1' <?php if($_GPC['comsiss_state']=='1'){ ?>selected<?php } ?>>已审核</option>
  85. <option value='2' <?php if($_GPC['comsiss_state']=='2'){ ?>selected<?php } ?>>已拒绝</option>
  86. </select>
  87. </div>
  88. <div class="layui-input-inline">
  89. <input type="text" class="layui-input" name='keyword' value="{$_GPC['keyword']}" placeholder="昵称/姓名/手机号">
  90. </div>
  91. <div class="layui-input-inline">
  92. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  93. <button type="submit" name="export" data-export="1" value="1" class="layui-btn layui-btn-sm">导出</button>
  94. </div>
  95. </div>
  96. </div>
  97. </form>
  98. <form action="" class="layui-form" lay-filter="example" method="post" >
  99. <div class="row">
  100. <div class="col-md-12">
  101. <div class="page-table-header">
  102. <div class="btn-group">
  103. <button class="btn btn-default btn-sm btn-operation" type="button" data-confirm='确认要审核通过?' data-toggle='batch' data-href="{:U('distribution/agent_check',array('comsiss_state'=>1))}">审核通过</button>
  104. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('distribution/agent_check',array('comsiss_state'=>0))}">取消审核</button>
  105. </div>
  106. </div>
  107. <table class="layui-table" lay-skin="line" lay-size="lg">
  108. <thead>
  109. <tr>
  110. <th style="width:25px;"></th>
  111. <th style="width:60px;">ID</th>
  112. <th style="width: 220px;">用户名</th>
  113. <th style='width:80px;'>累计佣金<br/>打款佣金</th>
  114. <th style='width:180px;'>推荐人</th>
  115. <th style='width:20px;'>上级用户</th>
  116. <th style='width:20px;'>下级用户</th>
  117. <th style="width:200px;">注册时间</br>审核时间</th>
  118. <th style='width:200px;'>申请类型</th>
  119. <th style='width:150px;'>状态</th>
  120. <th style="width: 220px;text-align: center;">操作</th>
  121. </tr>
  122. </thead>
  123. <tbody>
  124. <?php foreach($list as $row){ ?>
  125. <tr>
  126. <td style="position: relative; ">
  127. <input type='checkbox' name="item_checkbox" lay-skin="primary" value="{$row['member_id']}"/>
  128. </td>
  129. <td>
  130. {$row['member_id']}
  131. </td>
  132. <td style="overflow: visible">
  133. <div rel="pop" style="display: flex" >
  134. <img class="img-40" src="{$row['avatar']}" style='border-radius:50%;border:1px solid #efefef;' />
  135. <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
  136. <span class="nickname">
  137. <?php if(empty($row['username'])){ ?>未更新<?php }else{ ?>{$row['username']}<?php } ?>
  138. </span>
  139. <?php if($row['isblack']==1){ ?>
  140. <span class="text-danger">未启用<i class="icow icow-heimingdan1"style="color: #db2228;margin-left: 2px;font-size: 13px;"></i></span>
  141. <?php } ?>
  142. </span>
  143. </div>
  144. </td>
  145. <td>
  146. <span class="text-danger">{$row['commission_info']['commission_total']}</span><br/>
  147. <span class="text-warning">{$row['commission_info']['getmoney']}</span>
  148. </td>
  149. <td>
  150. <?php if( empty($row['share_parent_info']) ){ ?>
  151. <?php if( $row['isagent']==0 ){ ?>
  152. 总店
  153. <?php }else{ ?>
  154. 暂无
  155. <?php } ?>
  156. <?php }else{ ?>
  157. <?php if( !empty($row['share_parent_info']['avatar']) ){ ?>
  158. <img src='{$row['share_parent_info']['avatar']}' style='width:20px;height:20px;padding1px;border:1px solid #ccc' />
  159. <?php } ?>
  160. [{$row['share_parent_info']['member_id']}]<?php if(empty($row['share_parent_info']['username'])){ ?>未更新<?php }else{ ?>{$row['share_parent_info']['username']}<?php } ?>
  161. <?php } ?>
  162. </td>
  163. <td>
  164. <?php if(empty($row['parent_info'])){ ?>
  165. <?php if($row['isagent']==0){ ?>
  166. 总店
  167. <?php }else{ ?>
  168. 暂无
  169. <?php } ?>
  170. <?php }else{ ?>
  171. <?php if(!empty($row['parent_info']['avatar'])){ ?>
  172. <img src='{$row['parent_info']['avatar']}' style='width:20px;height:20px;padding1px;border:1px solid #ccc' />
  173. <?php } ?>
  174. [{$row['parent_info']['member_id']}]<?php if(empty($row['parent_info']['username'])){ ?>未更新<?php }else{ ?>{$row['parent_info']['username']}<?php } ?>
  175. <?php } ?>
  176. </td>
  177. <td>
  178. <a href="{:U('distribution/nextchild_list',array('id' => $row['member_id']));}" style="color: rgb(0,0,255);" title="">
  179. {$row['next_member_count']}
  180. </a>
  181. </td>
  182. <td>
  183. {:date("Y-m-d",$row['create_time'])}<br/>{:date("H:i:s",$row['create_time'])}
  184. <br/>
  185. <?php if( !empty($row['comsiss_time']) ){ ?>
  186. {:date("Y-m-d",$row['comsiss_time'])}<br/>{:date("H:i:s",$row['comsiss_time'])}
  187. <?php } ?>
  188. </td>
  189. <td>
  190. <?php if($row['is_writecommiss_form'] == 1){ ?>
  191. <a class="layui-btn layui-btn-sm " href="{:U('user/detail',array('id' => $row['member_id'],'is_showform' => 1));}" title="">
  192. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="表单">
  193. <i class='icow icow-bianji2'></i>表单
  194. </span>
  195. </a>
  196. <?php } ?>
  197. <?php if($row['is_share_tj'] == 1){ ?>
  198. <a class="layui-btn layui-btn-sm " href="{:U('distribution/sharedetail',array('id' => $row['member_id']));}" title="">
  199. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="分享">
  200. <i class='icow icow-bianji2'></i>分享
  201. </span>
  202. </a>
  203. <?php } ?>
  204. <?php if($row['is_share_tj'] == 0 && $row['is_writecommiss_form'] == 0){ ?>
  205. <?php if($row['is_comsiss_admin'] == 1){ ?>
  206. 后台设置
  207. <?php }else{?>
  208. <?php } ?>
  209. <?php } ?>
  210. </td>
  211. <td>
  212. <?php if($row['is_comsiss_audit'] == 0 && $row['comsiss_state'] != 1){ ?>
  213. <?php if($row['comsiss_state'] == 0){ ?>
  214. <a class="layui-btn layui-btn-xs check_agent" href="javascript:void(0)" data-href="{:U('distribution/check_agent',array('id'=>$row['member_id'],'state'=>1))}" data-confirm="确认通过该会员的分销申请?" title="" style="padding: 0 15px;">
  215. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="通过">
  216. <i class='icow icow-bianji2'></i>通过
  217. </span>
  218. </a>
  219. <br/>
  220. <input type="checkbox" lay-filter="statewsitch_jujue" data-href="{:U('distribution/check_agent',array('id'=>$row['member_id'],'state'=>2))}" lay-skin="switch" lay-text="拒绝|拒绝">
  221. <?php } ?>
  222. <?php if($row['comsiss_state'] == 2){ ?>
  223. <span style="color:red;">已拒绝</span><br/>
  224. <a class="check_agent" data-href="{:U('distribution/check_agent',array('id'=>$row['member_id'],'state'=>1))}" data-confirm="确认通过该会员的分销申请?" style="padding: 0px;color:#1182e4;cursor: pointer;">
  225. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="重新审核">
  226. <i class='icow icow-bianji2'></i>重新审核
  227. </span>
  228. </a>
  229. <?php } ?>
  230. <?php } ?>
  231. <?php if($row['comsiss_state'] == 1 || $row['is_comsiss_audit'] == 1){ ?>
  232. <input type="checkbox" name="" lay-filter="statewsitch" data-href="{:U('distribution/agent_check',array('id'=>$row['member_id']))}" <?php if($row['comsiss_state']==1){ ?>checked<?php } ?> lay-skin="switch" lay-text="启用|禁用">
  233. <?php } ?>
  234. </td>
  235. <td style="overflow:visible;">
  236. <div class="btn-group">
  237. <?php if($s_id == 1){ ?>
  238. <a class="layui-btn layui-btn-xs " href="{:U('user/detail',array('id' => $row['member_id']));}" title="">
  239. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="会员详情">
  240. <i class='icow icow-bianji2'></i>查看详情
  241. </span>
  242. </a>
  243. <?php }else{ ?>
  244. <a class="layui-btn layui-btn-xs user" title="">
  245. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="会员详情">
  246. <i class='icow icow-bianji2'></i>查看详情
  247. </span>
  248. </a>
  249. <?php } ?>
  250. </div>
  251. <div class="btn-group">
  252. <a class="layui-btn layui-btn-xs" href="{:U('distribution/distributionorder',array('commiss_member_id' => $row['member_id']));}" target='_blank'>
  253. 分销推广订单
  254. </a>
  255. </div>
  256. <div class="btn-group">
  257. <a class="layui-btn layui-btn-xs" href="{:U('distribution/communityorder',array('member_id' => $row['member_id']));}" target='_blank'>
  258. 分销收益明细
  259. </a>
  260. </div>
  261. <div class="btn-group">
  262. <?php if( $row['comsiss_flag'] == 1 && $row['comsiss_state'] == 1 ){ ?>
  263. <a class="layui-btn layui-btn-sm " href="{:U('distribution/nextchild_list',array('id' => $row['member_id']));}" title="">
  264. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="查看下级">
  265. <i class='icow icow-bianji2'></i>查看下级
  266. </span>
  267. </a>
  268. <?php } ?>
  269. </div>
  270. </td>
  271. </tr>
  272. <?php } ?>
  273. </tbody>
  274. <tfoot>
  275. <tr>
  276. <td colspan="4">
  277. <div class="page-table-header">
  278. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  279. <div class="btn-group">
  280. <button class="btn btn-default btn-sm btn-operation" type="button" data-confirm='确认要审核通过?' data-toggle='batch' data-href="{:U('distribution/agent_check',array('comsiss_state'=>1))}">审核通过</button>
  281. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('distribution/agent_check',array('comsiss_state'=>0))}">取消审核</button>
  282. </div>
  283. </div>
  284. </td>
  285. <td colspan="7" style="text-align: right">
  286. {$pager}
  287. </td>
  288. </tr>
  289. </tfoot>
  290. </table>
  291. </div>
  292. </div>
  293. </form>
  294. </div>
  295. </div>
  296. </div>
  297. <script src="/layuiadmin/layui/layui.js"></script>
  298. <script>
  299. layui.config({
  300. base: '/layuiadmin/' //静态资源所在路径
  301. }).extend({
  302. index: 'lib/index' //主入口模块
  303. }).use('index');
  304. </script>
  305. <script>
  306. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  307. var layer = layui.layer;
  308. var $;
  309. layui.use(['jquery', 'layer','form'], function(){
  310. $ = layui.$;
  311. var form = layui.form;
  312. $('.check_agent').click(function(){
  313. var s_url = $(this).attr('data-href');
  314. var confirm_txt = $(this).attr('data-confirm');
  315. if(confirm_txt){
  316. layer.confirm($(this).attr('data-confirm'), function(index){
  317. $.ajax({
  318. url:s_url,
  319. type:'post',
  320. dataType:'json',
  321. success:function(info){
  322. if(info.status == 0)
  323. {
  324. layer.msg(info.result.message,{icon: 1,time: 2000});
  325. }else if(info.status == 1){
  326. var go_url = location.href;
  327. if( info.result.hasOwnProperty("url") )
  328. {
  329. go_url = info.result.url;
  330. }
  331. layer.msg('操作成功',{time: 1000,
  332. end:function(){
  333. location.href = info.result.url;
  334. }
  335. });
  336. }
  337. }
  338. })
  339. });
  340. }
  341. })
  342. $('.deldom').click(function(){
  343. var s_url = $(this).attr('data-href');
  344. layer.confirm($(this).attr('data-confirm'), function(index){
  345. $.ajax({
  346. url:s_url,
  347. type:'post',
  348. dataType:'json',
  349. success:function(info){
  350. if(info.status == 0)
  351. {
  352. layer.msg(info.result.message,{icon: 1,time: 2000});
  353. }else if(info.status == 1){
  354. var go_url = location.href;
  355. if( info.result.hasOwnProperty("url") )
  356. {
  357. go_url = info.result.url;
  358. }
  359. layer.msg('操作成功',{time: 1000,
  360. end:function(){
  361. location.href = info.result.url;
  362. }
  363. });
  364. }
  365. }
  366. })
  367. });
  368. })
  369. $('.btn-operation').click(function(){
  370. var ids_arr = [];
  371. var obj = $(this);
  372. var s_toggle = $(this).attr('data-toggle');
  373. var s_url = $(this).attr('data-href');
  374. $("input[name=item_checkbox]").each(function() {
  375. if( $(this).prop('checked') )
  376. {
  377. ids_arr.push( $(this).val() );
  378. }
  379. })
  380. if(ids_arr.length < 1)
  381. {
  382. layer.msg('请选择要操作的内容');
  383. }else{
  384. var can_sub = true;
  385. if( s_toggle == 'batch-remove' )
  386. {
  387. can_sub = false;
  388. layer.confirm($(obj).attr('data-confirm'), function(index){
  389. $.ajax({
  390. url:s_url,
  391. type:'post',
  392. dataType:'json',
  393. data:{ids:ids_arr},
  394. success:function(info){
  395. if(info.status == 0)
  396. {
  397. layer.msg(info.result.message,{icon: 1,time: 2000});
  398. }else if(info.status == 1){
  399. var go_url = location.href;
  400. if( info.result.hasOwnProperty("url") )
  401. {
  402. go_url = info.result.url;
  403. }
  404. layer.msg('操作成功',{time: 1000,
  405. end:function(){
  406. location.href = info.result.url;
  407. }
  408. });
  409. }
  410. }
  411. })
  412. });
  413. }else{
  414. $.ajax({
  415. url:s_url,
  416. type:'post',
  417. dataType:'json',
  418. data:{ids:ids_arr},
  419. success:function(info){
  420. if(info.status == 0)
  421. {
  422. layer.msg(info.result.message,{icon: 1,time: 2000});
  423. }else if(info.status == 1){
  424. var go_url = location.href;
  425. if( info.result.hasOwnProperty("url") )
  426. {
  427. go_url = info.result.url;
  428. }
  429. layer.msg('操作成功',{time: 1000,
  430. end:function(){
  431. location.href = info.result.url;
  432. }
  433. });
  434. }
  435. }
  436. })
  437. }
  438. }
  439. })
  440. form.on('switch(statewsitch_jujue)', function(data){
  441. var s_url = $(this).attr('data-href');
  442. $.ajax({
  443. url:s_url,
  444. type:'post',
  445. dataType:'json',
  446. success:function(info){
  447. if(info.status == 0)
  448. {
  449. layer.msg(info.result.message,{icon: 1,time: 2000});
  450. }else if(info.status == 1){
  451. var go_url = location.href;
  452. if( info.result.hasOwnProperty("url") )
  453. {
  454. go_url = info.result.url;
  455. }
  456. layer.msg('操作成功',{time: 1000,
  457. end:function(){
  458. location.href = info.result.url;
  459. }
  460. });
  461. }
  462. }
  463. })
  464. });
  465. form.on('switch(statewsitch)', function(data){
  466. var s_url = $(this).attr('data-href')
  467. var s_value = 1;
  468. if(data.elem.checked)
  469. {
  470. s_value = 1;
  471. }else{
  472. s_value = 0;
  473. }
  474. $.ajax({
  475. url:s_url,
  476. type:'post',
  477. dataType:'json',
  478. data:{comsiss_state:s_value},
  479. success:function(info){
  480. if(info.status == 0)
  481. {
  482. layer.msg(info.result.message,{icon: 1,time: 2000});
  483. }else if(info.status == 1){
  484. var go_url = location.href;
  485. if( info.result.hasOwnProperty("url") )
  486. {
  487. go_url = info.result.url;
  488. }
  489. layer.msg('操作成功',{time: 1000,
  490. end:function(){
  491. location.href = info.result.url;
  492. }
  493. });
  494. }
  495. }
  496. })
  497. });
  498. form.on('checkbox(checkboxall)', function(data){
  499. if(data.elem.checked)
  500. {
  501. $("input[name=item_checkbox]").each(function() {
  502. $(this).prop("checked", true);
  503. });
  504. $("input[name=checkall]").each(function() {
  505. $(this).prop("checked", true);
  506. });
  507. }else{
  508. $("input[name=item_checkbox]").each(function() {
  509. $(this).prop("checked", false);
  510. });
  511. $("input[name=checkall]").each(function() {
  512. $(this).prop("checked", false);
  513. });
  514. }
  515. form.render('checkbox');
  516. });
  517. $('.user').click(function(){
  518. layer.msg('权限不足!',{icon: 2,time: 1200});
  519. });
  520. //监听提交
  521. form.on('submit(formDemo)', function(data){
  522. $.ajax({
  523. url: data.form.action,
  524. type: data.form.method,
  525. data: data.field,
  526. dataType:'json',
  527. success: function (info) {
  528. if(info.status == 0)
  529. {
  530. layer.msg(info.result.message,{icon: 1,time: 2000});
  531. }else if(info.status == 1){
  532. var go_url = location.href;
  533. if( info.result.hasOwnProperty("url") )
  534. {
  535. go_url = info.result.url;
  536. }
  537. layer.msg('操作成功',{time: 1000,
  538. end:function(){
  539. location.href = info.result.url;
  540. }
  541. });
  542. }
  543. }
  544. });
  545. return false;
  546. });
  547. })
  548. </script>
  549. </body>
  550. </html>