@@ -125,26 +125,26 @@ | |||
let orderInfo = {}; | |||
const fileDataStrings = reactive({ | |||
approvedCount: "", //核载人数 | |||
approvedCount: 0, //核载人数 | |||
cardId: "", //卡号 | |||
obuId: "", //obu号 | |||
obuId: "", //obu号 | |||
packageNum: "", //套餐编号 | |||
axleCount: "", //轴数 | |||
axleCount: 0, //轴数 | |||
axleDistance: "", //轴距 | |||
engineNum: "", //发动机 | |||
vehicleVin: "", | |||
vehicleEngineNum: "", | |||
cardStatus: "", | |||
obuStatus: "", | |||
type: "", //类型 | |||
userType: "", //用户类型 | |||
type: 0, //类型 | |||
userType: 0, //用户类型 | |||
vehiclePlate: "", //车牌 | |||
vehiclePlateColor: "", //车牌颜色 | |||
vehiclePlateColor: 0, //车牌颜色 | |||
vehicleDimensions: "", | |||
outlineL: "", //外廓 长 | |||
outlineW: "", //外廓 宽 | |||
outlineH: "", //外廓 高 | |||
outlineL: 0, //外廓 长 | |||
outlineW: 0, //外廓 宽 | |||
outlineH: 0, //外廓 高 | |||
wheelCount: "", //车轮数 | |||
vehicleIdNo: "", //车牌号 | |||
vehiclePlateColorStr: "", | |||
@@ -248,18 +248,23 @@ | |||
//获取fileData | |||
const getFileData = () => { | |||
console.log(fileDataStrings); | |||
//获取fileData 拼接字符串 | |||
let res1 = AsciToHexString(fileDataStrings.vehiclePlate, 24); //车牌号 | |||
let res2 = IntegerToHexString(fileDataStrings.vehiclePlateColor, 4); //车牌颜色 | |||
let res3 = IntegerToHexString(fileDataStrings.type, 2); //类型 | |||
let res3 = IntegerToHexString(1, 2); //类型 | |||
let res4 = IntegerToHexString(1, 2); //用户类型 | |||
let res5 = IntegerToHexString(fileDataStrings.outlineL, 4); //车辆尺寸 长 | |||
let res6 = IntegerToHexString(fileDataStrings.outlineW, 2); //车辆尺寸 宽 | |||
let res7 = IntegerToHexString(fileDataStrings.outlineH, 2); //车辆尺寸 高 | |||
let res8 = IntegerToHexString(4, 2); //获取轮数 | |||
let res9 = IntegerToHexString(fileDataStrings.axleCount, 2); //轴数 | |||
let res10 = IntegerToHexString(null, 4); //轴距 | |||
let res9 = IntegerToHexString(4, 2); //轴数 | |||
let res10 = IntegerToHexString(null, 4); //轴距32 | |||
let res11 = IntegerToHexString(fileDataStrings.approvedCount, 6); //核载人数 | |||
let res12 = AsciToHexString(fileDataStrings.vehicleVin, 32); //车编号 | |||
let res13 = AsciToHexString(fileDataStrings.vehicleEngineNum, 32); //发动机 | |||
return res1 + res2 + res3 + res4 + res5 + res6 + res7 + res8 + res9 + res10 + res11 + res12 + res13; |
@@ -152,8 +152,6 @@ | |||
if (res.status) { | |||
getCardRenewal() | |||
} | |||
//移除监听 | |||
uni.$off('bluetoothLink') | |||
}) | |||
}) |
@@ -16,7 +16,7 @@ | |||
</view> | |||
</template> | |||
<script lang="ts" setup> | |||
<script setup> | |||
import { | |||
reactive, | |||
ref | |||
@@ -50,7 +50,7 @@ | |||
list: [] | |||
}); | |||
onLoad(() => { | |||
quanCheckActionTrue().then((item: any) => { | |||
quanCheckActionTrue().then((item) => { | |||
state.list = item.data | |||
console.log(item) | |||
}) | |||
@@ -78,16 +78,6 @@ | |||
reject(error); | |||
}); | |||
} | |||
const list = reactive([{ | |||
name: "A12345" | |||
}, | |||
{ | |||
name: "B12345" | |||
}, | |||
{ | |||
name: "C12345" | |||
}, | |||
]) | |||
const flag = ref('0') | |||
const choose = (i, item) => { |
@@ -1,252 +1,492 @@ | |||
<template> | |||
<view class="selectCar-box"> | |||
<view class="details"> | |||
<view class="title"> 基础信息 </view> | |||
<view class="details-item"> | |||
<view> 订单编号: </view> | |||
<text>123234350000001</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 用户名称: </view> | |||
<text>xxxxx</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 用户证件类型: </view> | |||
<text>居民身份证</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 用户证件号: </view> | |||
<text>44504049343434001</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 订单车牌号: </view> | |||
<text style="color: #00b38b ;">贵A12345</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 收费车型: </view> | |||
<text>客车</text> | |||
</view> | |||
</view> | |||
<view class="title"> 卡信号 </view> | |||
<view class="card"> | |||
<view class="card-left"> | |||
<image :src="`${$imgUrl}/card2.png`" mode=""></image> | |||
<view class="card-center"> | |||
<view class="card-center-head"> 2023022700012 </view> | |||
<view class="tips"> | |||
<text>储蓄卡</text> | |||
<text class="tips-card">正常</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="choose-item" @click="choose(1)"> | |||
<view class="active" v-if="flag.includes(1)"> </view> | |||
</view> | |||
</view> | |||
<view class="title"> OBU设备信息 </view> | |||
<view class="card"> | |||
<view class="card-left"> | |||
<image :src="`${$imgUrl}/card1.png`" mode=""></image> | |||
<view class="card-center"> | |||
<view class="card-center-head"> 2023022700012 </view> | |||
<view class="tips"> | |||
<!-- <text>储蓄卡</text> --> | |||
<text class="tips-card">正常</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="choose-item" @click="choose(2)"> | |||
<view class="active" v-if="flag.includes(2)"> </view> | |||
</view> | |||
</view> | |||
<view class="title"> OBU设备信息 </view> | |||
<view class="remark"> | |||
<view> 1.xxxxxxxx </view> | |||
<view> 2.xxxxxxxx </view> | |||
<view> 3.xxxxxxxx </view> | |||
<view> 4.xxxxxxxx </view> | |||
</view> | |||
<button class="submit" @click="toPage">下一步</button> | |||
</view> | |||
<view class="selectCar-box"> | |||
<view class="details"> | |||
<view class="title"> 基础信息 </view> | |||
<view class="details-item"> | |||
<view> 订单编号: </view> | |||
<text>{{ orderInfos.orderId }}</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 用户名称: </view> | |||
<text>{{ orderInfos.ownerName }}</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 用户证件类型: </view> | |||
<text>{{ getCredentialType(orderInfos.ownerIdtype) }}</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 用户证件号: </view> | |||
<text>{{ orderInfos.ownerIdnum }}</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 订单车牌号: </view> | |||
<text style="color: #00b38b">{{ orderInfos.vehiclePlate }}</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 车牌颜色: </view> | |||
<text style="color: #00b38b">{{ | |||
orderInfos.vehiclePlateColorStr | |||
}}</text> | |||
</view> | |||
<view class="details-item"> | |||
<view> 收费车型: </view> | |||
<text>{{ orderInfos.vehicleType }}</text> | |||
</view> | |||
</view> | |||
<view class="title"> 卡信息 </view> | |||
<view class="card"> | |||
<view class="card-left"> | |||
<image :src="`${$imgUrl}card2.png`" mode=""></image> | |||
<view class="card-center"> | |||
<view class="card-center-head"> {{orderInfos.cardId}} </view> | |||
<view class="tips"> | |||
<text>储蓄卡</text> | |||
<text class="tips-card">{{getEtcCardStatus(orderInfos.cardStatus)}}</text> | |||
</view> | |||
<view class="choose-item"> 有效期:{{orderInfos.cardEnableTime }}</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="title"> OBU设备信息 </view> | |||
<view class="card"> | |||
<view class="card-left"> | |||
<image :src="`${$imgUrl}card1.png`" mode=""></image> | |||
<view class="card-center"> | |||
<view class="card-center-head"> {{orderInfos.obuId}} </view> | |||
<view class="tips"> | |||
<!-- <text>储蓄卡</text> --> | |||
<text class="tips-card">{{getObuStatus(orderInfos.obuStatus)}}</text> | |||
</view> | |||
<view class="choose-item"> 有效期:{{orderInfos.obuEnableTime }} </view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="title"> 注意事项 </view> | |||
<view class="remark"> | |||
<view> 1.xxxxxxxx </view> | |||
<view> 2.xxxxxxxx </view> | |||
<view> 3.xxxxxxxx </view> | |||
<view> 4.xxxxxxxx </view> | |||
</view> | |||
<button class="submit" @click="toPage" v-show="!state.flag">{{orderInfos.cardStatus ==1?'卡签停用':'卡签启用'}}</button> | |||
<button class="submit" @click="toBack" v-show="state.flag">返回服务中心</button> | |||
<view class="mask" v-show="state.showPopup"> | |||
<view class="main"> | |||
<view class="top"> | |||
<image class="icon-close" :src="`${$imgUrl}common/icon-close.png`" @click="cancel"></image> | |||
</view> | |||
<image class="icon-success" :src="`${$imgUrl}bluetooth/device-active-success.png`"></image> | |||
<view class="title">{{orderInfos.cardStatus ==1?'卡签停用':'卡签启用'}}成功!</view> | |||
</view> | |||
</view> | |||
</view> | |||
</template> | |||
<script lang="ts" setup> | |||
import { reactive, ref } from "vue"; | |||
import { navTo } from "@/utils/utils"; | |||
const toPage = () => { | |||
if (flag.length == 0) { | |||
uni.showToast({ | |||
title: "请至少勾选一项", | |||
}); | |||
} else { | |||
wx.showModal({ | |||
title: "提示", | |||
content: "请确保你的ETC设备可以使用,若ETC丢失请前往挂失", | |||
confirmText: "确认停用", | |||
cancelText: "前往挂失", | |||
success: function (res) { | |||
if (res.confirm) { | |||
console.log("用户点击确定"); | |||
navTo("/pages/bluetooth/bluetooth"); | |||
} else if (res.cancel) { | |||
console.log("用户点击取消"); | |||
navTo("/after-sale/card-loss-reporting/cardloss-confirm"); | |||
} | |||
}, | |||
}); | |||
} | |||
}; | |||
const flag = reactive([]); | |||
const choose = (data) => { | |||
if (!flag.includes(data)) { | |||
flag.push(data); | |||
console.log(flag); | |||
} else { | |||
flag.splice(flag.indexOf(data), 1); | |||
console.log(flag); | |||
} | |||
}; | |||
<script setup> | |||
import { | |||
reactive | |||
} from "vue"; | |||
import { | |||
navTo | |||
} from "@/utils/utils"; | |||
import { | |||
onLoad, | |||
onUnload, | |||
onShow | |||
} from "@dcloudio/uni-app"; | |||
import { | |||
request | |||
} from "@/utils/network/request.js"; | |||
import { | |||
orderDetail, | |||
cardStopOrStart, | |||
writeCardBack, | |||
cardModifyConfirm | |||
} from "@/utils/network/api.js"; | |||
import { | |||
getCredentialType | |||
} from "@/datas/credentialType.js"; | |||
import { | |||
getEtcCardStatus | |||
} from "@/datas/etcCardStatus.js"; | |||
import { | |||
getObuStatus | |||
} from "@/datas/obuStatus.js"; | |||
import { | |||
stringToJson | |||
} from "@/utils/network/encryption"; | |||
const tools = require("../../static/etcUtil/tools.js"); | |||
const bluetoothUtil = require("../../static/etcUtil/index.js"); | |||
const state = reactive({ | |||
showPopup: false, | |||
flag: false | |||
}) | |||
const orderInfos = reactive({ | |||
orderId: "", | |||
ownerName: "", | |||
ownerIdtype: "", | |||
ownerIdnum: "", | |||
vehiclePlate: "", | |||
vehiclePlateColorStr: "", | |||
vehiclePlateColor: "", | |||
vehicleType: "", | |||
cardId: "", | |||
cardStatus: "", | |||
obuId: "", | |||
obuStatus: "", | |||
cardEnableTime: "", | |||
obuEnableTime: "", | |||
}); | |||
onLoad((option) => { | |||
//请求订单详情 | |||
queryOrderDetail(option.id); | |||
}); | |||
onShow((option) => { | |||
uni.$on('bluetoothLink', res => { | |||
console.log(res); | |||
if (res.status) { | |||
tools.showLoadingAlert("正在执行指令"); | |||
getCardStopOrStart() | |||
} | |||
}) | |||
}) | |||
onUnload(() => { | |||
//移除监听 | |||
uni.$off('bluetoothLink') | |||
}) | |||
//获取订单详情 | |||
const queryOrderDetail = (id) => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
id: id, | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(orderDetail, options).then((res) => { | |||
let orderInfo = JSON.parse(res.bizContent); | |||
console.log(orderInfo); | |||
orderInfos.orderId = orderInfo.orderId; | |||
orderInfos.ownerName = orderInfo.ownerName; | |||
orderInfos.ownerIdtype = orderInfo.ownerIdtype; | |||
orderInfos.ownerIdnum = orderInfo.ownerIdnum; | |||
orderInfos.vehiclePlate = orderInfo.vehiclePlate; | |||
orderInfos.vehiclePlateColorStr = orderInfo.vehiclePlateColorStr; | |||
orderInfos.vehiclePlateColor = orderInfo.vehiclePlateColor; | |||
orderInfos.vehicleType = orderInfo.vehicleType; | |||
orderInfos.cardId = orderInfo.cardId; | |||
orderInfos.cardStatus = orderInfo.cardStatus; | |||
orderInfos.obuId = orderInfo.obuId; | |||
orderInfos.obuStatus = orderInfo.obuStatus; | |||
orderInfos.cardEnableTime = orderInfo.cardEnableTime.substring(0, 10); | |||
orderInfos.obuEnableTime = orderInfo.obuEnableTime.substring(0, 10); | |||
}); | |||
}; | |||
//卡停用/启用 请求 | |||
const getCardStopOrStart = () => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
cardId: orderInfos.cardId, | |||
orderId:orderInfos.orderId, | |||
operation: orderInfos.cardStatus ==1?1:2,//1停用2启用 | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(cardStopOrStart, options).then((res) => { | |||
let result = stringToJson(res.bizContent); | |||
let cmdArray = result.command?result.command.split(","):[]; | |||
console.log(result); | |||
// console.log(result.cosRecordId); | |||
if (cmdArray.length > 0) { | |||
tools.showLoadingAlert("正在执行指令"); | |||
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, result.cosRecordId, res.toString()); | |||
} | |||
}) | |||
} | |||
}) | |||
}; | |||
/** | |||
* 写卡指令返回 请求 | |||
*/ | |||
const getCommandBack = (command, cosRecordId, response) => { | |||
console.log('======循环写卡指令中======') | |||
tools.showLoadingAlert("加载中"); | |||
let options = { | |||
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交) | |||
data: { | |||
cardId: orderInfos.cardId, | |||
orderId: orderInfos.orderId, | |||
command: command, | |||
response: response, | |||
cosRecordId: cosRecordId, | |||
cosType: 2 | |||
}, //请求参数 | |||
method: "POST", //提交方式(默认POST) | |||
showLoading: true, //是否显示加载中(默认显示) | |||
}; | |||
//调用方式 | |||
request(writeCardBack, options) | |||
.then((res) => { | |||
tools.hideLoadingAlert(); | |||
let result = JSON.parse(res.bizContent); | |||
if (result.orderStatus == 1 || result.orderStatus == "1") { | |||
tools.showLoadingAlert("执行指令中"); | |||
bluetoothUtil.transCmd(result.command.split(","), "10", function(res) { | |||
tools.hideLoadingAlert(); | |||
let response = res.toString(); | |||
getCommandBack(result.command, cosRecordId, response); | |||
}); | |||
} else { | |||
getCardModifyConfirm(cosRecordId); | |||
} | |||
}) | |||
}; | |||
//卡信息变更确认 | |||
const getCardModifyConfirm = (cosRecordId) => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
cardId: orderInfos.cardId, | |||
operation: 3, | |||
cosRecordId: cosRecordId, | |||
orderId: orderInfos.orderId | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(cardModifyConfirm, options).then((res) => { | |||
console.log(res); | |||
state.showPopup = true; | |||
}) | |||
} | |||
//去连接蓝牙 | |||
const toPage = () => { | |||
// getCardStopOrStart() | |||
navTo("/pages/bluetooth/bluetooth?routeType=5"); //去连接蓝牙 | |||
}; | |||
//返回列表 | |||
const toBack = () => { | |||
// navTo("/pages/service/service") | |||
uni.navigateBack({ | |||
delta:2 | |||
}) | |||
} | |||
//关闭弹窗 | |||
const cancel = () => { | |||
state.flag = true; | |||
state.showPopup = false; | |||
} | |||
</script> | |||
<style> | |||
page { | |||
width: 100%; | |||
height: 100%; | |||
background-color: #fff; | |||
} | |||
page { | |||
width: 100%; | |||
height: 100%; | |||
background-color: #fff; | |||
} | |||
</style> | |||
<style lang="scss" scoped> | |||
.selectCar-box { | |||
// width: 100%; | |||
// height: 100%; | |||
padding: 30rpx; | |||
.title { | |||
font-size: 30rpx; | |||
font-family: Microsoft YaHei UI; | |||
font-weight: 400; | |||
color: #333333; | |||
margin-bottom: 30rpx; | |||
} | |||
.details { | |||
.title { | |||
font-size: 30rpx; | |||
font-family: Microsoft YaHei UI; | |||
font-weight: 400; | |||
color: #333333; | |||
margin-bottom: 30rpx; | |||
} | |||
.details-item { | |||
display: flex; | |||
font-size: 26rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #999999; | |||
margin-bottom: 30rpx; | |||
text { | |||
font-size: 26rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
} | |||
} | |||
.card { | |||
height: 150rpx; | |||
background: #ffffff; | |||
box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8); | |||
border-radius: 20rpx; | |||
padding: 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
margin-bottom: 60rpx; | |||
.card-left { | |||
display: flex; | |||
align-items: center; | |||
image { | |||
width: 100rpx; | |||
height: 90rpx; | |||
} | |||
.card-center { | |||
margin-left: 30rpx; | |||
.card-center-head { | |||
font-size: 32rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
.tips { | |||
font-size: 26rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #666666; | |||
.tips-card { | |||
width: 70rpx; | |||
height: 40rpx; | |||
background: #d3f2ef; | |||
border-radius: 6rpx; | |||
font-size: 20rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #0a8f8a; | |||
padding: 5rpx 10rpx; | |||
margin-left: 20rpx; | |||
} | |||
} | |||
} | |||
} | |||
.choose-item { | |||
margin-right: 20rpx; | |||
width: 50rpx; | |||
height: 50rpx; | |||
border: 1rpx solid #00b38b; | |||
border-radius: 50%; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
.active { | |||
width: 38rpx; | |||
height: 38rpx; | |||
background: #00b38b; | |||
border-radius: 50%; | |||
} | |||
} | |||
} | |||
.remark { | |||
font-size: 26rpx; | |||
font-family: Microsoft YaHei UI; | |||
font-weight: 400; | |||
color: #666666; | |||
text-indent: 30rpx; | |||
margin-bottom: 30rpx; | |||
} | |||
.submit { | |||
margin-top: 100rpx; | |||
width: 670rpx; | |||
height: 80rpx; | |||
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%); | |||
border-radius: 40rpx; | |||
font-size: 32rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #ffffff; | |||
line-height: 80rpx; | |||
} | |||
} | |||
.mask { | |||
background: rgba(0, 0, 0, .35); | |||
position: fixed; | |||
left: 0; | |||
top: 0; | |||
bottom: 0; | |||
right: 0; | |||
} | |||
.main { | |||
width: 560rpx; | |||
padding: 25rpx 20rpx 55rpx; | |||
text-align: center; | |||
background: #fff; | |||
position: absolute; | |||
left: 50%; | |||
top: 50%; | |||
transform: translate(-50%, -50%); | |||
border-radius: 20rpx; | |||
.top { | |||
text-align: right; | |||
.icon-close { | |||
width: 48rpx; | |||
height: 48rpx; | |||
} | |||
} | |||
.icon-success { | |||
width: 500rpx; | |||
height: 320rpx; | |||
margin-top: 22rpx; | |||
} | |||
.title { | |||
color: #333333; | |||
font-size: 40rpx; | |||
font-weight: 600; | |||
text-align: center; | |||
margin-top: 55rpx; | |||
} | |||
} | |||
.selectCar-box { | |||
// width: 100%; | |||
// height: 100%; | |||
padding: 30rpx; | |||
.title { | |||
font-size: 30rpx; | |||
font-family: Microsoft YaHei UI; | |||
font-weight: 400; | |||
color: #333333; | |||
margin-bottom: 30rpx; | |||
} | |||
.details { | |||
.title { | |||
font-size: 30rpx; | |||
font-family: Microsoft YaHei UI; | |||
font-weight: 400; | |||
color: #333333; | |||
margin-bottom: 30rpx; | |||
} | |||
.details-item { | |||
display: flex; | |||
font-size: 26rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #999999; | |||
margin-bottom: 30rpx; | |||
text { | |||
font-size: 26rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
} | |||
} | |||
.card { | |||
height: 150rpx; | |||
background: #ffffff; | |||
box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8); | |||
border-radius: 20rpx; | |||
padding: 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
margin-bottom: 60rpx; | |||
.card-left { | |||
display: flex; | |||
align-items: center; | |||
image { | |||
width: 100rpx; | |||
height: 90rpx; | |||
} | |||
.card-center { | |||
margin-left: 30rpx; | |||
.card-center-head { | |||
font-size: 32rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
.tips { | |||
font-size: 26rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #666666; | |||
.tips-card { | |||
width: 70rpx; | |||
height: 40rpx; | |||
background: #d3f2ef; | |||
border-radius: 6rpx; | |||
font-size: 20rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #0a8f8a; | |||
padding: 5rpx 10rpx; | |||
margin-left: 20rpx; | |||
} | |||
} | |||
} | |||
} | |||
.choose-item { | |||
margin-right: 20rpx; | |||
/* width: 50rpx; */ | |||
// height: 50rpx; | |||
/* border: 1rpx solid #00B38B; */ | |||
border-radius: 50%; | |||
// display: flex; | |||
// justify-content: center; | |||
// align-items: center; | |||
font-size: 25rpx; | |||
// align-self: end; | |||
.active { | |||
width: 38rpx; | |||
height: 38rpx; | |||
background: #00b38b; | |||
border-radius: 50%; | |||
} | |||
} | |||
} | |||
.remark { | |||
font-size: 26rpx; | |||
font-family: Microsoft YaHei UI; | |||
font-weight: 400; | |||
color: #666666; | |||
text-indent: 30rpx; | |||
margin-bottom: 30rpx; | |||
} | |||
.submit { | |||
margin-top: 100rpx; | |||
width: 670rpx; | |||
height: 80rpx; | |||
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%); | |||
border-radius: 40rpx; | |||
font-size: 32rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #ffffff; | |||
line-height: 80rpx; | |||
} | |||
} | |||
</style> |
@@ -1,35 +1,89 @@ | |||
<template> | |||
<view class="selectCar-box"> | |||
<view class="item" v-for="(item,i) in list" :key="i"> | |||
<view v-if="state.list.length>0" @click="choose(i,item)" class="item" v-for="(item,i) in state.list" :key="i"> | |||
<view class="iten-left"> | |||
<image :src="`${$imgUrl}/che.png`" mode=""></image> | |||
<text>{{item.name}}</text> | |||
<image :src="`${$imgUrl}che.png`" mode=""></image> | |||
<text>{{item.vehiclePlate}}</text> | |||
</view> | |||
<view class="choose-item" @click="choose(i,item)"> | |||
<view class="active" v-if="flag==i"> | |||
<view class="choose-item"> | |||
<view class="active" v-if="flag==i"> | |||
</view> | |||
</view> | |||
</view> | |||
<view v-else class="flex"> | |||
暂无车辆订单信息 | |||
</view> | |||
</view> | |||
</template> | |||
<script lang="ts" setup> | |||
import {reactive,ref} from"vue" | |||
import {navTo} from "@/utils/utils" | |||
const list=reactive([ | |||
{name:"A12345"}, | |||
{name:"B12345"}, | |||
{name:"C12345"}, | |||
]) | |||
const flag=ref('0') | |||
const choose=(i,item)=>{ | |||
flag.value=i | |||
console.log("选择得数据",item); | |||
navTo('/after-sale/card-deactivation-activation/deactivation-activation-confirm') | |||
} | |||
<script setup> | |||
import { | |||
reactive, | |||
ref | |||
} from "vue" | |||
import { | |||
navTo | |||
} from "@/utils/utils" | |||
import { | |||
onLoad, | |||
onShow | |||
} from "@dcloudio/uni-app"; | |||
import { | |||
orderList | |||
} from "@/utils/network/api.js"; | |||
import { | |||
request | |||
} from "@/utils/network/request.js"; | |||
import { | |||
msg | |||
} from "@/utils/utils"; | |||
import { | |||
getItem, | |||
StorageKeys, | |||
setItem | |||
} from "@/utils/storage"; | |||
import { | |||
stringToJson | |||
} from "@/utils/network/encryption"; | |||
const state = reactive({ | |||
list: [] | |||
}); | |||
onLoad(() => { | |||
quanCheckActionTrue().then((item) => { | |||
state.list = item.data | |||
console.log(item) | |||
}) | |||
}); | |||
const quanCheckActionTrue = () => { | |||
var data = { | |||
opId: getItem(StorageKeys.OpenId), | |||
source: 'WECHAT', | |||
tabIndex: '0', | |||
orderStep: '11', | |||
isValueCard: '2' | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(orderList, options); | |||
const data = stringToJson(res.bizContent); | |||
resolve(data); | |||
}).catch((error) => { | |||
reject(error); | |||
}); | |||
} | |||
const flag = ref('0') | |||
const choose = (i, item) => { | |||
console.log(item.cardId) | |||
navTo(`/after-sale/card-deactivation-activation/deactivation-activation-confirm?id=${item.id}`) | |||
} | |||
</script> | |||
<style> | |||
@@ -40,6 +94,11 @@ const choose=(i,item)=>{ | |||
} | |||
</style> | |||
<style lang="scss" scoped> | |||
.flex { | |||
display: flex; | |||
justify-content: center; | |||
} | |||
.selectCar-box { | |||
// width: 100%; | |||
height: 100%; | |||
@@ -55,9 +114,11 @@ const choose=(i,item)=>{ | |||
box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8); | |||
border-radius: 20rpx; | |||
margin-bottom: 30rpx; | |||
.iten-left { | |||
display: flex; | |||
align-items: center; | |||
image { | |||
width: 150rpx; | |||
height: 90rpx; | |||
@@ -72,19 +133,21 @@ const choose=(i,item)=>{ | |||
color: #333333; | |||
} | |||
} | |||
.choose-item{ | |||
width: 44rpx; | |||
height: 44rpx; | |||
background: #FFFFFF; | |||
border: 2rpx solid #00B38B; | |||
border-radius: 50%; | |||
margin-right: 20rpx; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
box-sizing: content-box; | |||
.choose-item { | |||
width: 44rpx; | |||
height: 44rpx; | |||
background: #FFFFFF; | |||
border: 2rpx solid #00B38B; | |||
border-radius: 50%; | |||
margin-right: 20rpx; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
box-sizing: content-box; | |||
} | |||
.active{ | |||
.active { | |||
width: 34rpx; | |||
height: 34rpx; | |||
background: #00B38B; |
@@ -319,7 +319,7 @@ | |||
obu.engineNum = HexToStrig(res.substring(86, 118)); | |||
obu.type = getVehicleType(HexToInt(res.substring(28, 30))); | |||
obu.userType = HexToInt(res.substring(30, 32))==1?"个人用户":"单位用户"; | |||
obu.vehiclePlate = HexToStrig(res.substring(0, 24)); | |||
obu.vehiclePlate = HexToStrig(res.substring(0, 24),2); | |||
//获取车牌颜色 | |||
obu.vehiclePlateColor = getVehiclePlateColor(HexToInt(res.substring(24, 28))); | |||
obu.vin = HexToStrig(res.substring(54, 86)); |
@@ -62,7 +62,7 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<button class="submit" @click="toPage" v-show="!state.flag">设备升级</button> | |||
<button class="submit" @click="toPage" v-show="!state.flag" :disabled="state.disabled">设备升级</button> | |||
<button class="submit" @click="toBack" v-show="state.flag">返回服务中心</button> | |||
<view class="mask" v-show="state.showPopup"> | |||
@@ -96,6 +96,7 @@ | |||
import { | |||
orderDetail, | |||
deviceUpgrade, | |||
writeCardBack, | |||
cardModifyConfirm | |||
} from "@/utils/network/api.js"; | |||
@@ -116,7 +117,8 @@ | |||
const bluetoothUtil = require("../../static/etcUtil/index.js"); | |||
const state = reactive({ | |||
showPopup: false, | |||
flag: false | |||
flag: false, | |||
disabled:false, | |||
}) | |||
const orderInfos = reactive({ | |||
orderId: "", | |||
@@ -131,8 +133,8 @@ | |||
cardStatus: "", | |||
obuId: "", | |||
obuStatus: "", | |||
cardEnableTime:"", | |||
obuEnableTime:"", | |||
cardEnableTime: "", | |||
obuEnableTime: "", | |||
}); | |||
onLoad((option) => { | |||
@@ -144,12 +146,11 @@ | |||
uni.$on('bluetoothLink', res => { | |||
console.log(res); | |||
if (res.status) { | |||
tools.showLoadingAlert("正在执行指令"); | |||
state.disabled = true; | |||
getDeviceUpgrade() | |||
} | |||
//移除监听 | |||
uni.$off('bluetoothLink') | |||
}) | |||
}) | |||
onUnload(() => { | |||
//移除监听 | |||
@@ -180,8 +181,8 @@ | |||
orderInfos.cardStatus = orderInfo.cardStatus; | |||
orderInfos.obuId = orderInfo.obuId; | |||
orderInfos.obuStatus = orderInfo.obuStatus; | |||
orderInfos.cardEnableTime = orderInfo.cardEnableTime.substring(0,10); | |||
orderInfos.obuEnableTime = orderInfo.obuEnableTime.substring(0,10); | |||
orderInfos.cardEnableTime = orderInfo.cardEnableTime.substring(0, 10); | |||
orderInfos.obuEnableTime = orderInfo.obuEnableTime.substring(0, 10); | |||
}); | |||
}; | |||
//设备升级 请求 | |||
@@ -190,36 +191,32 @@ | |||
type: 2, | |||
data: { | |||
cardId: orderInfos.cardId, | |||
vehiclePlate: orderInfos.vehiclePlate, | |||
expireTime: "", | |||
customerName: orderInfos.ownerName, | |||
customerIdNum: orderInfos.ownerIdnum, | |||
vehiclePlateColor: orderInfos.vehiclePlateColor, | |||
orderId: orderInfos.orderId | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(deviceUpgrade, options).then((res) => { | |||
tools.hideLoadingAlert(); | |||
let result = stringToJson(res.bizContent); | |||
console.log(result); | |||
console.log("&&&&&&&&&&&&",result); | |||
let cmdArray = result.command ? result.command.split(",") : ""; | |||
let cmdArray = result.command.split(","); | |||
console.log(cmdArray); | |||
console.log(result.cosRecordId); | |||
if (cmdArray.length > 0) { | |||
tools.showLoadingAlert("正在执行指令"); | |||
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") { | |||
if (status == "9000") { | |||
getCommandBack(result.command, result.cosRecordId, res.toString()); | |||
} | |||
}) | |||
} | |||
}) | |||
}; | |||
/** | |||
* 写卡指令返回 请求 | |||
*/ | |||
@@ -239,7 +236,7 @@ | |||
method: "POST", //提交方式(默认POST) | |||
showLoading: true, //是否显示加载中(默认显示) | |||
}; | |||
//调用方式 | |||
request(writeCardBack, options) | |||
.then((res) => { | |||
@@ -257,7 +254,7 @@ | |||
} | |||
}) | |||
}; | |||
//卡信息变更确认 | |||
const getCardModifyConfirm = (cosRecordId) => { | |||
const options = { | |||
@@ -284,7 +281,10 @@ | |||
//返回列表 | |||
const toBack = () => { | |||
navTo("/pages/service/service") | |||
// navTo("/pages/service/service") | |||
uni.navigateBack({ | |||
delta:2 | |||
}) | |||
} | |||
@@ -480,5 +480,12 @@ | |||
color: #ffffff; | |||
line-height: 80rpx; | |||
} | |||
.submit::after{ | |||
border: 0; | |||
} | |||
.submit[disabled] { | |||
background: #f0f0f0; | |||
color: #333; | |||
} | |||
} | |||
</style> |
@@ -1,98 +1,154 @@ | |||
<template> | |||
<view class="selectCar-box"> | |||
<view class="item" v-for="(item,i) in list" :key="i"> | |||
<view class="iten-left"> | |||
<image :src="`${$imgUrl}che.png`" mode=""></image> | |||
<text>{{item.name}}</text> | |||
</view> | |||
<view class="choose-item" @click="choose(i,item)"> | |||
<view class="active" v-if="flag==i"> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="selectCar-box"> | |||
<view | |||
v-if="state.list.length > 0" | |||
@click="choose(i, item)" | |||
class="item" | |||
v-for="(item, i) in state.list" | |||
:key="i" | |||
> | |||
<view class="iten-left"> | |||
<image :src="`${$imgUrl}che.png`" mode=""></image> | |||
<text>{{ item.vehiclePlate }}</text> | |||
</view> | |||
<view class="choose-item"> | |||
<view class="active" v-if="flag == i"> </view> | |||
</view> | |||
</view> | |||
<view v-else class="flex"> 暂无车辆订单信息 </view> | |||
</view> | |||
</template> | |||
<script lang="ts" setup> | |||
import {reactive,ref} from"vue" | |||
import {navTo} from "@/utils/utils" | |||
import { reactive, ref } from "vue"; | |||
import { navTo } from "@/utils/utils"; | |||
import { onLoad, onShow } from "@dcloudio/uni-app"; | |||
import { orderList } from "@/utils/network/api.js"; | |||
import { request } from "@/utils/network/request.js"; | |||
import { msg } from "@/utils/utils"; | |||
import { getItem, StorageKeys, setItem } from "@/utils/storage"; | |||
import { stringToJson } from "@/utils/network/encryption"; | |||
const list=reactive([ | |||
{name:"A12345"}, | |||
{name:"B12345"}, | |||
{name:"C12345"}, | |||
]) | |||
const flag=ref('0') | |||
const state = reactive({ | |||
list: [], | |||
}); | |||
onLoad(() => { | |||
quanCheckActionTrue().then((item: any) => { | |||
state.list = item.data; | |||
console.log(item); | |||
}); | |||
}); | |||
const choose=(i,item)=>{ | |||
flag.value=i | |||
console.log("选择得数据",item); | |||
navTo('/after-sale/pin-code-deblocking/pin-code-confirm') | |||
} | |||
const quanCheckActionTrue = () => { | |||
var data = { | |||
opId: getItem(StorageKeys.OpenId), | |||
source: "WECHAT", | |||
tabIndex: "0", | |||
orderStep: "11", | |||
isValueCard: "2", | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
return new Promise(async (resolve, reject) => { | |||
const res = await request(orderList, options); | |||
const data = stringToJson(res.bizContent); | |||
resolve(data); | |||
}).catch((error) => { | |||
reject(error); | |||
}); | |||
}; | |||
const list = reactive([ | |||
{ | |||
name: "A12345", | |||
}, | |||
{ | |||
name: "B12345", | |||
}, | |||
{ | |||
name: "C12345", | |||
}, | |||
]); | |||
const flag = ref("0"); | |||
const choose = (i, item) => { | |||
console.log(item.cardId); | |||
navTo( | |||
`/after-sale/pin-code-deblocking/pin-code-confirm?id=${item.id}` | |||
); | |||
}; | |||
</script> | |||
<style> | |||
page { | |||
width: 100%; | |||
height: 100%; | |||
background-color: #EEF7F7; | |||
} | |||
page { | |||
width: 100%; | |||
height: 100%; | |||
background-color: #eef7f7; | |||
} | |||
</style> | |||
<style lang="scss" scoped> | |||
.selectCar-box { | |||
// width: 100%; | |||
height: 100%; | |||
padding: 30rpx; | |||
.flex { | |||
display: flex; | |||
justify-content: center; | |||
} | |||
.selectCar-box { | |||
// width: 100%; | |||
height: 100%; | |||
padding: 30rpx; | |||
.item { | |||
padding: 20rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
height: 130rpx; | |||
background: #FFFFFF; | |||
box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8); | |||
border-radius: 20rpx; | |||
margin-bottom: 30rpx; | |||
.iten-left { | |||
display: flex; | |||
align-items: center; | |||
image { | |||
width: 150rpx; | |||
height: 90rpx; | |||
.item { | |||
padding: 20rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
height: 130rpx; | |||
background: #ffffff; | |||
box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8); | |||
border-radius: 20rpx; | |||
margin-bottom: 30rpx; | |||
} | |||
.iten-left { | |||
display: flex; | |||
align-items: center; | |||
text { | |||
margin-left: 20rpx; | |||
font-size: 32rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
} | |||
.choose-item{ | |||
width: 44rpx; | |||
height: 44rpx; | |||
background: #FFFFFF; | |||
border: 2rpx solid #00B38B; | |||
border-radius: 50%; | |||
margin-right: 20rpx; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
box-sizing: content-box; | |||
} | |||
.active{ | |||
width: 34rpx; | |||
height: 34rpx; | |||
background: #00B38B; | |||
border-radius: 50%; | |||
} | |||
image { | |||
width: 150rpx; | |||
height: 90rpx; | |||
} | |||
} | |||
text { | |||
margin-left: 20rpx; | |||
font-size: 32rpx; | |||
font-family: Noto Sans S Chinese; | |||
font-weight: 400; | |||
color: #333333; | |||
} | |||
} | |||
.choose-item { | |||
width: 44rpx; | |||
height: 44rpx; | |||
background: #ffffff; | |||
border: 2rpx solid #00b38b; | |||
border-radius: 50%; | |||
margin-right: 20rpx; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
box-sizing: content-box; | |||
} | |||
} | |||
.active { | |||
width: 34rpx; | |||
height: 34rpx; | |||
background: #00b38b; | |||
border-radius: 50%; | |||
} | |||
} | |||
} | |||
</style> |
@@ -32,6 +32,10 @@ export const etcCardStatus = [ | |||
id: 9, | |||
title: '预注销' | |||
}, | |||
{ | |||
id: 11, | |||
title: '停用' | |||
}, | |||
{ | |||
id: 99, | |||
title: '已删除' |
@@ -121,5 +121,6 @@ export const quanConfirm = "72"; //圈存确认 | |||
//卡签操作 | |||
export const cardRenewal = "891" //ASS-卡续期 | |||
export const cardStopOrStart ="892" //ASS-卡停/启用 | |||
export const deviceUpgrade = "893"//BDS-设备升级接口 | |||
export const deviceUpgrade = "896"//BDS-设备升级接口 | |||
export const cardModifyConfirm = "898" //ASS-卡信息变更确认 | |||
export const pinCodeUnlock = "862" //ASS-卡PIN解锁 |
@@ -28,7 +28,7 @@ export function HighAddZero(str, nLen) { | |||
} | |||
export function AsciToHexString(strAsci, nLen) { | |||
let s = String(strAsci); | |||
let encoder = new TextEncoder("gbk"); | |||
let encoder = new TextEncoder("UTF-8"); | |||
let bytes = encoder.encode(s); | |||
let strResult = HexToString(bytes); | |||
let strLen = strResult.length; | |||
@@ -62,7 +62,8 @@ export function HexToString(inHex) { | |||
* @param {string} data | |||
* @returns {string} | |||
*/ | |||
export function HexToStrig(data) { | |||
export function HexToStrig(data,charType=1) { | |||
let str = data.substring(data.length - 2); | |||
while (str === "00") { | |||
data = data.substring(0, data.length - 2); | |||
@@ -73,7 +74,12 @@ export function HexToStrig(data) { | |||
} | |||
const asd = hexStringToByteArray(data); | |||
try { | |||
str = new TextDecoder("gbk").decode(asd); | |||
if(charType ==1){ | |||
str = new TextDecoder("GBK").decode(asd); | |||
}else{ | |||
str = new TextDecoder("UTF-8").decode(asd); | |||
} | |||
} catch (e) { | |||
console.error(e); | |||
} | |||
@@ -112,3 +118,30 @@ export function HexToInt(data) { | |||
} | |||
return num.toString(); | |||
} | |||
function guessEncoding(bytes) { | |||
// 检查字节序列是否以 BOM(字节顺序标记)开头 | |||
if (bytes[0] === 0xEF && bytes[1] === 0xBB && bytes[2] === 0xBF) { | |||
return 'UTF-8'; | |||
} else if (bytes[0] === 0xFE && bytes[1] === 0xFF) { | |||
return 'UTF-16BE'; | |||
} else if (bytes[0] === 0xFF && bytes[1] === 0xFE) { | |||
return 'UTF-16LE'; | |||
} else { | |||
// 统计每个字节的频率 | |||
let freq = {}; | |||
for (let i = 0; i < bytes.length; i++) { | |||
let b = bytes[i]; | |||
freq[b] = freq[b] ? freq[b] + 1 : 1; | |||
} | |||
// 检查是否存在 GBK 的特定字节序列 | |||
if (freq[0x81] && freq[0x81] > 0 && freq[0x40] && freq[0x40] > 0) { | |||
return 'GBK'; | |||
} | |||
// 如果没有特定的 GBK 字节序列,则假设为 UTF-8 | |||
return 'UTF-8'; | |||
} | |||
} |