Authored by 陈峰

newarrival api

@@ -1096,15 +1096,40 @@ module.exports = class extends global.yoho.BaseModel { @@ -1096,15 +1096,40 @@ module.exports = class extends global.yoho.BaseModel {
1096 return Promise.all(rel).then(); 1096 return Promise.all(rel).then();
1097 } 1097 }
1098 } else { 1098 } else {
1099 - method = 'web.search.newshelve'; 1099 + if (!sortList.length) {
  1100 + return Promise.all(rel).then();
  1101 + }
  1102 + let viewNum = _.first(sortList).viewNum;
  1103 +
1100 params = { 1104 params = {
  1105 + method: 'web.search.newShelveBatch',
1101 order: 'shelve_time:desc', 1106 order: 'shelve_time:desc',
1102 status: 1, 1107 status: 1,
1103 sales: 'Y', 1108 sales: 'Y',
1104 attribute_not: 2, 1109 attribute_not: 2,
1105 stocknumber: 3, 1110 stocknumber: 3,
1106 - dayLimit: 4 1111 + dayLimit: 4,
  1112 + limit: viewNum,
  1113 + viewNum,
  1114 + gender: channelMap[channel].gender,
  1115 + misort: _.join(_.map(sortList, s => s.misort), ',')
1107 }; 1116 };
  1117 + return this.get({
  1118 + data: params,
  1119 + param: {cache: true}
  1120 + }).then(res => {
  1121 + let result = [];
  1122 + let list = _.get(res, 'data.product_list', []);
  1123 +
  1124 + _.forEach(list, (item) => {
  1125 + result.push(processProduct(item, {
  1126 + width: 280,
  1127 + height: 373,
  1128 + gender: params.gender
  1129 + }));
  1130 + });
  1131 + return result;
  1132 + });
1108 } 1133 }
1109 1134
1110 1135
@@ -21,13 +21,13 @@ module.exports = { @@ -21,13 +21,13 @@ module.exports = {
21 cookieDomain: '.yohobuy.com', 21 cookieDomain: '.yohobuy.com',
22 domains: { 22 domains: {
23 // test3 23 // test3
24 - // singleApi: 'http://api-test3.yohops.com:9999/',  
25 - // api: 'http://api-test3.yohops.com:9999/',  
26 - // service: 'http://api-test3.yohops.com:9999/',  
27 - // serviceNotify: 'http://api-test3.yohops.com:9999/',  
28 - // global: 'http://global-test-soa.yohops.com:9999/',  
29 - // platformApi: 'http://192.168.102.48:8088/',  
30 - // yohoNowApi: 'http://yohonow-test.yohops.com:9999/', 24 + singleApi: 'http://api-test3.yohops.com:9999/',
  25 + api: 'http://api-test3.yohops.com:9999/',
  26 + service: 'http://api-test3.yohops.com:9999/',
  27 + serviceNotify: 'http://api-test3.yohops.com:9999/',
  28 + global: 'http://global-test-soa.yohops.com:9999/',
  29 + platformApi: 'http://192.168.102.48:8088/',
  30 + yohoNowApi: 'http://yohonow-test.yohops.com:9999/',
31 31
32 // test2 32 // test2
33 // singleApi: 'http://api-test2.yohops.com:9999/', 33 // singleApi: 'http://api-test2.yohops.com:9999/',
@@ -38,11 +38,11 @@ module.exports = { @@ -38,11 +38,11 @@ module.exports = {
38 // platformApi: 'http://192.168.102.48:8088/', 38 // platformApi: 'http://192.168.102.48:8088/',
39 39
40 // prod 40 // prod
41 - singleApi: 'http://api.yoho.cn/',  
42 - api: 'http://api.yoho.cn/',  
43 - service: 'http://api.yoho.cn/',  
44 - serviceNotify: 'http://service.yoho.cn/',  
45 - platformApi: 'http://172.16.6.210:8088/', 41 + // singleApi: 'http://api.yoho.cn/',
  42 + // api: 'http://api.yoho.cn/',
  43 + // service: 'http://api.yoho.cn/',
  44 + // serviceNotify: 'http://service.yoho.cn/',
  45 + // platformApi: 'http://172.16.6.210:8088/',
46 46
47 // gray 47 // gray
48 // singleApi: 'http://apigray.yoho.cn/', 48 // singleApi: 'http://apigray.yoho.cn/',
@@ -113,7 +113,7 @@ module.exports = { @@ -113,7 +113,7 @@ module.exports = {
113 port: '4444' // influxdb port 113 port: '4444' // influxdb port
114 }, 114 },
115 console: { 115 console: {
116 - level: 'debug', 116 + level: 'info',
117 colorize: 'all', 117 colorize: 'all',
118 prettyPrint: true 118 prettyPrint: true
119 } 119 }