Authored by 郭成尧

Merge branch 'master' into release/usercenter

... ... @@ -29,6 +29,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
return new Promise((resolve) => {
let joinContentFunc = (i, len) => {
if (i < len) {
let build = {};
let art = articleContent[i];
... ... @@ -160,6 +161,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
resolve(contents);
}
};
joinContentFunc(0, articleContent.length);
});
};
... ... @@ -170,6 +172,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
*/
const _relatedBrand = (getBrand) => {
let relatedBrand = getBrand;
relatedBrand.forEach(brand => {
brand.thumb = brand.thumb.replace('http://', '//');
});
... ... @@ -183,6 +186,7 @@ const _relatedBrand = (getBrand) => {
*/
const _relatedTag = (tags, isApp) => {
let relatedTag = [];
tags.forEach(value => {
if (!isApp) {
value.url = helpers.urlFormat('/tags/index', {
... ... @@ -201,6 +205,7 @@ const _relatedTag = (tags, isApp) => {
*/
const _relatedInfo = (getOtherArticle, isApp) => {
let relatedInfo = [];
getOtherArticle.forEach(value => {
if (!isApp) {
value.url = helpers.urlFormat('/info/index', {
... ... @@ -220,6 +225,7 @@ const _relatedInfo = (getOtherArticle, isApp) => {
*/
const _shareInfo = (id, getArticle) => {
let shareInfo = {};
shareInfo.shareLink = helpers.urlFormat('/info/index', {
id: id
}, 'guang');
... ... @@ -317,6 +323,7 @@ const index = (req, res, next) => {
// 分享参数
if (detail.getArticle.cover_image) {
let shareInfo = _shareInfo(id, detail.getArticle);
Object.assign(guang, shareInfo);
data.title = detail.getArticle.article_title + ' | Yoho!Buy有货 | 潮流购物逛不停';
data.title_more = true;
... ... @@ -391,6 +398,7 @@ const mini = (req, res, next) => {
// 分享参数
if (detail.getArticle.cover_image) {
let shareInfo = _shareInfo(id, detail.getArticle);
Object.assign(guang, shareInfo);
}
... ... @@ -446,9 +454,11 @@ const foryoho = (req, res, next) => {
let relatedRecoIndex = data.content.findIndex((cont) => {
return typeof cont.relatedReco !== 'undefined';
});
let collocationIndex = data.content.findIndex((cont) => {
return typeof cont.collocation !== 'undefined';
});
if (relatedRecoIndex > 0) {
data.goods = data.content[relatedRecoIndex].relatedReco;
data.content.splice(relatedRecoIndex, 1);
... ...
... ... @@ -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;
}
});
};
... ... @@ -650,7 +652,7 @@ const getBrandLogoByDomain = (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',
... ...
... ... @@ -31,6 +31,8 @@ var historyval = writeSearch.getHistoryval();
var chHammer, cHammer;
require('../../common');
chHammer = new Hammer($clearHistory[0]);
chHammer.on('tap', function() {
... ... @@ -50,7 +52,7 @@ chHammer.on('tap', function() {
$historySearch.hide();
$clearHistory.hide();
// window.rePosFooter();
window.rePosFooter();
dialog.showDialog({
dialogText: '删除成功',
... ...
... ... @@ -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);
... ...
... ... @@ -587,6 +587,7 @@
margin-top: 1px;
.filter-body {
top: 1px;
overflow: auto;
}
... ...