123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
- <html>
- <head>
- <title>活动专区</title>
- <meta name="decorator" content="default"/>
- <style type="text/css">
- .table th{text-align: center;}
- .table td{text-align: center;}
- .topSelect{
- width: 80px;
- position: absolute;
- right: 65px;
- background-color: white;
- }
- </style>
- <script type="text/javascript">
- $(document).ready(function() {
-
- });
- function page(n,s){
- $("#pageNo").val(n);
- $("#pageSize").val(s);
- $("#searchForm").submit();
- return false;
- }
- //PC端状态修改
- function updateEnabledStatus(status,ids){
- var msg='确定开启?';
- if('0'==status){
- msg='确定停用?';
- }
- top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
- if(v=='ok'){
- $.post("${ctx}/cmpage/cmImage/updateEnabledStatus",{'enabledStatus':status,'ids':ids}, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg,'error');
- }
- $("#searchForm").submit();
- },"JSON");//这里返回的类型有:json,html,xml,text
- }
- return;
- },{buttonsFocus:1,persistent: true});
- }
- //小程序端状态修改
- function updateAppletsEnabledStatus(status,ids){
- var msg='确定开启?';
- if('0'==status){
- msg='确定停用?';
- }
- top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
- if(v=='ok'){
- $.post("${ctx}/cmpage/cmImage/updateAppletsEnabledStatus",{'enabledStatus':status,'ids':ids}, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg,'error');
- }
- $("#searchForm").submit();
- },"JSON");//这里返回的类型有:json,html,xml,text
- }
- return;
- },{buttonsFocus:1,persistent: true});
- }
- //CRM端状态修改
- function updateCrmEnabledStatusByIds(status,ids){
- var msg='确定开启?';
- if('0'==status){
- msg='确定停用?';
- }
- top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
- if(v=='ok'){
- $.post("${ctx}/cmpage/cmImage/updateCrmEnabledStatusByIds",{'crmEnabledStatus':status,'ids':ids}, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg,'error');
- }
- $("#searchForm").submit();
- },"JSON");//这里返回的类型有:json,html,xml,text
- }
- return;
- },{buttonsFocus:1,persistent: true});
- }
- //展示置顶选项
- function showTopSelect(index,status) {
- var homePageImage = $("#homePageImage" + index).text();
- if (homePageImage != "") {
- if ('open' == status) {
- document.getElementById("topSelect" + index).style.cssText = "display:block";
- }else if ('close' == status) {
- document.getElementById("topSelect" + index).style.cssText = "display:none";
- }
- }else {
- alertx("请先去编辑页面上传商城首页图再置顶")
- }
- }
- //更新置顶
- function updateTopPosition(topPosition,id,type) {
- debugger
- var msg = '';
- if ('setTopPosition' == type) {
- msg = '确认置顶该活动吗?';
- //已有的置顶活动数量
- var topLength = ${topLength};
- if (topPosition - 1 > topLength) {
- var emptyPosition = topLength == 0 ? '一' : '二' ;
- msg = '由于当前没有第'+ emptyPosition +'位的置顶活动,将直接把该条活动置顶为第'+emptyPosition+'位';
- topPosition = topLength == 0 ? 1 : topLength == 1 ? 2 : topLength == 2 ? 3 : topLength == 3 ? 4 : 5;
- }
- }
- if ('clearTopPosition' == type) {
- msg = '确认清除该条数据的置顶位吗?清除后这条数据将不会在商城首页展示';
- }
- top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
- if (v == 'ok') {
- $.post("${ctx}/cmpage/cmImage/updateTopPosition", {
- 'topPosition': topPosition,
- 'id': id,
- 'type':type
- }, function (data) {
- if (true == data.success) {
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg, 'error');
- }
- setTimeout(function () {
- $("#searchForm").submit();
- },800)
- }, "JSON");//这里返回的类型有:json,html,xml,text
- }
- return;
- }, {buttonsFocus: 1, persistent: true});
- }
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li class="active"><a href="${ctx}/cmpage/cmImage/?type=${cmImage.type}&flag=${cmImage.flag}">
- <c:if test="${cmImage.flag eq 4}">活动专区列表</c:if>
- <c:if test="${cmImage.flag ne 4}">图片链接列表</c:if>
- </a>
- </li>
- <shiro:hasPermission name="cmpage:cmImage:edit"><li><a href="${ctx}/cmpage/cmImage/form?flag=${cmImage.flag}&type=${cmImage.type}">
- <c:if test="${cmImage.flag eq 4}">
- 活动专区图添加
- </c:if>
- <c:if test="${empty cmImage.flag}">
- 图片链接添加
- </c:if>
- </a></li>
- </shiro:hasPermission>
- </ul>
- <form:form id="searchForm" modelAttribute="cmImage" action="${ctx}/cmpage/cmImage/?flag=${empty cmImage.flag?null:(cmImage.flag)}" method="post" class="breadcrumb form-search">
- <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
- <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
- <div class="ul-form">
- <label>ID:</label>
- <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
- <label>标题:</label>
- <form:input path="title" htmlEscape="false" maxlength="40" class="input-small"/>
- <c:if test="${cmImage.flag ne 4}">
- <label>类型:</label>
- <form:select path="type" class="input-small">
- <form:option value="" label=" "/>
- <form:options items="${fns:getDictList('imagePage_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>
- </c:if>
- <label>PC端状态:</label>
- <form:select path="enabledStatus" class="input-small">
- <form:option value="" label=" "/>
- <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>
- <label>小程序端状态:</label>
- <form:select path="crmEnabledStatus" class="input-small">
- <form:option value="" label=" "/>
- <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>
- <label>活动状态:</label>
- <form:select path="actStatus" class="input-mini">
- <form:option value="" label="全部"/>
- <form:option value="1" label="未开始"/>
- <form:option value="2" label="进行中"/>
- <form:option value="3" label="已结束"/>
- </form:select>
- <label>首页置顶:</label>
- <form:select path="topFlag" class="input-mini">
- <form:option value="" label="全部"/>
- <form:option value="1" label="是"/>
- <form:option value="0" label="否"/>
- </form:select>
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
- <c:if test="${cmImage.flag eq 4}">
- <label style="float:right;">活动专区首页:<a href="${fns:getConfig('wwwServer')}cmpage/area.html" target="_blank">${fns:getConfig('wwwServer')}cmpage/area.html</a></label>
- </c:if>
- <div class="clearfix"></div>
- </div>
- </form:form>
- <sys:message content="${message}"/>
- <table id="contentTable" class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <th>ID</th>
- <th>标题</th>
- <th>PC端图片</th>
- <c:if test="${cmImage.flag ne 4}">
- <th>类型</th>
- </c:if>
- <th>PC端状态</th>
- <th>小程序端状态</th>
- <c:if test="${cmImage.flag eq 4}">
- <th>活动时间</th>
- <th>首页置顶位</th>
- <th>活动状态</th>
- </c:if>
- <th>排序</th>
- <th>创建时间</th>
- <shiro:hasPermission name="cmpage:cmImage:edit"><th>操作</th></shiro:hasPermission>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${page.list}" var="items" varStatus="index">
- <tr>
- <td>${items.id}</td>
- <td>${items.title}</td>
- <td><img src="${items.image}" style="width: 160px;height: 100px;"></td>
- <c:if test="${cmImage.flag ne 4}">
- <td>${fns:getDictLabel(items.type,"imagePage_type","" )}</td>
- </c:if>
- <c:if test="${cmImage.flag ne 4}">
- <%--crm状态控制--%>
- <td>
- <c:if test="${not empty items.crmEnabledStatus}">
- <shiro:hasPermission name="cmpage:cmImage:edit">
- <c:if test="${items.crmEnabledStatus eq 1 }">
- <a href="javascript:void(0);" onclick="updateCrmEnabledStatusByIds('0','${items.id}');" >
- <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
- </a>
- </c:if>
- <c:if test="${items.crmEnabledStatus ne 1 }">
- <a href="javascript:void(0)" onclick="updateCrmEnabledStatusByIds('1','${items.id}');">
- <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
- </a>
- </c:if>
- </shiro:hasPermission>
- </c:if>
- <c:if test="${empty items.crmEnabledStatus}">
- ----
- </c:if>
- </td>
- </c:if>
- <%--PC端状态控制--%>
- <td>
- <shiro:hasPermission name="cmpage:cmImage:edit">
- <c:if test="${items.enabledStatus eq 1 }">
- <a href="javascript:void(0);" onclick="updateEnabledStatus('0','${items.id}');" >
- <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
- </a>
- </c:if>
- <c:if test="${items.enabledStatus ne 1 }">
- <a href="javascript:void(0)" onclick="updateEnabledStatus('1','${items.id}');">
- <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
- </a>
- </c:if>
- </shiro:hasPermission>
- </td>
- <%--小程序端状态控制--%>
- <td>
- <shiro:hasPermission name="cmpage:cmImage:edit">
- <c:if test="${items.appletsEnabledStatus eq 1 }">
- <a href="javascript:void(0);" onclick="updateAppletsEnabledStatus('0','${items.id}');" >
- <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
- </a>
- </c:if>
- <c:if test="${items.appletsEnabledStatus ne 1 }">
- <a href="javascript:void(0)" onclick="updateAppletsEnabledStatus('1','${items.id}');">
- <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
- </a>
- </c:if>
- </shiro:hasPermission>
- </td>
- <c:if test="${cmImage.flag eq 4}">
- <td>${items.beginTimeStr}~${items.endTimeStr}</td>
- <td>${items.topPosition}</td>
- <td>
- <%--活动状态 1:未开始 2:进行中 3:已结束--%>
- <c:if test="${items.actStatus eq 1}">
- 未开始
- </c:if>
- <c:if test="${items.actStatus eq 2}">
- 进行中
- </c:if>
- <c:if test="${items.actStatus eq 3}">
- 已结束
- </c:if>
- <c:if test="${empty items.actStatus}">
- --
- </c:if>
- </td>
- </c:if>
- <td>${items.sort}</td>
- <td><fmt:formatDate value="${items.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
- <td hidden>
- <label id="homePageImage${index.index}">${items.homePageImage}</label>
- </td>
- <shiro:hasPermission name="cmpage:cmImage:edit"><td>
- <a href="${ctx}/cmpage/cmImage/form?id=${items.id}&flag=${cmImage.flag}">编辑</a>
- <shiro:hasPermission name="cmpage:cmImage:delete">
- <a href="${ctx}/cmpage/cmImage/delete?id=${items.id}&falg=${items.flag}&type=${items.type}" onclick="return confirmx('确认要删除该图片及链接管理吗?', this.href)">删除</a>
- </shiro:hasPermission>
- <a onclick="showTopSelect(${index.index},'open')" ${items.actStatus ne 2? 'hidden="hidden"':''} href="javascript:void(0)">首页置顶</a>
- <c:if test="${items.topPosition ne null}">
- <a onclick="updateTopPosition('','${items.id}','clearTopPosition')" href="javascript:void(0)">清除置顶</a>
- </c:if>
- <div style="display: none" class="topSelect" id="topSelect${index.index}" onmouseleave="showTopSelect(${index.index},'close')">
- <table style="border: 2px solid #000000;" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td><a onclick="updateTopPosition('1',${items.id},'setTopPosition')" href="javascript:void(0)">置顶第一位</a></td>
- </tr>
- <tr>
- <td><a onclick="updateTopPosition('2',${items.id},'setTopPosition')" href="javascript:void(0)">置顶第二位</a></td>
- </tr>
- <tr>
- <td><a onclick="updateTopPosition('3',${items.id},'setTopPosition')" href="javascript:void(0)">置顶第三位</a></td>
- </tr>
- </tbody>
- </table>
- </div>
- </td></shiro:hasPermission>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <div class="pagination">${page}</div>
- </body>
- </html>
|