|
@@ -22,8 +22,8 @@
|
|
|
</head>
|
|
|
<body>
|
|
|
<ul class="nav nav-tabs">
|
|
|
- <li class="active"><a href="${ctx}/hehe/cmHeheReduction/">活动列表</a></li>
|
|
|
- <shiro:hasPermission name="hehe:cmHeheReduction:edit"><li><a href="${ctx}/hehe/cmHeheReduction/form">活动添加</a></li></shiro:hasPermission>
|
|
|
+ <li class="active"><a href="${ctx}/hehe/cmHeheReduction/">分享减免活动列表</a></li>
|
|
|
+ <li><a href="${ctx}/hehe/cmHeheReduction/form">活动添加</a></li>
|
|
|
</ul>
|
|
|
<form:form id="searchForm" modelAttribute="cmHeheReduction" action="${ctx}/hehe/cmHeheReduction/" method="post" class="breadcrumb form-search">
|
|
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
|
@@ -31,6 +31,13 @@
|
|
|
<div class="ul-form">
|
|
|
<label>活动名称:</label>
|
|
|
<form:input path="name" htmlEscape="false" maxlength="30" class="input-medium"/>
|
|
|
+ <label>状态:</label>
|
|
|
+ <form:select path="status" class="input-medium">
|
|
|
+ <form:option value="" label="全部"/>
|
|
|
+ <form:option value="1" label="待上架"/>
|
|
|
+ <form:option value="2" label="已上架"/>
|
|
|
+ <form:option value="3" label="已下架"/>
|
|
|
+ </form:select>
|
|
|
<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
|
|
|
<div class="clearfix"></div>
|
|
|
</div>
|
|
@@ -39,21 +46,26 @@
|
|
|
<table id="contentTable" class="table table-striped table-bordered table-condensed">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
+ <th>ID</th>
|
|
|
<th>活动名称</th>
|
|
|
<th>减免金额</th>
|
|
|
<th>减免条件</th>
|
|
|
<th>上架时间</th>
|
|
|
<th>下架时间</th>
|
|
|
+ <th>状态</th>
|
|
|
<th>添加时间</th>
|
|
|
- <shiro:hasPermission name="hehe:cmHeheReduction:edit"><th>操作</th></shiro:hasPermission>
|
|
|
+ <th>操作</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<c:forEach items="${page.list}" var="cmHeheReduction">
|
|
|
<tr>
|
|
|
- <td><a href="${ctx}/hehe/cmHeheReduction/form?id=${cmHeheReduction.id}">
|
|
|
+ <td>
|
|
|
+ ${cmHeheReduction.id}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
${cmHeheReduction.name}
|
|
|
- </a></td>
|
|
|
+ </td>
|
|
|
<td>
|
|
|
${cmHeheReduction.reducedAmount}
|
|
|
</td>
|
|
@@ -61,24 +73,124 @@
|
|
|
${cmHeheReduction.touchPrice}
|
|
|
</td>
|
|
|
<td>
|
|
|
- <fmt:formatDate value="${cmHeheReduction.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ <fmt:formatDate value="${cmHeheReduction.startTime}" pattern="yyyy-MM-dd HH:mm"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <fmt:formatDate value="${cmHeheReduction.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ <fmt:formatDate value="${cmHeheReduction.endTime}" pattern="yyyy-MM-dd HH:mm"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <font color="${cmHeheReduction.status eq 1?'#2FA4E7':cmHeheReduction.status eq 2?'#FF0000':'#999999'}">
|
|
|
+ ${cmHeheReduction.status eq 1?'待上架':cmHeheReduction.status eq 2?'已上架':'已下架'}
|
|
|
+ </font>
|
|
|
</td>
|
|
|
<td>
|
|
|
<fmt:formatDate value="${cmHeheReduction.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
</td>
|
|
|
- <shiro:hasPermission name="hehe:cmHeheReduction:edit"><td>
|
|
|
- <a href="${ctx}/hehe/cmHeheReduction/form?id=${cmHeheReduction.id}">编辑</a>
|
|
|
- <shiro:hasPermission name="hehe:cmHeheReduction:delete">
|
|
|
- <a href="${ctx}/hehe/cmHeheReduction/delete?id=${cmHeheReduction.id}" onclick="return confirmx('确认要删除该活动吗?', this.href)">删除</a>
|
|
|
- </shiro:hasPermission>
|
|
|
- </td></shiro:hasPermission>
|
|
|
+ <td>
|
|
|
+ <a href="javascript:;" onclick="updateStatus(${cmHeheReduction.id},${cmHeheReduction.status})">
|
|
|
+ ${cmHeheReduction.status eq 2?'下架':'上架'}
|
|
|
+ </a>
|
|
|
+ <a href="javascript:;" onclick="editReduction(${cmHeheReduction.id},${cmHeheReduction.status})">编辑</a>
|
|
|
+ <a href="javascript:;" onclick="deleteReduction(${cmHeheReduction.id},${cmHeheReduction.status})">删除</a>
|
|
|
+ <a href="${ctx}/hehe/cmHeheReduction/userList?reductionId=${cmHeheReduction.id}">分享用户</a>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</c:forEach>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<div class="pagination">${page}</div>
|
|
|
+<script>
|
|
|
+ function updateStatus(reductionId,status) {
|
|
|
+ if (status !== 3) {
|
|
|
+ if (status === 2) {
|
|
|
+ status = 3;
|
|
|
+ } else {
|
|
|
+ status = 2;
|
|
|
+ }
|
|
|
+ // 待上架活动上架及已上架活动下架
|
|
|
+ var submit = function (v, h, f) {
|
|
|
+ if (v == true) {
|
|
|
+ $.post("${ctx}/hehe/cmHeheReduction/updateStatus?id="+reductionId+"&status="+status,function (data) {
|
|
|
+ top.$.jBox.tip((2 === status?'上架':'下架')+'活动成功');
|
|
|
+ setTimeout(function () {
|
|
|
+ $("#searchForm").submit();
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if (2 == status) {
|
|
|
+ $.jBox.confirm("确定上架该活动吗?", "提示", submit, {buttons: {'确认': true, '取消': false}});
|
|
|
+ } else {
|
|
|
+ $.jBox.confirm("确定下架该活动吗?", "提示", submit, {buttons: {'确认': true, '取消': false}});
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //已下架活动上架需重新设置上下架时间
|
|
|
+ var url = "${ctx}/hehe/cmHeheReduction/resetTimePage";
|
|
|
+ var title = "提示";
|
|
|
+ top.$.jBox("iframe:"+url, {
|
|
|
+ iframeScrolling: 'yes',
|
|
|
+ width: 800,
|
|
|
+ height: 350,
|
|
|
+ persistent: true,
|
|
|
+ title: title,
|
|
|
+ buttons: {"确定": '1', "取消": '-1'},
|
|
|
+ submit: function (v, h, f) {
|
|
|
+ //确定
|
|
|
+ var $jboxFrame = top.$('#jbox-iframe');
|
|
|
+ var $mainFrame = top.$('#mainFrame');
|
|
|
+ if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
|
|
|
+ var items = $jboxFrame[0].contentWindow.getCheckedItems(0);
|
|
|
+ if (items.length > 0) {
|
|
|
+ var startTime = items[0].startTime;
|
|
|
+ var endTime = items[0].endTime;
|
|
|
+ if (startTime === '') {
|
|
|
+ top.$.jBox.tip("请选择上架时间");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (endTime === '') {
|
|
|
+ top.$.jBox.tip("请选择下架时间");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $.post("${ctx}/hehe/cmHeheReduction/updateTime?id="+reductionId+"&startTime=" + startTime + "&endTime=" + endTime, function (data) {
|
|
|
+ top.$.jBox.tip("修改成功");
|
|
|
+ setTimeout(function () {
|
|
|
+ $("#searchForm").submit();
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ top.$.jBox.tip("请先勾选商品...");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function editReduction(reductionId,status) {
|
|
|
+ var href = "${ctx}/hehe/cmHeheReduction/form?id=" + reductionId;
|
|
|
+ if (status === 2) {
|
|
|
+ alertx('请下架后再编辑');
|
|
|
+ } else {
|
|
|
+ window.location.href = href;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function deleteReduction(reductionId,status) {
|
|
|
+ var href = "${ctx}/hehe/cmHeheReduction/delete?id=" + reductionId;
|
|
|
+ if (status === 2) {
|
|
|
+ alertx('请下架后再删除');
|
|
|
+ } else {
|
|
|
+ var submit = function (v, h, f) {
|
|
|
+ if (v == true) {
|
|
|
+ window.location.href = href;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $.jBox.confirm("确定要删除该活动吗?", "提示", submit, {buttons: {'确认': true, '取消': false}});
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
</body>
|
|
|
</html>
|