mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-06-19 19:29:16 +08:00
135 lines
7.0 KiB
PHP
135 lines
7.0 KiB
PHP
{extend name="../../admin/view/main"}
|
|
|
|
{block name="button"}
|
|
<!--{if auth("add")}-->
|
|
<button data-open='{:url("add")}' class='layui-btn layui-btn-sm layui-btn-primary'>添加商品</button>
|
|
<!--{/if}-->
|
|
|
|
{if isset($type) and $type eq 'index'}
|
|
<!--{if auth("remove")}-->
|
|
<button data-action='{:url("remove")}' data-rule="code#{key};deleted#1" class='layui-btn layui-btn-sm layui-btn-primary'>删除商品</button>
|
|
<!--{/if}-->
|
|
{else}
|
|
<!--{if auth("remove")}-->
|
|
<button data-action='{:url("remove")}' data-rule="code#{key};deleted#0" data-confirm="确定要恢复这些数据吗?" class='layui-btn layui-btn-sm layui-btn-primary'>恢复商品</button>
|
|
<!--{/if}-->
|
|
{/if}
|
|
|
|
<!--{if auth("shop_goods_mark/index")}-->
|
|
<button data-iframe='{:url("shop_goods_mark/index")}' data-width="900px" data-title="标签管理" class='layui-btn layui-btn-sm layui-btn-primary'>标签管理</button>
|
|
<!--{/if}-->
|
|
{/block}
|
|
|
|
{block name="content"}
|
|
<div class="layui-tab layui-tab-card think-bg-white table-block">
|
|
<ul class="layui-tab-title">
|
|
{foreach ['index'=>'商品管理','recycle'=>'回 收 站'] as $k=>$v}
|
|
{if isset($type) and $type eq $k}
|
|
<li data-open="{:url('index')}?type={$k}" class="layui-this">{$v}</li>
|
|
{else}
|
|
<li data-open="{:url('index')}?type={$k}">{$v}</li>
|
|
{/if}{/foreach}
|
|
</ul>
|
|
<div class="layui-tab-content table-block">
|
|
{include file='shop_goods/index_search'}
|
|
<table class="layui-table margin-top-10" lay-skin="line">
|
|
{notempty name='list'}
|
|
<thead>
|
|
<tr>
|
|
<th class='list-table-check-td think-checkbox'>
|
|
<label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
|
|
</th>
|
|
<th class='list-table-sort-td'>
|
|
<button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
|
|
</th>
|
|
<th class='text-left nowrap'>商品信息</th>
|
|
<th class='text-left nowrap'></th>
|
|
<th class='text-left nowrap'>商品状态</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
{/notempty}
|
|
<tbody>
|
|
{foreach $list as $key=>$vo}
|
|
<tr>
|
|
<td class='list-table-check-td think-checkbox'>
|
|
<label><input class="list-check-box" value='{$vo.code}' type='checkbox'></label>
|
|
</td>
|
|
<td class='list-table-sort-td'>
|
|
<label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></label>
|
|
</td>
|
|
<td class='nowrap'>
|
|
{notempty name='vo.cover'}
|
|
<div class="headimg" data-tips-image data-lazy-src="{$vo.cover}"></div>
|
|
{/notempty}
|
|
<div class="inline-block text-top sub-span-blue">
|
|
商品编号:<span>{$vo.code|default='--'}</span><br>
|
|
商品名称:<span>{$vo.name|default='--'}</span><br>
|
|
</div>
|
|
</td>
|
|
<td class="text-left">
|
|
<div>
|
|
<!--{notempty name='clist'}-->
|
|
所属分类:{$vo.cate.name|default='-'}<br>
|
|
<!--{/notempty}-->
|
|
</div>
|
|
<div>
|
|
{notempty name='vo.mark'}{foreach $vo.mark as $mark}
|
|
<span class="notselect nowrap layui-badge layui-bg-cyan">{$mark}</span>
|
|
{/foreach}{/notempty}
|
|
</div>
|
|
</td>
|
|
<td class='nowrap'>
|
|
<div>销售状态:{eq name='vo.status' value='0'}<span class="layui-badge">已下架</span>{else}<span class="layui-badge layui-bg-green">销售中</span>{/eq}</div>
|
|
<div>创建时间:{$vo.create_at|format_datetime}</div>
|
|
</td>
|
|
<td class='nowrap sub-span-blue'>
|
|
<div class="margin-bottom-5">剩余库存 <span>{$vo.stock_total-$vo.stock_sales}</span> 件 ( 已销售 <span>{$vo.stock_sales}</span> 件 )</div>
|
|
|
|
<!--{if auth('copy')}-->
|
|
<a class="layui-btn layui-btn-xs layui-btn-normal" data-open='{:url("copy")}?code={$vo.code}'>复 制</a>
|
|
<!--{/if}-->
|
|
|
|
<!--{if auth("edit")}-->
|
|
<a class="layui-btn layui-btn-xs" data-open='{:url("edit")}?code={$vo.code}'>编 辑</a>
|
|
<!--{else}-->
|
|
<a data-tips-text="您没有编辑商品的权限哦!" class="layui-btn layui-btn-xs layui-btn-primary layui-disabled">编 辑</a>
|
|
<!--{/if}-->
|
|
|
|
{if isset($type) and $type eq 'index'}
|
|
{if isset($vo.status) and $vo.status eq 1}
|
|
<!--{if auth("state")}-->
|
|
<a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('state')}" data-value="code#{$vo.code};status#0">下 架</a>
|
|
<!--{else}-->
|
|
<a data-tips-text="您没有下架商品的权限哦!" class="layui-btn layui-btn-xs layui-btn-primary layui-disabled">下 架</a>
|
|
<!--{/if}-->
|
|
{else}
|
|
<!--{if auth("state")}-->
|
|
<a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('state')}" data-value="code#{$vo.code};status#1">上 架</a>
|
|
<!--{else}-->
|
|
<a data-tips-text="您没有上架商品的权限哦!" class="layui-btn layui-btn-xs layui-btn-primary layui-disabled">上 架</a>
|
|
<!--{/if}-->
|
|
{/if}
|
|
<!--{if auth("stock")}-->
|
|
<a class="layui-btn layui-btn-xs layui-btn-normal" data-title="商品入库" data-modal='{:url("stock")}?code={$vo.code}'>入 库</a>
|
|
<!--{else}-->
|
|
<a data-tips-text="您没有商品入库的权限哦!" class="layui-btn layui-btn-xs layui-btn-primary layui-disabled">入 库</a>
|
|
<!--{/if}-->
|
|
<!--{if auth("remove")}-->
|
|
<a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要移入回收站吗?" data-action="{:url('remove')}" data-value="code#{$vo.code};deleted#1">删 除</a>
|
|
<!--{/if}-->
|
|
{else}
|
|
<!--{if auth("remove")}-->
|
|
<a class="layui-btn layui-btn-xs layui-btn-normal" data-action="{:url('remove')}" data-value="code#{$vo.code};deleted#0">恢 复</a>
|
|
<!--{/if}-->
|
|
{/if}
|
|
</td>
|
|
</tr>
|
|
{/foreach}
|
|
</tbody>
|
|
</table>
|
|
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
|
|
</div>
|
|
<script>form.render()</script>
|
|
</div>
|
|
{/block} |