seckill.js
1.18 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
/**
* 秒杀models
* @author: 陈峰<feng.chen@yoho.cn>
* @date: 2016/9/18
*/
'use strict';
const api = global.yoho.API;
/**
* [获取秒杀时间栏接口]
* @return {[object]}
*/
const queryActivity = () => {
return api.get('', {
method: 'app.seckill.queryActivity'
});
};
/**
* [获取指定秒杀活动商品列表接口]
* @param {[int]} activityId [秒杀活动id]
* @param {[int]} uid only app use
* @return {[object]}
*/
const queryProductList = (activityId) => {
return api.get('', {
method: 'app.seckill.queryProductList',
activityId: activityId
}, {
cache: true
});
};
/**
* 获取提醒 列表
*/
const queryRemindList = (activityId, uid) => {
return api.get('', {
method: 'app.seckill.queryRemindList',
activityId,
uid
});
};
/**
* 设置提醒
*/
const remind = (options) => {
let url = '';
let formData = Object.assign({
method: !options.on_off ? 'app.seckill.cancelUserReminder' : 'app.seckill.addUserReminder',
}, options);
return api.get(url, formData);
};
module.exports = {
queryActivity,
queryProductList,
queryRemindList,
remind
};