1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291 |
- <template>
- <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>{{ getCodeName('CERTIFICATE_TYPE',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 class="details-item">
- <view> 重新激活次数: </view>
- <text>{{ state.activationNum }}次</text>
- <text class="record" style="color:#00b38b" @click="goActivationRecord">OBU重新激活记录</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">{{getCodeName('CARD_STATE_TYPE',orderInfos.cardStatus)}}</text>
- </view>
- <!-- <view class="choose-item"> 有效期:xxxx-xx-xx </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">{{getCodeName('OBU_STATE_TYPE',orderInfos.obuStatus)}}</text>
- </view>
- <!-- <view class="choose-item"> 有效期:xxxx-xx-xx </view> -->
- </view>
- </view>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('3')">
- <view class="bg">
- <view class="">
- <view class="name"> 行驶证主页 </view>
- <view class="value"> 上传行驶证的主页 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
-
- <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('4')">
- <view class="bg">
- <view class="">
- <view class="name"> 行驶证副页 </view>
- <view class="value"> 上传行驶证的副页 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"></image>
- </view>
- </view>
- <button class="submit" @click="toPage">再次激活</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">设备激活成功!</view>
- </view>
- </view>
- </view>
- <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
- <view class="choice-takePhoto">
- <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
- <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
- <view @click.stop="cancle">取消</view>
- </view>
- </view>
- <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
- :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
- </template>
-
- <script lang="ts" setup>
- // #ifdef MP-ALIPAY
- import viewfinder from "@/components/viewfinder.vue"
- import {
- reactive,
- ref
- } from "vue";
- import {
- formatTime,
- expireDate,
- expireDate2,
- getFormatDate,
- msg,
- navTo,
- strReplace,
- uploadFile
- } from "@/utils/utils";
- import {
- onLoad, onShow
- } from '@dcloudio/uni-app'
- import {
- request
- } from "@/utils/network/request.js";
- import {
- stringToJson
- } from "@/utils/network/encryption.js";
- import activeSuccess from "./components/popup-device-active-success";
- import * as IFCODE from "@/utils/network/api.js";
- import {
- channelId
- } from "@/utils/network/difference";
- const cmd = require("../../../static/etcUtil/cmdConfig.js");
- const tools = require("../../../static/etcUtil/tools.js");
- const bluetoothUtil = require("../../../static/etcUtil/index.js");
- import {
- getCodeName
- } from "@/datas/queryKey.js";
- import { agentId } from "@/utils/network/difference";
-
-
- const state = reactive({
- phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
- choiceIndex: 1, // 1 身份证正面 2 身份证反面
- isTakePhotoModeShow: false, //选择拍照方式是否出来
- changeColor: false,
- showImg: true,
- images: '',
- showPopup: false,
- form: {
- vehPosImgUrl: "",
- vehNegImgUrl: "",
- vehicleIdNum: ""
- },
- activationNum: "",//激活次数
- })
-
- //订单
- const orderInfos = reactive({
- orderId: "",
- ownerName: "",
- ownerIdtype: "",
- ownerIdnum: "",
- vehiclePlate: "",
- vehiclePlateColorStr: "",
- vehiclePlateColor: "",
- vehicleType: "",
- cardId: "",
- cardStatus: "",
- obuId: "",
- obuStatus: "",
- outlineL: 0,
- outlineW: 0,
- outlineH: 0,
- type: 0,
- axleCount: 0,
- approvedCount: 0,
- vehicleVin: "",
- vehicleEngineNum: "",
- });
- //OBU
- const obu = reactive({
- obuId: "",
- startTime: "",
- endTime: "",
- version: "",
- approvedCount: "",
- axleCount: "",
- axleDistance: "",
- engineNum: "",
- type: "",
- userType: "",
- contractNo: "",
- vehiclePlate: "",
- vehiclePlateColor: "",
- vin: "",
- wheelCount: "",
- isJH: ""
- });
- let cmdRandNum = '';
- let ids = '';
-
- onLoad((option) => {
- console.log('======重新激活开始======', option);
- ids = option.id;
- //请求订单详情
- queryOrderDetail(option.id);
- // uni.$on('bluetoothLink', res => {
- // console.log(res,'===========123');
- // if (res.status) {
- // // getCardRenewal()
- // setTimeout(()=>{
- // getObuId()
- // })
- // }
- // //移除监听
- // console.log('======移除监听======', res)
- // // uni.$off('bluetoothLink')
- // })
-
- if (opn.state) {
- getObuId()
- }
- });
-
- onShow((option) => {
-
-
- })
-
- const cancel = () => {
- state.showPopup = false;
- uni.navigateBack({
- delta: 2
- })
- };
-
- const toPage = () => {
- if (!state.form.vehPosImgUrl) {
- msg("请上传行驶证主页")
- return;
- }
- if (!state.form.vehNegImgUrl) {
- msg("请上传行驶证副页")
- return;
- }
- console.log("state.form.vehicleIdNum", state.form.vehicleIdNum, orderInfos.vehiclePlate)
- if (state.form.vehicleIdNum == orderInfos.vehiclePlate) {
- activationRecordQuery().then((val) => {
- console.log("激活次数", val)
- if (val.limit) {
- navTo("/pages/bluetooth/bluetooth?routeType=5&id=" + ids);
- } else {
- msg("一年内到达激活次数上限5次")
- }
- });
- } else {
- msg("请上传正确行驶证")
- }
-
- // navTo("/pages/bluetooth/bluetooth?routeType=6&id=" + ids);
- };
-
- //获取订单详情
- const queryOrderDetail = (id : string) => {
- const options = {
- type: 2,
- data: {
- id: id,
- },
- method: "POST",
- showLoading: true,
- };
- request(IFCODE.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;
- let arr = orderInfo.vehicleDimensions.split("X");
- orderInfos.outlineL = parseInt(arr[0]); //外廓 长
- orderInfos.outlineW = parseInt(arr[1]); //外廓 宽
- orderInfos.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
-
- orderInfos.type = orderInfo.type;
- orderInfos.axleCount = orderInfo.vehicleAxleCount;
- orderInfos.approvedCount = orderInfo.vehicleApprovedCount;
- orderInfos.vehicleVin = orderInfo.vehicleVin;
- orderInfos.vehicleEngineNum = orderInfo.vehicleEngineNum;
- activationRecordQuery().then((val) => {
- console.log("jihuo", val)
- state.activationNum = val.num
- // getObuId()
- });
-
- });
- };
-
- /**
- * 获取OBU号 读OBU
- */
- const getObuId = () => {
- console.log('======获取OBU号======')
- let cmdArray = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE, cmd.RANDOM_NUMBER];
- tools.showLoadingAlert("正在执行指令");
- bluetoothUtil.transCmd(cmdArray, "20", function (res) {
- tools.hideLoadingAlert();
- var status = res[1].substring(res[1].length - 4, res[1].length);
- console.log('获取OBU号执行结果' + status)
- //第一次获取随机数
- if (status == "9000") {
- obu.obuId = res[1].substring(20, 36);
- obu.vin = res[1].substring(18, 20);
- obu.version = res[1].substring(18, 19) >= 4 ? "4x" : "2x";
- cmdRandNum = res[2].substring(0, res[2].length - 4);
- console.log("obu.obuId===========", obu.obuId, res[1].substring(20, 36), cmdRandNum)
- getInstallApply()
- }
- });
- // getInstallApply()
- };
-
- /**
- * BDS-安装申请 请求
- */
- const getInstallApply = () => {
- console.log('======安装申请======')
- tools.showLoadingAlert("加载中");
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {
- obuId: obu.obuId,
- vehicleId: orderInfos.vehiclePlate + "_" + orderInfos.vehiclePlateColor,
- orderId: orderInfos.orderId,
- agentId: agentId,
- channelId: channelId,
- channelType: "1",
- staffId: "opId",
- terminalId: "999999999",
- }, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
- //调用方式
- request(IFCODE.installApply, options)
- .then(() => {
- tools.hideLoadingAlert();
- //再次获取随机数
- getObuActivation(cmdRandNum);
- })
- };
-
- /**
- * VFJ-OBU在线激活 请求
- */
- const getObuActivation = (cmdRandNum : string) => {
- console.log('======VFJ-OBU在线激活======')
- tools.showLoadingAlert("加载中");
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {
- random: cmdRandNum,
- obuSerailNo: obu.obuId,
- orderId: orderInfos.orderId,
- }, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
- //调用方式
- request(IFCODE.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") {
- console.log("在线激活执行指令88888 请求", res);
- getObuInstall(0, ""); //status 0 - 安装成功 || 1 - 安装失败
- }
- });
- })
- .catch((err) => {
- console.log(err);
- });
- };
-
- /**
- * BDS-安装确认 请求
- */
- const getObuInstall = (status : number, reason : string) => {
- console.log('======OBU安装确认======')
- tools.showLoadingAlert("加载中");
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {
- installStatus: status,
- failReason: reason,
- installType: "1",
- installChannelId: channelId,
- obuId: obu.obuId,
- orderId: orderInfos.orderId
- }, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
- //调用方式
- request(IFCODE.obuInstall, options)
- .then(() => {
- tools.hideLoadingAlert();
- state.showPopup = true;
- submitVehicleQuery()
- });
-
- };
- const xiangce = (val) => {
- console.log("val", val)
- if (state.choiceIndex == 3) {
- var imageType = 1;
- } else {
- var imageType = 2;
- }
- state.changeColor = true;
- uni.chooseImage({
- count: 1, //只能选取一张照片
- sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["album"], //从相册选择
- success: function (res) {
- console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
- if (state.choiceIndex == 3 || state.choiceIndex == 4) {
- state.showImg = false
- state.images = res.tempFilePaths[0]
- state.phoneType = state.choiceIndex
- state.isTakePhotoModeShow = false
- return
- }
- },
- })
- }
- const takePhoto = (val) => {
- console.log("拍照", val)
- state.phoneType = val;
- state.showImg = true;
- }
- const confirmReturn = (val) => {
- if (state.choiceIndex == 3) {
- var imageType = 1;
- } else {
- var imageType = 2;
- }
- state.changeColor = true;
- state.phoneType = 0
- state.isTakePhotoModeShow = false
- uploadFile(val.tempImagePath, imageType, IFCODE.etcCarOcrCard).then((data : any) => {
- // uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
- console.log('输出内容=====================', state.choiceIndex)
- if (state.choiceIndex == "3") {
- if (data.plate_a.length > 8) {
- state.form.vehicleIdNum = data.plate_a.substring(0, 8);
- } else {
- state.form.vehicleIdNum = data.plate_a;
- }
- state.form.vehPosImgUrl = data.imageUrl;
-
- } else {
- state.form.vehNegImgUrl = data.imageUrl;
- console.log('=====================', state.form.vehNegImgUrl, state)
- }
- state.isTakePhotoModeShow = false
- })
- console.log("图片地址val", val.tempImagePath)
- }
- const takePhotoMode = (index) => {
- console.log("index", index)
- state.isTakePhotoModeShow = true
- state.choiceIndex = index
- }
- const cancle = () => {
- state.isTakePhotoModeShow = false
- }
- const camera = () => {
- state.phoneType = 0
- }
- // 查询重新激活记录
- const activationRecordQuery = () => {
- const options = {
- type: 2,
- data: {
- cardId: orderInfos.cardId,
- obuId: orderInfos.obuId,
- },
- method: "POST",
- showLoading: true,
- };
-
- return new Promise(async (resolve, reject) => {
- const res = await request(IFCODE.activationRecordApi, options);
- const data = stringToJson(res.bizContent);
- resolve(data);
- }).catch((error) => {
- reject(error);
- });
- }
- // 提交车辆信息
- const submitVehicleQuery = () => {
- const options = {
- type: 2,
- data: {
- cardId: orderInfos.cardId,
- obuId: orderInfos.obuId,
- vehPosImgUrl: state.form.vehPosImgUrl,
- vehNegImgUrl: state.form.vehNegImgUrl,
- vehiclePlate: orderInfos.vehiclePlate
- },
- method: "POST",
- };
- console.log("提交车辆信息成功", options)
- request(IFCODE.submitVehicleApi, options).then(() => {
- console.log("提交车辆信息成功")
- });
- }
- const goActivationRecord = () => {
- uni.navigateTo({
- url: `/subpackage/after-sale/activation-once-again/activation-once-again-record?obuId=${orderInfos.obuId}&&cardId=${orderInfos.cardId}`
- })
- }
-
-
- // #endif
-
- // #ifdef MP-WEIXIN
- import viewfinder from "@/components/viewfinder.vue"
- import {
- reactive,
- ref
- } from "vue";
- import {
- formatTime,
- expireDate,
- expireDate2,
- getFormatDate,
- msg,
- navTo,
- strReplace,
- uploadFile
- } from "@/utils/utils";
- import {
- onLoad, onShow
- } from '@dcloudio/uni-app'
- import {
- request
- } from "@/utils/network/request.js";
- import {
- stringToJson
- } from "@/utils/network/encryption.js";
- import activeSuccess from "./components/popup-device-active-success";
- import * as IFCODE from "@/utils/network/api.js";
- import {
- channelId
- } from "@/utils/network/difference";
- const cmd = require("../../../static/etcUtil/cmdConfig.js");
- const tools = require("../../../static/etcUtil/tools.js");
- const bluetoothUtil = require("../../../static/etcUtil/index.js");
- import {
- getCodeName
- } from "@/datas/queryKey.js";
- import { agentId } from "@/utils/network/difference";
-
-
- const state = reactive({
- phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
- choiceIndex: 1, // 1 身份证正面 2 身份证反面
- isTakePhotoModeShow: false, //选择拍照方式是否出来
- changeColor: false,
- showImg: true,
- images: '',
- showPopup: false,
- form: {
- vehPosImgUrl: "",
- vehNegImgUrl: "",
- vehicleIdNum: "",
- vehicleIdNumB: ''
- },
- activationNum: "",//激活次数
- })
-
- //订单
- const orderInfos = reactive({
- orderId: "",
- ownerName: "",
- ownerIdtype: "",
- ownerIdnum: "",
- vehiclePlate: "",
- vehiclePlateColorStr: "",
- vehiclePlateColor: "",
- vehicleType: "",
- cardId: "",
- cardStatus: "",
- obuId: "",
- obuStatus: "",
- outlineL: 0,
- outlineW: 0,
- outlineH: 0,
- type: 0,
- axleCount: 0,
- approvedCount: 0,
- vehicleVin: "",
- vehicleEngineNum: "",
- });
- //OBU
- const obu = reactive({
- obuId: "",
- startTime: "",
- endTime: "",
- version: "",
- approvedCount: "",
- axleCount: "",
- axleDistance: "",
- engineNum: "",
- type: "",
- userType: "",
- contractNo: "",
- vehiclePlate: "",
- vehiclePlateColor: "",
- vin: "",
- wheelCount: "",
- isJH: ""
- });
-
- onLoad((option) => {
- console.log('======重新激活开始======', option);
- //请求订单详情
- queryOrderDetail(option.id);
-
- });
-
- onShow((option) => {
- uni.$on('bluetoothLink', res => {
- console.log(res);
- if (res.status) {
- // getCardRenewal()
- getObuId()
- }
- //移除监听
- console.log('======移除监听======', res)
-
- // uni.$off('bluetoothLink')
- })
-
- })
-
- const cancel = () => {
- state.showPopup = false;
- uni.navigateBack({
- delta: 2
- })
- };
-
- const toPage = () => {
- if (!state.form.vehPosImgUrl) {
- msg("请上传行驶证主页")
- return;
- }
- if (!state.form.vehNegImgUrl) {
- msg("请上传行驶证副页")
- return;
- }
- console.log("state.form.vehicleIdNum", state.form.vehicleIdNum, orderInfos.vehiclePlate)
- if (state.form.vehicleIdNum == orderInfos.vehiclePlate) {
- if (state.form.vehicleIdNumB == orderInfos.vehiclePlate) {
- activationRecordQuery().then((val) => {
- console.log("激活次数", val)
- if (val.limit) {
- navTo("/pages/bluetooth/bluetooth?routeType=5");
- } else {
- msg("一年内到达激活次数上限5次")
- }
- });
- } else {
- msg("请上传正确行驶证副页")
- }
- } else {
- msg("请上传正确行驶证")
- }
-
- };
-
- //获取订单详情
- const queryOrderDetail = (id : string) => {
- const options = {
- type: 2,
- data: {
- id: id,
- },
- method: "POST",
- showLoading: true,
- };
- request(IFCODE.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;
- let arr = orderInfo.vehicleDimensions.split("X");
- orderInfos.outlineL = parseInt(arr[0]); //外廓 长
- orderInfos.outlineW = parseInt(arr[1]); //外廓 宽
- orderInfos.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
-
- orderInfos.type = orderInfo.type;
- orderInfos.axleCount = orderInfo.vehicleAxleCount;
- orderInfos.approvedCount = orderInfo.vehicleApprovedCount;
- orderInfos.vehicleVin = orderInfo.vehicleVin;
- orderInfos.vehicleEngineNum = orderInfo.vehicleEngineNum;
- activationRecordQuery().then((val) => {
- console.log("jihuo", val)
- state.activationNum = val.num
- });
-
- });
- };
-
- /**
- * 获取OBU号 读OBU
- */
- const getObuId = () => {
- console.log('======获取OBU号======')
- let cmdArray = [cmd.HOME_DIRECTORY, cmd.OBU_SYSTEM_FILE, cmd.RANDOM_NUMBER];
- tools.showLoadingAlert("正在执行指令");
- bluetoothUtil.transCmd(cmdArray, "20", function (res) {
- tools.hideLoadingAlert();
- var status = res[1].substring(res[1].length - 4, res[1].length);
- console.log('获取OBU号执行结果' + status)
- //第一次获取随机数
- if (status == "9000") {
- obu.obuId = res[1].substring(20, 36);
- obu.vin = res[1].substring(18, 20);
- obu.version = res[1].substring(18, 19) >= 4 ? "4x" : "2x";
- getInstallApply()
- // cmdRandNum = res[2].substring(0, res[2].length - 4);
- }
- });
- };
-
- /**
- * BDS-安装申请 请求
- */
- const getInstallApply = () => {
- console.log('======安装申请======')
- tools.showLoadingAlert("加载中");
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {
- obuId: obu.obuId,
- vehicleId: orderInfos.vehiclePlate + "_" + orderInfos.vehiclePlateColor,
- orderId: orderInfos.orderId,
- agentId: agentId,
- channelId: channelId,
- channelType: "1",
- staffId: "opId",
- terminalId: "999999999",
- }, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
- //调用方式
- request(IFCODE.installApply, options)
- .then(() => {
- tools.hideLoadingAlert();
- //再次获取随机数
- let cmdArr = [cmd.HOME_DIRECTORY, cmd.RANDOM_NUMBER];
- bluetoothUtil.transCmd(cmdArr, '20', function (res) {
- var str = res[1].substring(res[1].length - 4, res[1].length);
- if (str == "9000") {
- let cmdRandNum = res[1].substring(0, res[1].length - 4);
- getObuActivation(cmdRandNum);
- } else {
- tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]);
- }
- })
- })
- };
-
- /**
- * VFJ-OBU在线激活 请求
- */
- const getObuActivation = (cmdRandNum : string) => {
- console.log('======VFJ-OBU在线激活======')
- tools.showLoadingAlert("加载中");
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {
- random: cmdRandNum,
- obuSerailNo: obu.obuId,
- orderId: orderInfos.orderId,
- }, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
- //调用方式
- request(IFCODE.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") {
- console.log("在线激活执行指令88888 请求", res);
- getObuInstall(0, ""); //status 0 - 安装成功 || 1 - 安装失败
- }
- });
- })
- .catch((err) => {
- console.log(err);
- });
- };
-
- /**
- * BDS-安装确认 请求
- */
- const getObuInstall = (status : number, reason : string) => {
- console.log('======OBU安装确认======')
- tools.showLoadingAlert("加载中");
- let options = {
- type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
- data: {
- installStatus: status,
- failReason: reason,
- installType: "1",
- installChannelId: channelId,
- obuId: obu.obuId,
- orderId: orderInfos.orderId
- }, //请求参数
- method: "POST", //提交方式(默认POST)
- showLoading: true, //是否显示加载中(默认显示)
- };
- //调用方式
- request(IFCODE.obuInstall, options)
- .then(() => {
- tools.hideLoadingAlert();
- state.showPopup = true;
- submitVehicleQuery()
- });
-
- };
- const xiangce = (val) => {
- console.log("val", val)
- if (state.choiceIndex == 3) {
- var imageType = 1;
- } else {
- var imageType = 2;
- }
- state.changeColor = true;
- uni.chooseImage({
- count: 1, //只能选取一张照片
- sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["album"], //从相册选择
- success: function (res) {
- console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
- if (state.choiceIndex == 3 || state.choiceIndex == 4) {
- state.showImg = false
- state.images = res.tempFilePaths[0]
- state.phoneType = state.choiceIndex
- state.isTakePhotoModeShow = false
- return
- }
- },
- })
- }
- const takePhoto = (val) => {
- console.log("拍照", val)
- state.phoneType = val;
- state.showImg = true;
- }
- const confirmReturn = (val) => {
- if (state.choiceIndex == 3) {
- var imageType = 1;
- } else {
- var imageType = 2;
- }
- state.changeColor = true;
- state.phoneType = 0
- state.isTakePhotoModeShow = false
- uploadFile(val.tempImagePath, imageType, IFCODE.etcCarOcrCard).then((data) => {
- // uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
- console.log('输出内容=====================', state.choiceIndex)
- if (state.choiceIndex === "3") {
- if (data.plate_a.length > 8) {
- state.form.vehicleIdNum = data.plate_a.substring(0, 8);
- } else {
- state.form.vehicleIdNum = data.plate_a;
- }
- state.form.vehPosImgUrl = data.imageUrl;
-
- } else {
- state.form.vehNegImgUrl = data.imageUrl;
- state.form.vehicleIdNumB = data.plate_a;
- console.log('=====================', state.form.vehNegImgUrl, state)
- }
- state.isTakePhotoModeShow = false
- })
- console.log("图片地址val", val.tempImagePath)
- }
- const takePhotoMode = (index) => {
- console.log("index", index)
- state.isTakePhotoModeShow = true
- state.choiceIndex = index
- }
- const cancle = () => {
- state.isTakePhotoModeShow = false
- }
- const camera = () => {
- state.phoneType = 0
- }
- // 查询重新激活记录
- const activationRecordQuery = () => {
- const options = {
- type: 2,
- data: {
- cardId: orderInfos.cardId,
- obuId: orderInfos.obuId,
- },
- method: "POST",
- showLoading: true,
- };
-
- return new Promise(async (resolve, reject) => {
- const res = await request(IFCODE.activationRecordApi, options);
- const data = stringToJson(res.bizContent);
- resolve(data);
- }).catch((error) => {
- reject(error);
- });
- }
- // 提交车辆信息
- const submitVehicleQuery = () => {
- const options = {
- type: 2,
- data: {
- cardId: orderInfos.cardId,
- obuId: orderInfos.obuId,
- vehPosImgUrl: state.form.vehPosImgUrl,
- vehNegImgUrl: state.form.vehNegImgUrl,
- vehiclePlate: orderInfos.vehiclePlate
- },
- method: "POST",
- };
- console.log("提交车辆信息成功", options)
- request(IFCODE.submitVehicleApi, options).then(() => {
- console.log("提交车辆信息成功")
- });
- }
- const goActivationRecord = () => {
- uni.navigateTo({
- url: `/subpackage/after-sale/activation-once-again/activation-once-again-record?obuId=${orderInfos.obuId}&&cardId=${orderInfos.cardId}`
- })
- }
- // #endif
- </script>
-
- <style>
- page {
- width: 100%;
- height: 100%;
- background-color: #fff;
- }
- </style>
- <style lang="scss" scoped>
- .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;
- border-radius: 50%;
- font-size: 25rpx;
-
- .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;
- margin-bottom: 30rpx;
- 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;
- }
- }
-
- .picture-wrapper {
- margin-top: 40rpx;
-
- .bg {
- background: #ffffff;
- box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- padding: 40rpx;
- display: flex;
- // align-items: center;
- justify-content: space-between;
-
- .name {
- font-size: 34rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 34rpx;
- }
-
- .value {
- margin-top: 20rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24rpx;
- }
-
- .tip {
- margin-top: 20rpx;
- text-align: center;
- width: 110rpx;
- height: 40rpx;
- background: rgba(33, 190, 177, 0.2);
- border-radius: 6rpx;
-
- .tip-value {
- font-size: 20rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #0a8f8a;
- line-height: 40rpx;
- opacity: 1;
- }
- }
- }
-
- .icon {
- width: 294rpx;
- height: 188rpx;
- }
- }
-
- .choice-takePhoto {
- position: absolute;
- bottom: 0;
- background-color: white;
- width: 100%;
- border-radius: 20rpx 20rpx 0 0;
- }
-
- .choice-takePhoto>view:first-child {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
- background-color: white;
- }
-
- .choice-takePhoto>view:last-child {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- border-top: 6rpx solid rgba(127, 127, 127, 0.1);
- background-color: white;
- }
-
- .choice-takePhoto>view {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- background-color: white;
- }
-
- .choice-takePhoto-wrap {
- width: 100%;
- height: 100vh;
- background-color: rgba(127, 127, 127, 0.2);
- position: fixed;
- left: 0;
- top: 0;
- z-index: 11111;
- }
-
- .record {
- 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: 60rpx;
- }
- </style>
|