...
|
...
|
@@ -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
|
|
|
}; |
...
|
...
|
|