list.htm 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ##tlayout("admin/layout.htm"){
  2. <div class="breadcrumbs" style="padding-top:10px;height: 50px;">
  3. <div class="col-xs-12">
  4. <a class="btn btn-info btn-sm" style="margin-top: -12px;margin-left: 10px;" href="javascript:showAlert('/admin/bottle/add')">+添加瓶子</a>
  5. </div>
  6. </div>
  7. <div class="page-content">
  8. <div class="row" style="margin-top:10px;">
  9. <div class="col-xs-12">
  10. <div class="alert alert-block alert-success">
  11. <div style="float: left;">注意事项:</div>
  12. <div style="float: left;">
  13. <div>1.瓶子启用之前请确认瓶子信息准确无误,否则定制信息生成将无法修改</div>
  14. <div>2.瓶子启用之前请确认有水源可选,否则客户无法完成加购物车,下单等后续操作</div>
  15. </div>
  16. <div style="clear: both;"></div>
  17. </div>
  18. </div>
  19. <div class="col-xs-12">
  20. <div class="table-responsive">
  21. <table class="table table-striped table-bordered table-hover">
  22. <thead>
  23. <tr>
  24. <th>名称</th>
  25. <th>水源</th>
  26. <th>重量/g</th>
  27. <th>图片</th>
  28. <th>标签尺寸/mm</th>
  29. <th>状态</th>
  30. <th>操作</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. ##if(results!=null && results.list.~size!=0){
  35. ##for(_item in results.list!){
  36. <tr>
  37. <td>${_item.title!}</td>
  38. <td>
  39. ##for(_type in _item.type_list!){
  40. <div style="margin-top: 5px;">${_type.title!}:${_type.price!}元</div>
  41. ##}
  42. </td>
  43. <td>${_item.weight!}</td>
  44. <td>
  45. <a href="${_item.img_url!}" target="_blank"><img src="${_item.img_url!}" style="height:100px;" /></a>
  46. </td>
  47. <td>${_item.diy_width!}mm * ${_item.diy_height!}mm</td>
  48. <td>
  49. ##if(_item.status==1){
  50. 启用
  51. ##}else{
  52. 禁用
  53. ##}
  54. </td>
  55. <td style="width:100px;">
  56. <div class="btn-group">
  57. <button class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
  58. 操作<span class="icon-caret-down icon-on-right"></span>
  59. </button>
  60. <ul class="dropdown-menu dropdown-info pull-right">
  61. <li><a href="javascript:showAlert('/admin/bottle/edit?id=${_item.id!}')">编辑</a></li>
  62. <li><a href="/admin/bottle/type?id=${_item.id!}">水源管理</a></li>
  63. ##if(_item.status==1){
  64. <li><a href="javascript:changeStatus(${_item.id!}, 0, '禁用')">禁用</a></li>
  65. ##}else{
  66. <li><a href="javascript:changeStatus(${_item.id!}, 1, '启用')">启用</a></li>
  67. ##}
  68. <li><a href="javascript:changeStatus(${_item.id!}, 9, '删除')">删除</a></li>
  69. </ul>
  70. </div>
  71. </td>
  72. </tr>
  73. ##}
  74. ##}
  75. </tbody>
  76. </table>
  77. ##if(totalPage>1){
  78. <div class="fenye">
  79. <#_pagination page="${results!}">
  80. <ul id="Pagination"></ul>
  81. </#_pagination>
  82. </div>
  83. ##}
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <script>
  89. function changeStatus(id, status, msg){
  90. if(confirm("确定要" + msg + "该记录吗?")){
  91. $.post("/admin/bottle/changeStatus",{id:id,status:status},function(data){
  92. alert(data.msg);
  93. if(data.success){
  94. location.reload();
  95. }
  96. });
  97. }
  98. }
  99. </script>
  100. ##}