Files
order/web/templates/food/index.html

99 lines
4.1 KiB
HTML
Raw Normal View History

2019-07-18 08:59:26 +08:00
{% extends "common/layout_main.html" %}
{% block content %}
2019-08-02 18:24:04 +08:00
{% include "common/tab_food.html" %}
2019-07-18 08:59:26 +08:00
<div class="row">
<div class="col-lg-12">
<form class="form-inline wrap_search">
<div class="row m-t p-w-m">
<div class="form-group">
<select name="status" class="form-control inline">
<option value="-1">请选择状态</option>
2019-08-02 18:24:04 +08:00
{% for tmp_key in status_mapping %}
<option value="{{ tmp_key }}" {% if tmp_key == search_con['status'] %} selected {% endif %}>{{ status_mapping[ tmp_key ] }}</option>
{% endfor %}
2019-07-18 08:59:26 +08:00
</select>
</div>
<div class="form-group">
<select name="cat_id" class="form-control inline">
<option value="0">请选择分类</option>
2019-08-02 18:24:04 +08:00
{% for tmp_key in cat_mapping %}
<option value="{{ tmp_key }}" {% if tmp_key|string == search_con['cat_id'] %} selected {% endif %} >{{ cat_mapping[ tmp_key].name }}</option>
{% endfor %}
2019-07-18 08:59:26 +08:00
</select>
</div>
<div class="form-group">
<div class="input-group">
2019-08-02 18:24:04 +08:00
<input type="text" name="mix_kw" placeholder="请输入关键字" class="form-control" value="{{ search_con['mix_kw'] }}">
<input type="hidden" name="p" value="{{ search_con['p'] }}">
2019-07-18 08:59:26 +08:00
<span class="input-group-btn">
<button type="button" class="btn btn-primary search">
<i class="fa fa-search"></i>搜索
</button>
</span>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-lg-12">
<a class="btn btn-w-m btn-outline btn-primary pull-right" href="{{ buildUrl('/food/set') }}">
<i class="fa fa-plus"></i>美食
</a>
</div>
</div>
</form>
<table class="table table-bordered m-t">
<thead>
<tr>
<th>美食名</th>
<th>分类</th>
<th>价格</th>
<th>库存</th>
<th>标签</th>
<th>操作</th>
</tr>
</thead>
<tbody>
2019-08-02 18:24:04 +08:00
{% if list %}
{% for item in list %}
2019-07-18 08:59:26 +08:00
<tr>
2019-08-02 18:24:04 +08:00
<td>{{ item.name }}</td>
<td>{{ cat_mapping[ item.cat_id].name }}</td>
<td>{{ item.price }}</td>
<td>{{ item.stock }}</td>
<td>{{ item.tags }}</td>
2019-07-18 08:59:26 +08:00
<td>
2019-08-02 18:24:04 +08:00
<a href="{{ buildUrl('/food/info') }}?id={{ item.id }}">
2019-07-18 08:59:26 +08:00
<i class="fa fa-eye fa-lg"></i>
</a>
2019-08-02 18:24:04 +08:00
{% if item.status == 1 %}
<a class="m-l" href="{{ buildUrl('/food/set') }}?id={{ item.id }}">
2019-07-18 08:59:26 +08:00
<i class="fa fa-edit fa-lg"></i>
</a>
2019-08-02 18:24:04 +08:00
<a class="m-l remove" href="javascript:void(0);" data="{{ item.id }}">
2019-07-18 08:59:26 +08:00
<i class="fa fa-trash fa-lg"></i>
</a>
2019-08-02 18:24:04 +08:00
{% else %}
<a class="m-l recover" href="javascript:void(0);" data="{{ item.id }}">
<i class="fa fa-rotate-left fa-lg"></i>
</a>
{% endif %}
2019-07-18 08:59:26 +08:00
</td>
</tr>
2019-08-02 18:24:04 +08:00
{% endfor %}
{% else %}
<tr><td colspan="6">暂无数据~~</td></tr>
{% endif %}
2019-07-18 08:59:26 +08:00
</tbody>
</table>
2019-08-02 18:24:04 +08:00
<!--分页代码已被封装到统一模板文件中-->
{% include 'common/pagenation.html' %}
2019-07-18 08:59:26 +08:00
</div>
</div>
{% endblock %}
2019-08-02 18:24:04 +08:00
{% block js %}
<script src="{{ buildStaticUrl('/js/food/index.js') }}"></script>
{% endblock %}