cmImageList.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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{text-align: center;}
  9. .table td{text-align: center;}
  10. .topSelect{
  11. width: 80px;
  12. position: absolute;
  13. right: 65px;
  14. background-color: white;
  15. }
  16. </style>
  17. <script type="text/javascript">
  18. $(document).ready(function() {
  19. });
  20. function page(n,s){
  21. $("#pageNo").val(n);
  22. $("#pageSize").val(s);
  23. $("#searchForm").submit();
  24. return false;
  25. }
  26. //PC端状态修改
  27. function updateEnabledStatus(status,ids){
  28. var msg='确定开启?';
  29. if('0'==status){
  30. msg='确定停用?';
  31. }
  32. top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
  33. if(v=='ok'){
  34. $.post("${ctx}/cmpage/cmImage/updateEnabledStatus",{'enabledStatus':status,'ids':ids}, function(data) {
  35. if(true==data.success){
  36. $.jBox.tip(data.msg, 'info');
  37. } else {
  38. $.jBox.tip(data.msg,'error');
  39. }
  40. $("#searchForm").submit();
  41. },"JSON");//这里返回的类型有:json,html,xml,text
  42. }
  43. return;
  44. },{buttonsFocus:1,persistent: true});
  45. }
  46. //小程序端状态修改
  47. function updateAppletsEnabledStatus(status,ids){
  48. var msg='确定开启?';
  49. if('0'==status){
  50. msg='确定停用?';
  51. }
  52. top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
  53. if(v=='ok'){
  54. $.post("${ctx}/cmpage/cmImage/updateAppletsEnabledStatus",{'enabledStatus':status,'ids':ids}, function(data) {
  55. if(true==data.success){
  56. $.jBox.tip(data.msg, 'info');
  57. } else {
  58. $.jBox.tip(data.msg,'error');
  59. }
  60. $("#searchForm").submit();
  61. },"JSON");//这里返回的类型有:json,html,xml,text
  62. }
  63. return;
  64. },{buttonsFocus:1,persistent: true});
  65. }
  66. //CRM端状态修改
  67. function updateCrmEnabledStatusByIds(status,ids){
  68. var msg='确定开启?';
  69. if('0'==status){
  70. msg='确定停用?';
  71. }
  72. top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
  73. if(v=='ok'){
  74. $.post("${ctx}/cmpage/cmImage/updateCrmEnabledStatusByIds",{'crmEnabledStatus':status,'ids':ids}, function(data) {
  75. if(true==data.success){
  76. $.jBox.tip(data.msg, 'info');
  77. } else {
  78. $.jBox.tip(data.msg,'error');
  79. }
  80. $("#searchForm").submit();
  81. },"JSON");//这里返回的类型有:json,html,xml,text
  82. }
  83. return;
  84. },{buttonsFocus:1,persistent: true});
  85. }
  86. //展示置顶选项
  87. function showTopSelect(index,status) {
  88. var homePageImage = $("#homePageImage" + index).text();
  89. if (homePageImage != "") {
  90. if ('open' == status) {
  91. document.getElementById("topSelect" + index).style.cssText = "display:block";
  92. }else if ('close' == status) {
  93. document.getElementById("topSelect" + index).style.cssText = "display:none";
  94. }
  95. }else {
  96. alertx("请先去编辑页面上传商城首页图再置顶")
  97. }
  98. }
  99. //更新置顶
  100. function updateTopPosition(topPosition,id,type) {
  101. debugger
  102. var msg = '';
  103. if ('setTopPosition' == type) {
  104. msg = '确认置顶该活动吗?';
  105. //已有的置顶活动数量
  106. var topLength = ${topLength};
  107. if (topPosition - 1 > topLength) {
  108. var emptyPosition = topLength == 0 ? '一' : '二' ;
  109. msg = '由于当前没有第'+ emptyPosition +'位的置顶活动,将直接把该条活动置顶为第'+emptyPosition+'位';
  110. topPosition = topLength == 0 ? 1 : topLength == 1 ? 2 : topLength == 2 ? 3 : topLength == 3 ? 4 : 5;
  111. }
  112. }
  113. if ('clearTopPosition' == type) {
  114. msg = '确认清除该条数据的置顶位吗?清除后这条数据将不会在商城首页展示';
  115. }
  116. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  117. if (v == 'ok') {
  118. $.post("${ctx}/cmpage/cmImage/updateTopPosition", {
  119. 'topPosition': topPosition,
  120. 'id': id,
  121. 'type':type
  122. }, function (data) {
  123. if (true == data.success) {
  124. $.jBox.tip(data.msg, 'info');
  125. } else {
  126. $.jBox.tip(data.msg, 'error');
  127. }
  128. setTimeout(function () {
  129. $("#searchForm").submit();
  130. },800)
  131. }, "JSON");//这里返回的类型有:json,html,xml,text
  132. }
  133. return;
  134. }, {buttonsFocus: 1, persistent: true});
  135. }
  136. </script>
  137. </head>
  138. <body>
  139. <ul class="nav nav-tabs">
  140. <li class="active"><a href="${ctx}/cmpage/cmImage/?type=${cmImage.type}&flag=${cmImage.flag}">
  141. <c:if test="${cmImage.flag eq 4}">活动专区列表</c:if>
  142. <c:if test="${cmImage.flag ne 4}">图片链接列表</c:if>
  143. </a>
  144. </li>
  145. <shiro:hasPermission name="cmpage:cmImage:edit"><li><a href="${ctx}/cmpage/cmImage/form?flag=${cmImage.flag}&type=${cmImage.type}">
  146. <c:if test="${cmImage.flag eq 4}">
  147. 活动专区图添加
  148. </c:if>
  149. <c:if test="${empty cmImage.flag}">
  150. 图片链接添加
  151. </c:if>
  152. </a></li>
  153. </shiro:hasPermission>
  154. </ul>
  155. <form:form id="searchForm" modelAttribute="cmImage" action="${ctx}/cmpage/cmImage/?flag=${empty cmImage.flag?null:(cmImage.flag)}" method="post" class="breadcrumb form-search">
  156. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  157. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  158. <div class="ul-form">
  159. <label>ID:</label>
  160. <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
  161. <label>标题:</label>
  162. <form:input path="title" htmlEscape="false" maxlength="40" class="input-small"/>
  163. <c:if test="${cmImage.flag ne 4}">
  164. <label>类型:</label>
  165. <form:select path="type" class="input-small">
  166. <form:option value="" label=" "/>
  167. <form:options items="${fns:getDictList('imagePage_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  168. </form:select>
  169. </c:if>
  170. <label>PC端状态:</label>
  171. <form:select path="enabledStatus" class="input-small">
  172. <form:option value="" label=" "/>
  173. <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  174. </form:select>
  175. <label>小程序端状态:</label>
  176. <form:select path="crmEnabledStatus" class="input-small">
  177. <form:option value="" label=" "/>
  178. <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  179. </form:select>
  180. <label>活动状态:</label>
  181. <form:select path="actStatus" class="input-mini">
  182. <form:option value="" label="全部"/>
  183. <form:option value="1" label="未开始"/>
  184. <form:option value="2" label="进行中"/>
  185. <form:option value="3" label="已结束"/>
  186. </form:select>
  187. <label>首页置顶:</label>
  188. <form:select path="topFlag" class="input-mini">
  189. <form:option value="" label="全部"/>
  190. <form:option value="1" label="是"/>
  191. <form:option value="0" label="否"/>
  192. </form:select>
  193. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
  194. <c:if test="${cmImage.flag eq 4}">
  195. <label style="float:right;">活动专区首页:<a href="${fns:getConfig('wwwServer')}cmpage/area.html" target="_blank">${fns:getConfig('wwwServer')}cmpage/area.html</a></label>
  196. </c:if>
  197. <div class="clearfix"></div>
  198. </div>
  199. </form:form>
  200. <sys:message content="${message}"/>
  201. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  202. <thead>
  203. <tr>
  204. <th>ID</th>
  205. <th>标题</th>
  206. <th>PC端图片</th>
  207. <c:if test="${cmImage.flag ne 4}">
  208. <th>类型</th>
  209. </c:if>
  210. <th>PC端状态</th>
  211. <th>小程序端状态</th>
  212. <c:if test="${cmImage.flag eq 4}">
  213. <th>活动时间</th>
  214. <th>首页置顶位</th>
  215. <th>活动状态</th>
  216. </c:if>
  217. <th>排序</th>
  218. <th>创建时间</th>
  219. <shiro:hasPermission name="cmpage:cmImage:edit"><th>操作</th></shiro:hasPermission>
  220. </tr>
  221. </thead>
  222. <tbody>
  223. <c:forEach items="${page.list}" var="items" varStatus="index">
  224. <tr>
  225. <td>${items.id}</td>
  226. <td>${items.title}</td>
  227. <td><img src="${items.image}" style="width: 160px;height: 100px;"></td>
  228. <c:if test="${cmImage.flag ne 4}">
  229. <td>${fns:getDictLabel(items.type,"imagePage_type","" )}</td>
  230. </c:if>
  231. <c:if test="${cmImage.flag ne 4}">
  232. <%--crm状态控制--%>
  233. <td>
  234. <c:if test="${not empty items.crmEnabledStatus}">
  235. <shiro:hasPermission name="cmpage:cmImage:edit">
  236. <c:if test="${items.crmEnabledStatus eq 1 }">
  237. <a href="javascript:void(0);" onclick="updateCrmEnabledStatusByIds('0','${items.id}');" >
  238. <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
  239. </a>
  240. </c:if>
  241. <c:if test="${items.crmEnabledStatus ne 1 }">
  242. <a href="javascript:void(0)" onclick="updateCrmEnabledStatusByIds('1','${items.id}');">
  243. <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
  244. </a>
  245. </c:if>
  246. </shiro:hasPermission>
  247. </c:if>
  248. <c:if test="${empty items.crmEnabledStatus}">
  249. ----
  250. </c:if>
  251. </td>
  252. </c:if>
  253. <%--PC端状态控制--%>
  254. <td>
  255. <shiro:hasPermission name="cmpage:cmImage:edit">
  256. <c:if test="${items.enabledStatus eq 1 }">
  257. <a href="javascript:void(0);" onclick="updateEnabledStatus('0','${items.id}');" >
  258. <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
  259. </a>
  260. </c:if>
  261. <c:if test="${items.enabledStatus ne 1 }">
  262. <a href="javascript:void(0)" onclick="updateEnabledStatus('1','${items.id}');">
  263. <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
  264. </a>
  265. </c:if>
  266. </shiro:hasPermission>
  267. </td>
  268. <%--小程序端状态控制--%>
  269. <td>
  270. <shiro:hasPermission name="cmpage:cmImage:edit">
  271. <c:if test="${items.appletsEnabledStatus eq 1 }">
  272. <a href="javascript:void(0);" onclick="updateAppletsEnabledStatus('0','${items.id}');" >
  273. <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
  274. </a>
  275. </c:if>
  276. <c:if test="${items.appletsEnabledStatus ne 1 }">
  277. <a href="javascript:void(0)" onclick="updateAppletsEnabledStatus('1','${items.id}');">
  278. <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
  279. </a>
  280. </c:if>
  281. </shiro:hasPermission>
  282. </td>
  283. <c:if test="${cmImage.flag eq 4}">
  284. <td>${items.beginTimeStr}~${items.endTimeStr}</td>
  285. <td>${items.topPosition}</td>
  286. <td>
  287. <%--活动状态 1:未开始 2:进行中 3:已结束--%>
  288. <c:if test="${items.actStatus eq 1}">
  289. 未开始
  290. </c:if>
  291. <c:if test="${items.actStatus eq 2}">
  292. 进行中
  293. </c:if>
  294. <c:if test="${items.actStatus eq 3}">
  295. 已结束
  296. </c:if>
  297. <c:if test="${empty items.actStatus}">
  298. --
  299. </c:if>
  300. </td>
  301. </c:if>
  302. <td>${items.sort}</td>
  303. <td><fmt:formatDate value="${items.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
  304. <td hidden>
  305. <label id="homePageImage${index.index}">${items.homePageImage}</label>
  306. </td>
  307. <shiro:hasPermission name="cmpage:cmImage:edit"><td>
  308. <a href="${ctx}/cmpage/cmImage/form?id=${items.id}&flag=${cmImage.flag}">编辑</a>
  309. <shiro:hasPermission name="cmpage:cmImage:delete">
  310. <a href="${ctx}/cmpage/cmImage/delete?id=${items.id}&falg=${items.flag}&type=${items.type}" onclick="return confirmx('确认要删除该图片及链接管理吗?', this.href)">删除</a>
  311. </shiro:hasPermission>
  312. <a onclick="showTopSelect(${index.index},'open')" ${items.actStatus ne 2? 'hidden="hidden"':''} href="javascript:void(0)">首页置顶</a>
  313. <c:if test="${items.topPosition ne null}">
  314. <a onclick="updateTopPosition('','${items.id}','clearTopPosition')" href="javascript:void(0)">清除置顶</a>
  315. </c:if>
  316. <div style="display: none" class="topSelect" id="topSelect${index.index}" onmouseleave="showTopSelect(${index.index},'close')">
  317. <table style="border: 2px solid #000000;" cellpadding="0" cellspacing="0">
  318. <tbody>
  319. <tr>
  320. <td><a onclick="updateTopPosition('1',${items.id},'setTopPosition')" href="javascript:void(0)">置顶第一位</a></td>
  321. </tr>
  322. <tr>
  323. <td><a onclick="updateTopPosition('2',${items.id},'setTopPosition')" href="javascript:void(0)">置顶第二位</a></td>
  324. </tr>
  325. <tr>
  326. <td><a onclick="updateTopPosition('3',${items.id},'setTopPosition')" href="javascript:void(0)">置顶第三位</a></td>
  327. </tr>
  328. </tbody>
  329. </table>
  330. </div>
  331. </td></shiro:hasPermission>
  332. </tr>
  333. </c:forEach>
  334. </tbody>
  335. </table>
  336. <div class="pagination">${page}</div>
  337. </body>
  338. </html>