<template> | <template> | ||||
<!-- style="filter: grayscale(1)" --> | <!-- style="filter: grayscale(1)" --> | ||||
<view :class="state.isEnableSetGray?'setGray':''"> | |||||
<view :class="state.isEnableSetGray?'setGray':''"> | |||||
<slot></slot> | <slot></slot> | ||||
</view> | </view> | ||||
</template> | </template> |
state.cardId = option.cardId; | state.cardId = option.cardId; | ||||
state.connectSuccess = option.connectSuccess; | state.connectSuccess = option.connectSuccess; | ||||
state.orderNum = getItem("orderNum"); | state.orderNum = getItem("orderNum"); | ||||
//跳转过来走圈存流程 | |||||
if (state.connectSuccess === "1") { | if (state.connectSuccess === "1") { | ||||
/*读卡*/ | /*读卡*/ | ||||
getCardId(); | getCardId(); | ||||
} | } | ||||
quanCheckAction().then((val: any) => { | |||||
//如果 圈层检测正常 | |||||
if (val.chargeStatus === 1) { | |||||
console.log(`进行充值检测`); | |||||
czCheckAction().then((checkResult: any) => { | |||||
//判断订单逻辑如果有订单充值 则直接拿到订单去链接蓝牙 | |||||
if (checkResult.orders && checkResult.orders.length > 0) { | |||||
//拿到订单,存起来 | |||||
state.orderNum = checkResult.orders[0].orderNum; | |||||
setItem("orderNum", state.orderNum); | |||||
// 检测用户是否存在有半条流水 | |||||
go() | |||||
} else { | |||||
console.log('没有可修复的流水') | |||||
} | |||||
}); | |||||
} else { | |||||
// 检测用户是否存在有半条流水 | |||||
go() | |||||
} | |||||
}); | |||||
}); | }); | ||||
function go() { | |||||
uni.showModal({ | |||||
title: '提示', | |||||
content: '检测到你有一笔未充值的订单,请先进行充值!', | |||||
success: () => { | |||||
//走蓝牙进行修复 | |||||
uni.navigateTo({ | |||||
url: `/pages/bluetooth/bluetooth?routeType=2&&cardId=${state.cardId}`, | |||||
}); | |||||
}, | |||||
fail: () => {} | |||||
}) | |||||
} | |||||
const tableIndexAction = (val: any) => { | const tableIndexAction = (val: any) => { | ||||
state.tableIndex = val | state.tableIndex = val | ||||
state.money = state.moneryArray[val].value | state.money = state.moneryArray[val].value | ||||
const rechargeAction = () => { | const rechargeAction = () => { | ||||
state.fee = state.money * 100; //元换成分 | state.fee = state.money * 100; //元换成分 | ||||
wx.showModal({ | wx.showModal({ | ||||
title: '圈存确认', | title: '圈存确认', | ||||
content: '您确定要充值圈存吗', | content: '您确定要充值圈存吗', | ||||
//拿到订单,存起来 | //拿到订单,存起来 | ||||
state.orderNum = checkResult.orders[0].orderNum; | state.orderNum = checkResult.orders[0].orderNum; | ||||
setItem("orderNum", state.orderNum); | setItem("orderNum", state.orderNum); | ||||
//链接蓝牙 | //链接蓝牙 | ||||
uni.navigateTo({ | |||||
url: `/pages/bluetooth/bluetooth?routeType=2&&cardId=${state.cardId}`, | |||||
}); | |||||
go() | |||||
} else { | } else { | ||||
console.log(`进行充值申请`); | |||||
cardCzApplyAction().then((applyResult: any) => { | cardCzApplyAction().then((applyResult: any) => { | ||||
//拿到订单 存起来 | //拿到订单 存起来 | ||||
state.orderNum = applyResult.orderNum; | state.orderNum = applyResult.orderNum; | ||||
setItem("orderNum", state.orderNum); | setItem("orderNum", state.orderNum); | ||||
//如果订单没有支付 走支付 | //如果订单没有支付 走支付 | ||||
if (applyResult.orderStatus === | |||||
"ORDER_NOT_PAY") { | |||||
if (applyResult.orderStatus === "ORDER_NOT_PAY") { | |||||
//走支付 | //走支付 | ||||
console.log("走支付"); | console.log("走支付"); | ||||
wxPayment(); | wxPayment(); | ||||
}); | }); | ||||
} else { | } else { | ||||
//走蓝牙进行修复 | //走蓝牙进行修复 | ||||
uni.navigateTo({ | |||||
url: `/pages/bluetooth/bluetooth?routeType=2&&cardId=${state.cardId}`, | |||||
}); | |||||
go() | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
} | } | ||||
}); | }); | ||||
}; | }; | ||||
/*读卡*/ | /*读卡*/ | ||||
} else if (fixStatus === 2) { | } else if (fixStatus === 2) { | ||||
uanConfirmSucessAction(value).then((confirmResult) => { | uanConfirmSucessAction(value).then((confirmResult) => { | ||||
msg("充值成功"); | msg("充值成功"); | ||||
navTo( | |||||
`/pages/recharge/result`) | |||||
navTo(`/pages/recharge/result`) | |||||
}); | }); | ||||
} else if (fixStatus === 1) { | } else if (fixStatus === 1) { | ||||
quanCheckActionTrue().then((val) => { | quanCheckActionTrue().then((val) => { |
const obuId = orderInfo.obuId; | const obuId = orderInfo.obuId; | ||||
const obuStatus = orderInfo.obuStatus != null ? orderInfo.obuStatus : '9' | const obuStatus = orderInfo.obuStatus != null ? orderInfo.obuStatus : '9' | ||||
console.log('当前卡签状态', cardId, obuId, cardStatus, obuStatus) | console.log('当前卡签状态', cardId, obuId, cardStatus, obuStatus) | ||||
console.log('输出内容', obu.obuId, '=======', fileDataStrings.obuId) | |||||
if (obu.obuId != fileDataStrings.obuId) { | if (obu.obuId != fileDataStrings.obuId) { | ||||
tools.showModalAlert("订单设备号信息与当前设备号信息不符!"); | tools.showModalAlert("订单设备号信息与当前设备号信息不符!"); | ||||
return | return | ||||
}; | }; | ||||
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); | |||||
if (orderInfo) { | if (orderInfo) { | ||||
fileDataStrings.userType = orderInfo.userType; //用户类型 | fileDataStrings.userType = orderInfo.userType; //用户类型 | ||||
fileDataStrings.approvedCount = parseInt(orderInfo.vehicleApprovedCount); //核载人数 | fileDataStrings.approvedCount = parseInt(orderInfo.vehicleApprovedCount); //核载人数 | ||||
tools.hideLoadingAlert(); | tools.hideLoadingAlert(); | ||||
let result = stringToJson(res.bizContent); | let result = stringToJson(res.bizContent); | ||||
tools.showLoadingAlert("执行指令中"); | tools.showLoadingAlert("执行指令中"); | ||||
console.log('写卡指令', result.command) | |||||
bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { | bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { | ||||
tools.hideLoadingAlert(); | tools.hideLoadingAlert(); | ||||
getCommandBack(result.command, result.cosRecordId, res.toString()); | getCommandBack(result.command, result.cosRecordId, res.toString()); | ||||
if (res[0] == "9000") { | if (res[0] == "9000") { | ||||
tools.showLoadingAlert("执行指令"); | tools.showLoadingAlert("执行指令"); | ||||
//再次获取随机数 | //再次获取随机数 | ||||
let cmdArr = [cmd.HOME_DIRECTORY, cmd.OBU_DF01, cmd.OBU_EF01, cmd.RANDOM_NUMBER]; | |||||
let cmdArr = [cmd.HOME_DIRECTORY, cmd.OBU_DF01, cmd.OBU_EF01, cmd | |||||
.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> |
<view> 用户名称: </view> | <view> 用户名称: </view> | ||||
<text>{{ orderInfos.ownerName }}</text> | <text>{{ orderInfos.ownerName }}</text> | ||||
</view> | </view> | ||||
<view class="details-item"> | |||||
<view class="details-item">去 | |||||
<view> 用户证件类型: </view> | <view> 用户证件类型: </view> | ||||
<text>{{ getCodeName('CERTIFICATE_TYPE',orderInfos.ownerIdtype) }}</text> | <text>{{ getCodeName('CERTIFICATE_TYPE',orderInfos.ownerIdtype) }}</text> | ||||
</view> | </view> | ||||
}; | }; | ||||
request(pinCodeUnlock, options).then((res) => { | request(pinCodeUnlock, options).then((res) => { | ||||
tools.hideLoadingAlert(); | tools.hideLoadingAlert(); | ||||
//第一次调用 | |||||
let result = stringToJson(res.bizContent); | let result = stringToJson(res.bizContent); | ||||
console.log("&&&&&&&&&&&&", result); | |||||
let cmdArray = result.command ? result.command.split(",") : ""; | let cmdArray = result.command ? result.command.split(",") : ""; | ||||
if (cmdArray.length > 0) { | if (cmdArray.length > 0) { | ||||
tools.showLoadingAlert("正在执行指令"); | tools.showLoadingAlert("正在执行指令"); | ||||
bluetoothUtil.transCmd(cmdArray, "10", function(res) { | bluetoothUtil.transCmd(cmdArray, "10", function(res) { | ||||
tools.hideLoadingAlert(); | |||||
let status = res[cmdArray.length - 1].substring(res[cmdArray.length - 1].length - | |||||
4, res[cmdArray.length - 1].length); | |||||
if (status == "9000") { | |||||
getCommandBack(result.command, res.toString(), result.pinType); | |||||
let cosResponse = res.join(","); | |||||
if (cosResponse == "6985") { | |||||
tools.showModalAlert("此卡未锁定", function successFunc() {}); | |||||
} else if (cosResponse == "9303") { | |||||
tools.showModalAlert("此卡pin已永久锁定!请联系客服进行换卡处理!", function successFunc() {}); | |||||
} else { | |||||
getCommandBack(result.command, res.cosResponse, result.pinType); | |||||
} | } | ||||
}) | }) | ||||
} | } | ||||
request(pinCodeUnlock, options).then((res) => { | request(pinCodeUnlock, options).then((res) => { | ||||
tools.hideLoadingAlert(); | tools.hideLoadingAlert(); | ||||
let result = stringToJson(res.bizContent); | let result = stringToJson(res.bizContent); | ||||
console.log("**************", result); | |||||
let cmdArray = result.command ? result.command.split(",") : ""; | |||||
console.log(cmdArray); | |||||
console.log(cmdArray.length); | |||||
if (cmdArray.length > 0) { | |||||
tools.showLoadingAlert("正在执行指令"); | |||||
bluetoothUtil.transCmd(cmdArray, "10", function(res) { | |||||
console.log("执行指令~~~~~~~~~~~~~~~~", res); | |||||
tools.hideLoadingAlert(); | |||||
let status = res[cmdArray.length - 1].substring(res[cmdArray.length - 1].length - | |||||
4, res[cmdArray.length - 1].length); | |||||
if (status == "9000") { | |||||
console.log("执行指令成功结束~~~~~~~~~~~~~~~~"); | |||||
state.showPopup = true; | |||||
} else { | |||||
state.showPopup = true; | |||||
state.status = false; | |||||
} | |||||
}) | |||||
if (result.cardUnblockStatus == "1") { | |||||
tools.showModalAlert("解锁成功", function successFunc() {}); | |||||
} else if (result.cardUnblockStatus == "2") { | |||||
tools.showModalAlert("解锁失败", function successFunc() {}); | |||||
} else if (result.cardUnblockStatus == "3") { | |||||
let cmdArray = result.command ? result.command.split(",") : ""; | |||||
if (cmdArray.length > 0) { | |||||
tools.showLoadingAlert("正在执行指令"); | |||||
bluetoothUtil.transCmd(cmdArray, "10", function(res) { | |||||
tools.hideLoadingAlert(); | |||||
let cosResponse = res.join(","); | |||||
if (cosResponse == "6985") { | |||||
tools.alertF("此卡未锁定"); | |||||
} else if (cosResponse == "9303") { | |||||
tools.alertF("此卡pin已永久锁定!请联系客服进行换卡处理!"); | |||||
} else { | |||||
getCommandBack(result.command, res.cosResponse, result.pinType); | |||||
} | |||||
}) | |||||
} | |||||
} | } | ||||
}) | }) | ||||
}; | }; | ||||
//去连接蓝牙 | //去连接蓝牙 | ||||
const toPage = () => { | const toPage = () => { | ||||
// getPinCodeUnlock() | // getPinCodeUnlock() | ||||
}) | }) | ||||
} | } | ||||
//关闭弹窗 | //关闭弹窗 | ||||
const cancel = () => { | const cancel = () => { | ||||
state.flag = true; | state.flag = true; |
}else if(state.dataArray[i].cardType[j]=='2'){ | }else if(state.dataArray[i].cardType[j]=='2'){ | ||||
cardTypeArr.push('储值卡') | cardTypeArr.push('储值卡') | ||||
}else if(state.dataArray[i].cardType[j]=='3'){ | }else if(state.dataArray[i].cardType[j]=='3'){ | ||||
cardTypeArr.push('记存卡') | |||||
cardTypeArr.push('预存卡') | |||||
} | } | ||||
} | } | ||||
state.dataArray[i].cardTypeArr=cardTypeArr.toString() | state.dataArray[i].cardTypeArr=cardTypeArr.toString() |
{{ "¥" + state.allMoney }} | {{ "¥" + state.allMoney }} | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="as-layout-horizontal as-gravity-center"> | |||||
<checkbox value="cb" />请先阅读并同意 | |||||
<a style="color:#007AFF;text-decoration: underline;">《ETC客户协议》</a> | |||||
</view> | |||||
</view> | </view> | ||||
<view class="action"> | <view class="action"> |