...
|
...
|
@@ -7,6 +7,7 @@ |
|
|
const path = require('path');
|
|
|
const Promise = require('bluebird');
|
|
|
const moment = require('moment');
|
|
|
const _ = require('lodash');
|
|
|
const imgUtils = require(path.join(global.utils, 'images'));
|
|
|
const api = global.yoho.API;
|
|
|
const searchApi = global.yoho.SearchAPI;
|
...
|
...
|
@@ -32,6 +33,14 @@ function getProductGoodsInfo(skns) { |
|
|
data: {
|
|
|
query: query
|
|
|
}
|
|
|
}).then(result => {
|
|
|
let resData = {};
|
|
|
|
|
|
_.forEach(_.get(result, 'data.product_list', []), good => {
|
|
|
resData[good.product_skn] = good;
|
|
|
});
|
|
|
|
|
|
return resData;
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -49,10 +58,9 @@ exports.consultList = (uid, page, limit) => { |
|
|
};
|
|
|
|
|
|
const fetchConsults = co(function*(params) {
|
|
|
let res = yield api.get('', {
|
|
|
method: 'web.personCen.buyConsult',
|
|
|
data: params
|
|
|
});
|
|
|
let res = yield api.get('', Object.assign({
|
|
|
method: 'web.personCen.buyConsult'
|
|
|
}, params));
|
|
|
|
|
|
return res;
|
|
|
});
|
...
|
...
|
@@ -68,7 +76,7 @@ exports.consultList = (uid, page, limit) => { |
|
|
const skns = [];
|
|
|
|
|
|
|
|
|
if (res.code === 200 && origin && origin.consult_list.length) {
|
|
|
if (res.code === 200 && origin && origin.consult_list && origin.consult_list.length) {
|
|
|
origin.consult_list.forEach(consult => {
|
|
|
skns.push(consult.skn);
|
|
|
});
|
...
|
...
|
|