Authored by ccbikai(👎🏻🍜)

Merge remote-tracking branch 'origin/hotfix/shopSort'

... ... @@ -526,6 +526,7 @@ const getBaseShopData = (params, shopInfo) => {
const getShopData = (req, shopId, uid, isApp) => {
let shopData = {};
let channel = req.yoho.channel;
let brandData = [];
return _getShopInfo(shopId, uid).then(shopInfoResult => {
... ... @@ -536,16 +537,32 @@ const getShopData = (req, shopId, uid, isApp) => {
};
}
return _getShopDecorator(shopId).then(shopDeco => {
return shopDeco;
}).then(shopDeco => {
let brandBrowseData;
// 取店铺下的brand, id
_.forEach(shopDeco.list, floor => {
if (floor.resource_name === 'brandBrowse') {
brandBrowseData = JSON.parse(floor.resource_data);
_.forEach(brandBrowseData, brandBrowse => {
brandData.push(brandBrowse.id);
});
}
});
return Promise.all([
_getShopDecorator(shopId),
searchModel.getFilterSearchData({
shop_id: shopId,
brand: brandData.join(','),
order: '0',
channel: channel
}),
_shopCouponsList(shopId, uid)
]).then((result) => {
shopData = {
decorator: result[0], // 店铺装修资源数据
decorator: shopDeco, // 店铺装修资源数据
shopInfo: shopInfoResult // 店铺信息
};
... ... @@ -555,13 +572,13 @@ const getShopData = (req, shopId, uid, isApp) => {
goods: []
};
if (result[1]) {
shopFilterSearchData.filter = productProcess.processFilter(result[1].filter || []);
shopFilterSearchData.goods = productProcess.processProductList(result[1].product_list || [], {isApp: isApp});
if (result[0]) {
shopFilterSearchData.filter = productProcess.processFilter(result[0].filter || []);
shopFilterSearchData.goods = productProcess.processProductList(result[0].product_list || [], {isApp: isApp});
}
/* 店鋪優惠券 */
let shopCoupons = result[2] || [];
/* 店铺优惠券 */
let shopCoupons = result[1] || [];
// 店铺分类
return _getShopCategory(shopId, channel).then(shopCategory => {
... ... @@ -584,8 +601,9 @@ const getShopData = (req, shopId, uid, isApp) => {
);
});
});
});
});
};
/**
... ...
... ... @@ -101,7 +101,7 @@ var $listNav = $('#list-nav'),
end: false
},
newest: {
order: 1,
order: 0,
reload: true,
page: 0,
end: false
... ...