item-api.js
865 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
38
39
40
41
42
43
44
45
46
47
48
49
/**
* 商品基本信息
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/7/11
*/
'use strict';
const api = global.yoho.API;
const getProductBaseAsync = (pid, uid, skn) => {
let params = {
method: 'h5.product.data',
productId: pid
};
if (uid) {
params.uid = uid;
}
if (skn) {
params.product_skn = skn;
}
return api.get('', params, { cache: true });
};
const getsizeInfoAsync = (skn) => {
return api.get('', {
method: 'h5.product.intro',
productskn: skn
}, { cache: true });
};
const getProductComfort = productId => {
return api.get('', {
method: 'web.productComfort.data',
product_id: productId
}, {
cache: true,
code: 200
});
};
module.exports = {
getProductBaseAsync,
getsizeInfoAsync,
getProductComfort
};