yangteng 1 anno fa
parent
commit
2113668912

+ 97
- 15
subpackage/after-sale/card-Renewal/renewal-confirm.vue Vedi File

@@ -107,7 +107,9 @@
cardRenewal,
writeCardBack,
cardModifyConfirm,
obuRenewal
obuRenewal,
modifyObuVehicleInfo,
obuActivation
} from "@/utils/network/api.js";
const cmd = require("../../../static/etcUtil/cmdConfig.js");

@@ -121,6 +123,7 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js");
showPopup: false,
flag: false
})
let cmdRandNum = '';
const orderInfos = reactive({
orderId: "",
ownerName: "",
@@ -253,7 +256,7 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js");
getCommandBack(result.command, cosRecordId, response);
});
} else {
getCardModifyConfirm(cosRecordId);
getCardModifyConfirm(cosRecordId)
}
})
};
@@ -272,7 +275,6 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js");
};
request(cardModifyConfirm, options).then((res) => {
getObuRenewal()
})
}

@@ -305,7 +307,7 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js");
tools.hideLoadingAlert();
var str = res[3].substring(res[3].length - 4, res[3].length);
if (str == "9000") {
let cmdRandNum = res[3].substring(0, res[3].length - 4);
cmdRandNum = res[3].substring(0, res[3].length - 4);
const options = {
type: 2,
data: {
@@ -316,17 +318,25 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js");
showLoading: true,
};
request(obuRenewal, options).then((res) => {
let result = stringToJson(res.bizContent);
let cmdArray = result.command.split(",");
console.log("899",result,cmdArray);
console.log(result.cosRecordId);
if (cmdArray.length > 0) {
tools.showLoadingAlert("正在执行指令");
bluetoothUtil.transCmd(cmdArray, "20", function(res) {
tools.hideLoadingAlert();
state.showPopup = true;
})
}
let datas = stringToJson(res.bizContent);
// let cmdArray = result.command.split(",");
console.log("899",datas,datas.data.APDU);
// if (datas.data.APDU) {
// tools.showLoadingAlert("正在执行指令");
// bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) {
// tools.hideLoadingAlert();
// console.log("res=====",res,res[0])
// // var str = res[3].substring(res[3].length - 4, res[3].length);
// if (res[0] == "9000") {
// cmdRandNum = res[3].substring(0, res[3].length - 4);
// getFileData((demos) => {
// modifyVehicle(demos);
// })
// } else {
// tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]);
// }
// })
// }
})
} else {
tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]);
@@ -334,6 +344,78 @@ const cmd = require("../../../static/etcUtil/cmdConfig.js");
})
}
};
/**
* 修改车辆信息 请求
*/
const modifyVehicle = (ites) => {
tools.showLoadingAlert("加载中");
console.log('======修改车辆信息======', ites)
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
Status: "0",
random: cmdRandNum,
obuSerailNo: orderInfos.obuId,
fileData: ites,
orderId: orderInfos.orderId,
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
//调用方式
request(modifyObuVehicleInfo, options)
.then((res) => {
tools.hideLoadingAlert();
const datas = stringToJson(res.bizContent);
console.log("modifyObuVehicleInfo",modifyObuVehicleInfo,datas)
tools.showLoadingAlert("正在执行指令");
if (datas.data.APDU) {
bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) {
console.log('执行指令结果', res)
tools.hideLoadingAlert();
if (res[0] == "9000") {
getObuActivation();
}
});
}
})
};
/**
* VFJ-OBU在线激活 请求
*/
const getObuActivation = () => {
console.log('======VFJ-OBU在线激活======')
tools.showLoadingAlert("加载中");
let options = {
type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
data: {
random: cmdRandNum,
obuSerailNo: orderInfos.obuId,
orderId: orderInfos.orderId,
}, //请求参数
method: "POST", //提交方式(默认POST)
showLoading: true, //是否显示加载中(默认显示)
};
//调用方式
request(obuActivation, options)
.then((res) => {
tools.hideLoadingAlert();
console.log("在线激活 请求");
console.log(stringToJson(res.bizContent));
const datas = stringToJson(res.bizContent);
tools.showLoadingAlert("执行指令");
bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) {
tools.hideLoadingAlert();
console.log(res);
if (res[0] == "9000") {
state.showPopup = true;
}
});
})
.catch((err) => {
console.log(err);
});
};
</script>

<style>

+ 169
- 0
subpackage/after-sale/progress-query/select-car.vue Vedi File

@@ -0,0 +1,169 @@
<template>
<view class="selectCar-box">
<view v-if="state.list&&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="aspectFill"></image>
<text>{{item.vehiclePlate}}</text>
</view>
<view class="choose-item">
<view class="active" v-if="flag==i">
</view>
</view>
</view>

<view v-else>
<empty title='暂无找到相关车辆信息' />
</view>
</view>
</template>

<script lang="ts" setup>
import empty from "@/components/empty/empty.vue";
import {
reactive,
ref
} from "vue"
import {
navTo
} from "@/utils/utils"
import {
onLoad,
} from "@dcloudio/uni-app";
import {
orderList
} from "@/utils/network/api.js";
import {
request
} from "@/utils/network/request.js";
import {
getItem,
StorageKeys,
} from "@/utils/storage";
import {
stringToJson
} from "@/utils/network/encryption";

const state = reactive({
list: [] //车辆list
});
const flag = ref('0') //默认选择0

onLoad(() => {
quanCheckActionTrue().then((item : any) => {
state.list = item.data
})
});

const quanCheckActionTrue = () => {
let source = ""
// #ifdef MP-ALIPAY
source ="ALI"
// #endif
// #ifdef MP-WEIXIN
source ="WECHAT"
// #endif
var data = {
opId: getItem(StorageKeys.OpenId),
source: source, //渠道为小程序
tabIndex: '0', //0全部
orderStep: '11', //11 为已完成”
isValueCard: "",
orderStatus: "1",
isAfter: true,
};
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 choose = (i, item) => {
flag.value = i
navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?id=${item.id}`)
}
</script>

<style>
page {
width: 100%;
height: 100%;
background-color: #EEF7F7;
}
</style>
<style lang="scss" scoped>
.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;

}

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>

Loading…
Annulla
Salva