Authored by zhangxiaoru

merge

... ... @@ -88,7 +88,7 @@ const pageData = (req, res, next) => {
authorId = req.query.authorId,
isApp = req.yoho.isApp || false,
isTab = req.query.isTab || false,
showAuthor = true;
showAuthor = false;
let uid = req.user.uid,
udid = req.sessionID;
... ... @@ -102,7 +102,7 @@ const pageData = (req, res, next) => {
return;
}
if (!authorId && isNaN(authorId)) {
showAuthor = false;
showAuthor = true;
}
return indexModel.getPageData(gender, sortId, uid, udid, page, tag, authorId, isApp, showAuthor, isTab).then(data => {
if (data) {
... ...
... ... @@ -280,7 +280,7 @@ const index = (req, res, next) => {
}
// 作者信息数据
if (typeof detail.getAuthor.name !== 'undefined') {
if (detail && detail.getAuthor && (typeof detail.getAuthor.name !== 'undefined')) {
data.guang.author = {
avatar: detail.getAuthor.avatar.replace('http://', '//'),
name: detail.getAuthor.name,
... ...
... ... @@ -123,8 +123,9 @@ const getPageData = (gender, sortId, uid, udid, page, tag, authorId, isApp, show
let artList = article.data.list.artList;
artList.forEach(art => {
// build.push(guangProcess.formatArticle(art, true, isApp, showAuthor, uid));
build.push(guangProcess.formatArticle(art, true, isApp, true, uid));
build.push(guangProcess.formatArticle(art, true, isApp, showAuthor, uid));
// build.push(guangProcess.formatArticle(art, true, isApp, true, uid));
});
result.infos = build;
return result;
... ...
<div class="guang-list-page guang-page yoho-page">
{{# guang}}
{{# authorInfo}}
<div id="author-infos" class="editor-header clearfix" data-id={{id}}>
<div id="author-infos" class="editor-header clearfix" data-id={{uid}}>
<div class="avatar">
<img src="{{avatar}}">
</div>
... ...
... ... @@ -237,6 +237,10 @@ const brand = (req, res, next) => {
}
listModel.getBrandLogoByDomain(domain).then(result => {
if (!result) {
return next();
}
brandLogo = result;
title = brandLogo.name;
... ...
... ... @@ -942,13 +942,10 @@ let _getPromotionInfo = (skn) => {
method: 'app.product.promotion',
product_skn: _.toString(skn)
}, {
code: 200,
cache: true
}).then((result) => {
if (result.code === 200) {
return result.data;
}
return {};
return result && result.data;
});
};
... ...
... ... @@ -599,16 +599,18 @@ const getBrandIntro = (brandId, uid) => {
code: 200,
cache: true
}).then(result => {
if (result && result.data) {
let list = result.data;
let list = result.data;
return {
id: list.brand_id,
intro: list.brand_intro,
collected: list.is_favorite && list.is_favorite === 'Y',
title: list.brand_name ? list.brand_name : ''
};
return {
id: list.brand_id,
intro: list.brand_intro,
collected: list.is_favorite && list.is_favorite === 'Y',
title: list.brand_name ? list.brand_name : ''
};
} else {
return false;
}
});
};
... ... @@ -647,10 +649,9 @@ const getBrandLogoByDomain = (domain) => {
method: 'web.brand.byDomain',
domain: domain
}, {
code: 200,
cache: true
}).then(result => {
if (result.data) {
if (result && result.data) {
let formatData = result.data;
return {
... ...
... ... @@ -131,7 +131,7 @@ const getSearchData = (params) => {
return _searchGoods(params).then((result) => {
if (result && result.code === 200) {
return productProcess.processProductList(result.data.product_list || [], {
isApp: params.appVersion,
isApp: params.appVersion && params.appVersion !== 'false',
gender: _coverChannel[params.coverChannel]
});
} else {
... ...
... ... @@ -16,15 +16,15 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/',
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/',
api: 'http://api-test1.yohops.com:9999/',
service: 'http://service-test1.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test1.yohops.com:9999/',
// api: 'http://api-test1.yohops.com:9999/',
// service: 'http://service-test1.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test1.yohops.com:9999/',
},
subDomains: {
host: '.m.yohobuy.com',
... ...
{
"name": "m-yohobuy-node",
"version": "5.0.5",
"version": "5.0.6",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -36,7 +36,7 @@ var $subNav = $('.home-sub-nav'),
brand = $('input[name="brand"]').val(),
coverChannel = $('input[name="coverChannel"]').val(),
favId = $('input[name="favId"]').val();
uid = $('input[name="uid"]').val();
uid = $('input[name="uid"]').val();
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
... ... @@ -230,7 +230,8 @@ function newData(callback) {
type: 'new',
order: '0',
page: navInfo.new.page,
tagNew: '1'
tagNew: '1',
appVersion: appVersion
};
getParam(req);
... ... @@ -255,7 +256,8 @@ function hotData(callback) {
type: 'hot',
order: '1',
page: navInfo.hot.page,
showTag: '1'
showTag: '1',
appVersion: appVersion
};
getParam(req);
... ...
... ... @@ -139,6 +139,7 @@
top: 0;
color: #C0C0C0;
z-index: 2;
font-size: 18PX;
}
}
... ...
... ... @@ -587,6 +587,7 @@
margin-top: 1px;
.filter-body {
top: 1px;
overflow: auto;
}
... ...