pintuan.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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-tab layui-tab-brief" >
  101. <ul class="layui-tab-title">
  102. <li <?php if( !isset($_GPC['state']) ){ ?>class="layui-this"<?php } ?>><a href="{:U('group/pintuan')}">全部拼团</a></li>
  103. <li <?php if( $_GPC['state']=='1' ){ ?>class="layui-this"<?php } ?> ><a href="{:U('group/pintuan',array('state'=>'1'))}">拼团成功</a></li>
  104. <li <?php if( $_GPC['state']=='2' ){ ?>class="layui-this"<?php } ?> ><a href="{:U('group/pintuan',array('state'=>'2'))}">拼团失败</a></li>
  105. <li <?php if( $_GPC['state']=='0' ){ ?>class="layui-this"<?php } ?> ><a href="{:U('group/pintuan',array('state'=>'0'))}">拼团中</a></li>
  106. </ul>
  107. </div>
  108. <div class="layui-card-body" style="padding:15px;">
  109. <form action="" class="layui-form" lay-filter="example" method="post" >
  110. <div class="row">
  111. <div class="col-md-12">
  112. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  113. <thead>
  114. <tr>
  115. <th style="width:25px;">
  116. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  117. </th>
  118. <th style="width:80px;text-align:center;">拼团ID</th>
  119. <th style="width: 80px;">商品ID</th>
  120. <th style="width:200px;">商品名称</th>
  121. <th style="width: 240px;">状态</th>
  122. <th style="width: 120px;">已买/总需</th>
  123. <th style="">开团时间</th>
  124. <th style="">到期时间</th>
  125. <th style="">操作</th>
  126. </tr>
  127. </tr>
  128. </thead>
  129. <tbody>
  130. <?php foreach($list as $item){ ?>
  131. <tr>
  132. <td>
  133. <input type='checkbox' name="item_checkbox" class="checkone" lay-skin="primary" value="{$item['id']}"/>
  134. </td>
  135. <td style="text-align:center;">
  136. {$item['pin_id']}
  137. </td>
  138. <td>
  139. {$item['goods_id']}
  140. </td>
  141. <td>
  142. {$item['name']}
  143. </td>
  144. <td>
  145. <?php if($item['state'] == 0 ){ ?>
  146. <span class="blue">拼团中</span>
  147. <?php }else if($item['state'] == 1){ ?>
  148. <span class="red">已完成</span>
  149. <?php if($item['is_jiqi'] ==1){ ?>
  150. <span class="line-text">(虚拟成团)</span>
  151. <?php } ?>
  152. <?php }else if($item['state'] == 2 ){ ?>
  153. <span class="grey">已过期</span>
  154. <?php } ?>
  155. </td>
  156. <td><span class="red">{$item['buy_count']}</span>/{$item['need_count']}</td>
  157. <td><?php echo date('Y-m-d H:i:s',$item['begin_time']);?></td>
  158. <td>
  159. <?php echo date('Y-m-d H:i:s',$item['end_time']);?>
  160. </td>
  161. <td>
  162. <a href='{:U('group/pintuan_detail',array('pin_id'=>$item["pin_id"]))}' class="btn btn-success btn-sm">查看团信息</a>
  163. <?php if($item['real_state'] == 0 ){ ?>
  164. <a href='{:U("group/jia_over_order",array("pin_id"=>$item["pin_id"]))}' style="display:none;" class="btn btn-success btn-sm">机器人成团</a>
  165. <a class="btn btn-primary btn-xs deldom" href="javascript:;" data-href="{:U("group/jia_over_order",array("pin_id"=>$item["pin_id"]))}" data-confirm="确认机器人成团订单吗?">机器人成团</a>
  166. <?php } ?>
  167. </td>
  168. </tr>
  169. <?php } ?>
  170. </tbody>
  171. <tfoot>
  172. <tr>
  173. <td colspan="10" style="text-align: right">
  174. {$pager}
  175. </td>
  176. </tr>
  177. </tfoot>
  178. </table>
  179. </div>
  180. </div>
  181. </form>
  182. </div>
  183. </div>
  184. </div>
  185. <script src="/layuiadmin/layui/layui.js"></script>
  186. <script>
  187. layui.config({
  188. base: '/layuiadmin/' //静态资源所在路径
  189. }).extend({
  190. index: 'lib/index' //主入口模块
  191. }).use('index');
  192. </script>
  193. <script>
  194. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  195. var layer = layui.layer;
  196. var $;
  197. layui.use(['jquery', 'layer','form'], function(){
  198. $ = layui.$;
  199. var form = layui.form;
  200. $('.deldom').click(function(){
  201. var loadingIndex = layer.load();
  202. var s_url = $(this).attr('data-href');
  203. layer.confirm($(this).attr('data-confirm'), function(index){
  204. $.ajax({
  205. url:s_url,
  206. type:'post',
  207. dataType:'json',
  208. success:function(info){
  209. if(info.status == 0)
  210. {
  211. layer.msg(info.result.message,{icon: 1,time: 2000});
  212. layer.close(loadingIndex);
  213. }else if(info.status == 1){
  214. var go_url = location.href;
  215. if( info.result.hasOwnProperty("url") )
  216. {
  217. go_url = info.result.url;
  218. }
  219. layer.msg('操作成功',{time: 1000,
  220. end:function(){
  221. location.href = info.result.url;
  222. }
  223. });
  224. }
  225. }
  226. })
  227. });
  228. })
  229. $('.btn-operation').click(function(){
  230. var ids_arr = [];
  231. var obj = $(this);
  232. var s_toggle = $(this).attr('data-toggle');
  233. var s_url = $(this).attr('data-href');
  234. $("input[name=item_checkbox]").each(function() {
  235. if( $(this).prop('checked') )
  236. {
  237. ids_arr.push( $(this).val() );
  238. }
  239. })
  240. if(ids_arr.length < 1)
  241. {
  242. layer.msg('请选择要操作的内容');
  243. }else{
  244. var can_sub = true;
  245. if( s_toggle == 'batch-remove' )
  246. {
  247. can_sub = false;
  248. layer.confirm($(obj).attr('data-confirm'), function(index){
  249. $.ajax({
  250. url:s_url,
  251. type:'post',
  252. dataType:'json',
  253. data:{ids:ids_arr},
  254. success:function(info){
  255. if(info.status == 0)
  256. {
  257. layer.msg(info.result.message,{icon: 1,time: 2000});
  258. }else if(info.status == 1){
  259. var go_url = location.href;
  260. if( info.result.hasOwnProperty("url") )
  261. {
  262. go_url = info.result.url;
  263. }
  264. layer.msg('操作成功',{time: 1000,
  265. end:function(){
  266. location.href = info.result.url;
  267. }
  268. });
  269. }
  270. }
  271. })
  272. });
  273. }else{
  274. $.ajax({
  275. url:s_url,
  276. type:'post',
  277. dataType:'json',
  278. data:{ids:ids_arr},
  279. success:function(info){
  280. if(info.status == 0)
  281. {
  282. layer.msg(info.result.message,{icon: 1,time: 2000});
  283. }else if(info.status == 1){
  284. var go_url = location.href;
  285. if( info.result.hasOwnProperty("url") )
  286. {
  287. go_url = info.result.url;
  288. }
  289. layer.msg('操作成功',{time: 1000,
  290. end:function(){
  291. location.href = info.result.url;
  292. }
  293. });
  294. }
  295. }
  296. })
  297. }
  298. }
  299. })
  300. form.on('switch(statewsitch)', function(data){
  301. var s_url = $(this).attr('data-href')
  302. var s_value = 1;
  303. if(data.elem.checked)
  304. {
  305. s_value = 1;
  306. }else{
  307. s_value = 0;
  308. }
  309. $.ajax({
  310. url:s_url,
  311. type:'post',
  312. dataType:'json',
  313. data:{value:s_value},
  314. success:function(info){
  315. if(info.status == 0)
  316. {
  317. layer.msg(info.result.message,{icon: 1,time: 2000});
  318. }else if(info.status == 1){
  319. var go_url = location.href;
  320. if( info.result.hasOwnProperty("url") )
  321. {
  322. go_url = info.result.url;
  323. }
  324. layer.msg('操作成功',{time: 1000,
  325. end:function(){
  326. location.href = info.result.url;
  327. }
  328. });
  329. }
  330. }
  331. })
  332. });
  333. form.on('checkbox(checkboxall)', function(data){
  334. if(data.elem.checked)
  335. {
  336. $("input[name=item_checkbox]").each(function() {
  337. $(this).prop("checked", true);
  338. });
  339. $("input[name=checkall]").each(function() {
  340. $(this).prop("checked", true);
  341. });
  342. }else{
  343. $("input[name=item_checkbox]").each(function() {
  344. $(this).prop("checked", false);
  345. });
  346. $("input[name=checkall]").each(function() {
  347. $(this).prop("checked", false);
  348. });
  349. }
  350. form.render('checkbox');
  351. });
  352. //监听提交
  353. form.on('submit(formDemo)', function(data){
  354. $.ajax({
  355. url: data.form.action,
  356. type: data.form.method,
  357. data: data.field,
  358. dataType:'json',
  359. success: function (info) {
  360. if(info.status == 0)
  361. {
  362. layer.msg(info.result.message,{icon: 1,time: 2000});
  363. }else if(info.status == 1){
  364. var go_url = location.href;
  365. if( info.result.hasOwnProperty("url") )
  366. {
  367. go_url = info.result.url;
  368. }
  369. layer.msg('操作成功',{time: 1000,
  370. end:function(){
  371. location.href = info.result.url;
  372. }
  373. });
  374. }
  375. }
  376. });
  377. return false;
  378. });
  379. })
  380. </script>
  381. </body>