DESKTOP-2IO5MST\huting 1 年之前
父節點
當前提交
2a6bb930fa
共有 3 個文件被更改,包括 17 次插入15 次删除
  1. 3
    3
      components/bluetooth/bluetooth.vue
  2. 3
    3
      static/etcUtil/index.js
  3. 11
    9
      subpackage/after-sale/activation/activate.vue

+ 3
- 3
components/bluetooth/bluetooth.vue 查看文件

const tools = require("../../static/etcUtil/tools.js"); const tools = require("../../static/etcUtil/tools.js");
const datas = require("../../static/etcUtil/datas.js"); const datas = require("../../static/etcUtil/datas.js");
const bluetoothUtil = require("../../static/etcUtil/index.js"); const bluetoothUtil = require("../../static/etcUtil/index.js");
let jlApi = require("../../static/etc/JLAPI/JLObuSDK.js"); //聚力SDK let jlApi = require("../../static/etc/JLAPI/JLObuSDK.js"); //聚力SDK
let wjApi = require("../../static/etc/WJAPI/wjBleAPI"); let wjApi = require("../../static/etc/WJAPI/wjBleAPI");
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
wjApi.connectDevice( wjApi.connectDevice(
device, device,
function (res) { function (res) {
console.log('WJ输出内容1',res)
console.log('WJ输出内容1', res)
connectSuccess(res); connectSuccess(res);
}, },
function (res) { function (res) {
console.log('WJ输出内容2',res)
console.log('WJ输出内容2', res)
listenStatus(res); listenStatus(res);
} }
); );

+ 3
- 3
static/etcUtil/index.js 查看文件

let wjApi = require("../etc/WJAPI/wjBleAPI"); let wjApi = require("../etc/WJAPI/wjBleAPI");
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
// 这部分代码将仅在支付宝小程序平台下执行 // 这部分代码将仅在支付宝小程序平台下执行
jlApi = require("../../static/etc/JLObuSDK/JLObuSDK.js");
wjApi = require("../etc/WJBLE/WJBleAPI");
// jlApi = require("../../static/etc/JLObuSDK/JLObuSDK.js");
// wjApi = require("../etc/WJBLE/WJBleAPI");
// 执行支付宝小程序的特定功能 // 执行支付宝小程序的特定功能
// #endif // #endif


switch (connectPrefixName) { switch (connectPrefixName) {
case "WJ": case "WJ":
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
wjApi.transCmd(cmdArr, '00', type == '10' ? 'A3' : 'AC',function(res) {
wjApi.transCmd(cmdArr, '00', type == '10' ? 'A3' : 'AC', function(res) {
if (res.code == 0) { if (res.code == 0) {
func(res.data); func(res.data);
} else { } else {

+ 11
- 9
subpackage/after-sale/activation/activate.vue 查看文件

request(IFCODE.orderDetail, options).then((res) => { request(IFCODE.orderDetail, options).then((res) => {
orderInfo = JSON.parse(res.bizContent); orderInfo = JSON.parse(res.bizContent);
console.log("orderInfo", orderInfo); console.log("orderInfo", orderInfo);
console.log("orderInfores", res);
if (orderInfo) { if (orderInfo) {
fileDataStrings.userType = orderInfo.userType; //用户类型 fileDataStrings.userType = orderInfo.userType; //用户类型
fileDataStrings.approvedCount = parseInt(orderInfo.vehicleApprovedCount); //核载人数 fileDataStrings.approvedCount = parseInt(orderInfo.vehicleApprovedCount); //核载人数
console.log('======获取OBU号======') console.log('======获取OBU号======')
let cmdArray = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE, cmd.RANDOM_NUMBER]; let cmdArray = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE, cmd.RANDOM_NUMBER];
tools.showLoadingAlert("正在执行指令"); tools.showLoadingAlert("正在执行指令");
console.log('======cmdArray======',cmdArray)
console.log('======cmdArray======', cmdArray)
bluetoothUtil.transCmd(cmdArray, "20", function(res) { bluetoothUtil.transCmd(cmdArray, "20", function(res) {
console.log('======cmdArray1======',cmdArray)
console.log('======cmdArray1======', cmdArray)
tools.hideLoadingAlert(); tools.hideLoadingAlert();
console.log('======cmdArray2======',cmdArray)
console.log('======cmdArray2======', cmdArray)
var status = res[1].substring(res[1].length - 4, res[1].length); var status = res[1].substring(res[1].length - 4, res[1].length);
console.log('获取OBU号执行结果' + status)
console.log('获取OBU号执行结果' + status, res)
//第一次获取随机数 //第一次获取随机数
if (status == "9000") { if (status == "9000") {
obu.obuId = res[1].substring(20, 36); obu.obuId = res[1].substring(20, 36);
card.netId = res[2].substring(20, 24); card.netId = res[2].substring(20, 24);
card.cardType = res[2].substring(28, 30) == 23 ? 1 : 2; //23记账卡 非 23储值卡 1:记账卡 2:储值卡 card.cardType = res[2].substring(28, 30) == 23 ? 1 : 2; //23记账卡 非 23储值卡 1:记账卡 2:储值卡
card.vehiclePlateColor = parseInt(res[2].substring(82, 84), 16); card.vehiclePlateColor = parseInt(res[2].substring(82, 84), 16);
console.log('======卡信息======', card)
console.log('======卡信息======', card.cardId, fileDataStrings.cardId)
if (card.cardId != fileDataStrings.cardId) { if (card.cardId != fileDataStrings.cardId) {
tools.showModalAlert("订单卡号与当前设备卡号信息不符!"); tools.showModalAlert("订单卡号与当前设备卡号信息不符!");
return return
.then((res) => { .then((res) => {
tools.hideLoadingAlert(); tools.hideLoadingAlert();
let result = JSON.parse(res.bizContent); let result = JSON.parse(res.bizContent);
console.log("写卡指令============",result)
console.log("写卡指令============", result)
if (result.orderStatus == 1 || result.orderStatus == "1") { if (result.orderStatus == 1 || result.orderStatus == "1") {
tools.showLoadingAlert("执行指令中"); tools.showLoadingAlert("执行指令中");
bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { bluetoothUtil.transCmd(result.command.split(","), "10", function(res) {
tools.showLoadingAlert("执行指令"); tools.showLoadingAlert("执行指令");
//再次获取随机数 //再次获取随机数
let cmdArr = [cmd.HOME_DIRECTORY, cmd.OBU_DF01, cmd.OBU_EF01, cmd let cmdArr = [cmd.HOME_DIRECTORY, cmd.OBU_DF01, cmd.OBU_EF01, cmd
.RANDOM_NUMBER];
.RANDOM_NUMBER
];
bluetoothUtil.transCmd(cmdArr, '20', function(res) { bluetoothUtil.transCmd(cmdArr, '20', function(res) {
var str = res[3].substring(res[3].length - 4, res[3].length); var str = res[3].substring(res[3].length - 4, res[3].length);
if (str == "9000") { if (str == "9000") {
font-size: 34rpx; font-size: 34rpx;
border-radius: 20rpx; border-radius: 20rpx;
} }
</style>
</style>

Loading…
取消
儲存