Authored by 刘传洋

search bug

... ... @@ -7,6 +7,10 @@
const api = global.yoho.API;
const favApi = global.yoho.FavAPI;
const _ = require('lodash');
const favoriteApi = require('./favorite-api');
const isFavoriteAsync = (uid, pid) => {
let onNewApi = false;
... ... @@ -27,23 +31,8 @@ const isFavoriteAsync = (uid, pid) => {
}
};
const createAsync = (uid, pid) => {
return api.get('', {
method: 'app.favorite.add',
id: pid,
uid: uid,
type: 'product'
});
};
const deleteAsync = (uid, pid) => {
return api.get('', {
method: 'app.favorite.cancel',
fav_id: pid,
uid: uid,
type: 'product'
});
};
const createAsync = _.partial(favoriteApi.addFavAsync, _, _, 'product');
const deleteAsync = _.partial(favoriteApi.cancelFavAsync, _, _, 'product');
module.exports = {
isFavoriteAsync,
... ...
... ... @@ -4,6 +4,6 @@
'use strict';
const favoriteProductAPI = require('./favorite-api');
const favoriteProductAPI = require('./favorite-product-api');
module.exports = favoriteProductAPI;
... ...
... ... @@ -37,7 +37,18 @@ const getProductList = (params) => {
limit: 60
};
Object.assign(finalParams, params);
let nparams = {};
if(params && params.price) {
let mp = params.price.split(',');
let nmp = [];
nmp[0] = (mp && mp[0]) || 0;
nmp[1] = (mp && mp[1]) || 99999;
nparams.price = nmp.join(',');
}
Object.assign(finalParams, params, nparams);
return yohoApi.get('', finalParams);
};
... ...
... ... @@ -59,7 +59,7 @@
"uuid": "^2.0.2",
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.1.4",
"yoho-node-lib": "0.0.47"
"yoho-node-lib": "0.0.49"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
... ...