@@ -34,7 +34,7 @@ | |||
import { ref, reactive } from "vue"; | |||
import { onLoad, onReady } from "@dcloudio/uni-app"; | |||
import { fileURL } from "@/datas/fileURL.js"; | |||
const cmd = require("../../static/etcUtil/cmdConfig.js"); | |||
const imgURL = `${fileURL}image/`; | |||
const selectedUrl = imgURL + "bluetooth/select-icons.png"; | |||
@@ -96,6 +96,7 @@ | |||
vehNegImgUrl: "", | |||
isAfter: '', | |||
backIndex:"",//1返回首页 ""返回订单列表 | |||
cardNo:"" | |||
}); | |||
const deviceList = ref([]); | |||
const connectPrefixName = ref(null); | |||
@@ -712,12 +713,42 @@ | |||
console.log("连接成功====="); | |||
datas.setData("bluLinkStatus", true); | |||
datas.setData("connectPrefixName", connectPrefixName.value); | |||
etcOks() | |||
getCardId((cardNo) => { | |||
console.log("cardNo",cardNo); | |||
if(cardNo.includes('5201')){ | |||
// 正常激活 前装 5201 | |||
oks() | |||
}else{ | |||
// 前装9901 | |||
etcOks() | |||
} | |||
}) | |||
} else { | |||
alertF(res.msg); | |||
console.log(res.msg); | |||
} | |||
}; | |||
function getCardId(fun){ | |||
//执行0015文件 | |||
tools.showLoadingAlert("执行指令"); | |||
let cmdArr = [cmd.HOME_DIRECTORY, cmd.APPLICATION_DIRECTORY, "00B095002B"]; | |||
console.log(cmdArr); | |||
console.log(bluetoothUtil); | |||
bluetoothUtil.transCmd(cmdArr, '10', function(res) { //10:写卡 20:写OBU | |||
console.log("res====", res) | |||
var cardStr = res[2]; | |||
if (cardStr == undefined || cardStr == "undefined" || cardStr == "") { | |||
tools.alertF("卡指令不符" + cardStr); | |||
return; | |||
} | |||
if (cardStr.length < 40) { | |||
tools.alertF("卡指令长度不符" + cardStr); | |||
return; | |||
} | |||
tools.hideLoadingAlert(); | |||
fun(cardStr.substring(20, 40)); | |||
}) | |||
} | |||
function etcOks() { | |||
if (routeType.value == "4") { | |||
uni.navigateTo({ |
@@ -306,7 +306,6 @@ function versionVerification(transOrderId, cmd, cmdResult, stepNo){ | |||
const btn = () => { | |||
state.disabled = false | |||
console.log('orderInfo参数', orderInfo, state.disabled) | |||
// versionVerification('','','',1) | |||
cmdResult1() | |||
}; | |||
@@ -251,26 +251,6 @@ import { | |||
const getCardId = () => { | |||
//执行0015文件 | |||
tools.showLoadingAlert("执行指令"); | |||
// if (datas.getData("deviceName").includes("JY")) { | |||
// jyApiEtc.getCardInfo(function(res) { | |||
// if (res.code == '0') { | |||
// var cardInfo = res.cardInfo; | |||
// console.log("res.cardInfo", res.cardInfo) | |||
// card.cardNo = cardInfo.cardId; | |||
// card.startTime = cardInfo.signedDate; | |||
// card.endTime = cardInfo.expiredDate; | |||
// // message = "卡片方标识:" + cardInfo.provider + " 卡片类型:" + cardInfo.cardType + " 卡片版本号:" + | |||
// // cardInfo.cardVersion + " 卡号:" + cardInfo.cardId + " 启用时间:" + | |||
// // cardInfo.signedDate + " 到期时间:" + cardInfo.expiredDate + " 车牌号:" + cardInfo | |||
// // .vehicleNumber + | |||
// // " 用户类型:" + cardInfo.userType + " 车牌颜色:" + cardInfo.plateColor + " 车型:" + cardInfo | |||
// // .vehicleModel; | |||
// getObuId(); | |||
// } else { | |||
// tools.alertF("获取卡片信息失败" + res.code); | |||
// } | |||
// }) | |||
// } else { | |||
let cmdArr = [cmd.HOME_DIRECTORY, cmd.APPLICATION_DIRECTORY, "00B095002B"]; | |||
console.log(cmdArr); | |||
console.log(bluetoothUtil); |
@@ -530,6 +530,7 @@ | |||
fee: state.fee, | |||
preBalance: card.money, | |||
tradeType: 14, | |||
cardVersion:card.version.includes('2')?1:2 | |||
}; | |||
const options = { | |||
type: 2, | |||
@@ -678,8 +679,8 @@ | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(cardCzPayResultCheck, options); | |||
const data = stringToJson(res.bizContent); | |||
const res = await requestNew(cardCzPayResultCheck, options); | |||
const data = res; | |||
console.log("充值检测", data) | |||
resolve(data); | |||
}).catch((error) => { | |||
@@ -702,8 +703,8 @@ | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(cardCzApply, options); | |||
const data = stringToJson(res.bizContent); | |||
const res = await requestNew(cardCzApply, options); | |||
const data = res; | |||
resolve(data); | |||
}).catch((error) => { | |||
reject(error); | |||
@@ -756,8 +757,8 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(cardCzPay, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
requestNew(cardCzPay, options).then((res) => { | |||
const data = res; | |||
uni.requestPayment({ | |||
provider: "wxpay", | |||
orderInfo: "", | |||
@@ -808,7 +809,7 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(cardCzPay, optionsali).then((res) => { | |||
requestNew(cardCzPay, optionsali).then((res) => { | |||
const data = res; | |||
my.tradePay({ | |||
// 调用统一收单交易创建接口(alipay.trade.create),获得返回字段支付宝交易号 trade_no | |||
@@ -844,8 +845,8 @@ | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(cardCzPayResult, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
requestNew(cardCzPayResult, options).then((res) => { | |||
const data = res; | |||
if (data.tradeState === "SUCCESS") { | |||
getCardId(); | |||
} |
@@ -364,7 +364,7 @@ | |||
const gotoEditUserOrUnitInfo = () => { | |||
if (state.isValueCard == 1) { | |||
uni.switchTab({ | |||
url: "/pages/order/order" | |||
url: "/pages/index/index" | |||
}) | |||
} else { | |||
navTo( |
@@ -81,7 +81,7 @@ | |||
}; | |||
requestNew(etcSmsCodeValid, options) | |||
.then((res) => { | |||
navTo(`/subpackage/personal-center/personal-information/setting/change-phone-newphone?phone=${state.phone}&orderId=${res.orderId}`); | |||
navTo(`/subpackage/personal-center/setting/personal-information/change-phone-newphone?phone=${state.phone}&orderId=${res.orderId}`); | |||
}) | |||
.catch((err) => { | |||
console.log(err); |
@@ -438,10 +438,10 @@ export const silentLoginApi = "/iaw/issue/userBasic/loginByNoPassword" // 无感 | |||
//圈存 | |||
export const quanCheck = "/iaw/cardCharge/cardChargeCheckWithCosByVfj"; //圈存检测 | |||
export const quanApply = "/iaw/cardCharge/cardChargeWithCosByVfj"; //圈存申请 | |||
export const cardCzApply = "810"; //储值卡充值一申请 | |||
export const cardCzPay = "811"; //储值卡充值一获取支付 (充值申请) | |||
export const cardCzPayResult = "812"; //储值卡充值-查询支付结果 | |||
export const cardCzPayResultCheck = "814"; //储值卡充值-获取已支付未圈存的充值单(充值检测) | |||
export const cardCzXFCheck = "815"; //储值卡充值-圈存(消费) | |||
export const cardCzApply = "/iaw/cardCharge/recharge"; //储值卡充值一申请 | |||
export const cardCzPay = "/iaw/cardCharge/wxPayment"; //储值卡充值一获取支付 (充值申请) | |||
export const cardCzPayResult = "/iaw/cardCharge/wxPayQuery"; //储值卡充值-查询支付结果 | |||
export const cardCzPayResultCheck = "/iaw/cardCharge/payButNotCircle"; //储值卡充值-获取已支付未圈存的充值单(充值检测) | |||
export const cardCzXFCheck = "/iaw/cardCharge/circle"; //储值卡充值-圈存(消费) | |||
export const quanXf = "/iaw/cardCharge/cardChargeFixWithCosByVfj"; //圈存修复V (写指令) | |||
export const quanConfirm = "/iaw/cardCharge/cardChargeConfirmWithCosByVfj"; //圈存确认 |