Authored by 郝肖肖

名星原创详情,1、首屏加载去除调用相关资讯接口。2、更多商品无数据,前端不显示空标签。

... ... @@ -83,8 +83,7 @@ const getDetailData = (req, res, next) => {
let udid = req.sessionID || 'yoho';
let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3';
let isApp = req.query.app_version || req.query.appVersion || false;
let clientType = req.body.client_type || '';
let version = req.body.app_version || '';
let clientType = (req.body.client_type || '').toLowerCase();
let userAgent = req.get('User-Agent');
let isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问
... ... @@ -96,9 +95,9 @@ const getDetailData = (req, res, next) => {
uid = req.user.uid;
}
if (clientType.toLowerCase() === 'ios' && version) {
if (clientType === 'ios' && isApp) {
clientType = 'iphone';
} else if (clientType.toLowerCase() === 'android' && version) {
} else if (clientType === 'android' && isApp) {
clientType = 'android';
} else {
clientType = 'h5';
... ...
... ... @@ -227,7 +227,7 @@ const getNewProduct = (brandId, gender, url, isApp) => {
});
};
// 相关资讯
// 相关资讯--不能加cache,否则点赞有缓存.
const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => {
return serviceAPI.get('guang/service/v1/article/getArticleByBrand', {
... ... @@ -324,12 +324,11 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
list.brand_ico = imageProcess.getSourceUrl(list.brand_ico, 'brandLogo');
return Promise.all([getRelatedEditorial(brandId, uid, udid, clientType, isApp), getNewProduct(brandId, gender, url, isApp)]).then((result) => {
return getNewProduct(brandId, gender, url, isApp).then((result) => {
list = _.assign(list, {
return _.assign(list, {
isLike: false,
infos: result[0],
newArrival: result[1],
newArrival: result,
jumpToApp: jumpToApp,
shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id,
shareTitle: list.brand_name,
... ... @@ -337,8 +336,6 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
shareDesc: htmlProcess.removeHtml(list.brand_intro),
clientType: clientType
});
return list;
});
} else {
... ...
... ... @@ -25,25 +25,25 @@
</div>
</div>
</div>
{{# newArrival}}
{{#if newArrival.naList}}
<div class="new-arrival ps-block">
<div class="floor-header-more">
<h2>NEW ARRIVAL</h2>
<a class="more-btn iconfont buriedpoint" href="{{moreUrl}}" data-bp-id="shop_more_btn_0">&#xe606;</a>
<a class="more-btn iconfont buriedpoint" href="{{newArrival.moreUrl}}" data-bp-id="shop_more_btn_0">&#xe606;</a>
</div>
<div class="new-arrival-content clearfix">
{{# naList}}
{{# newArrival.naList}}
{{> good}}
{{/ naList}}
{{/ newArrival.naList}}
</div>
<div class="more-goods-container">
<a class="mg-text" href="{{moreUrl}}">
<a class="mg-text" href="{{newArrival.moreUrl}}">
更多商品
<span class="more-prods iconfont">&#xe604;</span>
</a>
</div>
</div>
{{/ newArrival}}
{{/if}}
<div class="related-infos data-bind ps-block">
<div>
<h2 class="related-info-title">相关资讯</h2>
... ...