You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. @extends('admin.layouts.app')
  2. @section('title', '商品列表')
  3. @section('content')
  4. <h5 class="sub-header"><a href="/fladmin/goodstype">商品分类</a> > <a href="/fladmin/goods">商品列表</a> [ <a href="/fladmin/goods/add<?php if(!empty($_GET["id"])){echo '?catid='.$_GET["id"];}?>">发布商品</a> ]</h5>
  5. <div class="table-responsive">
  6. <table class="table table-striped table-hover">
  7. <thead>
  8. <tr>
  9. <th>ID</th>
  10. <th>选择</th>
  11. <th>商品标题</th>
  12. <th>更新时间</th>
  13. <th>类目</th><th>点击</th><th>操作</th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <?php if($posts){foreach($posts as $row){ ?>
  18. <tr>
  19. <td><?php echo $row->id; ?></td>
  20. <td><input name="arcID" type="checkbox" value="<?php echo $row->id; ?>" class="np"></td>
  21. <td><a href="/fladmin/goods/edit?id=<?php echo $row->id; ?>"><?php echo $row->title; ?></a> <?php if(!empty($row->litpic)){echo "<small style='color:red'>[图]</small>";}if($row->tuijian==1){echo "<small style='color:#22ac38'>[荐]</small>";} ?> </td>
  22. <td><?php echo date('Y-m-d',$row->pubdate); ?></td>
  23. <td><a href="/fladmin/goods?id=<?php echo $row->typeid; ?>"><?php echo $row->name; ?></a></td><td><?php echo $row->click; ?></td><td><a target="_blank" href="<?php echo route('home_goods',['id'=>$row->id]); ?>">预览</a>&nbsp;<a href="/fladmin/goods/edit?id=<?php echo $row->id; ?>">修改</a>&nbsp;<a onclick="delconfirm('/fladmin/goods/del?id=<?php echo $row->id; ?>')" href="javascript:;">删除</a></td>
  24. </tr>
  25. <?php }} ?>
  26. <tr>
  27. <td colspan="8">
  28. <a href="javascript:selAll('arcID')" class="coolbg">反选</a>&nbsp;
  29. <a href="javascript:delArc()" class="coolbg">删除</a>&nbsp;
  30. <a href="javascript:tjArc()" class="coolbg">特荐</a>
  31. </td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div><!-- 表格结束 -->
  36. <div>
  37. <form id="searcharc" class="navbar-form" action="/fladmin/goods" method="get">
  38. <select name="typeid" id="typeid" style="padding:6px 5px;vertical-align:middle;border:1px solid #DBDBDB;border-radius:4px;">
  39. <option value="0">选择栏目...</option>
  40. <?php $catlist = category_tree(get_category('goods_type',0));if($catlist){foreach($catlist as $row){ ?><option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "—";}echo $row["name"]; ?></option><?php }} ?>
  41. </select>
  42. <div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
  43. <button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>
  44. <nav aria-label="Page navigation">{{ $posts->links() }}</nav>
  45. <script>
  46. //批量删除商品
  47. function delArc(aid)
  48. {
  49. var checkvalue=getItems();
  50. if(checkvalue=='')
  51. {
  52. alert('必须选择一个或多个商品!');
  53. return;
  54. }
  55. if(confirm("确定删除吗"))
  56. {
  57. location="<?php echo route('admin_goods_del'); ?>?id="+checkvalue;
  58. }
  59. else
  60. {
  61. }
  62. }
  63. //推荐商品
  64. function tjArc(aid)
  65. {
  66. var checkvalue=getItems();
  67. if(checkvalue=='')
  68. {
  69. alert('必须选择一个或多个文档!');
  70. return;
  71. }
  72. if(confirm("确定要推荐吗"))
  73. {
  74. location="<?php echo route('admin_goods_recommendarc'); ?>?id="+checkvalue;
  75. }
  76. else
  77. {
  78. }
  79. }
  80. $(function(){
  81. $('.required').on('focus', function() {
  82. $(this).removeClass('input-error');
  83. });
  84. $("#searcharc").submit(function(e){
  85. $(this).find('.required').each(function(){
  86. if( $(this).val() == "" )
  87. {
  88. e.preventDefault();
  89. $(this).addClass('input-error');
  90. }
  91. else
  92. {
  93. $(this).removeClass('input-error');
  94. }
  95. });
  96. });
  97. });
  98. </script>
  99. @endsection