Authored by yyq

hot entry

... ... @@ -32,7 +32,7 @@ exports.index = (req, res, next) => {
return res.render('hot', Object.assign({
css: yield css('chanpin.css'),
title: `${goodsList.name}价格_图片_品牌_怎么样-YOHO!BUY有货`,
title: `${goodsList.name}_${goodsList.name}【图片,新款,价格,折扣,搭配】-YOHO!BUY有货`,
mipUrl: `https://m.yohobuy.com${req.originalUrl}`,
mipFooter: true,
canonical: {
... ...
... ... @@ -54,25 +54,25 @@ module.exports = class extends global.yoho.BaseModel {
result.data.shopId = _.get(result, 'data.shop_id', null);
let finalResult = detailProcess.prodessDetailData(result.data);
let smallSort = _.get(result, 'data.smallSortId');
let midSort = _.get(result, 'data.middleSortId');
if (!smallSort) {
if (!midSort) {
return finalResult;
}
return this.getRecomdKeywords(smallSort).then(res => {
return this.getRecomdKeywords(midSort).then(res => {
let recomdKeywords = [];
try {
res = res ? JSON.parse(res) : [];
} catch (e) {
logger.error(`smallSort: ${smallSort}, message: ${e.message}`);
logger.error(`middleSort: ${midSort}, message: ${e.message}`);
res = [];
}
_.forEach(_.slice(_.shuffle(res), 0, 12), val => {
recomdKeywords.push({
url: helpers.urlFormat(`/chanpin/${val.id}.html`),
url: helpers.urlFormat(`/mip/hot/${val.id}.html`),
keyword: val.keyword
});
});
... ... @@ -86,8 +86,8 @@ module.exports = class extends global.yoho.BaseModel {
});
}
getRecomdKeywords(smallSort) {
return redis.all([['get', `global:yoho:seo:keywords:sortId:${smallSort}:page:1`]]).then(res => {
getRecomdKeywords(midSort) {
return redis.all([['get', `global:yoho:seo:hot:keywords:${midSort}:page:1`]]).then(res => {
return res[0];
});
}
... ...
... ... @@ -24,11 +24,10 @@ const domains = {
// platformApi: 'http://172.16.6.210:8088/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
api: 'http://api-test3.dev.yohocorp.com/',
service: 'http://api-test3.dev.yohocorp.com/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
singleApi: 'http://api-test3.dev.yohocorp.com/',
imSocket: 'ws://socket.yohobuy.com:10240',
imCs: 'http://im.yohobuy.com/api',
... ... @@ -135,7 +134,9 @@ module.exports = {
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.1/jssdk.js',
redis: {
connect: {
host: '127.0.0.1',
host: '192.168.102.49',
// host: '127.0.0.1',
port: '6379',
password: '',
enable_offline_queue: false,
... ...