restapi.js
8.15 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
const restapi = require('../utils/restapi.js');
module.exports = {
/** 获取绑定信息*/
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);
},
/**
* 删除车辆
*/
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);
},
//获取云防盗列表
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)
}
}