Authored by 周少峰

Merge branch 'release/5.3' of git.yoho.cn:fe/yohobuy-node into release/5.3

... ... @@ -771,7 +771,8 @@ const getShopListData = (channel, params, uid) => {
headerModel.requestHeaderData(channel), // 头部数据
searchApi.getShopDecorator(shopId), // 店铺装修数据
searchApi.getShopInfo(shopId, uid), // 店铺介绍
searchApi.getProductList(Object.assign({shop_id: shopId}, params)), // 搜索店铺商品
searchApi.getProductList(Object.assign({shop_id: shopId}, params,
{limit: (params.limit || 60) - 1})), // 搜索店铺商品
searchApi.getSortList({shop_id: shopId}) // 店铺分类
];
... ... @@ -833,6 +834,7 @@ const getShopListData = (channel, params, uid) => {
gender: _getGender(channel),
query: params.query
}),
hasNextPage: searchHandler.handleNextPage(params, totalPage),
footPager: searchHandler.handlePagerData(totalPage, params)
});
... ...
... ... @@ -412,7 +412,7 @@ exports.handleOptsData = (params, total, extra) => {
dest.countPerPage = _.isEmpty(params.limit) ? 60 : params.limit;
// 全部页码数量
dest.pageCount = parseInt(total / (dest.countPerPage - 1), 10) + 1;
dest.pageCount = _.ceil(total / (dest.countPerPage - 1));
// 每页多少商品
let paramsLimit = parseInt((_.isEmpty(params.limit) ? 60 : params.limit), 10);
... ... @@ -1341,9 +1341,9 @@ exports.handleNextPage = (params, total) => {
let href;
let currentPage = parseInt((_.isEmpty(params.page) ? 1 : params.page), 10); // 当前页
let perPageCount = parseInt((_.isEmpty(params.limit) ? 60 : params.limit) - 1, 10); // 每页商品数
let totalPage = parseInt(total / perPageCount, 10) + 1; // 总页数
let totalPage = _.ceil(total / perPageCount); // 总页数
if (currentPage === totalPage) {
if (currentPage >= totalPage) {
return null;
} else {
href = handleFilterUrl(params, {page: currentPage + 1});
... ...