65 lines
3.9 KiB
HTML
65 lines
3.9 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="display-name">业务店铺</label>
|
||
|
|
<input id="display-name" type="text" name="display_name" maxlength="500" required placeholder="页面统一显示名称">
|
||
|
|
<label for="syb-alias">SYB 名称</label>
|
||
|
|
<input id="syb-alias" type="text" name="syb_alias" maxlength="500" placeholder="与 SYB shopName 完全一致">
|
||
|
|
<label for="shopee-alias">蝦皮名称</label>
|
||
|
|
<input id="shopee-alias" type="text" name="shopee_alias" maxlength="500" placeholder="与导入店铺名完全一致">
|
||
|
|
<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 和蝦皮名称是各渠道原始名称。系统只做忽略首尾空白后的精确匹配,不会模糊猜测。当前有 {{.UnlinkedShopeeCount}} 个蝦皮商品待关联。</p>
|
||
|
|
|
||
|
|
<div class="table-wrap">
|
||
|
|
<table>
|
||
|
|
<thead><tr><th>业务店铺</th><th>全局状态</th><th>SYB 名称</th><th>SYB 同步</th><th>蝦皮名称</th><th>蝦皮商品</th><th>更新时间</th><th>操作</th></tr></thead>
|
||
|
|
<tbody>
|
||
|
|
{{range .Rows}}
|
||
|
|
<tr>
|
||
|
|
<td><input name="display_name" value="{{.DisplayName}}" maxlength="500" required form="shop-edit-{{.ShopID}}"></td>
|
||
|
|
<td>{{if .Enabled}}启用{{else}}停用{{end}}</td>
|
||
|
|
<td><input name="syb_alias" value="{{.SybAlias}}" maxlength="500" placeholder="未配置" form="shop-edit-{{.ShopID}}"></td>
|
||
|
|
<td>{{if .SybAlias}}{{if and .Enabled .SybSyncEnabled}}同步{{else}}不进入同步{{end}}{{else}}—{{end}}</td>
|
||
|
|
<td><input name="shopee_alias" value="{{.ShopeeAlias}}" maxlength="500" placeholder="未配置" form="shop-edit-{{.ShopID}}"></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 .SybAlias}}
|
||
|
|
<form class="inline" method="post" action="/shops/syb-status">
|
||
|
|
<input type="hidden" name="csrf_token" value="{{$.CSRFToken}}"><input type="hidden" name="shop_id" value="{{.ShopID}}"><input type="hidden" name="enabled" value="{{if .SybSyncEnabled}}0{{else}}1{{end}}">
|
||
|
|
<button type="submit">{{if .SybSyncEnabled}}停用 SYB{{else}}启用 SYB{{end}}</button>
|
||
|
|
</form>
|
||
|
|
{{end}}
|
||
|
|
{{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="8">还没有业务店铺。至少填写一个渠道名称后即可新增。</td></tr>
|
||
|
|
{{end}}
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
<div class="statusbar"><span class="grow"></span><span>共 {{len .Rows}} 个业务店铺</span></div>
|
||
|
|
{{template "footer" .}}
|
||
|
|
{{end}}
|