|
@@ -0,0 +1,193 @@
|
|
|
+<%@ 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;}
|
|
|
+ </style>
|
|
|
+ <script type="text/javascript">
|
|
|
+ $(document).ready(function() {
|
|
|
+
|
|
|
+ });
|
|
|
+ function page(n,s){
|
|
|
+ $("#pageNo").val(n);
|
|
|
+ $("#pageSize").val(s);
|
|
|
+ $("#searchForm").submit();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function update(status, ids, type) {
|
|
|
+ var msg = '确定上架该商品吗?';
|
|
|
+ if ('0' == status) {
|
|
|
+ msg = '确定下架该商品吗?';
|
|
|
+ }
|
|
|
+ top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
|
|
|
+ if (v == 'ok') {
|
|
|
+ $.post("${ctx}/hehe/homeTypeProduct/updateStatus", {
|
|
|
+ 'status': status,
|
|
|
+ 'id': 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 showSelect() {
|
|
|
+ var url = '';
|
|
|
+ var title = '';
|
|
|
+ url = "${ctx}/hehe/heheHomeTypeProduct/findProductPage";
|
|
|
+ title = "添加商品";
|
|
|
+ top.$.jBox("iframe:" + url, {
|
|
|
+ iframeScrolling: 'yes',
|
|
|
+ width: $(top.document).width() - 600,
|
|
|
+ height: $(top.document).height() - 160,
|
|
|
+ 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) {
|
|
|
+ console.log(items);
|
|
|
+ //添加数据
|
|
|
+ $.post("${ctx}/hehe/heheHomeTypeProduct/addProducts?homeTypeId=${heheHomeTypeProduct.homeTypeId}&productIds=" + items, function (data) {
|
|
|
+ if (true == data.success) {
|
|
|
+ $.jBox.tip(data.info, 'info');
|
|
|
+ setTimeout(function () {
|
|
|
+ window.location.href = "${ctx}/hehe/heheHomeTypeProduct/list?homeTypeId=${heheHomeTypeProduct.homeTypeId}"
|
|
|
+ }, 1300);
|
|
|
+ } else {
|
|
|
+ $.jBox.tip(data.info, 'error');
|
|
|
+ }
|
|
|
+ }, "JSON");//这里返回的类型有:json,html,xml,text
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ top.$.jBox.tip("请先勾选商品...");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function updateStatus(status, ids) {
|
|
|
+ var msg = '确定上架该商品吗?';
|
|
|
+ if ('0' == status) {
|
|
|
+ msg = '确定下架该商品吗?';
|
|
|
+ }
|
|
|
+ top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
|
|
|
+ if (v == 'ok') {
|
|
|
+ $.post("${ctx}/hehe/heheHomeTypeProduct/updateStatus", {
|
|
|
+ 'status': status,
|
|
|
+ 'id': 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});
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+ <ul class="nav nav-tabs">
|
|
|
+ <li><a href="${ctx}/hehe/heheHomeType">首页分类导航</a></li>
|
|
|
+ <li class="active"><a href="${ctx}/hehe/heheHomeTypeProduct/?homeTypeId=${heheHomeTypeProduct.homeTypeId}">商品列表</a></li>
|
|
|
+ </ul>
|
|
|
+ <form:form id="searchForm" modelAttribute="heheHomeTypeProduct" action="${ctx}/hehe/heheHomeTypeProduct/" 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}"/>
|
|
|
+ <form:hidden path="homeTypeId"/>
|
|
|
+ <div class="ul-form">
|
|
|
+ <label>商品ID:</label>
|
|
|
+ <form:input path="productId" htmlEscape="false" class="input-medium"/>
|
|
|
+ <label>商品名称:</label>
|
|
|
+ <form:input path="name" htmlEscape="false" class="input-medium"/>
|
|
|
+ <label>供应商名称:</label>
|
|
|
+ <form:input path="shopName" htmlEscape="false" class="input-medium"/>
|
|
|
+ <label>状态:</label>
|
|
|
+ <form:select path="status" class="input-medium">
|
|
|
+ <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="查询"/>
|
|
|
+ <input class="btn btn-primary" style="width: 80px" onclick="showSelect()" value="上线商品"/>
|
|
|
+ <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>商品名称</th>
|
|
|
+ <th>供应商名称</th>
|
|
|
+ <th>状态</th>
|
|
|
+ <th>添加时间</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <c:forEach items="${page.list}" var="heheHomeTypeProduct">
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ ${heheHomeTypeProduct.productId}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <img class="mainImage" src="${heheHomeTypeProduct.mainImage}" width="50px" height="50px">
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${heheHomeTypeProduct.name}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${heheHomeTypeProduct.shopName}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <c:if test="${heheHomeTypeProduct.status eq 1 }">
|
|
|
+ <font color="green" style="margin-right: 10px">已上架</font>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${heheHomeTypeProduct.status ne 1 }">
|
|
|
+ <font color="red" style="margin-right: 10px">已下架</font>
|
|
|
+ </c:if>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <fmt:formatDate value="${heheHomeTypeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <c:if test="${heheHomeTypeProduct.status eq 1 }">
|
|
|
+ <a href="javascript:;" onclick="updateStatus('0','${heheHomeTypeProduct.id}')">下架</a>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${heheHomeTypeProduct.status ne 1 }">
|
|
|
+ <a href="javascript:;" onclick="updateStatus('1','${heheHomeTypeProduct.id}')">上架</a>
|
|
|
+ </c:if>
|
|
|
+ <a href="${ctx}/hehe/heheHomeTypeProduct/delete?id=${heheHomeTypeProduct.id}" onclick="return confirmx('确认要删除该商品吗?', this.href)">删除</a>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </c:forEach>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <div class="pagination">${page}</div>
|
|
|
+</body>
|
|
|
+</html>
|