index-api.js
1.74 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
87
88
'use strict';
const api = global.yoho.API;
const pendingOrderCount = (uid) => {
return api.get('', {
method: 'web.SpaceOrders.getPendingOrderCount',
uid: uid
});
};
const unreadMessageCount = (uid, udid)=>{
return api.get('', {
method: 'app.home.getInfoNum',
uid: uid,
udid: udid
});
};
const needCommentCount = (uid) =>{
return api.get('', {
method: 'show.notCommentRecordCount',
uid: uid
});
};
const guessBrand = () => {
return api.get('', {
method: 'web.search.favorBrand'
});
};
const newArrival = () => {
return api.get('', {
method: 'web.search.search',
sales: 'Y',
outlets: 2,
stocknumber: 1,
new: 'Y',
order: 's_t_desc',
viewNum: 0
});
};
/**
* 优选新品
*
* @param int $channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活
* @param $uid 用户ID
* @param $udid 设备ID
* @param $rec_pos 位置码
* @param $limit 数量限制
* @return array 接口返回的数据
*/
const recommend = (channelNum, uid, udid, pos, limit) => {
return api.get('', {
method: 'app.home.newPreference',
yh_channel: channelNum,
uid: uid,
udid: udid,
rec_pos: pos,
limit: limit
});
};
/**
* 根据节点和运行模式选择静态内容
* @param $node 20141219-100447
* @param string $mode
* @return mixed
*/
const getByNodeContent = (node, mode) => {
return api.get('', {
method: 'web.html.content',
mode: mode,
node: node
});
};
module.exports = {
pendingOrderCount,
unreadMessageCount,
needCommentCount,
guessBrand,
newArrival,
recommend,
getByNodeContent
};