restapi.js
2.37 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
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);
},
/**
* 检查设备状态
*/
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)
},
/**
* 绑定设备
*/
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)
},
/**
* 获取车智能助手数据
*/
getSmartCarindexInfo: function (userId, success, fail) {
restapi.req('/web-dj-weapp/smartcar/getIndexInfo', { userId: userId }, {}, 'GET', 'json', 'text', success, fail);
}
}