|
@@ -67,7 +67,7 @@
|
|
|
<sys:message content="${message}"/>
|
|
|
<table class="table table-striped table-bordered table-condensed table-hover">
|
|
|
<tr>
|
|
|
- <th style="width:20px;"></th>
|
|
|
+ <th style="width:20px;"><input class="check-all" type="checkbox" onclick="handleClickAllSelect()"/> 全选 </th>
|
|
|
<th>商品ID</th>
|
|
|
<th>商品图片</th>
|
|
|
<th>商品名称</th>
|
|
@@ -80,7 +80,7 @@
|
|
|
<c:forEach items="${page.list}" var="item">
|
|
|
<tr id="${item.productID}" class="itemtr">
|
|
|
<th>
|
|
|
- <input class="check-item" type="radio" name="info" value='${fns:toJson(item)}'/>
|
|
|
+ <input class="check-item" type="checkbox" name="info" value='${fns:toJson(item)}'/>
|
|
|
</th>
|
|
|
<td>${item.productID}</td>
|
|
|
<td><img src="${item.mainImage}" width="50px" height="50px"></td>
|
|
@@ -98,6 +98,7 @@
|
|
|
</c:if>
|
|
|
<div class="pagination">${page}</div>
|
|
|
<script type="text/javascript">
|
|
|
+ var isCheckedAll = false;
|
|
|
$(document).ready(function () {
|
|
|
//弹出框去滚动条
|
|
|
top.$('#jbox-content').css("overflow-y", "hidden");
|
|
@@ -113,35 +114,79 @@
|
|
|
|
|
|
function getCheckedItems() {
|
|
|
var item = $('.check-item:checked').val();
|
|
|
- var product = JSON.parse(item);
|
|
|
- var link = '';
|
|
|
- if (${productCategory eq 1}) {
|
|
|
- link = "${fns:getConfig('wwwServer')}product-" + product.productID + ".html";
|
|
|
- } else {
|
|
|
- link = "${fns:getConfig('wwwServer')}flea-market-" + product.productID + ".html";
|
|
|
+ if(!item){
|
|
|
+ alertx("请勾选商品~");
|
|
|
+ return;
|
|
|
}
|
|
|
+ var imageArray = [];
|
|
|
+ $(".check-item:checked").each(function (index,el) {
|
|
|
+ var item = $(this).val();
|
|
|
+ var product = JSON.parse(item);
|
|
|
+ var link = '';
|
|
|
+ if (${productCategory eq 1}) {
|
|
|
+ link = "${fns:getConfig('wwwServer')}product-" + product.productID + ".html";
|
|
|
+ } else {
|
|
|
+ link = "${fns:getConfig('wwwServer')}flea-market-" + product.productID + ".html";
|
|
|
+ }
|
|
|
|
|
|
- var items = {
|
|
|
- "id": "",
|
|
|
- "productId": product.productID,
|
|
|
- "validFlag": product.validFlag,
|
|
|
- "image": product.mainImage,
|
|
|
- "name": product.name,
|
|
|
- "link": link,
|
|
|
- "sort": 1,
|
|
|
- "pcStatus": "1",
|
|
|
- "appletsStatus": "1",
|
|
|
- "label": "",
|
|
|
- "createDate": ""
|
|
|
- };
|
|
|
- return items;
|
|
|
+ var items = {
|
|
|
+ "id": "",
|
|
|
+ "productId": product.productID,
|
|
|
+ "validFlag": product.validFlag,
|
|
|
+ "image": product.mainImage,
|
|
|
+ "name": product.name,
|
|
|
+ "link": link,
|
|
|
+ "sort": 1,
|
|
|
+ "pcStatus": "1",
|
|
|
+ "appletsStatus": "1",
|
|
|
+ "label": "",
|
|
|
+ "createDate": ""
|
|
|
+ };
|
|
|
+ imageArray.push(items);
|
|
|
+ })
|
|
|
+ return imageArray;
|
|
|
}
|
|
|
-
|
|
|
- function clickAllSelect(ckb) {
|
|
|
- var isChecked = ckb.checked;
|
|
|
- $(".check-item").attr('checked', isChecked);
|
|
|
+ function handleClickAllSelect() {
|
|
|
+ var inputIsCheckedAll = $('.check-all').attr('checked');
|
|
|
+ var imageArray = [];
|
|
|
+ if(inputIsCheckedAll){
|
|
|
+ isCheckedAll = true;
|
|
|
+ $(".check-item").attr('checked', true);
|
|
|
+ $(".check-item").each(function (index,el) {
|
|
|
+ var item = $(this).val();
|
|
|
+ var product = JSON.parse(item);
|
|
|
+ var link ='';
|
|
|
+ if (${productCategory eq 1}) {
|
|
|
+ link = "${fns:getConfig('wwwServer')}product-" + product.productID + ".html";
|
|
|
+ } else {
|
|
|
+ link = "${fns:getConfig('wwwServer')}flea-market-" + product.productID + ".html";
|
|
|
+ }
|
|
|
+ var items = {
|
|
|
+ "id": "",
|
|
|
+ "productId": product.productID,
|
|
|
+ "validFlag": product.validFlag,
|
|
|
+ "image": product.mainImage,
|
|
|
+ "name": product.name,
|
|
|
+ "link": link,
|
|
|
+ "sort": 1,
|
|
|
+ "pcStatus": "1",
|
|
|
+ "appletsStatus": "1",
|
|
|
+ "label": "",
|
|
|
+ "createDate": ""
|
|
|
+ };
|
|
|
+ imageArray.push(items);
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ isCheckedAll = false;
|
|
|
+ $(".check-item").attr('checked', false);
|
|
|
+ imageArray = [];
|
|
|
+ }
|
|
|
+ return imageArray;
|
|
|
}
|
|
|
-
|
|
|
+ function handleCheckedAll() {
|
|
|
+ return isCheckedAll;
|
|
|
+ }
|
|
|
+ /**
|
|
|
/**
|
|
|
* @param obj
|
|
|
* jquery控制input只能输入数字
|