Authored by 王水玲

Merge branch 'develop' of git.yoho.cn:fe/yohobuywap-node into develop

@@ -55,7 +55,7 @@ exports.intro = (req, res) => { @@ -55,7 +55,7 @@ exports.intro = (req, res) => {
55 }; 55 };
56 56
57 /** 57 /**
58 - * 为你优选 待处理 58 + * 为你优选
59 * @param {[type]} req [description] 59 * @param {[type]} req [description]
60 * @param {[type]} res [description] 60 * @param {[type]} res [description]
61 * @return {[type]} [description] 61 * @return {[type]} [description]
@@ -66,11 +66,9 @@ exports.preference = (req, res) => { @@ -66,11 +66,9 @@ exports.preference = (req, res) => {
66 yhchannel: req.params.yhchannel, 66 yhchannel: req.params.yhchannel,
67 brandId: req.params.brandId 67 brandId: req.params.brandId
68 }).then((result) => { 68 }).then((result) => {
69 - res.send(result);  
70 -  
71 - // res.render('preference', {  
72 - // result: result,  
73 - // devEnv: true  
74 - // }); 69 + res.render('detail/preference', {
  70 + result: result,
  71 + devEnv: true
  72 + });
75 }); 73 });
76 }; 74 };
@@ -2,35 +2,19 @@ @@ -2,35 +2,19 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2016-05-18 11:42:11 3 * @Date: 2016-05-18 11:42:11
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2016-05-18 17:38:19 5 + * @Last Modified time: 2016-05-30 13:48:17
6 */ 6 */
7 7
8 'use strict'; 8 'use strict';
9 9
10 const library = '../../../library'; 10 const library = '../../../library';
  11 +const utils = '../../../utils';
11 const API = require(`${library}/api`).API; 12 const API = require(`${library}/api`).API;
12 const sign = require(`${library}/sign`); 13 const sign = require(`${library}/sign`);
13 const _ = require('lodash'); 14 const _ = require('lodash');
14 -  
15 -// const helpers = require(`${library}/helpers`);  
16 -  
17 -// const _ = require('lodash');  
18 -  
19 -// const log = require(`${library}/logger`);  
20 - 15 +const productProcess = require(`${utils}/product-process`);
21 var api = new API(); 16 var api = new API();
22 17
23 -/**  
24 - * 处理偏好信息  
25 - * @param {Object} origin [description]  
26 - * @return {Object} [description]  
27 - */  
28 -const getPreference = (origin) => {  
29 - var dest = origin;  
30 -  
31 - return dest;  
32 -};  
33 -  
34 module.exports = (data) => { 18 module.exports = (data) => {
35 var finalResult; 19 var finalResult;
36 20
@@ -40,8 +24,9 @@ module.exports = (data) => { @@ -40,8 +24,9 @@ module.exports = (data) => {
40 yhchannel: data.yhchannel, 24 yhchannel: data.yhchannel,
41 brandId: data.brandId 25 brandId: data.brandId
42 })).then(result => { 26 })).then(result => {
43 - if (!_.isEmpty(result)) {  
44 - finalResult = getPreference(result); 27 + if (!_.isEmpty(result) && result.code === 200) {
  28 + // 为你优选数据处理,接口没有数据,待处理,待验证
  29 + finalResult = productProcess.processProductList(result.data);
45 } 30 }
46 31
47 return finalResult; 32 return finalResult;
@@ -13,7 +13,7 @@ module.exports = { @@ -13,7 +13,7 @@ module.exports = {
13 port: 6001, 13 port: 6001,
14 siteUrl: 'http://m.yohobuy.com', 14 siteUrl: 'http://m.yohobuy.com',
15 domains: { 15 domains: {
16 - api: 'http://testapi.yoho.cn:28078/', // http://192.168.102.205:8080/gateway http://testapi.yoho.cn:28078/ 16 + api: 'http://testapi.yoho.cn:28078/', // http://192.168.102.205:8080/gateway
17 service: 'http://testservice.yoho.cn:28077/' 17 service: 'http://testservice.yoho.cn:28077/'
18 }, 18 },
19 useOneapm: false, 19 useOneapm: false,
@@ -15,6 +15,7 @@ camelCaseObject = (obj) => { @@ -15,6 +15,7 @@ camelCaseObject = (obj) => {
15 obj[k] = camelCase(obj[k]); 15 obj[k] = camelCase(obj[k]);
16 if (/[_-]/.test(k)) { 16 if (/[_-]/.test(k)) {
17 obj[_.camelCase(k)] = obj[k]; 17 obj[_.camelCase(k)] = obj[k];
  18 + delete obj[k];
18 } 19 }
19 }); 20 });
20 return obj; 21 return obj;