list.js
844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* product list Model
*/
'use strict';
const api = global.yoho.API;
const camelCase = global.yoho.camelCase;
const path = require('path');
const processProductList = require(path.join(global.utils, '/product-process')).processProductList;
let list = {
/**
* 商品搜索
* @param {[type]} params [description]
* @return {[type]} [description]
*/
search(params) {
return api.post('', {
method: 'app.search.sales',
limit: 4,
saleType: 2,
yh_channel: 3
}, {
cache: true,
code: 200
})
.then(result => {
result = camelCase(result);
result.data.productList = processProductList(result.data.productList);
return result;
});
}
};
module.exports = list;