170 lines
8.1 KiB
HTML
170 lines
8.1 KiB
HTML
{layout name="layout/food" /}
|
|
<div class="row-content am-cf">
|
|
<div class="row">
|
|
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
|
|
<div class="widget am-cf">
|
|
<div class="widget-head am-cf">
|
|
<div class="widget-title am-cf">门店列表</div>
|
|
</div>
|
|
<div class="widget-body am-fr">
|
|
<!-- 工具栏 -->
|
|
{if $user['applet']['shop_mode']['value']==20}
|
|
<div class="page_toolbar am-margin-bottom-xs am-cf">
|
|
<div class="am-u-sm-12 am-u-md-3">
|
|
<div class="am-form-group">
|
|
<div class="am-btn-group am-btn-group-sm">
|
|
<a class="am-btn am-btn-primary am-radius" href="{:url('food.shop/add')}">
|
|
<span class="am-icon-plus"></span> 新增
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
<div class="am-scrollable-horizontal am-u-sm-12">
|
|
<table width="100%" class="am-table am-table-hover tpl-table-black">
|
|
<thead>
|
|
<tr>
|
|
<th>门店ID</th>
|
|
<th>门店LOGO</th>
|
|
<th>门店名称</th>
|
|
<th>营业时间</th>
|
|
<th>联系人</th>
|
|
<th>联系电话</th>
|
|
<th>门店码</th>
|
|
<th>买单码</th>
|
|
<th>WIFI码</th>
|
|
<th>门店状态</th>
|
|
<th>创建时间</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{if $list}
|
|
{foreach $list as $index => $item}
|
|
<tr>
|
|
<td class="am-text-middle">{$item['shop_id']}</td>
|
|
<td class="am-text-middle">
|
|
<img src="{$item['logo']|default='/addons/food/img/no_pic.jpg'}" width="50" height="50" alt="门店图片">
|
|
</td>
|
|
<td class="am-text-middle">
|
|
<p class="item-title">{$item['shop_name']}</p>
|
|
</td>
|
|
<td class="am-text-middle">{$item['shop_hours']}</td>
|
|
<td class="am-text-middle">{$item['linkman']}</td>
|
|
<td class="am-text-middle">{$item['phone']}</td>
|
|
<td class="am-text-middle">
|
|
<a class="hema-qrcode" data-index="{$index}" href="javascript:;">
|
|
<i class="iconfont iconerweima" style="font-size:25px;color:#2979ff;"></i>
|
|
</a>
|
|
</td>
|
|
<td class="am-text-middle">
|
|
<a class="hema-paybill" data-index="{$index}" href="javascript:;">
|
|
<i class="iconfont iconerweima" style="font-size:25px;color:#2979ff;"></i>
|
|
</a>
|
|
</td>
|
|
<td class="am-text-middle">
|
|
<a class="hema-wifi" data-index="{$index}" href="javascript:;">
|
|
<i class="iconfont iconerweima" style="font-size:25px;color:#2979ff;"></i>
|
|
</a>
|
|
</td>
|
|
<td class="am-text-middle">
|
|
<span class="hema-status am-badge x-cur-p {$item['status']['value'] ? ' am-badge-success' : ' am-badge-warning'}"
|
|
data-id="{$item['shop_id']}"
|
|
data-status="{$item['status']['status']}">
|
|
{$item['status']['text']}
|
|
</span>
|
|
</td>
|
|
<td class="am-text-middle">{$item['create_time']}</td>
|
|
<td class="am-text-middle">
|
|
<div class="tpl-table-black-operation">
|
|
<a href="{:url('food.shop/edit',['id' => $item['shop_id']])}">
|
|
<i class="am-icon-pencil"></i> 编辑
|
|
</a>
|
|
<a href="javascript:;" class="hema-del tpl-table-black-operation-del"
|
|
data-id="{$item['shop_id']}">
|
|
<i class="am-icon-trash"></i> 删除
|
|
</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{/foreach}
|
|
{else /}
|
|
<tr>
|
|
<td colspan="12" class="am-text-center">暂无记录</td>
|
|
</tr>
|
|
{/if}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="am-u-lg-12 am-cf">
|
|
<div class="am-fr">{:$list->render()} </div>
|
|
<div class="am-fr pagination-total am-margin-right">
|
|
<div class="am-vertical-align-middle">总记录:{:$list->total()}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{include file="food/shop/qrcode" /}
|
|
|
|
<script>
|
|
$(function () {
|
|
let list = <?= json_encode($list)?>;
|
|
$('.hema-qrcode').click(function () {
|
|
let data = $(this).data();
|
|
$.showAction({
|
|
title: '门店码',
|
|
area: '990px',
|
|
content: template('tpl-qrcode', {qrcode:list.data[data.index].qrcode}),
|
|
uCheck: true,
|
|
btn: ['取消'],
|
|
success: function ($content) {
|
|
},
|
|
btn2: function ($content) {
|
|
return true;
|
|
}
|
|
});
|
|
});
|
|
$('.hema-paybill').click(function () {
|
|
let data = $(this).data();
|
|
$.showAction({
|
|
title: '买单码',
|
|
area: '990px',
|
|
content: template('tpl-qrcode', {qrcode:list.data[data.index].paybill}),
|
|
uCheck: true,
|
|
btn: ['取消'],
|
|
success: function ($content) {
|
|
},
|
|
btn2: function ($content) {
|
|
return true;
|
|
}
|
|
});
|
|
});
|
|
$('.hema-wifi').click(function () {
|
|
let data = $(this).data();
|
|
$.showAction({
|
|
title: 'WIFI码',
|
|
area: '990px',
|
|
content: template('tpl-qrcode', {qrcode:list.data[data.index].wifi}),
|
|
uCheck: true,
|
|
btn: ['取消'],
|
|
success: function ($content) {
|
|
},
|
|
btn2: function ($content) {
|
|
return true;
|
|
}
|
|
});
|
|
});
|
|
|
|
// 切换状态
|
|
$('.hema-status').click(function () {
|
|
var data = $(this).data();
|
|
var msg = '确定要'+(parseInt(data.status) === 1 ? '暂停营业' : '开启营业')+'吗?';
|
|
$('.hema-status').del('id', "{:url('food.shop/status')}",msg);
|
|
});
|
|
$('.hema-del').del('id', "{:url('food.shop/delete')}");// 删除元素
|
|
});
|
|
</script> |