...
|
...
|
@@ -6,11 +6,13 @@ |
|
|
'use strict';
|
|
|
const utils = '../../../utils';
|
|
|
const searchApi = require('./search-api');
|
|
|
const shopApi = require('./shop-api');
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const productProcess = require(`${utils}/product-process`);
|
|
|
const searchHandler = require('./search-handler');
|
|
|
const shopHandler = require('./shop-handler');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const crypto = global.yoho.crypto;
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
const limitNum = 60; // 商品每页显示数目
|
...
|
...
|
@@ -544,7 +546,8 @@ const getShopData = (shopId, channel, params, shopInfo) => { |
|
|
searchApi.getProductList(Object.assign({
|
|
|
shop_id: shopId
|
|
|
}, params)), // 搜索店铺商品
|
|
|
searchApi.getShopBrands(shopId) // 店铺品牌数据
|
|
|
searchApi.getShopBrands(shopId), // 店铺品牌数据
|
|
|
shopApi.shopCouponListAsync(792) // 店铺优惠券数据
|
|
|
]).then(result => {
|
|
|
let finalResult = {};
|
|
|
|
...
|
...
|
@@ -614,6 +617,29 @@ const getShopData = (shopId, channel, params, shopInfo) => { |
|
|
});
|
|
|
}
|
|
|
|
|
|
if (result[4].data && !_.isEmpty(result[4].data)) {
|
|
|
let data = result[4].data,
|
|
|
length = data.length || 0;
|
|
|
|
|
|
if (length) {
|
|
|
_.forEach(data, value => {
|
|
|
Object.assign(value, {
|
|
|
coupon_id: crypto.encryption('', `${value.coupon_id}`),
|
|
|
money: +value.money
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (length === 1) {
|
|
|
data[0].showUnit = true;
|
|
|
}
|
|
|
finalResult.coupon = {
|
|
|
list: data,
|
|
|
length: data.length,
|
|
|
showNextBtn: length > 3
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 根据品牌获取分类 (腾讯云测试没有该接口,暂时不调用分类)
|
|
|
apiMethod.push(searchApi.getSortList({brand: shopBrandIds}));
|
|
|
apiMethod = _.concat(apiMethod, articleApiMethod);
|
...
|
...
|
|