Authored by dongjunjie

物理类目优化

... ... @@ -66,11 +66,11 @@
<div class="form-group">
<label class="col-md-2 control-label">状态</label>
<div class="col-md-5">
<div class="col-md-5 form-inline">
<div class="radio">
<label><input type="radio" value="1" name="status">开启</label>
</div>
<div class="radio">
<div class="radio" style="margin-left: 10px">
<label><input type="radio" value="0" name="status">关闭</label>
</div>
<input id="status" type="hidden" value="[[status||'0']]" for="radio">
... ...
<%include '../../common/views/__ui/header'%>
<%include '../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="contentpanel">
<div style="margin-bottom: 20px">
<a href="/product/class/new" class="btn btn-success"><i class="fa fa-plus"></i> 添加品类</a>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading noborder">
<a href="/product/class/new" class="btn btn-success"><i class="glyphicon-plus"></i>添加品类</a>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel">
<div class="panel-body nopadding">
<div class="table-responsive">
<table class="table table-bordered toggle-table">
<thead>
... ... @@ -29,30 +25,33 @@
<tbody>
<%if data%>
<%each data as item%>
<tr class="level<%item.sortLevel%> <%if item.child%>hidden<%/if%>" data-parent="<%item.parentId%>" data-val="<%item.id%>" data-status="close">
<td class="toggle-td"><span class="glyphicon glyphicon-folder-close"></span></td>
<td><%item.id%></td>
<td><%item.sortName%></td>
<td><%item.sortInitials%></td>
<td><%item.sortLevel%>级分类</td>
<td><%item.orderBy%></td>
<td>
<%if item.booleanStatus%>开启<%else%>关闭<%/if%>
</td>
<td data-id="<%item.id%>">
<a href="/product/class/edit/<%item.id%>" class="btn btn-success btn-xs edit-class-btn">编辑</a>
<a href="" class="btn btn-xs open-close-btn <%if item.booleanStatus%>btn-danger <%else%>btn-warning<%/if%>" data-status="<%item.status%>">
<%if item.booleanStatus%>开启<%else%>关闭<%/if%>
</a>
</td>
</tr>
<%/each%>
<%/if%>
<%each data as item%>
<tr class="level<%item.sortLevel%> <%if item.child%>hidden<%/if%>" data-parent="<%item.parentId%>"
data-val="<%item.id%>" data-status="close">
<td class="toggle-td"><span class="glyphicon glyphicon-folder-close"></span></td>
<td><%item.id%></td>
<td><%item.sortName%></td>
<td><%item.sortInitials%></td>
<td><%item.sortLevel%>级分类</td>
<td><%item.orderBy%></td>
<td><%if item.booleanStatus%>开启<%else%>关闭<%/if%></td>
<td data-id="<%item.id%>">
<a href="/product/class/edit/<%item.id%>"
class="btn btn-info btn-xs edit-class-btn">编辑</a>
<a href=""
class="btn btn-xs open-close-btn <%if item.booleanStatus%>btn-success <%else%>btn-danger<%/if%>"
data-status="<%item.status%>">
<%if item.booleanStatus%>开启<%else%>关闭<%/if%>
</a>
</td>
</tr>
<%/each%>
<%/if%>
</tbody>
</table>
</div>
</div>
</div>
</div>
<%include '../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
... ... @@ -5,8 +5,7 @@
var $ = require('jquery');
var common=require('../../common/common');
//列表展示效果
var $toggleTd = $('.toggle-td');
... ... @@ -89,11 +88,13 @@ var $ = require('jquery');
if ($target.hasClass('btn-danger')) {
$target.text('开启');
$target.removeClass('btn-danger')
.addClass('btn-warning').closest('td').prev('td').text('关闭');
.addClass('btn-success').closest('td').prev('td').text('关闭');
common.util.__tip("关闭成功!",'success');
} else {
$target.text('关闭');
$target.removeClass('btn-warning')
$target.removeClass('btn-success')
.addClass('btn-danger').closest('td').prev('td').text('开启');
common.util.__tip("开启成功!",'success');
}
}
... ...