newPageZoneList.jsp 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>专区管理管理</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. .table th {
  9. text-align: center;
  10. }
  11. .table td {
  12. text-align: center;
  13. }
  14. </style>
  15. <script type="text/javascript">
  16. $(document).ready(function () {
  17. });
  18. function page(n, s) {
  19. $("#pageNo").val(n);
  20. $("#pageSize").val(s);
  21. $("#searchForm").submit();
  22. return false;
  23. }
  24. //PC端状态修改
  25. function updateEnabledStatus(status, ids) {
  26. var msg = '确定启用该专区吗?';
  27. if ('0' == status) {
  28. msg = '确定停用该专区吗?';
  29. }
  30. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  31. if (v == 'ok') {
  32. $.post("${ctx}/newhome/newPageZone/updateEnabledStatus", {
  33. 'enabledStatus': status,
  34. 'ids': ids
  35. }, function (data) {
  36. if (true == data.success) {
  37. $.jBox.tip(data.msg, 'info');
  38. } else {
  39. $.jBox.tip(data.msg, 'error');
  40. }
  41. window.location = "${ctx}/newhome/newPageZone/";
  42. }, "JSON");//这里返回的类型有:json,html,xml,text
  43. }
  44. return;
  45. }, {buttonsFocus: 1, persistent: true});
  46. }
  47. //CRM端状态修改
  48. function updateCrmEnabledStatusByIds(status, ids) {
  49. var msg = '确定启用该专区吗?';
  50. if ('0' == status) {
  51. msg = '确定停用该专区吗?';
  52. }
  53. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  54. if (v == 'ok') {
  55. $.post("${ctx}/newhome/newPageZone/updateCrmEnabledStatusByIds", {
  56. 'crmEnabledStatus': status,
  57. 'ids': ids
  58. }, function (data) {
  59. if (true == data.success) {
  60. $.jBox.tip(data.msg, 'info');
  61. } else {
  62. $.jBox.tip(data.msg, 'error');
  63. }
  64. window.location = "${ctx}/newhome/newPageZone/";
  65. }, "JSON");//这里返回的类型有:json,html,xml,text
  66. }
  67. return;
  68. }, {buttonsFocus: 1, persistent: true});
  69. }
  70. /**
  71. * @param obj
  72. * jquery控制input只能输入数字
  73. */
  74. function onlynum(obj) {
  75. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  76. }
  77. //批量保存排序
  78. function batchSaveSort() {
  79. var items = new Array();
  80. var $items = $('.check-item');
  81. $items.each(function () {
  82. items.push($(this).val());
  83. });
  84. //保存批量排序
  85. $.post("${ctx}/newhome/newPageZone/batchSaveSort?sortList=" + items, function (data) {
  86. if (true == data.success) {
  87. $.jBox.tip(data.msg, 'info');
  88. window.location.href = "${ctx}/newhome/newPageZone";
  89. } else {
  90. $.jBox.tip(data.msg, 'error');
  91. }
  92. }, "JSON");//这里返回的类型有:json,html,xml,text
  93. }
  94. //修改排序值
  95. function changeSort(id, sortThis) {
  96. var value = sortThis.value;
  97. $("#preferredProductSort" + id).val(id + "-" + value);
  98. }
  99. </script>
  100. </head>
  101. <body>
  102. <ul class="nav nav-tabs">
  103. <li class="active"><a href="${ctx}/newhome/newPageZone/">专区管理列表</a></li>
  104. </ul>
  105. <form:form action="" class="breadcrumb form-search">
  106. <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
  107. <input class="btn btn-primary" style="width: 70px" onclick="window.location='${ctx}/newhome/newPageZone/form'"
  108. value="添加专区"/>
  109. <div style="margin-top: 10px">
  110. <label><font color="#a9a9a9">注:排序值越小越靠前</font></label>
  111. </div>
  112. </form:form>
  113. <sys:message content="${message}"/>
  114. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  115. <thead>
  116. <tr>
  117. <th>ID</th>
  118. <th>专区名称</th>
  119. <th>描述</th>
  120. <th>网站状态</th>
  121. <th>小程序状态</th>
  122. <th>排序</th>
  123. <th>创建时间</th>
  124. <th>操作</th>
  125. </tr>
  126. </thead>
  127. <tbody>
  128. <c:forEach items="${page.list}" var="newPageZone">
  129. <tr>
  130. <input class="check-item" type="hidden" id="preferredProductSort${newPageZone.id}"
  131. value='${newPageZone.id}-${newPageZone.sort}'/>
  132. <td>${newPageZone.id}</td>
  133. <td>${newPageZone.floorTitle}</td>
  134. <td>${newPageZone.floorDetail}</td>
  135. <td>
  136. <c:if test="${newPageZone.wwwEnabledStatus eq 1 }">
  137. <font color="green">已启用</font>
  138. <a href="javascript:void(0);" onclick="updateEnabledStatus('0','${newPageZone.id}');">
  139. 停用
  140. </a>
  141. </c:if>
  142. <c:if test="${newPageZone.wwwEnabledStatus ne 1 }">
  143. <font color="red">已停用</font>
  144. <a href="javascript:void(0)" onclick="updateEnabledStatus('1','${newPageZone.id}');">
  145. 启用
  146. </a>
  147. </c:if>
  148. </td>
  149. <td>
  150. <c:if test="${newPageZone.crmEnabledStatus eq 1 }">
  151. <font color="green">已启用</font>
  152. <a href="javascript:void(0);" onclick="updateCrmEnabledStatusByIds('0','${newPageZone.id}');">
  153. 停用
  154. </a>
  155. </c:if>
  156. <c:if test="${newPageZone.crmEnabledStatus ne 1 }">
  157. <font color="red">已停用</font>
  158. <a href="javascript:void(0)" onclick="updateCrmEnabledStatusByIds('1','${newPageZone.id}');">
  159. 启用
  160. </a>
  161. </c:if>
  162. </td>
  163. <td>
  164. <input type="text" id="sort" name="sort" style="width:50px;" value="${newPageZone.sort}"
  165. onkeyup="onlynum(this)" onchange="changeSort(${newPageZone.id},this)">
  166. </td>
  167. <td><fmt:formatDate value="${newPageZone.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
  168. <td>
  169. <a href="${ctx}/newhome/newPageZone/form?id=${newPageZone.id}">编辑</a>
  170. <a href="${ctx}/newhome/newPageZone/productList?zoneId=${newPageZone.id}">专区商品</a>
  171. <a href="${ctx}/newhome/newPageZone/goContentPage?floorId=${newPageZone.id}">专区轮播图</a>
  172. <a href="${ctx}/newhome/newPageZone/delete?id=${newPageZone.id}"
  173. onclick="return confirmx('确定删除该专区吗?', this.href)">删除</a>
  174. </td>
  175. </tr>
  176. </c:forEach>
  177. </tbody>
  178. </table>
  179. <div class="pagination">${page}</div>
  180. </body>
  181. </html>