<!DOCTYPE html>
|
<html lang="zh-cn">
|
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/maincontent.css" rel="stylesheet">
|
<!--[if lt IE 9]>
|
<script src="js/html5shiv.js"></script>
|
<script src="js/respond.min.js"></script>
|
<![endif]-->
|
</head>
|
|
<body>
|
<div id="container">
|
<div class="erjidh">
|
<table class="table">
|
<tbody>
|
<tr>
|
<td class="xiala">
|
<select class="form-control tbclass" style="width: 200px;display: inline;">
|
<option value="0">全部</option>
|
<option value="1">女装尖货</option>
|
<option value="2">母婴热推</option>
|
<option value="3">高佣活动</option>
|
<option value="4">ifashion</option>
|
<option value="5">亲宝贝</option>
|
<option value="6">淘宝汇吃</option>
|
<option value="7">潮电街</option>
|
<option value="8">极有家</option>
|
<option value="9">酷动城</option>
|
<option value="10">淘宝DIY</option>
|
<option value="11">超值9块9</option>
|
<option value="12">20元封顶</option>
|
<option value="13">特价好货</option>
|
</select>
|
</td>
|
<td>
|
<form class="form-inline" role="form">
|
<div class="form-group" role="search">
|
<input type="text" class="form-control searchText" style="width:200px;" placeholder="搜索">
|
</div>
|
<button type="button" class="btn btn-default searchBtn">搜索</button>
|
</form>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<div class="zhuti">
|
<div class="zhutisousuo">
|
<table class="table">
|
<thead>
|
<tr>
|
<th width="33%">名称</th>
|
<th width="7%">商品ID</th>
|
<th width="10%">图片</th>
|
<th width="10%">销量</th>
|
<th width="10%">比例</th>
|
<th width="7%">价格</th>
|
<th width="15%">优惠卷信息</th>
|
<th width="8%">选择</th>
|
</tr>
|
</thead>
|
</table>
|
</div>
|
<div class="liebiao">
|
<table class="table">
|
<tbody>
|
<tr style="display: none;">
|
<td class="r-mingcheng" width="33%" style="text-align: center;"><a target="_blank"></a></td>
|
<td class="r-id" width="7%" style="text-align: center;"><div></div></td>
|
<td class="r-tupian" width="10%" style="text-align: center;"><img style="width: 120px;height: 120px;"/></td>
|
<td class="r-xiaoliang" width="10%" style="text-align: center;"></td>
|
<td class="r-bili" width="10%" style="text-align: center;"></td>
|
<td class="r-jiage" width="7%" style="text-align: center;"></td>
|
<td class="r-youhuijuan" width="15%" style="text-align: center;"></td>
|
<td style="text-align: center;" width="8%" ><input style="height: 20px;width: 20px;" class="checkbox myck" name="check" type="checkbox"/></td>
|
</tr>
|
</tbody>
|
</table>
|
<hr>
|
</div>
|
</div>
|
<div class="bottom">
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li>
|
<a href="#" class="next">»</a>
|
</li>
|
</ul>
|
<div class="form-group">
|
<div class="tzan">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
<div class="tz">
|
<input class="form-control" type="text" id="customPage" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/page.js"></script>
|
<script src="layer/layer.js"></script>
|
<script>
|
$(function(){
|
|
$(".checkAll").bind("click", function() {
|
if(this.checked) {
|
$(".myck").prop('checked', this.checked);
|
}else{
|
$(".myck").prop('checked', this.checked);
|
}
|
});
|
|
resultTrHtml = $(".liebiao > table tbody").html();
|
//搜索点击
|
$(".searchBtn").click(function() {
|
getTbDate(1);
|
});
|
|
var htmlAll = $("body").html();
|
|
// layerLoad(htmlAll);
|
});
|
|
function layerLoad(htmlAll){
|
layer.open({
|
type: 2,
|
title: '添加商品',
|
btn:['确定','取消'],
|
yes:function(index){
|
var arr = new Array();
|
$(".liebiao .myck").each(function(){
|
if(this.checked){
|
var key = $(this).attr("key");
|
arr.push(key);
|
}
|
});
|
if(arr.length==0){
|
layer.msg("请先选择数据");
|
return;
|
}
|
var sindex = layer.load(1, {
|
shade: false
|
});
|
$.ajax({
|
type:"post",
|
url:"api/v1/taobao/addTaoBaoGoodsBrief",
|
async:true,
|
data:{"ids":arr},
|
dataType:'json',
|
traditional: true, //阻止深度序列化
|
success:function(data){
|
if(data.code==0){
|
setMsgInfo(data);
|
}else{
|
layer.msg("添加失败");
|
}
|
layer.close(sindex);
|
},
|
error:function(data){
|
layer.msg("添加失败");
|
layer.close(sindex);
|
}
|
});
|
},
|
function(index){
|
layer.close(index);
|
},
|
area: ['1600px', '1000px'],
|
content: htmlAll
|
});
|
|
}
|
function getTbDate(pageIndex){
|
var key = $(".searchText").val();
|
var index = layer.load(0, {
|
'shade': false
|
});
|
var type = $(".tbclass option:checked").val();
|
$.post('api/v1/sectiongoods/searchTaoBaoGoodsList', {
|
'pageIndex':pageIndex,
|
'type':type,
|
'key': key
|
}, function(data) {
|
layer.close(index);
|
setTbDate(data);
|
if(data.code == 0) {
|
fillPage(data.data.pe, function(pageIndex) {
|
getTbDate(pageIndex);
|
});
|
}
|
|
}, 'json');
|
}
|
|
function setTbDate(data){
|
|
var $rtbody = $(".liebiao table tbody");
|
$rtbody.empty();
|
data.data.taoBaoGoodsList.forEach(function(obj){
|
$rtbody.append(resultTrHtml);
|
var $curtr = $rtbody.find("tr:last");
|
$curtr.css("display","table-row");
|
$curtr.find(".r-mingcheng a").text(obj.title);
|
$curtr.find(".r-mingcheng a").attr("href",obj.auctionUrl);
|
$curtr.find(".r-id").text(obj.auctionId);
|
$curtr.find(".r-tupian > img").attr("src",obj.pictUrl);
|
$curtr.find(".r-xiaoliang").text(obj.biz30day);
|
$curtr.find(".r-bili").text(obj.tkRate);
|
$curtr.find(".r-jiage").text("¥ "+obj.zkPrice);
|
$curtr.find(".r-youhuijuan").text(obj.couponInfo);
|
$curtr.find(".checkbox").attr("key",obj.auctionId);
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|