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