Authored by 郭成尧

为你优选处理逻辑添加

... ... @@ -55,7 +55,7 @@ exports.intro = (req, res) => {
};
/**
* 为你优选 待处理
* 为你优选
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
... ... @@ -66,11 +66,9 @@ exports.preference = (req, res) => {
yhchannel: req.params.yhchannel,
brandId: req.params.brandId
}).then((result) => {
res.send(result);
// res.render('preference', {
// result: result,
// devEnv: true
// });
res.render('detail/preference', {
result: result,
devEnv: true
});
});
};
... ...
... ... @@ -2,35 +2,19 @@
* @Author: Targaryen
* @Date: 2016-05-18 11:42:11
* @Last Modified by: Targaryen
* @Last Modified time: 2016-05-18 17:38:19
* @Last Modified time: 2016-05-30 13:48:17
*/
'use strict';
const library = '../../../library';
const utils = '../../../utils';
const API = require(`${library}/api`).API;
const sign = require(`${library}/sign`);
const _ = require('lodash');
// const helpers = require(`${library}/helpers`);
// const _ = require('lodash');
// const log = require(`${library}/logger`);
const productProcess = require(`${utils}/product-process`);
var api = new API();
/**
* 处理偏好信息
* @param {Object} origin [description]
* @return {Object} [description]
*/
const getPreference = (origin) => {
var dest = origin;
return dest;
};
module.exports = (data) => {
var finalResult;
... ... @@ -40,8 +24,9 @@ module.exports = (data) => {
yhchannel: data.yhchannel,
brandId: data.brandId
})).then(result => {
if (!_.isEmpty(result)) {
finalResult = getPreference(result);
if (!_.isEmpty(result) && result.code === 200) {
// 为你优选数据处理,接口没有数据,待处理,待验证
finalResult = productProcess.processProductList(result.data);
}
return finalResult;
... ...