1d9394aa01ab50e942a546ef14893c03.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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. <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. <span class="line-text">此处为:仅快递的商品列表页。可通过后台——设置——首页相关自定义链接到此页面</span>
  102. <br><br>
  103. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  104. <input type="hidden" name="c" value="generalmall" />
  105. <input type="hidden" name="a" value="slider" />
  106. <input type="hidden" name="type" value="<?php echo ($type); ?>" />
  107. <div class="layui-form-item">
  108. <div class="layui-inline">
  109. <div class="layui-input-inline" >
  110. <select name="enabled" class='layui-input layui-unselect' data-placeholder="状态">
  111. <option value="-1" <?php if( empty($_GPC['cate'])){ ?>selected<?php } ?> >状态</option>
  112. <option value="1" <?php if( $_GPC['enabled']==1){ ?>selected<?php } ?> >显示</option>
  113. <option value="0" <?php if( $_GPC['enabled']==0){ ?>selected<?php } ?> >隐藏</option>
  114. </select>
  115. </div>
  116. <div class="layui-input-inline">
  117. <input type="text" class="layui-input" name='keyword' value="<?php echo ($_GPC['keyword']); ?>" placeholder="输入关键词然后回车">
  118. </div>
  119. <div class="layui-input-inline">
  120. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  121. </div>
  122. </div>
  123. </div>
  124. </form>
  125. <form action="" class="layui-form" lay-filter="example" method="post" >
  126. <div class="row">
  127. <div class="col-md-12">
  128. <div class="page-table-header">
  129. <span class="pull-right">
  130. <a href="<?php echo U('generalmall/addslider', array('ok' => 1));?>" class="layui-btn layui-btn-sm"><i class="fa fa-plus"></i> 添加幻灯片</a>
  131. </span>
  132. <div class="btn-group">
  133. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="<?php echo U('generalmall/changeslider',array('type'=>'enabled','value'=>1));?>">
  134. 显示
  135. </button>
  136. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="<?php echo U('generalmall/changeslider',array('type'=>'enabled','value'=>0));?>">
  137. 隐藏
  138. </button>
  139. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗,删除后商品将进入回收站?" data-href="<?php echo U('generalmall/delete');?>">
  140. 删除
  141. </button>
  142. </div>
  143. </div>
  144. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  145. <thead>
  146. <tr>
  147. <th style="width:25px;">
  148. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  149. </th>
  150. <th style="width:80px;text-align:center;">ID</th>
  151. <th style="">幻灯片名称</th>
  152. <th style="width: 100px;">图片</th>
  153. <th style="">链接</th>
  154. <th style="width: 100px;">状态</th>
  155. <th style="width:80px;">排序</th>
  156. <th style="">操作</th>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <?php foreach( $list as $item ){ ?>
  161. <tr>
  162. <td>
  163. <input type='checkbox' name="item_checkbox" lay-skin="primary" value="<?php echo ($item['id']); ?>"/>
  164. </td>
  165. <td>
  166. <?php echo ($item['id']); ?>
  167. </td>
  168. <td>
  169. <?php echo ($item['advname']); ?>
  170. </td>
  171. <td>
  172. <a href="<?php echo U('generalmall/addslider', array('id' => $item['id']));?>">
  173. <img src="<?php echo resize($item['thumb'], 100,100 );?>" style="width:72px;padding:1px;border:1px solid #efefef;margin: 7px 0" onerror="this.src='/static/images/nopic.png'" />
  174. </a>
  175. </td>
  176. <td>
  177. <?php echo ($item['link']); ?>
  178. </td>
  179. <td>
  180. <input type="checkbox" name="" lay-filter="statewsitch" data-href="<?php echo U('generalmall/changeslider',array('type'=>'enabled','id'=>$item['id']));?>" <?php if( $item['enabled']==1){ ?>checked<?php }else{ } ?> lay-skin="switch" lay-text="显示|隐藏">
  181. </td>
  182. <td>
  183. <a href='javascript:;' data-toggle='ajaxEdit' data-href="<?php echo U('generalmall/changeslider',array('id'=>$item['id'],'type'=>'displayorder'));?>" ><?php echo ($item['displayorder']); ?></a>
  184. </td>
  185. <td style="overflow:visible;position:relative">
  186. <a class='layui-btn layui-btn-xs' href="<?php echo U('generalmall/addslider', array('id' => $item['id'], 'ok' => 1));?>" >
  187. <i class="layui-icon layui-icon-edit"></i>编辑
  188. </a>
  189. <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="<?php echo U('generalmall/delete',array('id' => $item['id']));?>" data-confirm='确认要删除吗?'>
  190. <i class="layui-icon">&#xe640;</i>删除
  191. </a>
  192. </td>
  193. </tr>
  194. <?php } ?>
  195. </tbody>
  196. <tfoot>
  197. <tr>
  198. <td colspan="5">
  199. <div class="page-table-header">
  200. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  201. <div class="btn-group">
  202. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="<?php echo U('generalmall/changeslider',array('type'=>'enabled','value'=>1));?>">
  203. 显示
  204. </button>
  205. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="<?php echo U('generalmall/changeslider',array('type'=>'enabled','value'=>0));?>">
  206. 隐藏
  207. </button>
  208. <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗?" data-href="<?php echo U('generalmall/delete');?>">
  209. 删除
  210. </button>
  211. </div>
  212. </div>
  213. </td>
  214. <td colspan="3" style="text-align: right">
  215. <?php echo ($pager); ?>
  216. </td>
  217. </tr>
  218. </tfoot>
  219. </table>
  220. </div>
  221. </div>
  222. </form>
  223. </div>
  224. </div>
  225. </div>
  226. <script src="/layuiadmin/layui/layui.js"></script>
  227. <script>
  228. layui.config({
  229. base: '/layuiadmin/' //静态资源所在路径
  230. }).extend({
  231. index: 'lib/index' //主入口模块
  232. }).use('index');
  233. </script>
  234. <script>
  235. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  236. var layer = layui.layer;
  237. var $;
  238. layui.use(['jquery', 'layer','form'], function(){
  239. $ = layui.$;
  240. var form = layui.form;
  241. $('.deldom').click(function(){
  242. var s_url = $(this).attr('data-href');
  243. layer.confirm($(this).attr('data-confirm'), function(index){
  244. $.ajax({
  245. url:s_url,
  246. type:'post',
  247. dataType:'json',
  248. success:function(info){
  249. if(info.status == 0)
  250. {
  251. layer.msg(info.result.message,{icon: 1,time: 2000});
  252. }else if(info.status == 1){
  253. var go_url = location.href;
  254. if( info.result.hasOwnProperty("url") )
  255. {
  256. go_url = info.result.url;
  257. }
  258. layer.msg('操作成功',{time: 1000,
  259. end:function(){
  260. location.href = info.result.url;
  261. }
  262. });
  263. }
  264. }
  265. })
  266. });
  267. })
  268. $('.btn-operation').click(function(){
  269. var ids_arr = [];
  270. var obj = $(this);
  271. var s_toggle = $(this).attr('data-toggle');
  272. var s_url = $(this).attr('data-href');
  273. $("input[name=item_checkbox]").each(function() {
  274. if( $(this).prop('checked') )
  275. {
  276. ids_arr.push( $(this).val() );
  277. }
  278. })
  279. if(ids_arr.length < 1)
  280. {
  281. layer.msg('请选择要操作的内容');
  282. }else{
  283. var can_sub = true;
  284. if( s_toggle == 'batch-remove' )
  285. {
  286. can_sub = false;
  287. layer.confirm($(obj).attr('data-confirm'), function(index){
  288. $.ajax({
  289. url:s_url,
  290. type:'post',
  291. dataType:'json',
  292. data:{ids:ids_arr},
  293. success:function(info){
  294. if(info.status == 0)
  295. {
  296. layer.msg(info.result.message,{icon: 1,time: 2000});
  297. }else if(info.status == 1){
  298. var go_url = location.href;
  299. if( info.result.hasOwnProperty("url") )
  300. {
  301. go_url = info.result.url;
  302. }
  303. layer.msg('操作成功',{time: 1000,
  304. end:function(){
  305. location.href = info.result.url;
  306. }
  307. });
  308. }
  309. }
  310. })
  311. });
  312. }else{
  313. $.ajax({
  314. url:s_url,
  315. type:'post',
  316. dataType:'json',
  317. data:{ids:ids_arr},
  318. success:function(info){
  319. if(info.status == 0)
  320. {
  321. layer.msg(info.result.message,{icon: 1,time: 2000});
  322. }else if(info.status == 1){
  323. var go_url = location.href;
  324. if( info.result.hasOwnProperty("url") )
  325. {
  326. go_url = info.result.url;
  327. }
  328. layer.msg('操作成功',{time: 1000,
  329. end:function(){
  330. location.href = info.result.url;
  331. }
  332. });
  333. }
  334. }
  335. })
  336. }
  337. }
  338. })
  339. form.on('switch(statewsitch)', function(data){
  340. var s_url = $(this).attr('data-href')
  341. var s_value = 1;
  342. if(data.elem.checked)
  343. {
  344. s_value = 1;
  345. }else{
  346. s_value = 0;
  347. }
  348. $.ajax({
  349. url:s_url,
  350. type:'post',
  351. dataType:'json',
  352. data:{value:s_value},
  353. success:function(info){
  354. if(info.status == 0)
  355. {
  356. layer.msg(info.result.message,{icon: 1,time: 2000});
  357. }else if(info.status == 1){
  358. var go_url = location.href;
  359. if( info.result.hasOwnProperty("url") )
  360. {
  361. go_url = info.result.url;
  362. }
  363. layer.msg('操作成功',{time: 1000,
  364. end:function(){
  365. location.href = info.result.url;
  366. }
  367. });
  368. }
  369. }
  370. })
  371. });
  372. form.on('checkbox(checkboxall)', function(data){
  373. if(data.elem.checked)
  374. {
  375. $("input[name=item_checkbox]").each(function() {
  376. $(this).prop("checked", true);
  377. });
  378. $("input[name=checkall]").each(function() {
  379. $(this).prop("checked", true);
  380. });
  381. }else{
  382. $("input[name=item_checkbox]").each(function() {
  383. $(this).prop("checked", false);
  384. });
  385. $("input[name=checkall]").each(function() {
  386. $(this).prop("checked", false);
  387. });
  388. }
  389. form.render('checkbox');
  390. });
  391. //监听提交
  392. form.on('submit(formDemo)', function(data){
  393. $.ajax({
  394. url: data.form.action,
  395. type: data.form.method,
  396. data: data.field,
  397. dataType:'json',
  398. success: function (info) {
  399. if(info.status == 0)
  400. {
  401. layer.msg(info.result.message,{icon: 1,time: 2000});
  402. }else if(info.status == 1){
  403. var go_url = location.href;
  404. if( info.result.hasOwnProperty("url") )
  405. {
  406. go_url = info.result.url;
  407. }
  408. layer.msg('操作成功',{time: 1000,
  409. end:function(){
  410. location.href = info.result.url;
  411. }
  412. });
  413. }
  414. }
  415. });
  416. return false;
  417. });
  418. })
  419. </script>
  420. </body>