search-api.js
1.35 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* Created by TaoHuang on 2016/6/14.
*/
'use strict';
const api = global.yoho.SearchAPI;
const yohoApi = global.yoho.API;
const getSortByConditionAsync = (condition) => {
return api.get('sortgroup.json', condition);
};
/**
* 获取商品列表
* @return
*/
const getProductList = (params) => {
let finalParams = {
limit: 60,
method: 'app.search.li'
};
Object.assign(finalParams, params);
return yohoApi.get('', finalParams);
};
/**
* 获取分类列表
* @return
*/
const getSortList = (params) => {
let finalParams = {
//method: 'web.regular.groupsort'
method: 'app.search.li'
};
Object.assign(finalParams, params);
return yohoApi.get('', finalParams);
};
/**
* 获取分类图文介绍
* @return
*/
const getSortIntroList = (params) => {
return yohoApi.get('', params);
};
/**
* 获取分类左侧广告
* @return
*/
const getSortads = (params) => {
return yohoApi.get('', params);
};
/**
* 获取品牌folder
* @return
*/
const getBrandFolder = (params) => {
return yohoApi.get('', params);
};
/**
* 一周新品上架
* @return
*/
const getWeekNew = (params) => {
return yohoApi.get('', params);
};
module.exports = {
getSortByConditionAsync,
getProductList,
getSortList,
getSortIntroList,
getSortads,
getBrandFolder,
getWeekNew
};