restapi.js
12.8 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
// const restapi = require('../utils/util.js');
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);
},
/** 获取智能提醒列表*/
pageIntelligentRminders: function(reminderVo, success, fail) {
restapi.req('/web-dj-weapp/home/pageIntelligentRminders', reminderVo, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
},
/** 下拉加载更多活动*/
loadMoreActivities: function (activityRequestVO, success, fail) {
restapi.req('/web-dj-weapp/popularActivity/loadMoreActivities', activityRequestVO, { '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);
},
generateActivityOrder: function (activityOrderRequestVO, success, fail) {
// restapi.req('/web-dj-weapp/popularActivity/generateActivityOrder', activityOrderRequestVO, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
restapi.req('/web-dj-weapp/popularActivity/generateActivityOrder', JSON.stringify(activityOrderRequestVO), { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail);
},
/** 获取绑定信息*/
getBindingInfo: function (merchantId, success, fail) {
restapi.req('/web-dj-weapp/home/getBindInfoByCondition', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 请求设备列表
*/
getDeviceList: function (success, fail) {
restapi.req('/web-dj-weapp/smartcar/listDevice', {}, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
},
/**
* 切换设备
*/
checkDevice: function (presentDevice, success, failed) {
restapi.req('/web-dj-weapp/smartcar/checkDevice', presentDevice, {}, 'Get', 'json', 'text', success, failed);
},
/**
* 分页获取车辆启动信息
*/
startCarMessgaePage: function (accountId, pageNum, pageSize, success, fail) {
restapi.req('/web-dj-weapp/smartcar/startCarMessgaePage', { accountId: accountId, pageNum: pageNum, pageSize: pageSize }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
},
/**
* 爱车追踪-获取爱车位置
*/
getVehiclePosition: function (userId, success, fail) {
restapi.req('/web-dj-weapp/smartcar/getVehiclePosition', { userId: userId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 我的里程-分页获取日里程列表
*/
getDayWheelPathList: function (obj, success, fail) {
restapi.req('/web-dj-weapp/mileage/getDailyWheelPathList', obj, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 我的里程-分页获取月里程列表
*/
getMonthWheelPathList: function (obj, success, fail) {
restapi.req('/web-dj-weapp/mileage/getMonthWheelPathList', obj, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 我的里程-获取日里程卡片信息
*/
getDailyJourneyCardInfo: function (userId, date, success, fail) {
restapi.req('/web-dj-weapp/mileage/getDailyJourneyCardInfo', { userId: userId, time: date }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 我的里程-获取月里程卡片信息
*/
getMonthJourneyCardInfo: function (userId, date, success, fail) {
restapi.req('/web-dj-weapp/mileage/getMonthJourneyCardInfo', { userId: userId, time: date }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 检查设备状态
*/
checkDeviceStatus: function (userId, success, fail) {
restapi.req('/web-dj-weapp/smartcar/checkDeviceStatus', { userId: userId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
},
/**
* 获取设备绑定信息
*/
getDeviceBindInfo: function (sourcefrom, success, fail) {
restapi.req('/web-dj-weapp/device/getBindInfo', { sourcefrom: sourcefrom }, { 'content-type': 'application/x-www-form-urlencoded' }, 'GET', 'json', 'text', success, fail)
},
/**
* 关闭引导图
*/
closeBindImg: function (success, fail) {
restapi.req('/web-dj-weapp/device/closeBindImg', { }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 绑定设备
*/
bindDevice: function (obj, success, fail) {
restapi.req('/web-dj-weapp/device/bindobd', JSON.stringify(obj), { 'content-type': 'application/json' }, 'POST', 'json', 'text', success, fail)
},
/**
* 绑定设备--车辆未上牌
*/
newCarBind: function (imei, validateCode, typeId, success, fail) {
restapi.req('/web-dj-weapp/device/newCarBindOBD', { sn: imei, checkCode: validateCode, typeId: typeId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 绑定设备--账户下是否包含车辆
*/
isNoVehicle: function (typeId, success, fail) {
restapi.req('/web-dj-weapp/device/isNoVehicle', { typeId: typeId}, { 'content-type': 'application/x-www-form-urlencoded' }, 'GET', 'json', 'text', success, fail)
},
/**
* 获取近四个月有轨迹的日期
*/
getJouneyDays: function (userId, success, fail) {
restapi.req('/web-dj-weapp/mileage/getJouneyDays', { userId: userId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
},
/**
* 获取车智能助手数据
*/
getSmartCarindexInfo: function (userId, success, fail) {
restapi.req('/web-dj-weapp/smartcar/getIndexInfo', { userId: userId }, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 获取车智能助手应用
*/
getSmartCarApp: function (userId, success, fail) {
restapi.req('/web-dj-weapp/smartcar/getSmartCarApp', { userId: userId }, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 获取轨迹详情
*/
// getJourneyById: function (userId, journeyId, startDate, endDate, success, fail) {
// restapi.req('/web-dj-weapp/smartcar/getJourneyById', { userId: userId, journeyId: journeyId, startDate: startDate, endDate: endDate }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
// },
getJourneyById: function (journeyId, success, fail) {
restapi.req('/web-dj-weapp/smartcar/getJourneyById', { journeyId: journeyId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail);
},
/**
* 获取账户下的所有车辆
*/
getVehicles: function(success){
restapi.req('/web-dj-weapp/home/getVehiclesForVerify', {}, {}, 'GET', 'json', 'text', success);
},
/**
* 添加车辆
*/
addOrUpdateVehicle: function (vehicle, success, fail){
restapi.req('/web-dj-weapp/home/addOrUpdateVehicle', vehicle, { 'content-type': 'application/x-www-form-urlencoded'}, 'Post', 'json', 'text', success, fail);
},
/**
* 获得一级品牌(车牌1、2级)
*/
getParentBrands: function(success){
restapi.req('/web-dj-weapp/home/getParentBrands', {}, {}, 'GET', 'json', 'text', success);
},
/**
* 获得品牌车系
*/
getSecondBrands: function (parentId, success){
restapi.req('/web-dj-weapp/home/getSecondBrands', { parentId: parentId }, {}, 'GET', 'json', 'text', success);
},
/**
* 获得门店公共内容
*/
getNotice: function (merchantId,success) {
restapi.req('/web-dj-weapp/home/getNotice', { merchantId: merchantId}, {}, 'GET', 'json', 'text', success);
},
/**
* 删除车辆
*/
deleteVehicle(id, success, fail) {
restapi.req('/web-dj-weapp/home/deleteVehicle', { id: id}, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 获取门店信息
*/
getMerchantById(merchantId, success) {
restapi.req('/web-dj-weapp/personal/merchant', { merchantId: merchantId }, {}, 'GET', 'json', 'text', success);
},
/**
* 获取显示违章的开关
*/
getIllegalFlag(appId, success, fail){
restapi.req('/web-dj-weapp/home/getIllegalFlag', { appId: appId}, {}, 'Get', 'json', 'text', success, fail);
},
/**
* 车智能跳转H5
*/
smartCarJumpToH5(redirectUrl, success, fail) {
restapi.req('/web-dj-weapp/smartcar/route', { redirectUrl: redirectUrl }, {}, 'GET', 'json', 'text', success, fail);
},
//获取云防盗列表
getCloudSecurity: function (userId, success, fail) {
restapi.req('/web-dj-weapp/cloudSecurity/getCloudSecurityList', { protocolId: userId }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
//修改云防盗数据
updateCloudSecurity: function (obj, success, fail) {
restapi.req('/web-dj-weapp/cloudSecurity/updateCloudSecurity', obj, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
//删除云防盗设置
deleteCloudSecurity: function (userId, group, success, fail) {
restapi.req('/web-dj-weapp/cloudSecurity/deleteCloudSecurity', { userId: userId, group: group }, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
//更新云防盗开关
updateCloudSecurityEnable: function (obj, success, fail) {
restapi.req('/web-dj-weapp/cloudSecurity/updateCloudSecurityEnable', obj, { 'content-type': 'application/x-www-form-urlencoded' }, 'POST', 'json', 'text', success, fail)
},
/**
* 获取小程序应用信息
* 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);
},
/**
* 查询是否此活动已报过价
*/
getQuoteRecord: function (activityId, success, fail){
restapi.req('/web-dj-weapp/quote/getQuoteRecord', {activityId:activityId},{},'GET', 'json', 'text', success, fail);
},
/**
* 根据车型年款和购车时间匹配报价价格
*/
getQuoteInfo: function (quote, success,fail){
restapi.req('/web-dj-weapp/quote/getQuoteInfo', quote, { 'content-type': 'application/json' }, 'POST','json','text',success,fail);
},
/**
* 获取商户主营品牌下车系列表
*/
getMerchantCarSeriesList: function(success, fail){
restapi.req('/web-dj-weapp/quote/getMerchantCarSeriesList', {}, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 获取车系下的车型年款
*/
getCarTypeList: function (carSeriesId, success, fail){
restapi.req('/web-dj-weapp/quote/getCarTypeList', { carSeriesId: carSeriesId}, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 生产报价单
*/
generateQuoteRecord: function (record, success, fail){
restapi.req('/web-dj-weapp/quote/generateQuoteRecord', record, { 'content-type': 'application/json'}, 'POST', 'json', 'text', success, fail);
},
/**
* 获取直播间详情
*/
getLiveDetail: function (roomId, success, fail){
restapi.req('/web-dj-weapp/home/liveplayer/detail', roomId, { }, 'GET', 'json', 'text', success, fail);
},
/**
* 获取活动优惠券详情
* */
getActivityCouponById: function(activityCouponId, success, fail) {
restapi.req('/web-dj-weapp/coupon/detail', {
activityCouponId: activityCouponId
}, {}, 'GET', 'json', 'text', success, fail);
},
/**
* 获取优惠券类名
*/
getQuoteCoupon: function (activityId, success, fail) {
restapi.req('/web-dj-weapp/quote/getQuoteCoupon', { activityId: activityId }, {}, 'GET', 'json', 'text', success, fail);
}
}