<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>收藏排行榜</title>
<link rel="stylesheet" type="text/css" href="css/common.css">
<link rel="stylesheet" type="text/css" href="css/ranking-list.css">
<script src="js/jquery-3.3.1.js"></script>
<script src="js/getParameter.js"></script>
<script src="js/load.js"></script>
<script>
$(function () {
var rname = getParameter("rname");
c(null,rname);
});
function c(currentPage,rname) {
$.ajax({
"url": "/travel/favorite/favoriteRankList",
"type": "post",
"data": {"currentPage":currentPage,"rname":rname},
"success":function (e) {
$("#"+e.currentPage).addClass("curPage");
// 设置总记录数总页数
$("#totalPage").html(e.totalPage);
$("#totalCount").html(e.totalCount);
var beforeNumber =e.currentPage-1;
var nextNumber=e.currentPage+1;
if(beforeNumber<=0){
beforeNumber=1;
}
if(nextNumber>=e.totalPage){
nextNumber=e.totalPage;
}
var lis = '<li onclick="javascript:c(null,\''+rname+'\',show)" ><a href="javascript:void(0)">首页</a></li><li onclick="javascript:c('+beforeNumber+',\''+rname+'\',show)" class="threeword"><a href="javascript:void(0)">上一页</a></li>';
var begin=e.currentPage-5;
var end=e.currentPage+4;
if (e.totalPage<10){
begin=1;
end=e.totalPage;
}else{
if(begin<=0){
begin=1;
end=10;
}
if(end>=e.totalPage){
begin=e.totalPage-9;
end=e.totalPage;
}
}
for (var i = begin; i <= end; i++) {
var li;
if (i==e.currentPage){
li = '<li class="curPage" onclick="javascript:c('+i+',\''+rname+'\',show)"><a href="javascript:void(0)" >' + i + '</a></li>';
}else{
li = '<li onclick="javascript:c('+i+',\''+rname+'\',show)"><a href="javascript:void(0)" >' + i + '</a></li>';
}
lis += li;
}
lis += '<li onclick="javascript:c('+nextNumber+',\''+rname+'\',show)" class="threeword"><a href="javascript:void(0)">下一页</a></li><li onclick="javascript:c('+e.totalPage+',\''+rname+'\',show)" class="threeword"><a href="javascript:void(0)">末页</a></li>';
$("#pageUl").html(lis);
show(e);
}
})
}
function show(e) {
var lis = "";
for (var i = 0; i < e.currentDate.length; i++) {
var li = '<li>\n' +
' <span class="num one">'+i+'</span>\n' +
' <a href="route_detail.html?rid=' + e.currentDate[i].rid + '"><img src="' + e.currentDate[i].rimage + '" alt=""></a>\n' +
' <h4><a href="route_detail.html?rid=' + e.currentDate[i].rid + '">' + e.currentDate[i].rname + '</a></h4>\n' +
' <p>\n' +
' <b class="price">¥<span>' + e.currentDate[i].price + '</span>起</b>\n' +
' <span class="shouchang">已收藏' + e.currentDate[i].count + '次</span>\n' +
' </p>\n' +
' </li>';
/*' <li>\n' +
' <span class="num one">1</span>\n' +
' <a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>\n' +
' <h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>\n' +
' <p>\n' +
' <b class="price">¥<span>899</span>起</b>\n' +
' <span class="shouchang">已收藏450次</span>\n' +
' </p>\n' +
' </li>';*/
lis += li;
}
$("#ul").html(lis);
}
</script>
</head>
<body>
<!--引入头部-->
<div id="header"></div>
<div class="contant">
<div class="shaixuan">
<span>线路名称</span>
<input type="text">
<span>金额</span>
<input type="text">~<input type="text">
<button>搜索</button>
</div>
<div class="list clearfix">
<ul id="ul">
<li>
<span class="num one">1</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
<li>
<span class="num two">2</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
<li>
<span class="num">3</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
<li>
<span class="num">4</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
<li>
<span class="num">5</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
<li>
<span class="num">6</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
<li>
<span class="num">7</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
<li>
<span class="num">8</span>
<a href="route_detail.html"><img src="images/jiangxuan_4.jpg" alt=""></a>
<h4><a href="route_detail.html">【尾单特卖】全国-曼谷6-7天自由行 泰国出境旅游 特价往6-7天自由行 泰国出境旅游 特价往..</a></h4>
<p>
<b class="price">¥<span>899</span>起</b>
<span class="shouchang">已收藏450次</span>
</p>
</li>
</ul>
</div>
<div class="pageNum">
<ul id="pageUl">
<li><a href="">首页</a></li>
<li class="threeword"><a href="#">上一页</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">6</a></li>
<li><a href="#">7</a></li>
<li><a href="#">8</a></li>
<li><a href="#">9</a></li>
<li><a href="#">10</a></li>
<li class="threeword"><a href="javascript:;">下一页</a></li>
<li class="threeword"><a href="javascript:;">末页</a></li>
</ul>
</div>
</div>
<!--导入底部-->
<div id="footer"></div>
<!--导入布局js,共享header和footer-->
<script type="text/javascript" src="js/include.js"></script>
</body>
</html> |
|