Authored by yyq

shop page

... ... @@ -13,7 +13,7 @@ const shopHandler = require('./shop-handler');
const helpers = global.yoho.helpers;
const _ = require('lodash');
const limitNum = 60; // 商品每页显示数目
// const limitNum = 60; // 商品每页显示数目
const needParams = ['query', 'msort', 'misort', 'gender', 'shelveTime'];
// 品牌页folder名称
... ... @@ -801,26 +801,18 @@ const getShopListData = (channel, params, uid) => {
let goodsList = _.get(info, 'data.product_list', []);
if (goodsList.length) {
let tip = {
start: (_.get(info, 'data.page', 1) - 1) * limitNum + 1,
total: _.get(info, 'data.total', 0)
};
tip.end = tip.start + limitNum - 1;
if (tip.end > tip.total) {
tip.end = tip.total;
}
let totalPage = _.get(info, 'data.total', 1);
Object.assign(finalResult, {
filters: searchHandler.handleFilterDataAll(info.data, params),
opts: searchHandler.handleOptsData(params, tip.total),
opts: searchHandler.handleOptsData(params, totalPage),
goods: productProcess.processProductList(goodsList, {
newCoverSort: true,
showDiscount: false,
gender: _getGender(channel),
query: params.query
}),
footPager: {tip: tip}
footPager: searchHandler.handlePagerData(totalPage, params)
});
_.set(finalResult, 'filters.checkedConditions.clearUrl',
... ...
... ... @@ -321,8 +321,10 @@ const signboard = (data) => {
// 销售类目
const _handleSaleCategory = (shopId, resourceObj) => {
const thisShop = (categoryId) => shopListUrl + '?' + qs.stringify({
const _handleSaleCategory = (shopId, baseUrl, resourceObj) => {
baseUrl = baseUrl || '';
const thisShop = (categoryId) => baseUrl + '?' + qs.stringify({
productPool: categoryId,
shopId: shopId,
navBar: -1
... ... @@ -361,7 +363,7 @@ exports.getShopDecorator = (data, params, shopId, base) => {
if (base) {
_.forEach(data.list, (value) => {
let info = Fn.pipe(JSON.parse, _.partial(_handleSaleCategory, shopId))(value.resource_data);
let info = Fn.pipe(JSON.parse, _.partial(_handleSaleCategory, shopId, ''))(value.resource_data);
switch (value.resource_name) {
case 'signboard':
... ... @@ -381,7 +383,7 @@ exports.getShopDecorator = (data, params, shopId, base) => {
});
_.forEach(data.list, (value) => {
let info = Fn.pipe(JSON.parse, _.partial(_handleSaleCategory, shopId))(value.resource_data);
let info = Fn.pipe(JSON.parse, _.partial(_handleSaleCategory, shopId, shopListUrl))(value.resource_data);
let tabBar;
switch (value.resource_name) {
... ...
... ... @@ -18,7 +18,6 @@
> .iconfont {
position: relative;
top: 2px;
}
}
... ...