123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- @extends('admin/master')
- @section('content')
- <body>
- @if(session('info'))
- <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
- {{session('info')}}
- </div>
- @endif
- <div class="page-container">
-
- <div>
- <input class="input-text" style="width:5%;text-align:center" type="text" value="商品名称"/>
- <input id="name" type="text" class="input-text" style="width:8%;text-align:center" name="name" value="{{$name?$name:''}}">
- <input class="input-text" style="width:5%;text-align:center" type="text" value="商品分类"/>
- <select style="width:7%;text-align:center" name="cate_name" id='cate_name'>
- <option value="0" @if($cate_name=='') selected @endif>选择分类</option>
- @foreach($cates as $v)
- <option value="{{$v}}" @if($cate_name==$v) selected @endif>{{$v}}</option>
- @endforeach
- </select>
- <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
- <a class="btn btn-primary radius" onclick="admin_add('新增')" href="javascript:;"><i class="Hui-iconfont"></i> 新增商品</a>
- </div>
- <div class="mt-20">
- <table class="table table-border table-bordered table-bg table-hover table-sort">
- <thead>
- <tr class="text-c">
- {{--<th width="25"><input type="checkbox" name="" value=""></th>--}}
- <th width="5%">商品编号</th>
- <th width="10%">商品标题</th>
- <th width="8%">商品分类</th>
- <th width="8%">商品图片</th>
- <th width="8%">商品货号</th>
- <th width="25%">商品规格</th>
- <th width="15%">商品描述</th>
- <th width="5%">上架状态</th>
- <th width="8%">创建时间</th>
- <th width="10%">操作</th>
- </tr>
- </thead>
- <tbody>
- @if($result)
- @foreach($result as $a)
- <tr class="text-c">
- {{--<td><input name="" type="checkbox" value=""></td>--}}
- <td class="text-c">{{$a['id']}}</td>
- <td class="text-c">{{$a['name']}}</td>
- <td class="text-c">{{$a['goodsCategoryName']}}</td>
- <td class="text-c"><img style="width:100px;" src="{{$a['picUrl']}}" /></td>
- <td class="text-c">{{$a['productCode']}}</td>
- <td class="text-c">
- @foreach($a['sku_list'] as $item)
- 规格:{{$item['propsName']}} 可用库存:{{$item['quantity']}} 预占库存:{{$item['w_num']}} @if($item['is_weigh']==1)【称重商品】 @endif <br>
- @endforeach
- </td>
- <td class="text-c">{{$a['description']}}</td>
- <td class="text-c">@if($a['is_del']==1) 已下架 @else 已上架 @endif</td>
- <td class="text-c">{{$a['createTime']}}</td>
- <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" onClick='sku_edit("规格管理","{{$a['id']}}")' href="javascript:;" title="规格管理"><span class="btn btn-primary radius">规格管理</span></a>
-
- @if($a['is_del']==0)
- <a style="text-decoration:none" class="ml-5" onClick="admin_down(this, '{{$a["id"]}}')" href="javascript:;" title="下架"><span class="btn btn-danger radius">下架</span></a>
- @elseif($a['is_del']==1)
- <a style="text-decoration:none" class="ml-5" onClick="admin_up(this, '{{$a['id']}}')" href="javascript:;" title="上架"><span class="btn btn-success radius">上架</span></a>
- @endif
- <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>
- </tr>
- @endforeach
- @endif
- </tbody>
- </table>
- </div>
- <div id="page" class="page_div"></div>
- </div>
- <!--_footer 作为公共模版分离出去-->
- <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
- <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
- <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
- <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
- <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
- <!--/_footer 作为公共模版分离出去-->
- <!--/_footer 作为公共模版分离出去-->
- <script type="text/javascript">
- $(function(){
- setTimeout("$('#info').hide()",3000);
- });
- /*管理员-添加*/
- function admin_add(title){
- location.href = '/admin/goods/create';
- }
- /*管理员-编辑*/
- function admin_edit(title,id){
- var page = '{{$page}}';
- location.href = "/admin/goods/edit/"+id+'?page=' + page;
- }
- function sku_edit(title,id){
- location.href = "/admin/goods/skulist?goods_id="+id;
- }
- function user_search(){
- var name = $('#name').val();
- var cate_name = $('#cate_name').val();
- location.href='index?page='+num + '&name='+name + '&cate_name='+cate_name;
- }
- /*管理员-下架*/
- function admin_down(obj,id){
- layer.confirm('确认要下架吗?',function(index){
- $.ajax({
- type: 'GET',
- url: '/admin/goods/down/'+id,
- dataType: 'json',
- success: function(data){
- if(data == 1){
- location.reload();
- }
- }
- });
- });
- }
- /**/
- function admin_up(obj,id){
- layer.confirm('确认要上架吗?',function(index){
- $.ajax({
- type: 'GET',
- url: '/admin/goods/up/'+id,
- dataType: 'json',
- success: function(data){
- if(data == 1){
- location.reload();
- }
- }
- });
- });
- }
- /*管理员-删除*/
- function admin_del(obj,id){
- layer.confirm('确认要删除吗?',function(index){
- $.ajax({
- type: 'GET',
- url: '/admin/goods/delete/'+id,
- dataType: 'json',
- success: function(data){
- if(data == 1){
- location.reload();
- }
- }
- });
- });
- }
- $("#page").paging({
- pageNo:{{$page}},
- totalPage: {{$pages}},
- totalSize: {{$count}},
- callback: function(num) {
- var name = $('#name').val();
- var cate_name = $('#cate_name').val();
- location.href='index?page='+num + '&name='+name + '&cate_name='+cate_name;
- }
- })
- </script>
- </body>
- @endsection
|