bug修复

This commit is contained in:
tx 2024-12-30 14:31:59 +08:00
parent f8675832cc
commit f1eee059b6
2 changed files with 1695 additions and 1639 deletions

View File

@ -9,27 +9,27 @@
</view> </view>
<!-- https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau --> <!-- https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau -->
<view class="choose_li"> <view class="choose_li">
<view class="li_cont" @click="checkIdx=1"> <view class="li_cont" @click="checkIdx = 1">
<view class="img_box"> <view class="img_box">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau" mode="" <image src="https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau" mode=""
v-if="checkIdx==1"></image> v-if="checkIdx == 1"></image>
</view> </view>
电量不足 电量不足
</view> </view>
<view class="li_cont" @click="checkIdx=2"> <view class="li_cont" @click="checkIdx = 2">
<view class="img_box"> <view class="img_box">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau" mode="" <image src="https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau" mode=""
v-if="checkIdx==2"></image> v-if="checkIdx == 2"></image>
</view> </view>
车辆损坏 车辆损坏
</view> </view>
</view> </view>
<view class="tit" style="margin-top: 20rpx;"> <view class="tit" style="margin-top: 20rpx;">
SN{{orderinfo.sn}} SN{{ orderinfo.sn }}
</view> </view>
</view> </view>
<view class="cont_box" v-show="checkIdx==2"> <view class="cont_box" v-show="checkIdx == 2">
<view class="tit"> <view class="tit">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uByIrgaV23PDGZWReKHW" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uByIrgaV23PDGZWReKHW" mode=""></image>
请选择车辆故障部位 请选择车辆故障部位
@ -43,7 +43,7 @@
:class="item.checked === true ? 'act1' : ''" @click="toggleCheckbox(index)"> :class="item.checked === true ? 'act1' : ''" @click="toggleCheckbox(index)">
{{ item.dictLabel }} {{ item.dictLabel }}
<image src="https://lxnapi.ccttiot.com/bike/img/static/ufYwbVclwhX64u4eGu6u" mode="" <image src="https://lxnapi.ccttiot.com/bike/img/static/ufYwbVclwhX64u4eGu6u" mode=""
v-if="item.checked === true "></image> v-if="item.checked === true"></image>
</view> </view>
</view> </view>
<view class="txt"> <view class="txt">
@ -54,7 +54,7 @@
:class="item.checked === true ? 'act1' : ''" @click="csCheckbox(index)"> :class="item.checked === true ? 'act1' : ''" @click="csCheckbox(index)">
{{ item.dictLabel }} {{ item.dictLabel }}
<image src="https://lxnapi.ccttiot.com/bike/img/static/ufYwbVclwhX64u4eGu6u" mode="" <image src="https://lxnapi.ccttiot.com/bike/img/static/ufYwbVclwhX64u4eGu6u" mode=""
v-if="item.checked === true "></image> v-if="item.checked === true"></image>
</view> </view>
</view> </view>
@ -66,7 +66,7 @@
:class="item.checked === true ? 'act1' : ''" @click="tsCheckbox(index)"> :class="item.checked === true ? 'act1' : ''" @click="tsCheckbox(index)">
{{ item.dictLabel }} {{ item.dictLabel }}
<image src="https://lxnapi.ccttiot.com/bike/img/static/ufYwbVclwhX64u4eGu6u" mode="" <image src="https://lxnapi.ccttiot.com/bike/img/static/ufYwbVclwhX64u4eGu6u" mode=""
v-if="item.checked === true "></image> v-if="item.checked === true"></image>
</view> </view>
</view> </view>
<view class="input-container"> <view class="input-container">
@ -76,7 +76,7 @@
<text class="word-count">{{ currentCount }}/500</text> <text class="word-count">{{ currentCount }}/500</text>
</view> </view>
</view> </view>
<view class="cont_box" v-if="checkIdx==2&&areainfo.returnVerify==0"> <view class="cont_box" v-if="checkIdx == 2 && areainfo.returnVerify == 0">
<view class="tit"> <view class="tit">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uByIrgaV23PDGZWReKHW" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uByIrgaV23PDGZWReKHW" mode=""></image>
请对故障部位拍照 请对故障部位拍照
@ -84,7 +84,7 @@
<view class="icon"> <view class="icon">
<view class="imgbox" v-for="(item,index) in imglist " :key="index"> <view class="imgbox" v-for="(item, index) in imglist " :key="index">
<image :src="item" mode=""></image> <image :src="item" mode=""></image>
</view> </view>
<view class="imgbox" @click="btn"> <view class="imgbox" @click="btn">
@ -95,20 +95,20 @@
<!-- https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau --> <!-- https://lxnapi.ccttiot.com/bike/img/static/uZQYJi6D7tPy4CszHtau -->
</view> </view>
<view class="cont" v-if="areainfo.returnVerify==1"> <view class="cont" v-if="areainfo.returnVerify == 1">
<view class="tip_txt" style="font-weight: 500;font-size: 32rpx;color: #3D3D3D;"> <view class="tip_txt" style="font-weight: 500;font-size: 32rpx;color: #3D3D3D;">
保持车辆录像的完整清晰,不要随意拍摄确保视频中车辆出境并且出现车牌号 保持车辆录像的完整清晰,不要随意拍摄确保视频中车辆出境并且出现车牌号
</view> </view>
<view class="vadio_png1" @click="recordVideo"> <view class="vadio_png1" @click="recordVideo">
<image class="backimg" src="https://lxnapi.ccttiot.com/bike/img/static/uEP0UPJw6a1WuxA7ZlMo" mode="" <image class="backimg" src="https://lxnapi.ccttiot.com/bike/img/static/uEP0UPJw6a1WuxA7ZlMo" mode=""
v-if="videoUrl==''"> v-if="videoUrl == ''">
<image class="tip_img" src="https://lxnapi.ccttiot.com/bike/img/static/uXFG7Vee8MWx5y7pha2U" <image class="tip_img" src="https://lxnapi.ccttiot.com/bike/img/static/uXFG7Vee8MWx5y7pha2U"
mode=""></image> mode=""></image>
</image> </image>
<video class="vad" :src="videoUrl" controls="controls" style="width: 100%;" v-if="videoUrl!=''"></video> <video class="vad" :src="videoUrl" controls="controls" style="width: 100%;" v-if="videoUrl != ''"></video>
<view class="glass" v-if="videoUrl!=''"></view> <view class="glass" v-if="videoUrl != ''"></view>
<image class="tip_img" src="https://lxnapi.ccttiot.com/bike/img/static/uXFG7Vee8MWx5y7pha2U" mode="" <image class="tip_img" src="https://lxnapi.ccttiot.com/bike/img/static/uXFG7Vee8MWx5y7pha2U" mode=""
v-if="videoUrl!=''"></image> v-if="videoUrl != ''"></image>
</view> </view>
</view> </view>
<view class="tits"> <view class="tits">
@ -127,7 +127,7 @@
<view class="cont_li"> <view class="cont_li">
<view class="left"> <view class="left">
<view class="km"> <view class="km">
可继续行驶{{deviceinfo.remainingMileage}}公里 可继续行驶{{ deviceinfo.remainingMileage }}公里
</view> </view>
<view class="speed"> <view class="speed">
<view class="speeds" :style="{ width: deviceinfo.remainingPower + '%' }"> <view class="speeds" :style="{ width: deviceinfo.remainingPower + '%' }">
@ -135,7 +135,7 @@
</view> </view>
</view> </view>
<view class="NO"> <view class="NO">
NO.{{deviceinfo.sn}} NO.{{ deviceinfo.sn }}
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@ -147,7 +147,7 @@
已骑行 已骑行
</view> </view>
<view class="right" style="font-size: 32rpx;font-weight: 400;"> <view class="right" style="font-size: 32rpx;font-weight: 400;">
{{timeString}} {{ timeString }}
</view> </view>
</view> </view>
<view class="cont_li" style="margin-top: 10rpx;"> <view class="cont_li" style="margin-top: 10rpx;">
@ -155,7 +155,7 @@
预估金额 预估金额
</view> </view>
<view class="right" style="font-size: 32rpx;font-weight: 400;"> <view class="right" style="font-size: 32rpx;font-weight: 400;">
{{ parseFloat(money).toFixed(2)}} {{ parseFloat(money).toFixed(2) }}
</view> </view>
</view> </view>
<view class="txtss"> <view class="txtss">
@ -183,25 +183,25 @@
提交 提交
</view> </view>
<view class="maskloadpage" v-if="maskloading"> <view class="maskloadpage" v-if="maskloading">
<view class="maskpage0" v-if="maskepage==0"> <view class="maskpage0" v-if="maskepage == 0">
<view class="top_info"> <view class="top_info">
<image :src="loadimg" mode=""></image> <image :src="loadimg" mode=""></image>
<view class="masktxt"> <view class="masktxt">
{{toploadtxt}} {{ toploadtxt }}
</view> </view>
</view> </view>
<view class="masktips"> <view class="masktips">
{{tiptxt}} {{ tiptxt }}
</view> </view>
<view class="tipsimg"> <view class="tipsimg">
<image src="https://lxnapi.ccttiot.com/bike/img/static/ugvqmfB3QYujZ6SnfTia" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/ugvqmfB3QYujZ6SnfTia" mode=""></image>
</view> </view>
</view> </view>
<view class="maskpage1" v-if="maskepage==4"> <view class="maskpage1" v-if="maskepage == 4">
<view class="top_info"> <view class="top_info">
<image :src="loadimg" mode=""></image> <image :src="loadimg" mode=""></image>
<view class="masktxt"> <view class="masktxt">
{{buletxt}} {{ buletxt }}
</view> </view>
</view> </view>
<view class="masktips" style="width: 100%;"> <view class="masktips" style="width: 100%;">
@ -213,7 +213,7 @@
</view> </view>
<!-- 不允许停车点外还车 --> <!-- 不允许停车点外还车 -->
<view class="maskpage1" v-if="maskepage==5"> <view class="maskpage1" v-if="maskepage == 5">
<view class="top_info"> <view class="top_info">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uG3cbPgvPDzwlq6IHHxK" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uG3cbPgvPDzwlq6IHHxK" mode=""></image>
<view class="masktxt" v-if="orderinfo.sn"> <view class="masktxt" v-if="orderinfo.sn">
@ -248,10 +248,10 @@
</template> </template>
<script> <script>
const app = getApp(); const app = getApp();
var xBlufi = require("@/utils/blufi/xBlufi.js"); var xBlufi = require("@/utils/blufi/xBlufi.js");
let _this = null; let _this = null;
export default { export default {
data() { data() {
return { return {
bgc: { bgc: {
@ -312,13 +312,22 @@
}, },
watch: { watch: {
sncode(newValue, oldValue) { sncode: {
handler(newValue) {
if (newValue && newValue.length === 7) { if (newValue && newValue.length === 7) {
// orderinfo
if (this.orderinfo && this.orderinfo.areaId) {
this.getdevice(); this.getdevice();
} else {
// orderinfo
setTimeout(() => {
this.getdevice();
}, 500);
} }
} }
},
immediate: false
}
}, },
onHide() { onHide() {
@ -373,13 +382,13 @@
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
success: function(lb) { success: function (lb) {
that.gps.latitude = lb.latitude; that.gps.latitude = lb.latitude;
that.gps.longitude = lb.longitude; that.gps.longitude = lb.longitude;
}, },
fail: function(error) { fail: function (error) {
uni.showToast({ uni.showToast({
title: '未获取到定位信息,请点击设置勾选允许位置信息,即可使用全部功能', title: '未获取到定位信息,请点击设置勾选允许位置信息,即可使用全部功能',
icon: 'none', icon: 'none',
@ -445,7 +454,7 @@
token: _this.token, //token token: _this.token, //token
key: 'smartmeter/img/' + math key: 'smartmeter/img/' + math
}, },
success: function(res) { success: function (res) {
console.log(res, 'resres'); console.log(res, 'resres');
let str = JSON.parse(res.data) let str = JSON.parse(res.data)
console.log(str.key) console.log(str.key)
@ -484,7 +493,7 @@
userId: this.orderinfo.userId, userId: this.orderinfo.userId,
detail: this.textValue, detail: this.textValue,
sn: this.orderinfo.sn, sn: this.orderinfo.sn,
orderNo:this.orderinfo.orderNo, orderNo: this.orderinfo.orderNo,
types: [] // Initialize the type array types: [] // Initialize the type array
}; };
if (this.areainfo.returnVerify == 0) { if (this.areainfo.returnVerify == 0) {
@ -584,7 +593,7 @@
token: _this.token, //token token: _this.token, //token
key: 'bike/video/' + math key: 'bike/video/' + math
}, },
success: function(res) { success: function (res) {
uni.hideLoading() uni.hideLoading()
console.log(res, 'resres'); console.log(res, 'resres');
let str = JSON.parse(res.data) let str = JSON.parse(res.data)
@ -596,7 +605,7 @@
}); });
}, },
subs(num) { subs(num) {
if(this.deviceinfo.onlineStatus==0){ if (this.deviceinfo.onlineStatus == 0) {
uni.showToast({ uni.showToast({
title: '当前设备离线中,请使用其他车辆', title: '当前设备离线中,请使用其他车辆',
icon: 'none', icon: 'none',
@ -665,9 +674,9 @@
if (!this.isback) { if (!this.isback) {
this.changeback(); this.changeback();
} else if (!this.isopen) { } else if (!this.isopen) {
setTimeout(()=>{ setTimeout(() => {
this.changeOpne(); this.changeOpne();
},300) }, 300)
} }
@ -700,7 +709,7 @@
// this.mac=this.orderinfo.mac // this.mac=this.orderinfo.mac
// this.buleclose=true // this.buleclose=true
// this.Binddevice() // this.Binddevice()
this.$u.post('/appVerify/changeVehicle/lock?orderNo=' + this.orderinfo.orderNo + '&changeReason=' + this.checkIdx+"&newSn="+this this.$u.post('/appVerify/changeVehicle/lock?orderNo=' + this.orderinfo.orderNo + '&changeReason=' + this.checkIdx + "&newSn=" + this
.deviceinfo.sn).then((res) => { .deviceinfo.sn).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -772,26 +781,46 @@
}); });
}, },
getdevice() { getdevice() {
this.deviceinfo={} if (!this.sncode) {
return;
}
//
this.deviceinfo = {};
this.$u.get('/app/device/info?sn=' + this.sncode).then((res) => { this.$u.get('/app/device/info?sn=' + this.sncode).then((res) => {
if (res.code == 200) { if (res.code === 200 && res.data) {
if(this.orderinfo.areaId==res.data.areaId){ console.log('当前区域ID:', this.orderinfo.areaId);
this.deviceinfo = res.data console.log('设备区域ID:', res.data.areaId);
// this.deviceinfo.onlineStatus=0
}else{ //
const currentAreaId = Number(this.orderinfo.areaId);
const deviceAreaId = Number(res.data.areaId);
if (!isNaN(currentAreaId) && !isNaN(deviceAreaId) && currentAreaId === deviceAreaId) {
this.deviceinfo = res.data;
} else {
uni.showToast({ uni.showToast({
title: '换车设备和当前运营区不同,请使用其他车辆换车', title: '换车设备和当前运营区不同,请使用其他车辆换车',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
this.sncode = ''; // sn
} }
} else { } else {
// uni.showToast({
title: res.msg || '获取设备信息失败',
icon: 'none',
duration: 2000
});
} }
}).catch(error => { }).catch(error => {
// console.error('获取设备信息错误:', error);
uni.showToast({
title: '获取设备信息失败',
icon: 'none',
duration: 2000
});
}); });
}, },
qrcode() { qrcode() {
@ -799,7 +828,7 @@
onlyFromCamera: true, onlyFromCamera: true,
scanType: ['qrCode'], scanType: ['qrCode'],
success: res => { success: res => {
try {
let sn = null; let sn = null;
let queryParams = res.result.split('?')[1]; let queryParams = res.result.split('?')[1];
if (queryParams) { if (queryParams) {
@ -812,29 +841,53 @@
}); });
} }
this.sncode = sn if (!sn) {
console.log(res.result); uni.showToast({
if (this.sncode != '') { title: '无效的二维码',
icon: 'none',
this.getdevice() duration: 2000
});
return;
} }
this.sncode = sn;
if (this.sncode) {
// orderinfo
if (this.orderinfo && this.orderinfo.areaId) {
this.getdevice();
} else {
// orderinfo
setTimeout(() => {
this.getdevice();
}, 500);
}
}
} catch (error) {
console.error('二维码解析错误:', error);
uni.showToast({
title: '二维码格式错误',
icon: 'none',
duration: 2000
});
}
}, },
fail: err => { fail: err => {
console.error('扫描失败:', err); console.error('扫描失败:', err);
uni.showToast({ uni.showToast({
title: '扫描失败', title: '扫描失败',
icon: 'none' icon: 'none',
duration: 2000
}); });
} }
}); });
}, },
Binddevice() { Binddevice() {
uni.getBluetoothAdapterState({ uni.getBluetoothAdapterState({
success: function(res) { success: function (res) {
console.log('蓝牙状态:', res.available) console.log('蓝牙状态:', res.available)
}, },
fail: function(res) { fail: function (res) {
console.log('获取蓝牙状态失败') console.log('获取蓝牙状态失败')
} }
}) })
@ -1000,7 +1053,7 @@
} }
}); });
}, },
funListenDeviceMsgEvent: function(options) { funListenDeviceMsgEvent: function (options) {
switch (options.type) { switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS: case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) { if (options.result) {
@ -1230,7 +1283,7 @@
// }) // })
this.orderinfo = {} this.orderinfo = {}
if (this.userId) { if (this.userId) {
this.$u.post('/app/user/isInOrder?userId=' + this.userId, ).then((res) => { this.$u.post('/app/user/isInOrder?userId=' + this.userId,).then((res) => {
// uni.hideLoading() // uni.hideLoading()
if (res.code === 200) { if (res.code === 200) {
@ -1376,14 +1429,14 @@
}); });
}, },
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: #F7FAFE; background-color: #F7FAFE;
} }
.page { .page {
padding-bottom: 100rpx; padding-bottom: 100rpx;
// width: 750rpx; // width: 750rpx;
width: 750rpx; width: 750rpx;
@ -1982,5 +2035,5 @@
} }
} }
} }
</style> </style>

View File

@ -1501,6 +1501,7 @@ export default {
}, },
deviceInfo(num) { deviceInfo(num) {
setTimeout(() => {
if (!this.sn) return; if (!this.sn) return;
// //
@ -1513,7 +1514,7 @@ export default {
}); });
return; return;
} }
return
} }
this.$u.get('/app/device/info?sn=' + this.sn).then((res) => { this.$u.get('/app/device/info?sn=' + this.sn).then((res) => {
@ -1577,6 +1578,10 @@ export default {
}); });
} }
}); });
}, 700);
}, },
// //
getStatusMessage(status) { getStatusMessage(status) {
@ -2082,8 +2087,6 @@ export default {
console.error("Error fetching parking data:", error); console.error("Error fetching parking data:", error);
}); });
}, },
totxtpage() { totxtpage() {
this.seeDetail = true this.seeDetail = true
uni.navigateTo({ uni.navigateTo({
@ -4577,7 +4580,7 @@ export default {
}, },
convertBoundaryToPolylines(boundaries, num) { convertBoundaryToPolylines(boundaries, num) {
if (num == 1) { if (num == 1) {
console.log('判断1');
return boundaries.map(boundary => { return boundaries.map(boundary => {
if (!boundary) return null; if (!boundary) return null;
let coords; let coords;