52 lines
2.7 KiB
HTML
52 lines
2.7 KiB
HTML
{{define "shop/list"}}
|
|
{{template "header" .}}
|
|
|
|
<div class="toolbar">
|
|
<form class="inline grow" method="post" action="/shops/create">
|
|
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
|
|
<label for="shop-name">店铺名称</label>
|
|
<input id="shop-name" type="text" name="shop_name" maxlength="500" required placeholder="与 SYB 和蝦皮店铺名称完全一致">
|
|
<button type="submit" class="primary">新增并启用</button>
|
|
</form>
|
|
</div>
|
|
|
|
{{if .Message}}<p class="hint" role="status">{{.Message}}</p>{{end}}
|
|
{{if .Error}}<p class="missing" role="alert">{{.Error}}</p>{{end}}
|
|
<p class="hint">同一个名称用于 SYB 同步过滤和蝦皮商品关联。系统只忽略首尾空白并做精确匹配,不会模糊猜测。<a href="/shopee?unlinked=1">未登记商品 {{.UnlinkedShopeeCount}} 个</a>。</p>
|
|
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead><tr><th>店铺名称</th><th>状态</th><th>蝦皮商品</th><th>更新时间</th><th>操作</th></tr></thead>
|
|
<tbody>
|
|
{{range .Rows}}
|
|
<tr>
|
|
<td><input name="shop_name" value="{{.DisplayName}}" maxlength="500" required form="shop-edit-{{.ShopID}}"></td>
|
|
<td>{{if .Enabled}}启用{{else}}停用{{end}}</td>
|
|
<td>{{.ShopeeProductCount}}</td>
|
|
<td>{{.UpdatedAt}}</td>
|
|
<td>
|
|
<form id="shop-edit-{{.ShopID}}" class="inline" method="post" action="/shops/update">
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}"><input type="hidden" name="shop_id" value="{{.ShopID}}">
|
|
<button type="submit">保存</button>
|
|
</form>
|
|
<form class="inline" method="post" action="/shops/status">
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}"><input type="hidden" name="shop_id" value="{{.ShopID}}"><input type="hidden" name="enabled" value="{{if .Enabled}}0{{else}}1{{end}}">
|
|
<button type="submit">{{if .Enabled}}停用店铺{{else}}启用店铺{{end}}</button>
|
|
</form>
|
|
{{if not .Enabled}}
|
|
<form class="inline" method="post" action="/shops/delete" data-confirm-submit="确定删除停用店铺“{{.DisplayName}}”吗?有关联商品或货运单时系统会拒绝删除。">
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}"><input type="hidden" name="shop_id" value="{{.ShopID}}"><button type="submit" class="danger">删除</button>
|
|
</form>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr class="empty"><td colspan="5">还没有店铺。填写与 SYB、蝦皮数据一致的店铺名称即可新增。</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="statusbar"><span class="grow"></span><span>共 {{len .Rows}} 个店铺</span></div>
|
|
{{template "footer" .}}
|
|
{{end}}
|