Authored by zhangxiaoru

冲突

... ... @@ -2,6 +2,12 @@
const mayLikeModel = require('../models/recom');
let yhChannel = {
boys: 1,
girl: 2,
kids: 3
};
/**
* 你可能喜欢的BOYS或GIRLS的商品列表
*/
... ... @@ -12,26 +18,15 @@ const mayLike = (req, res, next) => {
let limit = 50;
let gender = req.query.gender;
let udid = req.sessionID || 'yoho';
let recPos = 100009;
let channel = req.query.channel || 1;
if (channel === 1 || channel === 2) {
return mayLikeModel.mayLike(uid, page, limit, gender, udid, recPos, channel).then((result) => {
res.render('recom/maybe-like', Object.assign({
layout: false,
goods: result
}, result));
}).catch(next);
}
let recPos = req.query.rec_pos || 100001;
let channel = req.cookies._Channel && yhChannel[req.cookies._Channel] || 1;
recPos = 100001;
return mayLikeModel.mayLike(uid, page, limit, gender, udid, recPos, channel).then((result) => {
mayLikeModel.mayLike(uid, page, limit, gender, udid, recPos, channel).then((result) => {
res.render('recom/maybe-like', {
res.render('recom/maybe-like', Object.assign({
layout: false,
goods: result
});
}, result));
}).catch(next);
};
... ... @@ -52,7 +47,25 @@ const mayLikeKids = (req, res, next) => {
}).catch(next);
};
const mayLikelife = (req, res, next) => {
let page = req.query.page || 1;
let limit = 50;
if (page > 1) {
return;
}
mayLikeModel.mayLikelife(page, limit).then((result) => {
res.render('recom/maybe-like-lifestyle', {
layout: false,
goodsContainer: result.goodsContainer
});
}).catch(next);
};
module.exports = {
mayLike,
mayLikeKids
mayLikeKids,
mayLikelife
};
... ...
... ... @@ -59,7 +59,48 @@ const mayLikeKids = (page, limit, channel) => {
});
};
const mayLikelife = (page, limit, channel) => {
return api.get('', {
method: 'app.search.lifeStyle',
page: page,
limit: limit,
yh_channel: '4'
}).then((result) => {
if (result && result.code === 200) {
let formData = {
goodsContainer: []
};
if (result.data.product_list.top) {
let build = {};
build.show = true;
build.goods = productProcess.processProductList(result.data.product_list.top, {showTags: false});
formData.goodsContainer.push(build);
}
if (result.data.product_list.top) {
let build = {};
build.show = true;
build.goods = productProcess.processProductList(result.data.product_list.new, {showTags: false});
formData.goodsContainer.push(build);
}
// console.log(formData)
return formData;
} else {
logger.error('mayLikelife code no 200');
}
});
};
module.exports = {
mayLike,
mayLikeKids
mayLikeKids,
mayLikelife
};
... ...
... ... @@ -74,6 +74,7 @@ router.post('/detail/coupon/save.json', auth, detail.getCoupon); // 获得 品
router.get('/recom/maylike', recom.mayLike); // 你可能喜欢
router.get('/recom/maylikekids', recom.mayLikeKids); // 潮童你可能喜欢
router.get('/recom/maylikelife', recom.mayLikelife); // 创意生活你可能喜欢
router.get('/seckillDetail/seckillData/:productskn', seckillDetail.getSeckillData); // 秒杀数据接口
... ...
<div class="maybe-like">
<ul id="maybe-like-nav" class="maybe-like-nav clearfix">
<li class="maybe-like-nav-item focus">新品到着</li>
<li class="maybe-like-nav-item">人气单品</li>
</ul>
<div id="goods-list">
{{# goodsContainer}}
<div class="goods-list {{^show}}hide{{/show}}">
{{# goods}}
{{> goods}}
{{/ goods}}
</div>
{{/ goodsContainer}}
{{# goodsContainer}}
<div class="goods-list {{^show}}hide{{/show}}">
{{# goods}}
{{> common/goods}}
{{/ goods}}
</div>
<div id="load-more-info" class="load-more-info">
<div class="loading status hide">
正在加载...
</div>
<span class="no-more status hide">没有更多啦</span>
</div>
</div>
\ No newline at end of file
{{/ goodsContainer}}
... ...
... ... @@ -28,6 +28,19 @@ module.exports = {
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/'
// favApi: 'http://192.168.102.31:8092/brower',
// api: 'http://192.168.102.205:8080/gateway/',
// service: 'http://192.168.102.205:8080/gateway/',
// search: 'http://192.168.102.216:8080/yohosearch/'
// api: 'http://api.yoho.yohoops.org/',
// service: 'http://service.yoho.yohoops.org/',
},
subDomains: {
host: '.m.yohobuy.com',
... ...
'use strict';
const fs = require('fs');
let devHost = '127.0.0.1';
let devHost = '172.16.6.134';
fs.readFile('.devhost', (err, buf)=> {
if (!err) {
... ...