不甘寂寞 преди 2 години
родител
ревизия
17b3dfaa34

+ 10
- 12
after-sale/activation/activate.vue Целия файл

@@ -199,24 +199,22 @@
orderInfo = JSON.parse(res.bizContent);
if (orderInfo) {
fileDataStrings.userType = orderInfo.userType; //用户类型
fileDataStrings.approvedCount = orderInfo.vehicleApprovedCount; //核载人数
fileDataStrings.approvedCount = parseInt(orderInfo.vehicleApprovedCount); //核载人数
fileDataStrings.cardId = orderInfo.cardId;
fileDataStrings.packageNum = orderInfo.packageNum;
fileDataStrings.obuId = orderInfo.obuId;
fileDataStrings.vehicleVin = orderInfo.vehicleVin;
fileDataStrings.vehicleEngineNum = orderInfo.vehicleEngineNum;
fileDataStrings.axleCount = orderInfo.vehicleAxleCount; //轴数
fileDataStrings.axleCount = parseInt(orderInfo.vehicleAxleCount); //轴数
fileDataStrings.engineNum = orderInfo.vehicleVin; //发动机
fileDataStrings.type = orderInfo.vehicleType; //类型
fileDataStrings.type = parseInt(orderInfo.vehicleType); //类型
fileDataStrings.vehiclePlate = orderInfo.vehiclePlate; //车牌
fileDataStrings.vehiclePlateColor = orderInfo.vehiclePlateColor; //车牌颜色
fileDataStrings.vehicleDimensions = orderInfo.vehicleDimensions;
let arr = orderInfo.vehicleDimensions.split("x");
fileDataStrings.outlineL = parseInt(arr[0]); //外廓 长
fileDataStrings.outlineW = parseInt(arr[1]); //外廓 宽
fileDataStrings.outlineH = parseInt(
arr[2].substring(0, arr[2].length - 2)
); //外廓 高
fileDataStrings.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
fileDataStrings.vehicleIdNo = orderInfo.vehicleEngineNum; //车编号
fileDataStrings.vehiclePlateColorStr = orderInfo.vehiclePlateColorStr;
fileDataStrings.customerTel = orderInfo.customerTel;
@@ -253,15 +251,15 @@
//获取fileData 拼接字符串
let res1 = AsciToHexString(fileDataStrings.vehiclePlate, 24); //车牌号
let res2 = IntegerToHexString(fileDataStrings.vehiclePlateColor, 4); //车牌颜色
let res3 = IntegerToHexString(1, 2); //类型
let res3 = IntegerToHexString(fileDataStrings.type, 2); //类型
let res4 = IntegerToHexString(1, 2); //用户类型
let res5 = IntegerToHexString(123, 4); //车辆尺寸 长
let res6 = IntegerToHexString(123, 2); //车辆尺寸 宽
let res7 = IntegerToHexString(123, 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(4, 2); //轴数
let res9 = IntegerToHexString(fileDataStrings.axleCount, 2); //轴数
let res10 = IntegerToHexString(null, 4); //轴距
let res11 = IntegerToHexString(5, 6); //核载人数
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;

+ 105
- 32
after-sale/card-Renewal/select-car.vue Целия файл

@@ -1,35 +1,99 @@
<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>
<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-Renewal/renewal-confirm')
}
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: any) => {
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 list = reactive([{
name: "A12345"
},
{
name: "B12345"
},
{
name: "C12345"
},
])
const flag = ref('0')

const choose = (i, item) => {
console.log(item.cardId)
navTo(`/after-sale/card-Renewal/renewal-confirm?id=${item.id}`)
}
</script>

<style>
@@ -40,6 +104,11 @@ const choose=(i,item)=>{
}
</style>
<style lang="scss" scoped>
.flex {
display: flex;
justify-content: center;
}

.selectCar-box {
// width: 100%;
height: 100%;
@@ -55,9 +124,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 +143,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;

+ 18
- 52
after-sale/deviceInfo/deviceInfo.vue Целия файл

@@ -190,51 +190,16 @@
outsideDimensions: "",
})
onLoad((option) => {
// getOrderDetails("f04b28632a2b4dd5959752d0eb2cdb6e")
getCardId(getObuId())
getCardId()
})
//获取订单详情
const getOrderDetails = (id) => {
const options = {
type: 2,
data: {
"id": id
},
method: 'POST',
showLoading: true,
}
request(orderDetail, options).then((res) => {
console.log(res.bizContent);
const result = stringToJson(res.bizContent);
card.cardNo = result.cardId;
card.userName = result.ownerName;
card.idNum = result.ownerIdnum;
card.v_userType = result.vehicleClass;
card.vehiclePlate = result.vehiclePlate,
card.vehiclePlateColor = result.vehiclePlateColor;
card.startTime = result.cardEnableTime;
card.endTime = "";


obu.num = result.obuId;
obu.startTime = result.obuEnableTime;
obu.approvedCount = result.vehicleApprovedCount;
obu.axleCount = result.vehicleAxleCount;
obu.engineNum = result.vehicleEngineNum;
obu.vehiclePlate = result.vehiclePlate;
obu.vehiclePlateColor = result.vehiclePlateColor;

//测试
// state.orderInfo.orderStep = OrderStatus.待激活;
})
};
/**
* 获取卡号
*/
const getCardId = (func) => {
const getCardId = () => {
//执行0015文件
tools.showLoadingAlert("执行指令");

let cmdArr = [cmd.HOME_DIRECTORY, cmd.APPLICATION_DIRECTORY, cmd.CMD_READBINARY, cmd.CMD_GETBALANCE];
console.log(cmdArr);
console.log(bluetoothUtil);
@@ -293,11 +258,10 @@
card.favourable = '未知' + "_" + _str;
break;
}


//回调读取OBU指令
getObuId()
tools.hideLoadingAlert();
func();
} else {
alertF("CMD_00B08E0000指令长度不符" + res[2]);
}
@@ -348,16 +312,16 @@
if (str2 == "9000") {
decryptObuVehicleInfo(obu.num, res[1].substring(0, res[1].length - 4),
function(res) {
console.log(res);
obu.approvedCount = HexToInt(res.substring(48, 54));
obu.axleCount = HexToInt(res.substring(44, 48));
obu.axleDistance = HexToInt(res.substring(44, 48));
obu.engineNum = HexToStrig(res.substring(86, 118));
obu.type = HexToInt(res.substring(28, 30));
obu.userType = HexToInt(res.substring(30, 32));
obu.type = getVehicleType(HexToInt(res.substring(28, 30)));
obu.userType = HexToInt(res.substring(30, 32))==1?"个人用户":"单位用户";
obu.vehiclePlate = HexToStrig(res.substring(0, 24));
//获取车牌颜色
obu.vehiclePlateColor = HexToInt(res.substring(24, 28))
obu.vehiclePlateColor = getVehiclePlateColor(HexToInt(res.substring(24, 28)));
obu.vin = HexToStrig(res.substring(54, 86));
obu.wheelCount = HexToInt(res.substring(40, 42));
obu.outsideDimensions = HexToInt(res.substring(32, 36)) + "x" +
@@ -389,30 +353,32 @@
/**
* 解密OBU车辆信息
*/
const decryptObuVehicleInfo =(num, data, func) =>{
const decryptObuVehicleInfo = (num, data, func) => {
const options = {
type: 2,
data: {
obuSerailNo: num,
fileData: data
fileData: data
},
method: "POST",
showLoading: true,
};
request(obuDecrypt, options).then((res) => {
func(stringToJson(res.bizContent))
const data =stringToJson(res.bizContent)
const FileData =data.data.FileData
func(FileData)
});


};

//返回按钮
const back = () => {
uni.$emit("refreshOrder");
uni.switchTab({
url: "/pages/order/order"
})
}
//提示对话框
const alertF = (msg) => {

//隐藏加载框
@@ -439,7 +405,7 @@
padding: 30rpx 0;
font-size: 36rpx;
text-align: center;
color: #4cd95f;
color: #13E7C1;
}

.info-card .cell {

+ 13
- 3
applyCard/sign-up.vue Целия файл

@@ -77,7 +77,7 @@
uni.login({
provider: "weixin",
success: function(e) {
console.log(e);
uni.request({
url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
success: (res: any) => {
@@ -85,14 +85,23 @@
setItem("QYorder", state)
console.log(res);
},
fail:(err :any)=>{
uni.showToast({
title: "网络异常,请重试!"+err.errcode,
icon:"error",
duration: 500
})
return;
}
});
},
});
};
const savaHandle = () => {
console.log("openid*******",state.openid);
//如果获取openId成功
if (state.openid != '') {
if (state.openid) {
var data = {
orderId: state.orderId,
subOpenId: state.openid,
@@ -153,7 +162,8 @@
//如果获取openId失败
uni.showToast({
title: "网络异常,请重试!",
duration: 500
icon:"none",
duration: 1000
})
return;
}

+ 6
- 1
pages/bluetooth/bluetooth.vue Целия файл

@@ -500,7 +500,7 @@ const connectSuccess = (res) => {
datas.setData("bluLinkStatus", true);
datas.setData("connectPrefixName", connectPrefixName.value);

//routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.信息重写 4.信息读取
//routeType 1.激活(订单来) 2.圈存 (/pages/recharge/recharge来)3.信息重写 4.信息读取 5卡续期
if (routeType.value == "1") {
uni.navigateTo({
url: "/after-sale/activation/activate",
@@ -515,6 +515,11 @@ const connectSuccess = (res) => {
uni.navigateTo({
url: "/after-sale/deviceInfo/deviceInfo",
});
}
else if(routeType.value == "5"){
uni.navigateTo({
url: "/after-sale/card-Renewal/renewal-confirm",
});
}else {
return;
}

+ 8
- 3
utils/network/api.js Целия файл

@@ -2,8 +2,8 @@
export const appId = "52030131"; //应用appid 综合业务支撑平台使用
export const loginTime = 86400; //登录有效时间(单位s) 1天
export const wechatPayConfigId = "6a9a54bc01f6443faea7ffe132b19f6"; //支付配置编号 微信小程序支付
export const wechatAppID = "wx214b4f8de36a0181"; //小程序APPid
export const wechatSecret = "125a44b60b00d7e8a3820cc4cbdbdae8"; //小程序AppSecret
export const wechatAppID = "wx008c60533388527a"; //小程序APPid
export const wechatSecret = "95197718b43b497f02732bd9f8011080"; //小程序AppSecret
/*统一 会员平台*/
export const sendCode = "2"; //统一会员平台发送验证码接口
@@ -102,4 +102,9 @@ export const cardCzPayResult = "812"; //储值卡充值-查询支付结果
export const cardCzPayResultCheck = "814"; //储值卡充值-获取已支付未圈存的充值单(充值检测)
export const cardCzXFCheck = "815"; //储值卡充值-圈存(消费)
export const quanXf = "71"; //圈存修复V (写指令)
export const quanConfirm = "72"; //圈存确认
export const quanConfirm = "72"; //圈存确认
//卡操作
export const cardRenewal = "891" //ASS-卡续期
export const cardStopOrStart ="892" //ASS-卡停/启用

+ 4
- 3
utils/util/fileData.js Целия файл

@@ -1,6 +1,7 @@
// import {
// TextEncoder
// } from "text-decoding";
import {
TextEncoder,
TextDecoder
} from "text-decoding";


export function IntegerToHexString(num, nLen) {

Loading…
Отказ
Запис