0
0
Files
Babyclass/app/Admin/Views/goods/index.blade.php
2020-08-04 10:09:42 +08:00

131 lines
6.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="pageHeader">
<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="{{ url()->current() }}" method="post">
<div class="searchBar">
<table class="searchContent">
<tr>
<td>
商品名称:
<input type="text" name="title" value="{{ Request::input('title') }}" placeholder=""/>
</td>
<td><div class="buttonActive"><div class="buttonContent"><button type="submit">检索结果</button></div></div></td>
</tr>
</table>
</div>
</form>
</div>
<div class="pageContent">
<div class="panelBar">
<ul class="toolBar">
<li><a class="add" href="{{ route('Admin.goods.create') }}" mask="true" target="navTab" rel="navTab_{{ time() }}" title="添加商品"><span>添加商品</span></a></li>
</ul>
</div>
<table class="table" width="100%" layoutH="112">
<thead>
<tr>
<th width="50" orderField="id" @if (Request::input('orderField') == 'id') class="{{ Request::input('orderDirection') }}" @endif>编号</th>
<th width="80">商品类型</th>
<th width="200">商品名称</th>
<th width="100">商户名称</th>
<th width="100">规格</th>
<th width="100">售价</th>
<th width="100">成本价</th>
<th width="80">赠品设置</th>
<th width="80">奖品设置</th>
<th width="60">状态</th>
<th width="140" orderField="created_at" @if (Request::input('orderField') == 'created_at') class="{{ Request::input('orderDirection') }}" @endif>创建时间</th>
<th width="120"></th>
</tr>
</thead>
<tbody>
@php
$goodids = array();
@endphp
@foreach ($goods as $good)
@foreach($good->params()->where('status',1)->get() as $params)
<tr>
@if(!in_array($good->id, $goodids))
<td>{{ $good->id }}</td>
<td>{{ $good->category->title }}</td>
<td>{{ $good->title }}</td>
<td>{{ $good->seller->name }}</td>
@else
<td></td>
<td></td>
<td></td>
<td></td>
@endif
<td>{{ $params->value }}</td>
<td>
{{ number_format($params->price,2) }}
</td>
<td>{{ number_format($params->cost,2) }}
</td>
@if(!in_array($good->id, $goodids))
<td>
@if($good->is_seller_gift == 0 && $good->status == 1)
<a title="设为赠品" target="ajaxTodo" href="{{ route('Admin.goods.setgift', $good) }}">设为赠品</a>
@endif
@if($good->is_seller_gift == 1 && $good->status == 1)
<span style="color: red">赠品</span>
&nbsp; <a title="取消赠品" target="ajaxTodo" href="{{ route('Admin.goods.cancelgift', $good) }}">取消</a>
@endif
</td>
<td>
@if($good->is_lottery_gift == 0 && $good->status == 1)<a title="设为奖品" target="ajaxTodo" href="{{ route('Admin.goods.setlottery', $good) }}">设为奖品</a>@endif
@if($good->is_lottery_gift == 1 && $good->status == 1)<span style="color: red">奖品</span> &nbsp; <a title="取消奖品" target="ajaxTodo" href="{{ route('Admin.goods.cancellottery', $good) }}">取消</a>@endif
</td>
<td>{!! $good->status_text !!}</td>
<td>{{ $good->created_at }}</td>
<td>
@if($good->status == 1)<a title="编辑商品" target="navTab" href="{{ route('Admin.goods.edit', $good) }}" rel="navTab_{{ time() }}">编辑</a>@endif
@if($good->canDel())<a title="请确认要删除商品吗?" target="ajaxDelete" href="{{ route('Admin.goods.delete', $good) }}">删除</a>@endif
@if($good->canCancel())<a title="请确认要下架商品吗?" target="ajaxDelete" href="{{ route('Admin.goods.destroy', $good) }}">下架</a>@endif
@if($good->is_seller_gift == 1 && $good->status == 1)<a title="取消赠品" target="ajaxTodo" href="{{ route('Admin.goods.cancelgift', $good) }}">取消赠品</a> @endif
</td>
@else
<td></td>
<td></td>
<td></td>
<td></td>
@endif
</tr>
@php
array_push($goodids,$good->id);
@endphp
@endforeach
@endforeach
<tr><td colspan="10" height="50px">
<p style="color: red;padding: 10px;">
1》删除商品- 未产生订单的商品可删除删除操作不可逆。2》下架商品- 已产生订单的商品不可删除,只能下架,下架后不会再产生新订单,下架操作可通过上架操作恢复商品。
</p>
</td>
</tr>
</tbody>
</table>
<div class="panelBar">
<form id="pagerForm" method="post" action="#rel#">
<input type="hidden" name="page" value="{{ $goods->currentPage() }}" />
<input type="hidden" name="numPerPage" value="{{ $goods->perPage() }}" />
<input type="hidden" name="orderField" value="{{ Request::input('orderField') }}" />
<input type="hidden" name="orderDirection" value="{{ Request::input('orderDirection') }}" />
</form>
<div class="pages">
<span>显示</span>
<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
<option @if ($goods->perPage() == 30) selected @endif value="30">30</option>
<option @if ($goods->perPage() == 100) selected @endif value="100">100</option>
<option @if ($goods->perPage() == 200) selected @endif value="200">200</option>
</select>
<span>条,共 {{ $goods->total() }} </span>
</div>
<div class="pagination" targetType="navTab" totalCount="{{ $goods->total() }}" numPerPage="{{ $goods->perPage() }}" pageNumShown="10" currentPage="{{ $goods->currentPage() }}"></div>
</div>
</div>