新电动车

This commit is contained in:
吴鹏 2025-04-12 18:01:40 +08:00
parent 2a9de15785
commit 132f7808db
13 changed files with 1162 additions and 618 deletions

View File

@ -156,6 +156,13 @@
let sceneValue = res.result let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue) let decodedValue = decodeURIComponent(sceneValue)
this.sn = getQueryParam(decodedValue, 's') this.sn = getQueryParam(decodedValue, 's')
this.$u.get("/app/orderDevice/mineUsing").then(res =>{
if(res.code == 200){
if(res.data){
uni.switchTab({
url:'/pages/nearbystores/index'
})
}else{
this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.data){ if(res.data){
@ -176,6 +183,9 @@
}) })
} }
}) })
}
}
})
}, },
fail: err => { fail: err => {
console.error('扫描失败:', err) console.error('扫描失败:', err)

View File

@ -36,6 +36,13 @@
methods: { methods: {
// //
btnkaisuo(){ btnkaisuo(){
this.$u.get("/app/orderDevice/mineUsing").then(res =>{
if(res.code == 200){
if(res.data){
uni.switchTab({
url:'/pages/nearbystores/index'
})
}else{
this.$u.get("/app/device/availableDetail?sn=" + this.sn).then((res) => { this.$u.get("/app/device/availableDetail?sn=" + this.sn).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.data){ if(res.data){
@ -74,6 +81,9 @@
}) })
} }
} }
})
}
}
} }
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="确认订单页" :border-bottom="false" :background="bgc" back-icon-color="#3D3D3D" title-color='#3D3D3D' <u-navbar :title="tit" :border-bottom="false" :background="bgc" back-icon-color="#3D3D3D" title-color='#3D3D3D'
title-size='36' height='50' id="navbar" :custom-back="btnfh"> title-size='36' height='50' id="navbar" :custom-back="btnfh">
</u-navbar> </u-navbar>
<view class="jieshao"> <view class="jieshao">
@ -314,7 +314,7 @@
</view> </view>
</view> </view>
<view style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #fff;z-index: 99;" v-if="zhezhaoflag"></view> <view style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #fff;z-index: 999;" v-if="zhezhaoflag"></view>
</view> </view>
</template> </template>
@ -324,7 +324,7 @@
data() { data() {
return { return {
bgc: { bgc: {
backgroundColor: "#CCE5FF", backgroundColor: "",
}, },
bqlist: ['含电池', '含头盔', '含充电器', '含瓶装水', '含竹篮'], bqlist: ['含电池', '含头盔', '含充电器', '含瓶装水', '含竹篮'],
fanganindex: 0, fanganindex: 0,
@ -347,23 +347,45 @@
deviceId: '', deviceId: '',
name: '', name: '',
mac: '', mac: '',
zhezhaoflag:true zhezhaoflag:true,
tit:' '
} }
}, },
onLoad(option) { onLoad(option) {
console.log(option) console.log(option)
if (option.modelId) { if (option.modelId) {
this.zhezhaoflag = false
this.modelId = option.modelId
this.chesn = option.sn
this.gettaocan()
this.getcheliang()
} else {
this.zhezhaoflag = true
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
mask: true mask: true
}) })
setTimeout(()=>{
this.$u.get("/app/orderDevice/mineUsing").then(res =>{
if(res.code == 200){
if(res.data){
uni.switchTab({
url:'/pages/nearbystores/index'
})
this.zhezhaoflag = false
uni.hideLoading()
}else{
this.tit= '确认订单页'
this.zhezhaoflag = false
uni.hideLoading()
this.modelId = option.modelId
this.chesn = option.sn
this.gettaocan()
this.getcheliang()
}
}
})
},1000)
} else {
// this.zhezhaoflag = true
uni.showLoading({
title: '加载中...',
mask: true
})
setTimeout(()=>{
this.$u.get("/app/orderDevice/mineUsing").then((res) => { this.$u.get("/app/orderDevice/mineUsing").then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
@ -373,6 +395,7 @@
this.zhezhaoflag = false this.zhezhaoflag = false
uni.hideLoading() uni.hideLoading()
} else { } else {
this.tit= '确认订单页'
this.zhezhaoflag = false this.zhezhaoflag = false
uni.hideLoading() uni.hideLoading()
// //
@ -411,6 +434,7 @@
}) })
} }
}else{ }else{
this.tit= '确认订单页'
this.zhezhaoflag = false this.zhezhaoflag = false
uni.hideLoading() uni.hideLoading()
// //
@ -449,6 +473,7 @@
}) })
} }
}) })
},1000)
} }
}, },
methods: { methods: {
@ -666,42 +691,42 @@
this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => { this.$u.get(`/app/device/availableDetail?sn=${this.sn}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.bikeobj = res.data this.bikeobj = res.data
if (res.data.onlineStatus == 0) { // if (res.data.onlineStatus == 0) {
wx.openBluetoothAdapter({ // wx.openBluetoothAdapter({
success: function(res) { // success: function(res) {
console.log('蓝牙适配器初始化成功') // console.log('')
xBlufi.initXBlufi(1) // xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({ // xBlufi.notifyStartDiscoverBle({
'isStart': true // 'isStart': true
}) // })
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) // xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
}, // },
fail: function(err) { // fail: function(err) {
console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) // console.error('', err)
} // }
}) // })
} // }
} }
}) })
} else { } else {
this.$u.get(`/app/device/availableDetail?sn=${this.chesn}`).then((res) => { this.$u.get(`/app/device/availableDetail?sn=${this.chesn}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.bikeobj = res.data this.bikeobj = res.data
if (res.data.onlineStatus == 0) { // if (res.data.onlineStatus == 0) {
wx.openBluetoothAdapter({ // wx.openBluetoothAdapter({
success: function(res) { // success: function(res) {
console.log('蓝牙适配器初始化成功') // console.log('')
xBlufi.initXBlufi(1) // xBlufi.initXBlufi(1)
xBlufi.notifyStartDiscoverBle({ // xBlufi.notifyStartDiscoverBle({
'isStart': true // 'isStart': true
}) // })
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent) // xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
}, // },
fail: function(err) { // fail: function(err) {
console.error('蓝牙适配器初始化失败,可能是因为没有权限', err) // console.error('', err)
} // }
}) // })
} // }
} }
}) })
} }

View File

@ -533,11 +533,11 @@
}, },
2: { 2: {
fillColor: "#FFF5D640", fillColor: "#FFF5D640",
strokeColor: "#FFC107" strokeColor: "#FF473E"
}, },
3: { 3: {
fillColor: "#FFD1CF40", fillColor: "#FFD1CF40",
strokeColor: "#FF473E" strokeColor: "#FFC107"
} }
}; };
@ -925,15 +925,15 @@
iconPath: row.type == 1 ? iconPath: row.type == 1 ?
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' :
row.type == 2 ? row.type == 2 ?
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' :
'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq', 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t',
callout: { callout: {
content: row.name, content: row.name,
color: '#ffffff', color: '#ffffff',
fontSize: 14, fontSize: 14,
borderRadius: 10, borderRadius: 10,
bgColor: row.type == 1 ? '#3A7EDB' : row.type == 2 ? bgColor: row.type == 1 ? '#3A7EDB' : row.type == 2 ?
'#FFC107' : '#FF473E', '#FF473E' : '#FFC107',
padding: 6, padding: 6,
display: 'BYCLICK' display: 'BYCLICK'
}, },

View File

@ -295,7 +295,9 @@
createDateRange:this.firsTime == '' ? '' : this.lasTime == '' ? '' : this.firsTime + ',' + this.lasTime, createDateRange:this.firsTime == '' ? '' : this.lasTime == '' ? '' : this.firsTime + ',' + this.lasTime,
areaId: this.areaId, areaId: this.areaId,
pageSize: 20, pageSize: 20,
pageNum: this.pageNum pageNum: this.pageNum,
isAsc:'desc',
orderByColumn:'createTime'
}; };
} else if (this.typeidx == 2) { // this.typeidx == 2 } else if (this.typeidx == 2) { // this.typeidx == 2
data = { data = {
@ -305,7 +307,9 @@
createDateRange:this.firsTime == '' ? '' : this.lasTime == '' ? '' : this.firsTime + ',' + this.lasTime, createDateRange:this.firsTime == '' ? '' : this.lasTime == '' ? '' : this.firsTime + ',' + this.lasTime,
areaId: this.areaId, areaId: this.areaId,
pageSize: 20, pageSize: 20,
pageNum: this.pageNum pageNum: this.pageNum,
isAsc:'desc',
orderByColumn:'createTime'
}; };
} }
this.$u.get('/bst/order/list?', data).then((res) => { this.$u.get('/bst/order/list?', data).then((res) => {

View File

@ -372,7 +372,7 @@ export default {
}) })
} else if (num == 4) { // } else if (num == 4) { //
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/my'
}) })
} else if (num == 5) { } else if (num == 5) {
uni.navigateTo({ uni.navigateTo({

View File

@ -18,6 +18,12 @@
<view class="topsn"> <view class="topsn">
<view class="lt"> <view class="lt">
SN{{deviceInfos.sn}} SN{{deviceInfos.sn}}
<view class="lypic" style="background-color: #28c445;" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
<view class="lypic" v-if="ver_dataflag == 1 && deviceInfos.onlineStatus == 0">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
</view> </view>
<view class="rt"> <view class="rt">
<view class="stutas"> <view class="stutas">
@ -75,15 +81,6 @@
</view> </view>
开锁 开锁
</view> </view>
<!-- <view class="btn" @click="lanya(1)">
蓝牙开锁
</view>
<view class="btn" @click="lanya(2)">
蓝牙关锁
</view>
<view class="btn" @click="lanya(3)">
蓝牙响铃
</view> -->
<view class="dangeanniu" @click="checkbtn(1)"> <view class="dangeanniu" @click="checkbtn(1)">
<view class="pic"> <view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uKear247uKM7Axwgh3Jc" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uKear247uKM7Axwgh3Jc" mode=""></image>
@ -156,6 +153,31 @@
</view> </view>
定位更新 定位更新
</view> </view>
<!-- 蓝牙控制 -->
<view class="dangeanniu" @click="lanya(1)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙开锁
</view>
<view class="dangeanniu" @click="lanya(2)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙关锁
</view>
<view class="dangeanniu" @click="lanya(3)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙重启
</view>
<view class="dangeanniu" @click="lanya(4)" v-if="ver_dataflag == 3 && deviceInfos.onlineStatus == 0">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uqUiYiMtGTjkPNgmCjvP" mode=""></image>
</view>
蓝牙响铃
</view>
</view> </view>
<view class="bikejcxx"> <view class="bikejcxx">
<view class="wai"> <view class="wai">
@ -197,45 +219,6 @@
</view> </view>
<u-mask :show="false" @click="show = false" :z-index='100' /> <u-mask :show="false" @click="show = false" :z-index='100' />
<u-mask :show="maskloading" :z-index='100' duration='0' /> <u-mask :show="maskloading" :z-index='100' duration='0' />
<view class="maskloadpage" v-if="maskloading">
<view class="maskpage1" v-if="maskepage==4">
<view class="top_info">
<image :src="loadimg" mode=""></image>
<view class="masktxt">
{{buletxt}}
</view>
</view>
<view class="masktips" style="width: 100%;">
请确保与车辆的距离小于3米
</view>
<view class="tipsimg">
<image src="https://lxnapi.ccttiot.com/bike/img/static/ugvqmfB3QYujZ6SnfTia" mode=""></image>
</view>
</view>
<!-- 不允许停车点外还车 -->
<view class="maskpage1" v-if="maskepage==5">
<view class="top_info">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uG3cbPgvPDzwlq6IHHxK" mode=""></image>
<view class="masktxt" v-if="orderinfo.sn">
蓝牙连接失败
</view>
</view>
<view class="masktips" style="width: 100%;">
请确保手机蓝牙已经打开
</view>
<view class="tipsimg">
<image src="https://lxnapi.ccttiot.com/bike/img/static/ugvqmfB3QYujZ6SnfTia" mode=""></image>
</view>
<view class="btn_box">
<view class="btn4" @click="closemask()">
返回
</view>
<view class="btn3" @click="Binddevice">
重新连接
</view>
</view>
</view>
</view>
<u-mask :show="showvehicle" @click="closevehicle()" :z-index='100' /> <u-mask :show="showvehicle" @click="closevehicle()" :z-index='100' />
<view class="tip_box" v-if="showvehicle"> <view class="tip_box" v-if="showvehicle">
<view class="top" v-if="showvehicle"> <view class="top" v-if="showvehicle">
@ -415,6 +398,10 @@
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11close@" customData: "11close@"
}) })
}else if (num == 3) {
xBlufi.notifySendCustomData({
customData: "11reboot@"
})
} else { } else {
xBlufi.notifySendCustomData({ xBlufi.notifySendCustomData({
customData: "11play1@" customData: "11play1@"
@ -424,7 +411,7 @@
getlanya() { getlanya() {
console.log("进入111蓝牙连接") console.log("进入111蓝牙连接")
if (this.ver_dataflag != 3) { if (this.ver_dataflag != 3) {
this.ver_dataflag = 2 this.ver_dataflag = 1
this.findDevice() this.findDevice()
} }
}, },
@ -900,9 +887,9 @@
if (res.code === 200) { if (res.code === 200) {
this.deviceInfos = res.data this.deviceInfos = res.data
this.mac = res.data.mac this.mac = res.data.mac
// if (res.data.onlineStatus == 1) { if (res.data.onlineStatus == 0) {
// this.getlanya() this.getlanya()
// } }
if (res.data.isSound == 0) { if (res.data.isSound == 0) {
this.jytxt = '关' this.jytxt = '关'
} else { } else {
@ -913,7 +900,6 @@
} }
this.getnum = 1 this.getnum = 1
this.vehicleNum = res.vehicleNum this.vehicleNum = res.vehicleNum
this.mac = res.data.mac
this.getModelList() this.getModelList()
this.latitude = this.deviceInfos.latitude this.latitude = this.deviceInfos.latitude
this.longitude = this.deviceInfos.longitude this.longitude = this.deviceInfos.longitude
@ -1144,7 +1130,7 @@
return { return {
points: points, points: points,
fillColor: "#FFF5D640", // fillColor: "#FFF5D640", //
strokeColor: "#FFC107", // strokeColor: "#FF473E", //
strokeWidth: 2, // strokeWidth: 2, //
zIndex: 1, // zIndex: 1, //
} }
@ -1171,7 +1157,7 @@
return { return {
points: points, points: points,
fillColor: "#FFD1CF40", // fillColor: "#FFD1CF40", //
strokeColor: "#FF473E", // strokeColor: "#FFC107", //
strokeWidth: 2, // strokeWidth: 2, //
zIndex: 1, // zIndex: 1, //
@ -1193,15 +1179,15 @@
iconPath: item.type == 1 ? iconPath: item.type == 1 ?
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item
.type == 2 ? .type == 2 ?
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' :
' https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq', 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t',
callout: { callout: {
content: item.name, content: item.name,
color: '#ffffff', color: '#ffffff',
fontSize: 14, fontSize: 14,
borderRadius: 10, borderRadius: 10,
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FFC107' : bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' :
'#FF473E', '#FFC107',
padding: 6, padding: 6,
display: 'ALWAYS' display: 'ALWAYS'
}, },
@ -1444,6 +1430,22 @@
font-weight: 600; font-weight: 600;
font-size: 32rpx; font-size: 32rpx;
color: #3D3D3D; color: #3D3D3D;
display: flex;
align-items: center;
.lypic{
background-color: #ccc;
width: 50rpx;
height: 50rpx;
margin-left: 10rpx;
text-align: center;
padding-top: 8rpx;
border-radius: 6rpx;
box-sizing: border-box;
image{
width: 32rpx;
height: 32rpx;
}
}
} }
.rt{ .rt{
display: flex; display: flex;

View File

@ -1553,7 +1553,7 @@
return { return {
points: points, points: points,
fillColor: "#FFF5D640", // fillColor: "#FFF5D640", //
strokeColor: "#FFC107", // strokeColor: "#FF473E", //
strokeWidth: 2, // strokeWidth: 2, //
zIndex: 1, // zIndex: 1, //
} }
@ -1580,7 +1580,7 @@
return { return {
points: points, points: points,
fillColor: "#FFD1CF40", // fillColor: "#FFD1CF40", //
strokeColor: "#FF473E", // strokeColor: "#FFC107", //
strokeWidth: 2, // strokeWidth: 2, //
zIndex: 1, // zIndex: 1, //
@ -1602,14 +1602,14 @@
iconPath: item.type == 1 ? iconPath: item.type == 1 ?
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : item
.type == 2 ? .type == 2 ?
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' :
' https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq', 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t',
callout: { callout: {
content: item.name, content: item.name,
color: '#ffffff', color: '#ffffff',
fontSize: 14, fontSize: 14,
borderRadius: 10, borderRadius: 10,
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FFC107' : '#FF473E', bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' : '#FFC107',
padding: 6, padding: 6,
display: 'ALWAYS' display: 'ALWAYS'
}, },

View File

@ -10,16 +10,16 @@
车牌号{{item.vehicleNum == null ? '--' : item.vehicleNum}} 车牌号{{item.vehicleNum == null ? '--' : item.vehicleNum}}
</view> </view>
<view class="zt" v-if="item.appealStatus == 0"> <view class="zt" v-if="item.appealStatus == 0">
已驳回 <u-icon name="arrow-right" color="#808080" size="28"></u-icon> 已驳回 <!-- <u-icon name="arrow-right" color="#808080" size="28"></u-icon> -->
</view> </view>
<view class="zt" v-if="item.appealStatus == 1"> <view class="zt" v-if="item.appealStatus == 1">
待处理 <u-icon name="arrow-right" color="#808080" size="28"></u-icon> 待处理 <!-- <u-icon name="arrow-right" color="#808080" size="28"></u-icon> -->
</view> </view>
<view class="zt" v-if="item.appealStatus == 2"> <view class="zt" v-if="item.appealStatus == 2">
维修中 <u-icon name="arrow-right" color="#808080" size="28"></u-icon> 维修中 <!-- <u-icon name="arrow-right" color="#808080" size="28"></u-icon> -->
</view> </view>
<view class="zt" v-if="item.appealStatus == 3"> <view class="zt" v-if="item.appealStatus == 3">
已完成 <u-icon name="arrow-right" color="#808080" size="28"></u-icon> 已完成 <!-- <u-icon name="arrow-right" color="#808080" size="28"></u-icon> -->
</view> </view>
</view> </view>
<view class="wz"> <view class="wz">
@ -50,29 +50,33 @@
}, },
list:[], list:[],
pageNum:1, pageNum:1,
total:'' total:'',
userid:''
} }
}, },
onLoad() { onLoad() {
}, },
onShow() { onShow() {
this.pageNum = 1
this.list = []
this.getuser() this.getuser()
}, },
methods: { methods: {
getuser(){ getuser(){
this.$u.get("/getInfo").then((res) => { this.$u.get("/getInfo").then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.userid = res.user.userId
let that = this let that = this
that.$u.get(`/app/fault?userId=${res.user.userId}&pageNum=${this.pageNum}&pageSize=10`).then((resp) => { that.$u.get(`/app/fault?userId=${that.userid}&pageNum=${that.pageNum}&pageSize=10`).then((resp) => {
if (resp.code == 200) { if (resp.code == 200) {
that.total = resp.total that.total = resp.total
if(this.pageNum == 1){ if(that.pageNum == 1){
that.list = resp.rows that.list = resp.rows
}else{ }else{
that.list = that.list.concat(resp.rows) that.list = that.list.concat(resp.rows)
} }
this.pageNum++ that.pageNum++
} }
}) })
}else if(res.code == 401){ }else if(res.code == 401){
@ -97,10 +101,10 @@
handleScrollToLower() { handleScrollToLower() {
if(this.total > this.list.length){ if(this.total > this.list.length){
let that = this let that = this
that.$u.get(`/app/fault?userId=${res.user.userId}&pageNum=${this.pageNum}&pageSize=10`).then((resp) => { that.$u.get(`/app/fault?userId=${that.userid}&pageNum=${that.pageNum}&pageSize=10`).then((resp) => {
if (resp.code == 200) { if (resp.code == 200) {
that.total = resp.total that.total = resp.total
if(this.pageNum == 1){ if(that.pageNum == 1){
that.list = resp.rows that.list = resp.rows
}else{ }else{
that.list = that.list.concat(resp.rows) that.list = that.list.concat(resp.rows)

View File

@ -1,65 +1,161 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="订单详情" :border-bottom="false" :background="bgc" title-color='#fff' title-size='36' height='45' back-icon-color='#fff'></u-navbar> <u-navbar title="订单详情" :border-bottom="false" :background="bgc" title-color='#000' title-size='36' height='45' back-icon-color='#000'></u-navbar>
<view class="tit">
<view class="left">{{info.deviceVehicleNum == null ? '--' : info.deviceVehicleNum}}</view> <view class="jiaoyi">
<view class="pic">
<image src="https://api.ccttiot.com/smartmeter/img/static/uiXte3LpSV30jyvTUR2R" mode=""></image>
<text v-if="info.status == 'PROCESSING'">进行中</text>
<text v-if="info.status == 'WAIT_PAY'">待支付</text>
<text v-if="info.status == 'CANCELED'">已取消</text>
<text v-if="info.status == 'FINISHED'">交易完成</text>
<text v-if="info.status == 'WAIT_VERIFY'">待审核</text>
</view> </view>
<view class="data"> <view class="gx">
{{info.createTime}} <text v-if="info.status == 'PROCESSING'">订单进行中</text>
</view> <text v-if="info.status == 'WAIT_PAY'">订单待支付</text>
<view class="card"> <text v-if="info.status == 'CANCELED'">订单已取消</text>
<view class="card_tit"> <text v-if="info.status == 'FINISHED'">感谢您的支持欢迎再次光临</text>
账单信息 <text v-if="info.status == 'WAIT_VERIFY'">订单待审核</text>
</view>
<view class="cont">
<view class="cont_box" style="margin-top: 20rpx;">
<view class="cont_left">
支付金额
</view>
<view class="cont_right">
{{info.payAmount}}
</view> </view>
</view> </view>
<view class="cont_box" style="margin-top: 20rpx;"> <view class="ordermx">
<view class="cont_left"> <view class="top">
预存金额 订单明细
</view> </view>
<view class="cont_right"> <view class="xuxian">
{{info.depositFee}} <view class="one">
<view class="qian">
订单编号
</view>
<view class="shen">
{{info.no == null ? '--' : info.no}} <image src="https://api.ccttiot.com/smartmeter/img/static/uimYURcxkn9ItLquwPpM" mode=""></image>
</view> </view>
</view> </view>
<view class="cont_box" style="margin-top: 20rpx;"> <view class="one">
<view class="cont_left"> <view class="qian">
下单时间
</view>
<view class="shen">
{{info.createTime == null ? '--' : info.createTime}}
</view>
</view>
<view class="one">
<view class="qian">
结束时间
</view>
<view class="shen">
{{info.endTime == null ? '--' : info.endTime}}
</view>
</view>
</view>
<view class="xuxian">
<view class="one">
<view class="qian">
骑行费 骑行费
</view> </view>
<view class="cont_right"> <view class="shen">
{{info.ridingFee}} {{info.ridingFee == null ? '0.00' : info.ridingFee}}
</view> </view>
</view> </view>
<view class="cont_box" style="margin-top: 20rpx;"> <view class="one">
<view class="cont_left"> <view class="qian">
停车点外调度费 停车点外调度费
</view> </view>
<view class="cont_right"> <view class="shen">
{{info.manageFee}} {{info.manageFee == null ? '0.00' : info.manageFee}}
</view> </view>
</view> </view>
<view class="cont_box" style="margin-top: 20rpx;"> <view class="one">
<view class="cont_left"> <view class="qian">
运营区外调度费 运营区外调度费
</view> </view>
<view class="cont_right"> <view class="shen">
{{info.dispatchFee}} {{info.dispatchFee == null ? '0.00' : info.dispatchFee}}
</view> </view>
</view> </view>
<view class="tip"> </view>
骑行时间{{ rideDuration == '' ? '--' : rideDuration}} <view class="xuxian">
<view class="one">
<view class="qian">
合计
</view>
<view class="shen">
{{info.totalFee == null ? '0.00' : info.totalFee}}
</view> </view>
</view> </view>
<view class="price"> <view class="one">
<view class="zhanwei"></view> <view class="qian">
<view class="prices"> 预存金额
共计<span style="font-size:48rpx ;">{{info.totalFee}}</span> </view>
<view class="shen">
{{info.depositFee == null ? '0.00' : info.depositFee}}
</view>
</view>
<view class="one">
<view class="qian">
退款金额
</view>
<view class="shen">
{{info.payRefunded == null ? '0.00' : info.payRefunded}}
</view>
</view>
</view>
<view class="xuxian" style="border: 0;">
<view class="one">
<view class="qian">
实付金额
</view>
<view class="shen">
<span style="color: #E7612E;font-size: 40rpx;">{{info.payAmount == null ? '0.00' : info.payAmount}}</span>
</view>
</view>
</view>
</view>
<view class="qixing">
<view class="top">
骑行信息
</view>
<view class="xuxian">
<view class="one">
<view class="qian">
骑行时长
</view>
<view class="shen">
{{ rideDuration == '' ? '--' : rideDuration}}
</view>
</view>
<view class="one">
<view class="qian">
骑行距离
</view>
<view class="shen">
{{info.distance > 1000 ? (info.distance / 1000).toFixed(2) + 'km' : info.distance + 'm'}}
</view>
</view>
<view class="one">
<view class="qian">
运营区
</view>
<view class="shen">
{{info.areaName == null ? '--' : info.areaName}}
</view>
</view>
<view class="one">
<view class="qian">
车牌号
</view>
<view class="shen">
{{info.deviceVehicleNum == null ? '--' : info.deviceVehicleNum}}
</view>
</view>
<view class="one">
<view class="qian">
车辆编号SN
</view>
<view class="shen">
{{info.deviceSn == null ? '--' : info.deviceSn}}
</view>
</view> </view>
</view> </view>
</view> </view>
@ -74,7 +170,7 @@
data() { data() {
return { return {
bgc: { bgc: {
backgroundColor: "", backgroundColor: "#fff",
}, },
id: 0, id: 0,
info: {}, info: {},
@ -143,13 +239,15 @@ page{
} }
.page{ .page{
width: 750rpx; width: 750rpx;
background: linear-gradient( 180deg, #C4E1FF 0%, rgba(255,255,255,0) 100%), #FFFFFF; background: #F7F7F7;
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
padding-bottom: 200rpx;
box-sizing: border-box;
.kefu{ .kefu{
width: 680rpx; width: 680rpx;
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
background-color: #4297F3; background-color: #4C97E7;
color: #fff; color: #fff;
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
@ -160,126 +258,110 @@ page{
bottom: 50rpx; bottom: 50rpx;
border-radius: 20rpx; border-radius: 20rpx;
} }
.tit{ .qixing{
margin-left: 86rpx; width: 702rpx;
margin-right: 86rpx; height: 466rpx;
margin-top: 30rpx;
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
.left{
font-weight: 700;
font-size: 40rpx;
color: #3D3D3D;
}
.right{
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
}
}
.data{
margin-left: 86rpx;
font-weight: 400;
font-size: 24rpx;
color: #808080;
}
.card{
padding:34rpx 44rpx ;
margin: 68rpx auto;
width: 672rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08); border-radius: 16rpx 16rpx 16rpx 16rpx;
border-radius: 32rpx 32rpx 32rpx 32rpx; padding: 0 42rpx;
.card_tit{ box-sizing: border-box;
width: 112rpx; margin: auto;
height: 38rpx;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
background: linear-gradient( 0deg, #C4E1FF 0.1%, rgba(255,255,255,0) 40%), #FFFFFF;
}
.cont{
padding: 32rpx 28rpx;
margin-top: 26rpx;
width: 586rpx;
background: #F3F3F3;
border-radius: 26rpx 26rpx 26rpx 26rpx;
.cont_box{
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
.cont_left{
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
}
.cont_right{
font-weight: 400;
font-size: 28rpx;
color: #3D3D3D;
}
}
.tip{
margin-top: 32rpx; margin-top: 32rpx;
font-weight: 400; .top{
font-size: 24rpx; font-weight: 600;
color: #808080; font-size: 32rpx;
color: #3D3D3D;
padding: 36rpx 0 24rpx 0;
box-sizing: border-box;
border-bottom: 1px dashed #D8D8D8;
} }
} .xuxian{
.price{ .one{
margin-top: 28rpx;
display: flex; display: flex;
flex-wrap: nowrap;
.prices{
margin-left: auto;
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
span{
margin-left: 2rpx;
margin-right: 2rpx;
}
}
.showmore{
margin-left: auto;
display: flex;
flex-wrap: nowrap;
align-items: center;
font-weight: 400;
font-size: 20rpx;
color: #3D3D3D;
.icon-xiangshang1{
font-size: 20rpx;
color: #3D3D3D;
}
.icon-xiangxia1{
font-size: 20rpx;
color: #3D3D3D;
}
}
}
.info_cont{
margin-top: 12rpx;
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between; justify-content: space-between;
.cont_left{ align-items: center;
font-weight: 400; margin-top: 30rpx;
font-size: 24rpx; .qian{
color: #808080;
font-size: 28rpx;
}
.shen{
color: #3D3D3D; color: #3D3D3D;
} }
.cont_right{
font-weight: 400;
font-size: 24rpx;
color: #3D3D3D;
} }
} }
} }
.ordermx{
width: 702rpx;
max-height: 1862rpx;
background: #FFFFFF;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 0 42rpx;
box-sizing: border-box;
margin: auto;
margin-top: 32rpx;
.xuxian{
padding-bottom: 24rpx;
box-sizing: border-box;
border-bottom: 1px dashed #D8D8D8;
.one{
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 30rpx;
.qian{
color: #808080;
font-size: 28rpx;
}
.shen{
color: #3D3D3D;
image{
width: 23rpx;
height: 28rpx;
vertical-align: baseline;
margin-left: 10rpx;
}
}
}
}
.top{
font-weight: 600;
font-size: 32rpx;
color: #3D3D3D;
padding: 36rpx 0 24rpx 0;
box-sizing: border-box;
border-bottom: 1px dashed #D8D8D8;
}
}
.jiaoyi{
width: 702rpx;
height: 182rpx;
background: #FFFFFF;
border-radius: 16rpx 16rpx 16rpx 16rpx;
margin: auto;
text-align: center;
margin-top: 26rpx;
.pic{
padding-top: 34rpx;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
image{
width: 38rpx;
height: 38rpx;
margin-right: 10rpx;
}
font-weight: 600;
font-size: 40rpx;
color: #4C97E7;
}
.gx{
font-size: 28rpx;
color: #808080;
margin-top: 20rpx;
}
}
} }
</style> </style>

View File

@ -75,7 +75,7 @@
<view class="rt" v-if="item.status == 'WAIT_PAY'"> <view class="rt" v-if="item.status == 'WAIT_PAY'">
待支付 <u-icon name="arrow-right" color="#808080" size="28"></u-icon> 待支付 <u-icon name="arrow-right" color="#808080" size="28"></u-icon>
</view> </view>
<view class="rt" v-if="item.status == 'CANCEL'"> <view class="rt" v-if="item.status == 'CANCELED'">
已取消 <u-icon name="arrow-right" color="#808080" size="28"></u-icon> 已取消 <u-icon name="arrow-right" color="#808080" size="28"></u-icon>
</view> </view>
<view class="rt" v-if="item.status == 'PROCESSING'"> <view class="rt" v-if="item.status == 'PROCESSING'">
@ -84,6 +84,9 @@
<view class="rt" v-if="item.status == 'FINISHED'"> <view class="rt" v-if="item.status == 'FINISHED'">
已完成 <u-icon name="arrow-right" color="#808080" size="28"></u-icon> 已完成 <u-icon name="arrow-right" color="#808080" size="28"></u-icon>
</view> </view>
<view class="rt" v-if="item.status == 'WAIT_VERIFY'">
待审核 <u-icon name="arrow-right" color="#808080" size="28"></u-icon>
</view>
</view> </view>
<view class="bot"> <view class="bot">
<view class="lt"> <view class="lt">
@ -94,7 +97,7 @@
<text>时长</text> {{computedList(item.duration)}} <text>时长</text> {{computedList(item.duration)}}
</view> </view>
<view class=""> <view class="">
<text>距离</text> {{item.distance > 1000 ? item.distance / 1000 + 'km' : item.distance + 'm'}} <text>距离</text> {{item.distance > 1000 ? (item.distance / 1000).toFixed(2) + 'km' : item.distance + 'm'}}
</view> </view>
<view class="" v-if="item.status == 'WAIT_VERIFY'"> <view class="" v-if="item.status == 'WAIT_VERIFY'">
<text>还车审核</text> 未审核 <text>还车审核</text> 未审核
@ -173,7 +176,7 @@
}, },
// //
getlist(){ getlist(){
this.$u.get(`/app/order/mineList?pageNum=${this.pageNum}&pageSize=10&suitType=${this.activeindex}&status=${this.status}`).then((res) => { this.$u.get(`/app/order/mineList?pageNum=${this.pageNum}&pageSize=10&suitType=${this.activeindex}&status=${this.status}&isAsc=desc&orderByColumn=createTime`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(this.pageNum == 1){ if(this.pageNum == 1){
this.qixinglist = res.rows this.qixinglist = res.rows

View File

@ -18,8 +18,11 @@
车牌号{{deivceobj.deviceVehicleNum == null ? '--' : deivceobj.deviceVehicleNum}} 车牌号{{deivceobj.deviceVehicleNum == null ? '--' : deivceobj.deviceVehicleNum}}
<text>SN{{deivceobj.deviceSn == null ? '--' : deivceobj.deviceSn}}</text> <text>SN{{deivceobj.deviceSn == null ? '--' : deivceobj.deviceSn}}</text>
</view> </view>
<!-- <view class="lanya"> <!-- <view class="lanya" v-if="ver_dataflag == 3">
<image src="https://api.ccttiot.com/smartmeter/img/static/uGhbsMP0tkh3ngL6EI99" class="xz" mode=""></image> 正在连接 <image src="https://api.ccttiot.com/smartmeter/img/static/uO1TOFA1vdxQlz3NJenN" class="ljimg" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uFfCiqhjHpbTBXcZvKl6" class="ljimg" mode=""></image>
</view>
<view class="lanya" v-else>
<image src="https://api.ccttiot.com/smartmeter/img/static/uO1TOFA1vdxQlz3NJenN" class="ljimg" mode=""></image>
</view> --> </view> -->
</view> </view>
<view class="dianliang"> <view class="dianliang">
@ -143,6 +146,7 @@
</template> </template>
<script> <script>
var xBlufi = require("@/components/blufi/xBlufi.js")
export default { export default {
data() { data() {
return { return {
@ -165,15 +169,27 @@
imglist:[], imglist:[],
deivceobj:{}, deivceobj:{},
orderAreaReturnVerify:false, orderAreaReturnVerify:false,
imgs:'' imgs:'',
ver_dataflag: 1,
mac: '',
deviceid: '',
devicename: '',
devicesarr: [],
findDeviceTimer: null,
name:''
}; };
}, },
onLoad(option) { onLoad(option) {
// xBlufi.initXBlufi(1)
if(option.id){ if(option.id){
this.cheflag = false this.cheflag = false
} }
}, },
onShow() { onShow() {
// xBlufi.notifyStartDiscoverBle({
// 'isStart': true
// })
// xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent)
setTimeout(()=>{ setTimeout(()=>{
this.getorderdevice() this.getorderdevice()
},100) },100)
@ -183,15 +199,33 @@
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.executeTask(); this.executeTask();
}, 60000); }, 60000);
xBlufi.notifyConnectBle({
isStart: false,
deviceId: this.deviceId,
name: this.name
})
}, },
onHide() { onHide() {
// //
this.clearTimer(); this.clearTimer();
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
if (this.findDeviceTimer) {
clearTimeout(this.findDeviceTimer)
this.findDeviceTimer = null
}
}, },
onUnload() { onUnload() {
// //
this.clearTimer(); this.clearTimer();
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
if (this.findDeviceTimer) {
clearTimeout(this.findDeviceTimer)
this.findDeviceTimer = null
}
}, },
methods: { methods: {
// 使 // 使
@ -199,6 +233,8 @@
this.$u.get("/app/orderDevice/mineUsing").then((res) => { this.$u.get("/app/orderDevice/mineUsing").then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.data){ if(res.data){
this.mac = res.data.deviceMac
this.findDevice()
this.cheflag = false this.cheflag = false
this.orderAreaReturnVerify = res.data.orderAreaReturnVerify this.orderAreaReturnVerify = res.data.orderAreaReturnVerify
this.deivceobj = res.data this.deivceobj = res.data
@ -209,6 +245,72 @@
} }
}) })
}, },
findDevice() {
// 使 find
const matchedDevice = this.devicesarr.find(device => {
console.log(device.name, this.mac, '111')
return device.name.slice(-12) == this.mac.slice(-12)
})
if (matchedDevice) {
//
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
xBlufi.notifyConnectBle({
isStart: true,
deviceId: matchedDevice.deviceId,
name: matchedDevice.name
})
this.deviceid = matchedDevice.deviceId
this.devicename = matchedDevice.name
console.log(this.deviceid, '11221')
} else {
console.log("未找到匹配的设备,继续查找...")
this.findDeviceTimer = setTimeout(this.findDevice.bind(this), 1000) // 使 bind this
}
},
//
funListenDeviceMsgEvent: function(options) {
switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED:
if (!options.result) {
this.ver_dataflag = 1
console.log('断开');
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) {
this.devicesarr = options.data
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
console.log("连接回调:" + JSON.stringify(options))
if (options.result == true) {
setTimeout(() => {
this.ver_dataflag = 3
}, 2000)
xBlufi.notifyInitBleEsp32({
deviceId: this.deviceid
})
this.deviceid = options.data.deviceId
this.name = this.name
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
this.ver_dataflag = 3
console.log("1收到设备发来的自定义数据结果", options.data)
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) {
console.log('蓝牙未开启')
return
} else {
this.lanyaflag = false
}
break;
}
},
// //
btnghbike(){ btnghbike(){
uni.navigateTo({ uni.navigateTo({
@ -343,7 +445,7 @@
// //
btntcd(){ btntcd(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/myorder/returned/tingche' url:'/pages/myorder/returned/tingche?areaId=' + this.deivceobj.orderAreaId
}) })
}, },
// //
@ -427,6 +529,9 @@
}, },
// //
btnfm(){ btnfm(){
// xBlufi.notifySendCustomData({
// customData: "11play1@"
// })
this.$u.put(`/bst/device/iot/ring?id=${this.deivceobj.deviceId}`).then((res) => { this.$u.put(`/bst/device/iot/ring?id=${this.deivceobj.deviceId}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
@ -797,17 +902,6 @@
} }
} }
.lanya{ .lanya{
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 22rpx;
box-sizing: border-box;
font-size: 32rpx;
color: #FF8282;
width: 272rpx;
height: 60rpx;
background: #FFFFFF;
border-radius: 30rpx 30rpx 30rpx 30rpx;
.xz{ .xz{
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;

View File

@ -152,7 +152,8 @@
</view> </view>
<view class="cont_li"> <view class="cont_li">
<view class="right"> <view class="right">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uqKmFMF9YHTX8lAQARSd" mode="aspectFill"></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uqKmFMF9YHTX8lAQARSd" mode="aspectFill">
</image>
<view class="NO"> <view class="NO">
SN{{orderobj.deviceSn == null ? '--' : orderobj.deviceSn}} SN{{orderobj.deviceSn == null ? '--' : orderobj.deviceSn}}
</view> </view>
@ -169,11 +170,15 @@
</view> </view>
</view> </view>
</view> </view>
<view class="" style="display: flex;width: 100%;padding: 0 20rpx;box-sizing: border-box;justify-content: space-between;"> <view class=""
style="display: flex;width: 100%;padding: 0 20rpx;box-sizing: border-box;justify-content: space-between;">
<view class="dh" @click.stop="danghang"> <view class="dh" @click.stop="danghang">
导航 <u-icon name="arrow-right" color="#333" size="28"></u-icon> 导航 <u-icon name="arrow-right" color="#333" size="28"></u-icon>
</view> </view>
<view class="suocheanniu"> <view class="suocheanniu">
<view class="lssc" @click.stop="btnjsdd">
结束订单
</view>
<view class="lssc" @click.stop="btnqd"> <view class="lssc" @click.stop="btnqd">
{{orderobj.deviceLockStatus == 1 ? '临时锁车' : '开锁'}} {{orderobj.deviceLockStatus == 1 ? '临时锁车' : '开锁'}}
</view> </view>
@ -181,6 +186,29 @@
</view> </view>
</view> </view>
<!-- 扫码用车未在停车点内还车弹窗 -->
<view class="tingchetc" v-if="fjflag">
<view class="topname">
<image src="https://api.ccttiot.com/smartmeter/img/static/uDfEXjApmdS6ByM88pv3" mode=""></image>
{{fajinobj.manageFee > 0 ? '不在运营区' : fajinobj.dispatchFee > 0 ? '不在停车点' : ''}}
</view>
<view class="shuom">
需支付<text>{{fajinobj.manageFee > 0 ? fajinobj.manageFee : fajinobj.dispatchFee > 0 ? fajinobj.dispatchFee : ''}}</text>你可查看<text
@click="btntcd">最近停车点</text>
</view>
<image src="https://api.ccttiot.com/smartmeter/img/static/uzRrRFiToK3bb3IurIHU" class="tcimg" mode="">
</image>
<view class="btnan">
<view class="fj" @click="btnfajin">
缴纳罚金还车
</view>
<view class="qx" @click="fjflag = false">
继续骑行
</view>
</view>
</view>
<view class="mask" v-if="fjflag"></view>
<tab-bar :indexs='1'></tab-bar> <tab-bar :indexs='1'></tab-bar>
</view> </view>
@ -216,11 +244,17 @@
areaId: '', areaId: '',
orderobj: {}, orderobj: {},
orderAreaReturnVerify: '', orderAreaReturnVerify: '',
fajinobj: {},
fjflag: false,
sockedata:{},
socketTask: null, socketTask: null,
reconnectTimer: null, messages: [],
heartbeatTimer: null, reconnectAttempts: 0,
dataList: [], maxReconnectAttempts: 5,
reconnectInterval: 3000, // 3
isPageActive: true,
deviceMac: '' //
} }
}, },
onLoad() { onLoad() {
@ -233,54 +267,204 @@
this.polyline = [] this.polyline = []
}, },
onUnload() { onUnload() {
this.socketTask?.close() this.isPageActive = false;
this.stopHeartbeat() this.closeWebSocket();
},
onHide() {
//
this.isPageActive = false;
this.closeWebSocket();
}, },
methods: { methods: {
// 使websocket //WebSocket
initWebSocket() { initWebSocket() {
if (!this.isPageActive || !this.deviceMac) return;
let token = uni.getStorageSync('token');
//
if (this.socketTask) {
this.socketTask.close();
this.socketTask = null;
}
//
this.socketTask = uni.connectSocket({ this.socketTask = uni.connectSocket({
url: 'wss://your-websocket-server.com', url: `wss://ele.ccttiot.com/prod-api/ws/device?token=${token}&mac=${this.deviceMac}`,
}) success: () => {
console.log('WebSocket连接建立中...');
},
fail: (err) => {
console.error('WebSocket连接失败:', err);
this.scheduleReconnect();
}
});
//
this.socketTask.onOpen(() => { this.socketTask.onOpen(() => {
console.log('WebSocket 已连接') console.log('WebSocket连接已打开');
this.startHeartbeat() this.reconnectAttempts = 0; //
//
this.socketTask.send({ this.socketTask.send({
data: JSON.stringify({ data: JSON.stringify({
action: 'subscribe' action: 'subscribe'
}), }),
}) success: () => console.log('订阅消息发送成功'),
}) fail: (err) => console.error('订阅消息发送失败:', err)
});
});
//
this.socketTask.onMessage((res) => { this.socketTask.onMessage((res) => {
// this.covers.push(JSON.parse(res.data)) console.log('收到实时消息:', res.data);
}) this.messages.push(res.data); //
this.socketTask.onClose(() => { try {
console.log('WebSocket 断开,尝试重连...') const data = JSON.parse(res.data);
this.reconnect() console.log('解析后的JSON数据:', data);
//
this.sockedata = data
this.getqingqiu()
this.covers.push({
latitude: data.latitude,
longitude: data.longitude,
width: 8,
height: 8,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uow9Zq3edTUYCVHI9H60',
}) })
} catch (e) {
console.log('原始消息内容:', res.data);
}
});
//
this.socketTask.onError((err) => { this.socketTask.onError((err) => {
console.error('WebSocket 错误:', err) console.error('WebSocket错误:', err);
this.reconnect() this.scheduleReconnect();
});
//
this.socketTask.onClose((res) => {
console.log('WebSocket连接已关闭', res);
if (this.isPageActive) {
this.scheduleReconnect();
}
});
},
// WebSocket
closeWebSocket() {
if (this.socketTask) {
this.socketTask.close({
success: () => {
console.log('WebSocket已主动关闭');
this.socketTask = null;
},
fail: (err) => {
console.error('WebSocket关闭失败:', err);
this.socketTask = null;
}
});
}
},
//
scheduleReconnect() {
if (!this.isPageActive || this.reconnectAttempts >= this.maxReconnectAttempts) {
console.log('已达到最大重连次数或页面已关闭,停止重连');
return;
}
this.reconnectAttempts++;
console.log(`尝试第 ${this.reconnectAttempts} 次重连,等待 ${this.reconnectInterval/1000} 秒...`);
setTimeout(() => {
this.initWebSocket();
}, this.reconnectInterval);
// 退
this.reconnectInterval = Math.min(this.reconnectInterval * 2, 30000); // 30
},
//
btnjsdd() {
if (this.orderAreaReturnVerify == true) {
uni.navigateTo({
url: '/page_user/hcshenhe?sn=' + this.orderobj.deviceSn + '&orderid=' + this.orderobj
.orderId + '&orderAreaId=' + this.orderobj.orderAreaId
}) })
} else {
uni.getLocation({
type: 'wgs84',
success: (res) => {
console.log(res);
this.latsc = res.latitude
this.lonsc = res.longitude
this.getfeiyong()
}, },
reconnect() { fail: (err) => {
if (this.reconnectTimer) clearTimeout(this.reconnectTimer) console.error('获取位置失败:', err)
this.reconnectTimer = setTimeout(() => { this.getfeiyong()
this.initWebSocket() }
}, 3000)
},
startHeartbeat() {
this.heartbeatTimer = setInterval(() => {
if (this.socketTask?.readyState === 1) {
this.socketTask.send({
data: 'ping'
}) })
} }
}, 30000)
}, },
stopHeartbeat() { //
clearInterval(this.heartbeatTimer) getfeiyong() {
let data = {
orderId: this.orderobj.orderId,
lon: this.latsc,
lat: this.lonsc
}
this.$u.post(`/app/order/calcFee`, data).then(res => {
if (res.code == 200) {
this.fajinobj = res.data
if (res.data.manageFee > 0 || res.data.dispatchFee > 0) {
this.fjflag = true
// this.gethuan()
} else {
// this.fjflag = true
this.gethuan()
}
}
})
}, },
//
btnfajin() {
this.gethuan()
},
//
gethuan() {
let that = this
uni.showModal({
title: '提示',
content: '您确定要还车吗?',
showCancel: true,
success: function(res) {
if (res.confirm) {
let data = {
orderId: that.orderobj.orderId,
picture: that.imgs,
lon: that.lonsc,
lat: that.latsc
}
that.$u.put(`/app/order/end`, data).then(res => {
if (res.code == 200) {
uni.showToast({
title: '还车成功',
icon: 'success',
duration: 2000
})
that.getorderdevice()
that.fjflag = false
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
}
}
})
},
//
btntcd() {
uni.navigateTo({
url: '/pages/myorder/returned/tingche?areaId=' + this.orderobj.orderAreaId
})
},
// //
btntz() { btntz() {
uni.switchTab({ uni.switchTab({
@ -289,12 +473,20 @@
}, },
// //
danghang() { danghang() {
if (this.orderobj.deviceLatitude && this.orderobj.deviceLongitude) {
uni.openLocation({ uni.openLocation({
latitude: this.orderobj.latitude, //-/ latitude: this.orderobj.deviceLatitude, //-/
longitude: this.orderobj.longitude, //-/ longitude: this.orderobj.deviceLongitude, //-/
name: '', // name: '', //
address: '' // address: '' //
}) })
} else {
uni.showToast({
title: '车辆暂无法导航',
icon: 'none',
duration: 2000
})
}
}, },
// and // and
btnqd() { btnqd() {
@ -306,7 +498,8 @@
showCancel: true, showCancel: true,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.$u.put(`/app/order/openDevice?orderId=${that.orderobj.orderId}`).then((res) => { that.$u.put(`/app/order/openDevice?orderId=${that.orderobj.orderId}`).then((
res) => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '解锁成功', title: '解锁成功',
@ -346,7 +539,9 @@
showCancel: true, showCancel: true,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
that.$u.put(`/app/order/closeDevice?orderId=${that.orderobj.orderId}&lat=${that.latsc}&lon=${that.lngsc}`).then((res) => { that.$u.put(
`/app/order/closeDevice?orderId=${that.orderobj.orderId}&lat=${that.latsc}&lon=${that.lngsc}`
).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '临时锁车成功', title: '临时锁车成功',
@ -378,6 +573,11 @@
this.orderAreaReturnVerify = res.data.orderAreaReturnVerify this.orderAreaReturnVerify = res.data.orderAreaReturnVerify
this.orderAreaId = res.data.orderAreaId this.orderAreaId = res.data.orderAreaId
this.areaId = res.data.orderAreaId this.areaId = res.data.orderAreaId
this.deviceMac = res.data.deviceMac
this.isPageActive = true
this.initWebSocket() //WebSocket
this.$u.get(`/app/area/detail?id=${this.orderAreaId}`).then((res) => { this.$u.get(`/app/area/detail?id=${this.orderAreaId}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr) const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
@ -407,7 +607,8 @@
if (this.orderAreaId == '') { if (this.orderAreaId == '') {
this.covers.filter(item => { this.covers.filter(item => {
if (item.id == id) { if (item.id == id) {
item.iconPath = 'https://api.ccttiot.com/smartmeter/img/static/uCBNaRAdk9kcgQgrom2G' item.iconPath =
'https://api.ccttiot.com/smartmeter/img/static/uCBNaRAdk9kcgQgrom2G'
this.taocanflag = true this.taocanflag = true
this.$u.get(`/app/device/availableDetail?id=${id.slice(0, -1)}`).then((res) => { this.$u.get(`/app/device/availableDetail?id=${id.slice(0, -1)}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -444,7 +645,8 @@
if (res.code == 200) { if (res.code == 200) {
this.taocanflag = false this.taocanflag = false
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/storedlist/trueorder?modelId=' + this.cheobj.modelId + '&sn=' + this.cheobj.sn url: '/page_fenbao/storedlist/trueorder?modelId=' + this.cheobj.modelId +
'&sn=' + this.cheobj.sn
}) })
} else if (res.code == 401) { } else if (res.code == 401) {
uni.showModal({ uni.showModal({
@ -592,6 +794,15 @@
this.$u.get(`/app/device/listNearBy?radius=10000&center=${this.jingweidu}`).then((res) => { this.$u.get(`/app/device/listNearBy?radius=10000&center=${this.jingweidu}`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.covers = [] this.covers = []
if(this.sockedata.latitude){
this.covers.push({
latitude: this.sockedata.latitude,
longitude: this.sockedata.longitude,
width: 8,
height: 8,
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uow9Zq3edTUYCVHI9H60',
})
}
res.data.forEach(item => { res.data.forEach(item => {
const shopCover = { const shopCover = {
// 123 // 123
@ -705,7 +916,7 @@
return { return {
points: points, points: points,
fillColor: "#FFF5D640", // fillColor: "#FFF5D640", //
strokeColor: "#FFC107", // strokeColor: "#FF473E", //
strokeWidth: 2, // strokeWidth: 2, //
zIndex: 1, // zIndex: 1, //
} }
@ -732,7 +943,7 @@
return { return {
points: points, points: points,
fillColor: "#FFD1CF40", // fillColor: "#FFD1CF40", //
strokeColor: "#FF473E", // strokeColor: "#FFC107", //
strokeWidth: 2, // strokeWidth: 2, //
zIndex: 1, // zIndex: 1, //
@ -760,17 +971,16 @@
height: 28.95, height: 28.95,
iconPath: item.type == 1 ? iconPath: item.type == 1 ?
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' : 'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' :
item item.type == 2 ?
.type == 2 ? 'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq' :
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' : 'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t',
' https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq',
callout: { callout: {
content: item.name, content: item.name,
color: '#ffffff', color: '#ffffff',
fontSize: 14, fontSize: 14,
borderRadius: 10, borderRadius: 10,
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FFC107' : bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FF473E' :
'#FF473E', '#FFC107',
padding: 6, padding: 6,
display: 'ALWAYS' display: 'ALWAYS'
}, },
@ -859,6 +1069,92 @@
opacity: 1; opacity: 1;
} }
} }
.mask {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, .3);
z-index: 9;
}
.tingchetc {
width: 624rpx;
height: 610rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
top: 572rpx;
z-index: 99;
padding: 28rpx 36rpx;
box-sizing: border-box;
.btnan {
display: flex;
justify-content: space-between;
margin-top: 40rpx;
.fj {
width: 252rpx;
height: 72rpx;
border-radius: 45rpx 45rpx 45rpx 45rpx;
border: 2rpx solid #808080;
font-weight: 600;
font-size: 32rpx;
color: #808080;
text-align: center;
line-height: 72rpx;
}
.qx {
width: 252rpx;
height: 72rpx;
background: #4C97E7;
border-radius: 45rpx 45rpx 45rpx 45rpx;
text-align: center;
line-height: 72rpx;
box-sizing: border-box;
font-weight: 600;
font-size: 32rpx;
color: #FFFFFF;
}
}
.tcimg {
width: 552rpx;
height: 300rpx;
margin-top: 28rpx;
}
.shuom {
font-size: 26rpx;
color: #3D3D3D;
margin-top: 18rpx;
text {
color: #4C97E7;
}
}
.topname {
font-weight: 600;
font-size: 36rpx;
color: #3D3D3D;
display: flex;
align-items: center;
image {
width: 48rpx;
height: 48rpx;
margin-right: 14rpx;
}
}
}
.conts_box { .conts_box {
width: 680rpx; width: 680rpx;
height: 360rpx; height: 360rpx;
@ -876,6 +1172,7 @@
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
bottom: 220rpx; bottom: 220rpx;
.orderzt { .orderzt {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -884,6 +1181,7 @@
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
} }
.txtss { .txtss {
margin-top: 18rpx; margin-top: 18rpx;
padding-left: 20rpx; padding-left: 20rpx;
@ -892,6 +1190,7 @@
font-size: 28rpx; font-size: 28rpx;
color: #808080; color: #808080;
} }
.dh { .dh {
width: 160rpx; width: 160rpx;
height: 60rpx; height: 60rpx;
@ -902,9 +1201,11 @@
padding-top: 10rpx; padding-top: 10rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.suocheanniu { .suocheanniu {
display: flex; display: flex;
align-items: center; align-items: center;
.lssc { .lssc {
width: 160rpx; width: 160rpx;
height: 60rpx; height: 60rpx;
@ -918,6 +1219,7 @@
margin-left: 30rpx; margin-left: 30rpx;
} }
} }
.cont_li { .cont_li {
width: 100%; width: 100%;
display: flex; display: flex;
@ -933,23 +1235,27 @@
font-weight: 600; font-weight: 600;
font-size: 36rpx; font-size: 36rpx;
color: #3D3D3D; color: #3D3D3D;
.km { .km {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #3D3D3D; color: #3D3D3D;
} }
.speed { .speed {
margin-top: 18rpx; margin-top: 18rpx;
width: 226rpx; width: 226rpx;
height: 22rpx; height: 22rpx;
background: #ccc; background: #ccc;
border-radius: 16rpx 16rpx 16rpx 16rpx; border-radius: 16rpx 16rpx 16rpx 16rpx;
.speeds { .speeds {
height: 100%; height: 100%;
background: #4297F3; background: #4297F3;
border-radius: 16rpx 16rpx 16rpx 16rpx; border-radius: 16rpx 16rpx 16rpx 16rpx;
} }
} }
.NO { .NO {
width: 100%; width: 100%;
font-weight: 400; font-weight: 400;
@ -958,11 +1264,13 @@
margin-top: 18rpx; margin-top: 18rpx;
} }
} }
.right { .right {
width: 70%; width: 70%;
padding-right: 20rpx; padding-right: 20rpx;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
image { image {
width: 160rpx; width: 160rpx;
height: 110rpx; height: 110rpx;
@ -970,6 +1278,7 @@
} }
} }
} }
.picimg { .picimg {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
@ -1084,6 +1393,7 @@
margin: auto; margin: auto;
padding-bottom: 30rpx; padding-bottom: 30rpx;
box-sizing: border-box; box-sizing: border-box;
.topfor { .topfor {
width: 100%; width: 100%;
margin: auto; margin: auto;