Няма описание

index.blade.php 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. @extends('admin/master')
  2. @section('content')
  3. <body>
  4. @if(session('info'))
  5. <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
  6. {{session('info')}}
  7. </div>
  8. @endif
  9. <div class="page-container">
  10. <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"> <a class="btn btn-primary radius" onclick="admin_add('新增')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 新增商品</a></span> </div>
  11. <div class="mt-20">
  12. <table class="table table-border table-bordered table-bg table-hover table-sort">
  13. <thead>
  14. <tr class="text-c">
  15. {{--<th width="25"><input type="checkbox" name="" value=""></th>--}}
  16. <th width="8%">商品编号</th>
  17. <th width="10%">商品标题</th>
  18. <th width="10%">商品图片</th>
  19. <th width="10%">商品货号</th>
  20. <th width="25%">商品规格</th>
  21. <th width="15%">商品描述</th>
  22. <th width="10%">创建时间</th>
  23. <th width="10%">操作</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. @if($result)
  28. @foreach($result as $a)
  29. <tr class="text-c">
  30. {{--<td><input name="" type="checkbox" value=""></td>--}}
  31. <td class="text-c">{{$a['id']}}</td>
  32. <td class="text-c">{{$a['name']}}</td>
  33. <td class="text-c"><img style="width:100px;" src="{{$a['picUrl']}}" /></td>
  34. <td class="text-c">{{$a['productCode']}}</td>
  35. <td class="text-c">
  36. @foreach($a['sku_list'] as $item)
  37. sku编码:{{$item['id']}}&nbsp;&nbsp; 规格:{{$item['propsName']}}&nbsp;&nbsp; 价格:{{$item['price']}}<br>
  38. @endforeach
  39. </td>
  40. <td class="text-c">{{$a['description']}}</td>
  41. <td class="text-c">{{$a['createTime']}}</td>
  42. <td class="f-14 product-brand-manage"><a style="text-decoration:none" onClick='admin_edit("编辑","{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a> <!--a style="text-decoration:none" class="ml-5" onClick="admin_del(this, '{{$a['id']}}')" href="javascript:;" title="删除"><span class="btn btn-danger radius">删除</span></a--></td>
  43. </tr>
  44. @endforeach
  45. @endif
  46. </tbody>
  47. </table>
  48. </div>
  49. </div>
  50. <!--_footer 作为公共模版分离出去-->
  51. <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
  52. <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
  53. <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
  54. <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
  55. <!--/_footer 作为公共模版分离出去-->
  56. <!--/_footer 作为公共模版分离出去-->
  57. <script type="text/javascript">
  58. $(function(){
  59. setTimeout("$('#info').hide()",3000);
  60. });
  61. /*管理员-添加*/
  62. function admin_add(title){
  63. location.href = '/admin/goods/create';
  64. }
  65. /*管理员-编辑*/
  66. function admin_edit(title,id){
  67. location.href = "/admin/goods/edit/"+id;
  68. }
  69. /*管理员-删除*/
  70. function admin_del(obj,id){
  71. layer.confirm('确认要删除吗?',function(index){
  72. $.ajax({
  73. type: 'POST',
  74. url: '/admin/goods/delete/'+id,
  75. dataType: 'json',
  76. success: function(data){
  77. if(data == 1){
  78. $(obj).parents("tr").remove();
  79. layer.msg('已删除!',{icon:1,time:1000});
  80. }
  81. }
  82. });
  83. });
  84. }
  85. </script>
  86. </body>
  87. @endsection