restapi.js
2.95 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
const restapi = require('../../../utils/restapi.js');
module.exports = {
/** 获取主页数据*/
getIndexModules: function (merchantId, success, fail) {
restapi.req('/web-dj-weapp/home/getIndexModules', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success, fail);
},
/** 领取活动优惠券*/
receiveActivityCoupon: function (activityCouponId, activityId, success, fail) {
restapi.req('/web-dj-weapp/coupon/receive', { activityCouponId: activityCouponId, activityId: activityId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
},
/** 查看活动详情*/
getActivityDetail: function (data, success, fail) {
restapi.req('/web-dj-weapp/popularActivity/detail', JSON.stringify(data), { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail);
},
/** 查看精品交付礼包详情*/
getGoodsDetail: function (data, success, fail) {
restapi.req('/web-dj-weapp/boutiquedelivery/goods/getDetailByGoodsCode', data, {}, 'GET', 'json', 'text', success, fail);
},
generateActivityOrder: function (activityOrderRequestVO, success, fail) {
restapi.req('/web-dj-weapp/popularActivity/generateActivityOrder', JSON.stringify(activityOrderRequestVO), { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail);
},
/**
* 获取门店信息
*/
getMerchantById(merchantId, success) {
restapi.req('/web-dj-weapp/personal/merchant', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success);
},
/**
* 获取小程序应用信息
* merchantId:商户号
*/
getAppInfo: function (merchantId, success, fail) {
restapi.req('/web-dj-weapp/appinfo/get', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 创建记录
*/
createLogRecord: function (obj, success, fail) {
restapi.req('/web-dj-weapp/myactivity/createLogRecord', JSON.stringify(obj), { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail);
},
/**
* 根据活动id查找正在进行的拼团
*/
getGroupsByActivityId: function (activityId, success, fail){
restapi.req('/web-dj-weapp/popularActivity/getGroupsByActivityId', { activityId: activityId }, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 根据团队编码查找拼团记录
*/
getGroupsByGroupCode: function (groupCode, success, fail){
restapi.req('/web-dj-weapp/popularActivity/getGroupsByGroupCode', { groupCode: groupCode }, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 根据条件查找拼团(团长)信息:groupCode:团队编码,account_id:用户账号,activity_id:活动id
*/
getGroupInfoDetail: function (record , success, fail) {
restapi.req('/web-dj-weapp/popularActivity/getGroupInfoDetail', record, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
}
}