Authored by dongjunjie

物理类目优化

@@ -66,11 +66,11 @@ @@ -66,11 +66,11 @@
66 66
67 <div class="form-group"> 67 <div class="form-group">
68 <label class="col-md-2 control-label">状态</label> 68 <label class="col-md-2 control-label">状态</label>
69 - <div class="col-md-5"> 69 + <div class="col-md-5 form-inline">
70 <div class="radio"> 70 <div class="radio">
71 <label><input type="radio" value="1" name="status">开启</label> 71 <label><input type="radio" value="1" name="status">开启</label>
72 </div> 72 </div>
73 - <div class="radio"> 73 + <div class="radio" style="margin-left: 10px">
74 <label><input type="radio" value="0" name="status">关闭</label> 74 <label><input type="radio" value="0" name="status">关闭</label>
75 </div> 75 </div>
76 <input id="status" type="hidden" value="[[status||'0']]" for="radio"> 76 <input id="status" type="hidden" value="[[status||'0']]" for="radio">
1 <%include '../../common/views/__ui/header'%> 1 <%include '../../common/views/__ui/header'%>
2 <%include '../../common/views/__partail/ListHeader'%> 2 <%include '../../common/views/__partail/ListHeader'%>
3 -<div class="contentpanel">  
4 3
  4 +<div class="contentpanel">
  5 + <div style="margin-bottom: 20px">
  6 + <a href="/product/class/new" class="btn btn-success"><i class="fa fa-plus"></i> 添加品类</a>
  7 + </div>
5 8
6 - <div class="row">  
7 - <div class="col-md-12">  
8 - <div class="panel panel-default">  
9 - <div class="panel-heading noborder">  
10 - <a href="/product/class/new" class="btn btn-success"><i class="glyphicon-plus"></i>添加品类</a>  
11 - </div>  
12 - </div>  
13 - </div>  
14 - <div class="col-md-12"> 9 + <div class="panel">
  10 + <div class="panel-body nopadding">
15 <div class="table-responsive"> 11 <div class="table-responsive">
16 <table class="table table-bordered toggle-table"> 12 <table class="table table-bordered toggle-table">
17 <thead> 13 <thead>
@@ -29,30 +25,33 @@ @@ -29,30 +25,33 @@
29 <tbody> 25 <tbody>
30 26
31 <%if data%> 27 <%if data%>
32 - <%each data as item%>  
33 - <tr class="level<%item.sortLevel%> <%if item.child%>hidden<%/if%>" data-parent="<%item.parentId%>" data-val="<%item.id%>" data-status="close">  
34 - <td class="toggle-td"><span class="glyphicon glyphicon-folder-close"></span></td>  
35 - <td><%item.id%></td>  
36 - <td><%item.sortName%></td>  
37 - <td><%item.sortInitials%></td>  
38 - <td><%item.sortLevel%>级分类</td>  
39 - <td><%item.orderBy%></td>  
40 - <td>  
41 - <%if item.booleanStatus%>开启<%else%>关闭<%/if%>  
42 - </td>  
43 - <td data-id="<%item.id%>">  
44 - <a href="/product/class/edit/<%item.id%>" class="btn btn-success btn-xs edit-class-btn">编辑</a>  
45 - <a href="" class="btn btn-xs open-close-btn <%if item.booleanStatus%>btn-danger <%else%>btn-warning<%/if%>" data-status="<%item.status%>">  
46 - <%if item.booleanStatus%>开启<%else%>关闭<%/if%>  
47 - </a>  
48 - </td>  
49 - </tr>  
50 - <%/each%>  
51 - <%/if%> 28 + <%each data as item%>
  29 + <tr class="level<%item.sortLevel%> <%if item.child%>hidden<%/if%>" data-parent="<%item.parentId%>"
  30 + data-val="<%item.id%>" data-status="close">
  31 + <td class="toggle-td"><span class="glyphicon glyphicon-folder-close"></span></td>
  32 + <td><%item.id%></td>
  33 + <td><%item.sortName%></td>
  34 + <td><%item.sortInitials%></td>
  35 + <td><%item.sortLevel%>级分类</td>
  36 + <td><%item.orderBy%></td>
  37 + <td><%if item.booleanStatus%>开启<%else%>关闭<%/if%></td>
  38 + <td data-id="<%item.id%>">
  39 + <a href="/product/class/edit/<%item.id%>"
  40 + class="btn btn-info btn-xs edit-class-btn">编辑</a>
  41 + <a href=""
  42 + class="btn btn-xs open-close-btn <%if item.booleanStatus%>btn-success <%else%>btn-danger<%/if%>"
  43 + data-status="<%item.status%>">
  44 + <%if item.booleanStatus%>开启<%else%>关闭<%/if%>
  45 + </a>
  46 + </td>
  47 + </tr>
  48 + <%/each%>
  49 + <%/if%>
52 </tbody> 50 </tbody>
53 </table> 51 </table>
54 </div> 52 </div>
55 </div> 53 </div>
56 </div> 54 </div>
57 </div> 55 </div>
  56 +
58 <%include '../../common/views/__ui/footer'%> 57 <%include '../../common/views/__ui/footer'%>
@@ -5,8 +5,7 @@ @@ -5,8 +5,7 @@
5 5
6 6
7 var $ = require('jquery'); 7 var $ = require('jquery');
8 -  
9 - 8 +var common=require('../../common/common');
10 //列表展示效果 9 //列表展示效果
11 10
12 var $toggleTd = $('.toggle-td'); 11 var $toggleTd = $('.toggle-td');
@@ -89,11 +88,13 @@ var $ = require('jquery'); @@ -89,11 +88,13 @@ var $ = require('jquery');
89 if ($target.hasClass('btn-danger')) { 88 if ($target.hasClass('btn-danger')) {
90 $target.text('开启'); 89 $target.text('开启');
91 $target.removeClass('btn-danger') 90 $target.removeClass('btn-danger')
92 - .addClass('btn-warning').closest('td').prev('td').text('关闭'); 91 + .addClass('btn-success').closest('td').prev('td').text('关闭');
  92 + common.util.__tip("关闭成功!",'success');
93 } else { 93 } else {
94 $target.text('关闭'); 94 $target.text('关闭');
95 - $target.removeClass('btn-warning') 95 + $target.removeClass('btn-success')
96 .addClass('btn-danger').closest('td').prev('td').text('开启'); 96 .addClass('btn-danger').closest('td').prev('td').text('开启');
  97 + common.util.__tip("开启成功!",'success');
97 } 98 }
98 99
99 } 100 }