c5340cd3ba9d6f922dde567552ceac4c.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. <?php if (!defined('THINK_PATH')) exit();?><!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': '<?php echo ($_W['uniacid']); ?>',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '<?php echo ($_W['acid']); ?>',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '<?php echo ($_W['openid']); ?>',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '<?php echo ($_W['uid']); ?>',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '<?php echo ($_W['siteroot']); ?>',
  27. 'siteurl': '<?php echo ($_W['siteurl']); ?>',
  28. 'attachurl': '<?php echo ($_W['attachurl']); ?>',
  29. 'attachurl_local': '<?php echo ($_W['attachurl_local']); ?>',
  30. 'attachurl_remote': '<?php echo ($_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' : <?php echo 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. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">群接龙活动管理</span></div>
  49. <div class="layui-tab layui-tab-brief" >
  50. <ul class="layui-tab-title">
  51. <li <?php if( empty($_GPC['type']) || $_GPC['type']=='0' ){ ?>class="layui-this"<?php } ?>>
  52. <a href="<?php echo U('solitaire/index', array('type' => 0 ));?>">全部(<?php echo ($all_count); ?>)</a>
  53. </li>
  54. <li <?php if( $_GPC['type']=='1' ){ ?>class="layui-this"<?php } ?> >
  55. <a href="<?php echo U('solitaire/index', array('type' => 1));?>">进行中(<?php echo ($count_status_1); ?>)</a>
  56. </li>
  57. <li <?php if( $_GPC['type']=='2' ){ ?>class="layui-this"<?php } ?> >
  58. <a href="<?php echo U('solitaire/index', array('type' => 2));?>">未开始(<?php echo ($count_status_2); ?>)</a>
  59. </li>
  60. <li <?php if( $_GPC['type']=='3' ){ ?>class="layui-this"<?php } ?> >
  61. <a href="<?php echo U('solitaire/index', array('type' => 3));?>">已结束(<?php echo ($count_status_3); ?>)</a>
  62. </li>
  63. <li <?php if( $_GPC['type']=='4' ){ ?>class="layui-this"<?php } ?> >
  64. <a href="<?php echo U('solitaire/index', array('type' => 4));?>">待审核(<?php echo ($count_status_4); ?>)</a>
  65. </li>
  66. <li <?php if( $_GPC['type']=='5' ){ ?>class="layui-this"<?php } ?> >
  67. <a href="<?php echo U('solitaire/index', array('type' => 5));?>">已拒绝(<?php echo ($count_status_5); ?>)</a>
  68. </li>
  69. </ul>
  70. </div>
  71. <div class="layui-card-body" style="padding:15px;">
  72. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  73. <input type="hidden" name="c" value="solitaire" />
  74. <input type="hidden" name="a" value="index" />
  75. <div class="layui-form-item">
  76. <div class="layui-inline">
  77. <div class="layui-input-inline">
  78. <input type="text" class="layui-input" name='keyword' value="<?php echo ($_GPC['keyword']); ?>" placeholder="输入关键词然后回车">
  79. </div>
  80. <div class="layui-input-inline">
  81. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  82. </div>
  83. </div>
  84. </div>
  85. </form>
  86. <form action="" class="layui-form" lay-filter="example" method="post" >
  87. <div class="row">
  88. <div class="col-md-12">
  89. <div class="page-table-header">
  90. <span class="pull-right">
  91. <a href="<?php echo U('solitaire/add', array('ok' => 1));?>" class="layui-btn layui-btn-sm"><i class="fa fa-plus"></i> 添加群接龙活动</a>
  92. </span>
  93. <div class="btn-group">
  94. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗?" data-href="<?php echo U('solitaire/delete');?>">删除</button>
  95. </div>
  96. </div>
  97. <table class="layui-table" lay-skin="line" lay-size="lg">
  98. <thead>
  99. <tr>
  100. <th style="width:25px;"><input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" /></th>
  101. <th style="width:80px;">ID</th>
  102. <th style="">接龙名称</th>
  103. <th style="">接龙社区团长</th>
  104. <th style="width: 120px;">商品数量</th>
  105. <th style="width: 120px;">接龙人数</th>
  106. <th style="width: 120px;">浏览人数</th>
  107. <th style="width: 150px;">接龙状态</th>
  108. <th style="width: 150px;">接龙时间</th>
  109. <th >操作</th>
  110. </tr>
  111. </thead>
  112. <tbody>
  113. <?php foreach($list as $item){ ?>
  114. <tr>
  115. <td style="width:25px;">
  116. <input type='checkbox' name="item_checkbox" lay-skin="primary" value="<?php echo ($item['id']); ?>"/>
  117. </td>
  118. <td>
  119. <?php echo ($item['id']); ?>
  120. </td>
  121. <td>
  122. <?php echo ($item['solitaire_name']); ?>
  123. </td>
  124. <td>
  125. <?php echo ($item['head_info']['community_name']); ?><br/>(<?php echo ($item['head_info']['head_name']); ?>)
  126. </td>
  127. <td>
  128. <?php echo ($item['goods_count']); ?>
  129. </td>
  130. <td>
  131. <?php echo ($item['order_count']); ?>
  132. </td>
  133. <td>
  134. <?php echo ($item['invite_count']); ?>
  135. </td>
  136. <td>
  137. <?php if($item['appstate'] == 0){ ?>
  138. <input type="checkbox" name="" lay-filter="is_appstate2" data-href="<?php echo U('solitaire/change',array('type'=>'appstate','id'=>$item['id'] , 'value' => 1 ));?>" lay-skin="switch" lay-text="已通过|通过">
  139. <input type="checkbox" name="" lay-filter="is_appstate1" data-href="<?php echo U('solitaire/change',array('type'=>'appstate','id'=>$item['id'] , 'value' => 2 ));?>" lay-skin="switch" lay-text="已拒绝|拒绝">
  140. <?php }else if( $item['appstate'] == 1 ){ ?>
  141. <input type="checkbox" name="" lay-filter="iswsitch_state" data-href="<?php echo U('solitaire/changestate',array('type'=>'state','id'=>$item['id'] ));?>" <?php if($item['state'] == 1){ ?> checked<?php } ?> lay-skin="switch" lay-text="启用|禁用">
  142. <?php }else if($item['appstate'] == 2){ ?>
  143. 拒绝审核
  144. <?php } ?>
  145. </td>
  146. <td>
  147. <?php echo date('Y-m-d H:i:s', $item['begin_time']); ?><br/>
  148. <?php echo date('Y-m-d H:i:s', $item['end_time']); ?>
  149. </td>
  150. <td style="overflow:visible;position:relative">
  151. <a class='layui-btn layui-btn-xs' href="<?php echo U('solitaire/add', array('id'=>$item['id'],'ok' => 1));?>" >
  152. <i class="layui-icon layui-icon-edit"></i>编辑
  153. </a>
  154. <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="<?php echo U('solitaire/delete',array('id'=>$item['id']));?>" data-confirm='确认要删除吗?'>
  155. <i class="layui-icon">&#xe640;</i>删除
  156. </a>
  157. <?php if( $item['state'] == 1 && $item['appstate'] == 1 ){ ?>
  158. <a class='layui-btn layui-btn-xs' href="<?php echo U('solitaire/detail', array('id'=>$item['id'],'ok' => 1));?>" >
  159. 查看详情
  160. </a>
  161. <?php } ?>
  162. </td>
  163. </tr>
  164. <?php } ?>
  165. </tbody>
  166. <tfoot>
  167. <tr>
  168. <td colspan="4">
  169. <div class="page-table-header">
  170. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  171. <div class="btn-group">
  172. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗?" data-href="<?php echo U('solitaire/delete');?>">删除</button>
  173. </div>
  174. </div>
  175. </td>
  176. <td colspan="6" style="text-align: right">
  177. <?php echo ($pager); ?>
  178. </td>
  179. </tr>
  180. </tfoot>
  181. </table>
  182. </div>
  183. </div>
  184. </form>
  185. </div>
  186. </div>
  187. </div>
  188. <script src="/layuiadmin/layui/layui.js"></script>
  189. <script>
  190. layui.config({
  191. base: '/layuiadmin/' //静态资源所在路径
  192. }).extend({
  193. index: 'lib/index' //主入口模块
  194. }).use('index');
  195. </script>
  196. <script>
  197. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  198. var layer = layui.layer;
  199. var $;
  200. layui.use(['jquery', 'layer','form'], function(){
  201. $ = layui.$;
  202. var form = layui.form;
  203. $('.deldom').click(function(){
  204. var s_url = $(this).attr('data-href');
  205. layer.confirm($(this).attr('data-confirm'), function(index){
  206. $.ajax({
  207. url:s_url,
  208. type:'post',
  209. dataType:'json',
  210. success:function(info){
  211. if(info.status == 0)
  212. {
  213. layer.msg(info.result.message,{icon: 1,time: 2000});
  214. }else if(info.status == 1){
  215. var go_url = location.href;
  216. if( info.result.hasOwnProperty("url") )
  217. {
  218. go_url = info.result.url;
  219. }
  220. layer.msg('操作成功',{time: 1000,
  221. end:function(){
  222. location.href = info.result.url;
  223. }
  224. });
  225. }
  226. }
  227. })
  228. });
  229. })
  230. $('.btn-operation').click(function(){
  231. var ids_arr = [];
  232. var obj = $(this);
  233. var s_toggle = $(this).attr('data-toggle');
  234. var s_url = $(this).attr('data-href');
  235. $("input[name=item_checkbox]").each(function() {
  236. if( $(this).prop('checked') )
  237. {
  238. ids_arr.push( $(this).val() );
  239. }
  240. })
  241. if(ids_arr.length < 1)
  242. {
  243. layer.msg('请选择要操作的内容');
  244. }else{
  245. var can_sub = true;
  246. if( s_toggle == 'batch-remove' )
  247. {
  248. can_sub = false;
  249. layer.confirm($(obj).attr('data-confirm'), function(index){
  250. $.ajax({
  251. url:s_url,
  252. type:'post',
  253. dataType:'json',
  254. data:{ids:ids_arr},
  255. success:function(info){
  256. if(info.status == 0)
  257. {
  258. layer.msg(info.result.message,{icon: 1,time: 2000});
  259. }else if(info.status == 1){
  260. var go_url = location.href;
  261. if( info.result.hasOwnProperty("url") )
  262. {
  263. go_url = info.result.url;
  264. }
  265. layer.msg('操作成功',{time: 1000,
  266. end:function(){
  267. location.href = info.result.url;
  268. }
  269. });
  270. }
  271. }
  272. })
  273. });
  274. }else{
  275. $.ajax({
  276. url:s_url,
  277. type:'post',
  278. dataType:'json',
  279. data:{ids:ids_arr},
  280. success:function(info){
  281. if(info.status == 0)
  282. {
  283. layer.msg(info.result.message,{icon: 1,time: 2000});
  284. }else if(info.status == 1){
  285. var go_url = location.href;
  286. if( info.result.hasOwnProperty("url") )
  287. {
  288. go_url = info.result.url;
  289. }
  290. layer.msg('操作成功',{time: 1000,
  291. end:function(){
  292. location.href = info.result.url;
  293. }
  294. });
  295. }
  296. }
  297. })
  298. }
  299. }
  300. })
  301. form.on('switch(is_appstate1)', function(data){
  302. var s_url = $(this).attr('data-href')
  303. $.ajax({
  304. url:s_url,
  305. type:'post',
  306. dataType:'json',
  307. success:function(info){
  308. if(info.status == 0)
  309. {
  310. layer.msg(info.result.message,{icon: 1,time: 2000});
  311. }else if(info.status == 1){
  312. var go_url = location.href;
  313. if( info.result.hasOwnProperty("url") )
  314. {
  315. go_url = info.result.url;
  316. }
  317. layer.msg('操作成功',{time: 1000,
  318. end:function(){
  319. location.href = info.result.url;
  320. }
  321. });
  322. }
  323. }
  324. })
  325. });
  326. form.on('switch(is_appstate2)', function(data){
  327. var s_url = $(this).attr('data-href')
  328. $.ajax({
  329. url:s_url,
  330. type:'post',
  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. });
  351. form.on('switch(iswsitch_state)', function(data){
  352. var s_url = $(this).attr('data-href')
  353. var s_value = 1;
  354. if(data.elem.checked)
  355. {
  356. s_value = 1;
  357. }else{
  358. s_value = 0;
  359. }
  360. $.ajax({
  361. url:s_url,
  362. type:'post',
  363. dataType:'json',
  364. data:{value:s_value},
  365. success:function(info){
  366. if(info.status == 0)
  367. {
  368. layer.msg(info.result.message,{icon: 1,time: 2000});
  369. }else if(info.status == 1){
  370. var go_url = location.href;
  371. if( info.result.hasOwnProperty("url") )
  372. {
  373. go_url = info.result.url;
  374. }
  375. layer.msg('操作成功',{time: 1000,
  376. end:function(){
  377. location.href = info.result.url;
  378. }
  379. });
  380. }
  381. }
  382. })
  383. });
  384. form.on('checkbox(checkboxall)', function(data){
  385. if(data.elem.checked)
  386. {
  387. $("input[name=item_checkbox]").each(function() {
  388. $(this).prop("checked", true);
  389. });
  390. $("input[name=checkall]").each(function() {
  391. $(this).prop("checked", true);
  392. });
  393. }else{
  394. $("input[name=item_checkbox]").each(function() {
  395. $(this).prop("checked", false);
  396. });
  397. $("input[name=checkall]").each(function() {
  398. $(this).prop("checked", false);
  399. });
  400. }
  401. form.render('checkbox');
  402. });
  403. //监听提交
  404. form.on('submit(formDemo)', function(data){
  405. $.ajax({
  406. url: data.form.action,
  407. type: data.form.method,
  408. data: data.field,
  409. dataType:'json',
  410. success: function (info) {
  411. if(info.status == 0)
  412. {
  413. layer.msg(info.result.message,{icon: 1,time: 2000});
  414. }else if(info.status == 1){
  415. var go_url = location.href;
  416. if( info.result.hasOwnProperty("url") )
  417. {
  418. go_url = info.result.url;
  419. }
  420. layer.msg('操作成功',{time: 1000,
  421. end:function(){
  422. location.href = info.result.url;
  423. }
  424. });
  425. }
  426. }
  427. });
  428. return false;
  429. });
  430. })
  431. </script>
  432. </body>
  433. </html>