|
|
@@ -235,11 +235,8 @@ |
|
|
|
console.log('======获取OBU号======') |
|
|
|
let cmdArray = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE, cmd.RANDOM_NUMBER]; |
|
|
|
tools.showLoadingAlert("正在执行指令"); |
|
|
|
console.log('======cmdArray======', cmdArray) |
|
|
|
bluetoothUtil.transCmd(cmdArray, "20", function(res) { |
|
|
|
console.log('======cmdArray1======', cmdArray) |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
console.log('======cmdArray2======', cmdArray) |
|
|
|
var status = res[1].substring(res[1].length - 4, res[1].length); |
|
|
|
|
|
|
|
console.log('获取OBU号执行结果' + status, res) |
|
|
@@ -255,8 +252,9 @@ |
|
|
|
|
|
|
|
//获取fileData |
|
|
|
const getFileData = () => { |
|
|
|
console.log(fileDataStrings); |
|
|
|
console.log("======修改车辆信息0.1======",fileDataStrings); |
|
|
|
//获取fileData 拼接字符串 |
|
|
|
|
|
|
|
let res1 = AsciToHexString(fileDataStrings.vehiclePlate, 24); //车牌号 |
|
|
|
let res2 = IntegerToHexString(fileDataStrings.vehiclePlateColor, 4); //车牌颜色 |
|
|
|
|
|
|
@@ -721,11 +719,85 @@ |
|
|
|
// "&orderId=" + |
|
|
|
// state.orderId, |
|
|
|
// }); |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/subpackage/after-sale/deviceInfo/deviceInfo", |
|
|
|
}); |
|
|
|
bindCardAndObu(); |
|
|
|
|
|
|
|
}); |
|
|
|
}; |
|
|
|
/** |
|
|
|
* 卡签绑定 请求 |
|
|
|
*/ |
|
|
|
const bindCardAndObu = () => { |
|
|
|
console.log('======卡签绑定======') |
|
|
|
tools.showLoadingAlert("加载中"); |
|
|
|
let options = { |
|
|
|
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) |
|
|
|
data: { |
|
|
|
obuId: obu.obuId, |
|
|
|
cardId: card.cardId, |
|
|
|
}, //请求参数 |
|
|
|
method: "POST", //提交方式(默认POST) |
|
|
|
showLoading: true, //是否显示加载中(默认显示) |
|
|
|
}; |
|
|
|
//调用方式 |
|
|
|
request(IFCODE.bindCardAndObu, options) |
|
|
|
.then((res) => { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
let result = JSON.parse(res.bizContent); |
|
|
|
console.log("写卡指令============", result) |
|
|
|
tools.showLoadingAlert("执行指令中"); |
|
|
|
bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
let response = res.toString(); |
|
|
|
getCommandBackEnd(result.command, result.cosRecordId, response); |
|
|
|
// uni.navigateTo({ |
|
|
|
// url: "/subpackage/after-sale/deviceInfo/deviceInfo", |
|
|
|
// }); |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
}; |
|
|
|
/** |
|
|
|
* 卡签绑定写卡指令返回 请求 |
|
|
|
*/ |
|
|
|
const getCommandBackEnd = (command, cosRecordId, response) => { |
|
|
|
console.log('======卡签绑定循环写卡指令中======') |
|
|
|
tools.showLoadingAlert("加载中"); |
|
|
|
let options = { |
|
|
|
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) |
|
|
|
data: { |
|
|
|
cardId: card.cardId, |
|
|
|
orderId: fileDataStrings.orderId, |
|
|
|
command: command, |
|
|
|
response: response, |
|
|
|
cosRecordId: cosRecordId, |
|
|
|
cosType: "4" |
|
|
|
}, //请求参数 |
|
|
|
method: "POST", //提交方式(默认POST) |
|
|
|
showLoading: true, //是否显示加载中(默认显示) |
|
|
|
}; |
|
|
|
|
|
|
|
//调用方式 |
|
|
|
request(IFCODE.writeCardBack, options) |
|
|
|
.then((res) => { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
let result = JSON.parse(res.bizContent); |
|
|
|
console.log("写卡指令============", result) |
|
|
|
if (result.orderStatus == 1 || result.orderStatus == "1") { |
|
|
|
tools.showLoadingAlert("执行指令中"); |
|
|
|
bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
let response = res.toString(); |
|
|
|
getCommandBackEnd(result.command, cosRecordId, response); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
uni.navigateTo({ |
|
|
|
url: "/subpackage/after-sale/deviceInfo/deviceInfo", |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |