Authored by zhangxiaoru

recom

... ... @@ -60,7 +60,6 @@ const currencyDetail = (req, res, next) => {
}),
title: '有货币明细',
pageFooter: true,
money: result.money
});
}).catch(next);
... ...
... ... @@ -61,7 +61,7 @@ const currencyDetail = (uid, page, limit) => {
let total = parseInt(result.data.page_total, 10) + 1;
if (page && page < total) {
return myCurrency(uid).then(list => {
return yohoCoin(uid).then(list => {
if (list.yohocoinNum && list.yohocoinNum === 0) {
result.data = _.assign(result.data, {
... ... @@ -86,24 +86,24 @@ const currencyDetail = (uid, page, limit) => {
});
};
const mayLike = (uid, page, limit, udid, gender, recPos, channel) => {
return api.get('', {
method: 'app.search.newLast7day',
uid: uid,
page: page,
limit: limit,
udid: udid,
rec_pos: recPos,
yh_channel: channel
}).then((result) => {
console.log(result);
});
};
// const mayLike = (uid, page, limit, udid, gender, recPos, channel) => {
// return api.get('', {
// method: 'app.search.newLast7day',
// uid: uid,
// page: page,
// limit: limit,
// udid: udid,
// rec_pos: recPos,
// yh_channel: channel
// }).then((result) => {
// console.log(result);
// });
// };
module.exports = {
myCurrency,
currencyDetail,
bannerData,
yohoCoin,
mayLike
yohoCoin
// mayLike
};
... ...
'use strict';
const mRoot = '../models';
const headerModel = require('../../../doraemon/models/header'); // 头部model
const mayLikeModel = require('../models/recom');
const mayLike = (req, res, next) => {
let uid = req.user.uid || 8039759;
let page = req.body.page || 1;
let limit = 50;
let gender = req.query.gender || '1,3';
let udid = req.sessionID || 'yoho';
let recPos = 100009;
let channel = req.query.channel || 1;
mayLikeModel.mayLike(uid, page, limit, gender, udid, recPos, channel).then((result) => {
// res.render('../common/goods', {
// layout: false
// });
}).catch(next);
};
module.exports = {
mayLike
};
\ No newline at end of file
... ...
'use strict';
const serviceAPI = global.yoho.ServiceAPI;
const api = global.yoho.API;
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
const logger = global.yoho.logger;
const mayLike = (uid, page, limit, gender, udid, recPos, channel) => {
return api.get('', {
method: 'app.search.newLast7day',
uid: uid,
page: page,
limit: limit,
udid: udid,
rec_pos: recPos,
yh_channel: channel
}).then((result) => {
//console.log(result);
});
}
module.exports = {
mayLike
};
\ No newline at end of file
... ...
... ... @@ -24,6 +24,9 @@ const outlet = require(`${cRoot}/outlet`);
// recommend-for-you controller
const recommendForYou = require(`${cRoot}/recommend-for-you`);
//recom
const recom = require(`${cRoot}/recom`);
// routers
// /pro_136349_455445/HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html
... ... @@ -34,6 +37,7 @@ router.get('/detail/consults', detail.consults); // 商品咨询页
router.get('/detail/consultform', auth, detail.consultform); // 商品咨询表单页
router.get('/detail/comments', detail.comments);
router.post('/detail/consultsubmit', auth, detail.consultsubmit); // 商品咨询提交接口
router.get('/recom/maylike', recom.mayLike);//你可能喜欢
router.get('/sale', sale.index);
router.get('/sale/discount', sale.discount);
... ...