111
This commit is contained in:
parent
efd58a0571
commit
a677eb52fd
File diff suppressed because it is too large
Load Diff
|
@ -473,12 +473,13 @@
|
||||||
border-bottom: 2rpx solid #fff;
|
border-bottom: 2rpx solid #fff;
|
||||||
}
|
}
|
||||||
.qs_li{
|
.qs_li{
|
||||||
margin-top: 10rpx;
|
// margin-top: 10rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 2rpx solid #D8D8D8;
|
border-bottom: 2rpx solid #D8D8D870;
|
||||||
|
padding-top: 26rpx;
|
||||||
padding-bottom: 26rpx;
|
padding-bottom: 26rpx;
|
||||||
.qs_li_txt{
|
.qs_li_txt{
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,8 @@
|
||||||
areaInfo: "",
|
areaInfo: "",
|
||||||
isback:false,
|
isback:false,
|
||||||
showBack:false,
|
showBack:false,
|
||||||
loadingmask:false
|
loadingmask:false,
|
||||||
|
ispaid:false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,6 +338,8 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sub4() {
|
sub4() {
|
||||||
|
if(this.ispaid==false){
|
||||||
|
this.ispaid=true
|
||||||
let id = uni.getStorageSync('areaId');
|
let id = uni.getStorageSync('areaId');
|
||||||
let data = {
|
let data = {
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
|
@ -349,10 +352,11 @@
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
let that = this
|
||||||
this.$u.post('/appVerify/pre/order', data).then((res) => {
|
this.$u.post('/appVerify/pre/order', data).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
// this.freList=res.rows
|
// this.freList=res.rows
|
||||||
let that = this
|
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: 'wxpay',
|
provider: 'wxpay',
|
||||||
timeStamp: res.data.timeStamp,
|
timeStamp: res.data.timeStamp,
|
||||||
|
@ -365,6 +369,7 @@
|
||||||
// uni.showLoading({
|
// uni.showLoading({
|
||||||
// title: '加载中'
|
// title: '加载中'
|
||||||
// })
|
// })
|
||||||
|
that.ispaid=false
|
||||||
that.loadingmask=true
|
that.loadingmask=true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
|
@ -379,6 +384,7 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
|
that.ispaid=false
|
||||||
// 支付失败逻辑
|
// 支付失败逻辑
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付失败',
|
title: '支付失败',
|
||||||
|
@ -388,6 +394,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
that.ispaid=false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.data,
|
title: res.data,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
@ -395,6 +402,10 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -748,7 +748,7 @@
|
||||||
<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">
|
<view class="masktxt" v-if="orderinfo.sn">
|
||||||
蓝牙连接失败
|
蓝牙连接失败
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -764,9 +764,13 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="btn_box">
|
<view class="btn_box">
|
||||||
|
|
||||||
<view class="btn4" @click="maskloading=false">
|
<view class="btn4" @click="maskloading=false" v-if="orderinfo.sn">
|
||||||
继续用车
|
继续用车
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="btn4" @click="maskloading=false" v-else>
|
||||||
|
返回
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="btn3" @click="Binddevice">
|
<view class="btn3" @click="Binddevice">
|
||||||
重新连接
|
重新连接
|
||||||
|
@ -797,6 +801,30 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="maskpage1" v-if="maskepage==7">
|
||||||
|
<view class="top_info">
|
||||||
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/uvAGhjbhjhSaxCru8dSN" mode=""
|
||||||
|
style="width: 25rpx;"></image>
|
||||||
|
<view class="masktxt">
|
||||||
|
设备电量过低
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="masktips" style="width: 100%;margin-top: 45rpx;">
|
||||||
|
请使用附近其他车辆
|
||||||
|
</view>
|
||||||
|
<view class="tipsimg" style="margin-top: 90rpx;">
|
||||||
|
<image src="https://lxnapi.ccttiot.com/bike/img/static/ugvqmfB3QYujZ6SnfTia" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="btn_box" style="justify-content: center;">
|
||||||
|
|
||||||
|
<view class="btn3" @click="maskloading=false" style="width: 600rpx;">
|
||||||
|
换车解锁
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="fixdivce">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -805,7 +833,8 @@
|
||||||
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;
|
||||||
import QQMapWX from '@/common/qqmap-wx-jssdk.js'
|
import QQMapWX from '@/common/qqmap-wx-jssdk.min.js'
|
||||||
|
var qqmapsdk
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -920,8 +949,15 @@
|
||||||
navBarHeight: 0,
|
navBarHeight: 0,
|
||||||
|
|
||||||
mappolyline: [],
|
mappolyline: [],
|
||||||
qqmapsdk: {},
|
qqmapsdk: null,
|
||||||
index: 0,
|
index: 0,
|
||||||
|
|
||||||
|
lastClickedMarkerId: null, // To store the ID of the last clicked marker
|
||||||
|
defaultMarkerIconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
|
||||||
|
clickedMarkerIconPath: 'https://lxnapi.ccttiot.com/bike/img/static/uf2TwgtQ2sKJrUY3wTz4',
|
||||||
|
ispaid:false,
|
||||||
|
isInParkingArea:null,
|
||||||
|
specificDeviceMarkerId:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -949,7 +985,7 @@
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
this.qqmapsdk = new QQMapWX({
|
qqmapsdk = new QQMapWX({
|
||||||
key: 'E7OBZ-KRKWW-5VKRH-36XXR-TB3NS-MUFHB' // 自己申请的key值
|
key: 'E7OBZ-KRKWW-5VKRH-36XXR-TB3NS-MUFHB' // 自己申请的key值
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -993,40 +1029,7 @@
|
||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.timers = setInterval(() => {
|
this.timestare()
|
||||||
// console.log('定时器运行中...');
|
|
||||||
this.getmarks()
|
|
||||||
// 在这里执行你的逻辑
|
|
||||||
if (this.orderinfo.sn) {
|
|
||||||
|
|
||||||
this.$u.get('/app/device/info?sn=' + this.orderinfo.sn).then((res) => {
|
|
||||||
if (res.code === 200) {
|
|
||||||
this.mac = this.OrderdeviceInfos.mac
|
|
||||||
if (this.OrderdeviceInfos.onlineStatus != res.data.onlineStatus) {
|
|
||||||
this.OrderdeviceInfos = res.data
|
|
||||||
// this.OrderdeviceInfos.onlineStatus ='0'
|
|
||||||
|
|
||||||
// if (this.OrderdeviceInfos.onlineStatus == 0 && this.orderinfo.status !=
|
|
||||||
// 3) {
|
|
||||||
|
|
||||||
// if (this.carstause == false) {
|
|
||||||
|
|
||||||
// this.isnoline = true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// 处理接口返回错误的情况
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
// 处理接口请求失败的情况
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 3000); // 每秒执行一次
|
|
||||||
// 检查蓝牙权限状态
|
// 检查蓝牙权限状态
|
||||||
uni.getBluetoothAdapterState({
|
uni.getBluetoothAdapterState({
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
|
@ -1085,7 +1088,7 @@
|
||||||
that.latitude = lb.latitude;
|
that.latitude = lb.latitude;
|
||||||
that.longitude = lb.longitude;
|
that.longitude = lb.longitude;
|
||||||
|
|
||||||
that.routePlanning(27.10557727,120.25709224)
|
|
||||||
console.log(that.areaInfo, 'that.areaInfo');
|
console.log(that.areaInfo, 'that.areaInfo');
|
||||||
that.getArea()
|
that.getArea()
|
||||||
if (that.qParam != 'null' && that.showagre == false) {
|
if (that.qParam != 'null' && that.showagre == false) {
|
||||||
|
@ -1221,8 +1224,8 @@
|
||||||
routePlanning(end_lat, end_long) {
|
routePlanning(end_lat, end_long) {
|
||||||
console.log('调用了');
|
console.log('调用了');
|
||||||
let that = this
|
let that = this
|
||||||
that.qqmapsdk.direction({
|
qqmapsdk.direction({
|
||||||
mode: 'driving', // 驾车
|
mode: 'walking', // 驾车
|
||||||
from: { // 起始位置(当前位置)坐标
|
from: { // 起始位置(当前位置)坐标
|
||||||
latitude: that.latitude,
|
latitude: that.latitude,
|
||||||
longitude: that.longitude
|
longitude: that.longitude
|
||||||
|
@ -1248,18 +1251,24 @@
|
||||||
longitude: coors[i + 1]
|
longitude: coors[i + 1]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log('点串数组', pl)
|
// console.log('点串数组', pl)
|
||||||
// 设置polyline属性,将路线显示出来,将解压坐标第一个数据作为起点
|
// 设置polyline属性,将路线显示出来,将解压坐标第一个数据作为起点
|
||||||
that.mappolyline = [{
|
that.mappolyline = [{
|
||||||
points: pl,
|
points: pl,
|
||||||
color: '#367EEF', // 线的填充色
|
// color: '#367EEF', // 线的填充色
|
||||||
width: 3, // 折现宽度
|
// width: 3, // 折现宽度
|
||||||
borderWidth: 2, // 边线宽度
|
// borderWidth: 2, // 边线宽度
|
||||||
borderColor: '#5B98FD', // 边线颜色
|
// borderColor: '#5B98FD', // 边线颜色
|
||||||
lineCap: 'square', // 线端头
|
// lineCap: 'square', // 线端头
|
||||||
showArrow: true, // 沿线路方向显示箭头
|
// showArrow: true, // 沿线路方向显示箭头
|
||||||
|
width: 8,
|
||||||
|
arrowLine: true,
|
||||||
|
color: '#00AF99',
|
||||||
|
strokeWidth: 2,
|
||||||
|
strokeColor: '#00AF99',
|
||||||
|
fillColor: '#00AF99'
|
||||||
}]
|
}]
|
||||||
console.log(that.mappolyline,'that.mappolylinethat.mappolyline');
|
// console.log(that.mappolyline, 'that.mappolylinethat.mappolyline');
|
||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
console.log('resresresresresresres', res)
|
console.log('resresresresresresres', res)
|
||||||
|
@ -1267,6 +1276,302 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
onMapTap(event) {
|
||||||
|
this.showdevice = false
|
||||||
|
this.deviceIndex = 0
|
||||||
|
// this.sn = ''
|
||||||
|
this.type = 0
|
||||||
|
this.freeInfo = {}
|
||||||
|
this.freeListIndex = 0
|
||||||
|
this.mappolyline=[]
|
||||||
|
// const {
|
||||||
|
// latitude,
|
||||||
|
// longitude
|
||||||
|
// } = event.detail;
|
||||||
|
// console.log('Map tapped at:', latitude, longitude);
|
||||||
|
// this.close()
|
||||||
|
// 在这里添加你的回调逻辑
|
||||||
|
},
|
||||||
|
onMarkerTap(e) {
|
||||||
|
this.showdevice = false;
|
||||||
|
this.deviceIndex = 0;
|
||||||
|
this.type = 0;
|
||||||
|
this.freeInfo = {};
|
||||||
|
this.freeListIndex = 0;
|
||||||
|
|
||||||
|
if (e.type === 'markertap') {
|
||||||
|
console.log('Clicked marker:', e.markerId);
|
||||||
|
|
||||||
|
const markerExists = this.listData.some(item => item.sn == e.markerId);
|
||||||
|
|
||||||
|
if (markerExists) {
|
||||||
|
this.sn = e.markerId;
|
||||||
|
this.deviceInfo(0);
|
||||||
|
|
||||||
|
// Revert the last clicked marker to the default image
|
||||||
|
if (this.lastClickedMarkerId !== null) {
|
||||||
|
this.markers = this.markers.map(marker => {
|
||||||
|
if (marker.id === this.lastClickedMarkerId) {
|
||||||
|
return {
|
||||||
|
...marker,
|
||||||
|
iconPath: this.defaultMarkerIconPath
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return marker;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the clicked marker's image
|
||||||
|
this.markers = this.markers.map(marker => {
|
||||||
|
if (marker.id === e.markerId) {
|
||||||
|
return {
|
||||||
|
...marker,
|
||||||
|
iconPath: this.clickedMarkerIconPath
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return marker;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Store the ID of the currently clicked marker
|
||||||
|
this.lastClickedMarkerId = e.markerId;
|
||||||
|
|
||||||
|
// Get the latitude and longitude of the clicked marker
|
||||||
|
const clickedMarker = this.markers.find(marker => marker.id === e.markerId);
|
||||||
|
if (clickedMarker) {
|
||||||
|
const {
|
||||||
|
latitude,
|
||||||
|
longitude
|
||||||
|
} = clickedMarker;
|
||||||
|
console.log(`Clicked marker location - Latitude: ${latitude}, Longitude: ${longitude}`);
|
||||||
|
this.routePlanning(latitude, longitude)
|
||||||
|
// Find nearby markers
|
||||||
|
this.getNearbyMarkers(latitude, longitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(this.markers, 'Updated markers');
|
||||||
|
} else {
|
||||||
|
console.log('Marker ID does not exist in the list data');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent event bubbling
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getNearbyMarkers(clickedLat, clickedLon) {
|
||||||
|
const nearbyMarkers = this.listData.filter(item => {
|
||||||
|
if (item.latitude && item.longitude) {
|
||||||
|
const distance = this.haversineDistance(
|
||||||
|
parseFloat(clickedLat),
|
||||||
|
parseFloat(clickedLon),
|
||||||
|
parseFloat(item.latitude),
|
||||||
|
parseFloat(item.longitude)
|
||||||
|
);
|
||||||
|
return distance <= 15;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
console.log('Nearby markers within 15 meters:', nearbyMarkers);
|
||||||
|
},
|
||||||
|
haversineDistance(lat1, lon1, lat2, lon2) {
|
||||||
|
const R = 6371e3; // Earth radius in meters
|
||||||
|
const toRad = angle => angle * Math.PI / 180;
|
||||||
|
const dLat = toRad(lat2 - lat1);
|
||||||
|
const dLon = toRad(lon2 - lon1);
|
||||||
|
const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
||||||
|
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
|
||||||
|
Math.sin(dLon / 2) * Math.sin(dLon / 2);
|
||||||
|
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||||
|
return R * c;
|
||||||
|
},
|
||||||
|
|
||||||
|
getmarks() {
|
||||||
|
let data = {
|
||||||
|
areaId: this.areaInfo.areaId
|
||||||
|
};
|
||||||
|
if (this.areaInfo.areaId) {
|
||||||
|
this.$u.get(`/app/allVehicleByArea`, data).then((res) => {
|
||||||
|
if (res.code === 200 && res.data != '') {
|
||||||
|
this.listData = res.data;
|
||||||
|
const newDeviceMarkers = this.listData.map(item => ({
|
||||||
|
id: parseFloat(item.sn),
|
||||||
|
latitude: parseFloat(item.latitude),
|
||||||
|
longitude: parseFloat(item.longitude),
|
||||||
|
width: 40,
|
||||||
|
height: 28,
|
||||||
|
iconPath: this.defaultMarkerIconPath,
|
||||||
|
isDeviceMarker: true // 区分为设备标记
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 保留停车标记和特定设备标记
|
||||||
|
const preservedMarkers = this.markers.filter(marker => marker.isParkingMarker || marker.id === this.specificDeviceMarkerId);
|
||||||
|
|
||||||
|
// 更新markers数组,避免删除已识别的重要标记
|
||||||
|
let updatedMarkers = [...newDeviceMarkers, ...preservedMarkers];
|
||||||
|
|
||||||
|
// 确保点击的标记保持其图标
|
||||||
|
if (this.lastClickedMarkerId !== null) {
|
||||||
|
updatedMarkers = updatedMarkers.map(marker => {
|
||||||
|
if (marker.id === this.lastClickedMarkerId) {
|
||||||
|
return {
|
||||||
|
...marker,
|
||||||
|
iconPath: this.clickedMarkerIconPath
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return marker;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用this.$set触发Vue的响应式更新
|
||||||
|
this.$set(this, 'markers', updatedMarkers);
|
||||||
|
|
||||||
|
this.oldMarkers = [...this.markers];
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error("Error fetching device data:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
timestare() {
|
||||||
|
this.timers = setInterval(() => {
|
||||||
|
this.getmarks();
|
||||||
|
|
||||||
|
if (this.orderinfo.sn) {
|
||||||
|
this.$u.get('/app/device/info?sn=' + this.orderinfo.sn).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.mac = this.OrderdeviceInfos.mac;
|
||||||
|
if (this.OrderdeviceInfos.onlineStatus != res.data.onlineStatus) {
|
||||||
|
this.OrderdeviceInfos = res.data;
|
||||||
|
}
|
||||||
|
// console.log(parseFloat(res.data.latitude),parseFloat(res.data.longitude),'每次更新的经纬度');
|
||||||
|
// // 添加或更新特定设备标记
|
||||||
|
// this.specificDeviceMarkerId = parseFloat(this.orderinfo.sn);
|
||||||
|
// const specificDeviceMarker = {
|
||||||
|
// id: this.specificDeviceMarkerId,
|
||||||
|
// latitude: parseFloat(res.data.latitude),
|
||||||
|
// longitude: parseFloat(res.data.longitude),
|
||||||
|
// width: 40,
|
||||||
|
// height: 28,
|
||||||
|
// iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u5Im6YipwNSYiiaMTHxH',
|
||||||
|
// // isSpecificDeviceMarker: true // 区分为特定设备标记
|
||||||
|
// };
|
||||||
|
|
||||||
|
// // 保留现有标记
|
||||||
|
// const preservedMarkers = this.markers.filter(marker => marker.id !== this.specificDeviceMarkerId);
|
||||||
|
|
||||||
|
// // 更新markers数组
|
||||||
|
// const updatedMarkers = [...preservedMarkers, specificDeviceMarker];
|
||||||
|
// this.$set(this, 'markers', updatedMarkers);
|
||||||
|
} else {
|
||||||
|
// 处理接口返回错误的情况
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error("Error fetching specific device data:", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 3000); // 每3秒执行一次
|
||||||
|
},
|
||||||
|
toggleIconAndCallout() {
|
||||||
|
this.showIconAndCallout = !this.showIconAndCallout;
|
||||||
|
this.markers = this.markers.map(marker => {
|
||||||
|
if (this.showIconAndCallout) {
|
||||||
|
// Show callout
|
||||||
|
if (marker.isParkingMarker) {
|
||||||
|
marker.callout.display = 'ALWAYS';
|
||||||
|
marker.isCalloutVisible = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Hide callout
|
||||||
|
if (marker.isParkingMarker) {
|
||||||
|
marker.callout.display = 'BYCLICK';
|
||||||
|
marker.isCalloutVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return marker;
|
||||||
|
});
|
||||||
|
// Force update markers array
|
||||||
|
this.$set(this, 'markers', [...this.markers]);
|
||||||
|
},
|
||||||
|
|
||||||
|
getParking() {
|
||||||
|
// Send request to get data
|
||||||
|
let data = {
|
||||||
|
areaId: this.areaInfo.areaId
|
||||||
|
};
|
||||||
|
this.$u.get('/app/parking/list?', data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
// Process returned data
|
||||||
|
const type1Data = [];
|
||||||
|
const type2Data = [];
|
||||||
|
const type3Data = [];
|
||||||
|
|
||||||
|
res.rows.forEach(row => {
|
||||||
|
if (row.type == 1) {
|
||||||
|
type1Data.push(row);
|
||||||
|
} else if (row.type == 2) {
|
||||||
|
type2Data.push(row);
|
||||||
|
} else if (row.type == 3) {
|
||||||
|
type3Data.push(row);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const validBoundaries = type1Data.map(row => row.boundaryStr).filter(
|
||||||
|
boundary => typeof boundary === 'string' && boundary.trim() !== '');
|
||||||
|
const polylines = this.convertBoundaryToPolylines(validBoundaries, 1);
|
||||||
|
|
||||||
|
const validBoundaries1 = type2Data.map(row => row.boundaryStr).filter(
|
||||||
|
boundary => typeof boundary === 'string' && boundary.trim() !== '');
|
||||||
|
const polylines1 = this.convertBoundaryToPolylines(validBoundaries1, 2);
|
||||||
|
|
||||||
|
const validBoundaries2 = type3Data.map(row => row.boundaryStr).filter(
|
||||||
|
boundary => typeof boundary === 'string' && boundary.trim() !== '');
|
||||||
|
const polylines2 = this.convertBoundaryToPolylines(validBoundaries2, 3);
|
||||||
|
|
||||||
|
// Add processed data to this.polyline
|
||||||
|
this.polyline = this.polyline.concat(polylines2);
|
||||||
|
this.polyline = this.polyline.concat(polylines1);
|
||||||
|
this.polyline = this.polyline.concat(polylines);
|
||||||
|
this.parkingList = res.rows;
|
||||||
|
|
||||||
|
// Set parking markers and distinguish them
|
||||||
|
const newParkingMarkers = res.rows.map(item => ({
|
||||||
|
id: parseFloat(item.parkingId),
|
||||||
|
latitude: parseFloat(item.latitude),
|
||||||
|
longitude: parseFloat(item.longitude),
|
||||||
|
width: 20,
|
||||||
|
height: 29,
|
||||||
|
iconPath: item.type == 1 ?
|
||||||
|
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' :
|
||||||
|
item.type == 2 ?
|
||||||
|
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' :
|
||||||
|
'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq',
|
||||||
|
callout: {
|
||||||
|
content: item.parkingName,
|
||||||
|
color: '#ffffff',
|
||||||
|
fontSize: 14,
|
||||||
|
borderRadius: 10,
|
||||||
|
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ?
|
||||||
|
'#FFC107' : '#FF473E',
|
||||||
|
padding: 6,
|
||||||
|
display: 'BYCLICK' // Initially do not show callout
|
||||||
|
},
|
||||||
|
isCalloutVisible: false, // Initially do not show callout
|
||||||
|
isParkingMarker: true // Distinguish as parking marker
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Preserve device markers and specific device marker
|
||||||
|
const preservedMarkers = this.markers.filter(marker => marker.isDeviceMarker || marker.id === this.specificDeviceMarkerId);
|
||||||
|
|
||||||
|
// Merge parking markers and device markers
|
||||||
|
this.markers = [...newParkingMarkers, ...preservedMarkers];
|
||||||
|
this.$set(this, 'markers', [...this.markers]);
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error("Error fetching parking data:", error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
totxtpage() {
|
totxtpage() {
|
||||||
this.seeDetail = true
|
this.seeDetail = true
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -1313,6 +1618,9 @@
|
||||||
// this.showYjTip = true;
|
// this.showYjTip = true;
|
||||||
} else if (res.msg == '【扫码/编号开锁骑行】发送开锁命令失败') {
|
} else if (res.msg == '【扫码/编号开锁骑行】发送开锁命令失败') {
|
||||||
this.maskepage = 3
|
this.maskepage = 3
|
||||||
|
} else if (res.msg == '低电量不得骑行') {
|
||||||
|
this.maskepage = 7
|
||||||
|
// this.offopencar()
|
||||||
} else {
|
} else {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: res.msg,
|
// title: res.msg,
|
||||||
|
@ -1322,7 +1630,11 @@
|
||||||
this.toploadtxt = '开锁失败';
|
this.toploadtxt = '开锁失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.maskloading = false;
|
this.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 800);
|
}, 800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1516,7 +1828,8 @@
|
||||||
let data = {
|
let data = {
|
||||||
latitude: lb.latitude,
|
latitude: lb.latitude,
|
||||||
longitude: lb.longitude,
|
longitude: lb.longitude,
|
||||||
areaId: that.areaInfo.areaId
|
areaId: that.areaInfo.areaId,
|
||||||
|
sn:that.OrderdeviceInfos.sn
|
||||||
}
|
}
|
||||||
that.backgps.latitude = lb.latitude
|
that.backgps.latitude = lb.latitude
|
||||||
that.backgps.longitude = lb.longitude
|
that.backgps.longitude = lb.longitude
|
||||||
|
@ -1528,6 +1841,7 @@
|
||||||
let parkingReturn = res.data
|
let parkingReturn = res.data
|
||||||
.parkingReturn /** 强制停车点还车 true:开启,false:关闭*/
|
.parkingReturn /** 强制停车点还车 true:开启,false:关闭*/
|
||||||
let isInParkingArea = res.data.isInParkingArea /** 是否在停车区内*/
|
let isInParkingArea = res.data.isInParkingArea /** 是否在停车区内*/
|
||||||
|
that.isInParkingArea=res.data.isInParkingArea
|
||||||
if (parkingReturn) {
|
if (parkingReturn) {
|
||||||
// 不可以在停车点外还车
|
// 不可以在停车点外还车
|
||||||
if (isInParkingArea) {
|
if (isInParkingArea) {
|
||||||
|
@ -1544,7 +1858,7 @@
|
||||||
'/appVerify/device/return?returnType=1&orderNo=' +
|
'/appVerify/device/return?returnType=1&orderNo=' +
|
||||||
that.orderinfo.orderNo + '&isBluetooth=true' +
|
that.orderinfo.orderNo + '&isBluetooth=true' +
|
||||||
'&lon=' + that.backgps.longitude + '&lat=' +
|
'&lon=' + that.backgps.longitude + '&lat=' +
|
||||||
that.backgps.latitude).then((
|
that.backgps.latitude+'&isInParkingArea='+that.isInParkingArea).then((
|
||||||
res) => {
|
res) => {
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
@ -1564,6 +1878,11 @@
|
||||||
that.toploadtxt = '还车失败';
|
that.toploadtxt = '还车失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.maskloading = false;
|
that.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1593,7 +1912,7 @@
|
||||||
that.orderinfo
|
that.orderinfo
|
||||||
.orderNo + '&isBluetooth=true' + '&lon=' + that
|
.orderNo + '&isBluetooth=true' + '&lon=' + that
|
||||||
.backgps.longitude + '&lat=' + that.backgps
|
.backgps.longitude + '&lat=' + that.backgps
|
||||||
.latitude).then((
|
.latitude+'&isInParkingArea='+that.isInParkingArea).then((
|
||||||
res) => {
|
res) => {
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
@ -1614,6 +1933,11 @@
|
||||||
that.toploadtxt = '还车失败';
|
that.toploadtxt = '还车失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.maskloading = false;
|
that.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1671,6 +1995,11 @@
|
||||||
that.toploadtxt = '校验失败';
|
that.toploadtxt = '校验失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.maskloading = false;
|
that.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: res.msg,
|
// title: res.msg,
|
||||||
|
@ -1730,7 +2059,7 @@
|
||||||
this.$u.post('/appVerify/device/return?returnType=1&orderNo=' + this.orderinfo
|
this.$u.post('/appVerify/device/return?returnType=1&orderNo=' + this.orderinfo
|
||||||
.orderNo + '&isBluetooth=true' + '&lon=' + this.backgps.longitude +
|
.orderNo + '&isBluetooth=true' + '&lon=' + this.backgps.longitude +
|
||||||
'&lat=' + this.backgps
|
'&lat=' + this.backgps
|
||||||
.latitude).then((
|
.latitude+'&isInParkingArea='+this.isInParkingArea).then((
|
||||||
res) => {
|
res) => {
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
@ -1753,6 +2082,11 @@
|
||||||
this.buletxt = '还车失败!';
|
this.buletxt = '还车失败!';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.maskloading = false;
|
this.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
this.getisInOrder();
|
this.getisInOrder();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
|
@ -1776,7 +2110,7 @@
|
||||||
},
|
},
|
||||||
backDevice() {
|
backDevice() {
|
||||||
|
|
||||||
this.$u.post('/appVerify/device/return?returnType=1&orderNo=' + this.orderinfo.orderNo).then((
|
this.$u.post('/appVerify/device/return?returnType=1&orderNo=' + this.orderinfo.orderNo+'&isInParkingArea='+this.isInParkingArea).then((
|
||||||
res) => {
|
res) => {
|
||||||
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
@ -1793,6 +2127,11 @@
|
||||||
this.toploadtxt = '还车失败';
|
this.toploadtxt = '还车失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.maskloading = false;
|
this.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1976,6 +2315,8 @@
|
||||||
this.$u.post('/appVerify/device/snSwitch', data).then((res) => {
|
this.$u.post('/appVerify/device/snSwitch', data).then((res) => {
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
this.seeDetail = false;
|
this.seeDetail = false;
|
||||||
|
// res.code=500
|
||||||
|
// res.msg='低电量不得骑行'
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.loadimg = 'https://lxnapi.ccttiot.com/bike/img/static/upNvRa9ZQMyiwxLliF5z';
|
this.loadimg = 'https://lxnapi.ccttiot.com/bike/img/static/upNvRa9ZQMyiwxLliF5z';
|
||||||
this.toploadtxt = '开锁成功';
|
this.toploadtxt = '开锁成功';
|
||||||
|
@ -1990,18 +2331,21 @@
|
||||||
this.maskepage = 6
|
this.maskepage = 6
|
||||||
// this.showYjTip = true;
|
// this.showYjTip = true;
|
||||||
} else if (res.msg == '【扫码/编号开锁骑行】发送开锁命令失败') {
|
} else if (res.msg == '【扫码/编号开锁骑行】发送开锁命令失败') {
|
||||||
// this.maskepage=3
|
// this.maskepage=3 低电量不得骑行
|
||||||
this.offopencar()
|
this.offopencar()
|
||||||
|
} else if (res.msg == '低电量不得骑行') {
|
||||||
|
this.maskepage = 7
|
||||||
|
// this.offopencar()
|
||||||
} else {
|
} else {
|
||||||
// uni.showToast({
|
|
||||||
// title: res.msg,
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000
|
|
||||||
// });
|
|
||||||
this.toploadtxt = '开锁失败';
|
this.toploadtxt = '开锁失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.maskloading = false;
|
this.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 800);
|
}, 800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2389,6 +2733,11 @@
|
||||||
that.buletxt = '开锁失败';
|
that.buletxt = '开锁失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.maskloading = false;
|
that.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
// if (res.msg == '10500-----') {
|
// if (res.msg == '10500-----') {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
|
@ -2454,6 +2803,11 @@
|
||||||
this.toploadtxt = '锁车失败';
|
this.toploadtxt = '锁车失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.maskloading = false;
|
this.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
// if (res.msg == '10500-----') {
|
// if (res.msg == '10500-----') {
|
||||||
|
@ -2512,6 +2866,11 @@
|
||||||
that.buletxt = '锁车失败';
|
that.buletxt = '锁车失败';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.maskloading = false;
|
that.maskloading = false;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
|
|
||||||
|
@ -3090,21 +3449,7 @@
|
||||||
url: '/page_user/agreement'
|
url: '/page_user/agreement'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onMapTap(event) {
|
|
||||||
this.showdevice = false
|
|
||||||
this.deviceIndex = 0
|
|
||||||
// this.sn = ''
|
|
||||||
this.type = 0
|
|
||||||
this.freeInfo = {}
|
|
||||||
this.freeListIndex = 0
|
|
||||||
// const {
|
|
||||||
// latitude,
|
|
||||||
// longitude
|
|
||||||
// } = event.detail;
|
|
||||||
// console.log('Map tapped at:', latitude, longitude);
|
|
||||||
// this.close()
|
|
||||||
// 在这里添加你的回调逻辑
|
|
||||||
},
|
|
||||||
// lockDevice() {
|
// lockDevice() {
|
||||||
// if (this.orderinfo.status) {
|
// if (this.orderinfo.status) {
|
||||||
// this.showtcs = true
|
// this.showtcs = true
|
||||||
|
@ -3399,6 +3744,8 @@
|
||||||
},
|
},
|
||||||
// 骑行结束支付
|
// 骑行结束支付
|
||||||
topay1() {
|
topay1() {
|
||||||
|
if(this.ispaid==false){
|
||||||
|
this.ispaid=true
|
||||||
let data = {
|
let data = {
|
||||||
userId: this.userId,
|
userId: this.userId,
|
||||||
sn: this.orderinfo.sn,
|
sn: this.orderinfo.sn,
|
||||||
|
@ -3427,12 +3774,18 @@
|
||||||
signType: res.data.signType,
|
signType: res.data.signType,
|
||||||
paySign: res.data.paySign,
|
paySign: res.data.paySign,
|
||||||
success(res) {
|
success(res) {
|
||||||
|
that.ispaid=false
|
||||||
console.log('支付成功');
|
console.log('支付成功');
|
||||||
// 支付成功逻辑
|
// 支付成功逻辑
|
||||||
|
clearInterval(that.timer)
|
||||||
|
that.orderinfo = {}
|
||||||
|
that.showdevice = false
|
||||||
|
that.deviceIndex = 0
|
||||||
that.getisInOrder()
|
that.getisInOrder()
|
||||||
|
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
|
that.ispaid=false
|
||||||
// 支付失败逻辑
|
// 支付失败逻辑
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付失败',
|
title: '支付失败',
|
||||||
|
@ -3442,6 +3795,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
that.ispaid=false
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
@ -3449,6 +3803,9 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -3860,95 +4217,21 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
findBike() {
|
findBike() {
|
||||||
uni.showToast({
|
uni.showLoading({
|
||||||
title: '响铃请求发送成功',
|
|
||||||
icon: 'none',
|
})
|
||||||
duration: 2000
|
// uni.showToast({
|
||||||
});
|
// title: '响铃请求发送成功',
|
||||||
|
// icon: 'none',
|
||||||
|
// duration: 2000
|
||||||
|
// });
|
||||||
this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => {
|
this.$u.post('/app/device/ring?sn=' + this.sn).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onMarkerTap(e) {
|
|
||||||
this.showdevice = false
|
|
||||||
this.deviceIndex = 0
|
|
||||||
// this.sn = ''
|
|
||||||
this.type = 0
|
|
||||||
this.freeInfo = {}
|
|
||||||
this.freeListIndex = 0
|
|
||||||
if (e.type === 'markertap') {
|
|
||||||
console.log('点击了标记:', e.markerId);
|
|
||||||
// 这里可以根据需要处理点击标记的逻辑
|
|
||||||
// 阻止事件冒泡\
|
|
||||||
|
|
||||||
const markerExists = this.listData.some(item => item.sn == e.markerId);
|
|
||||||
|
|
||||||
if (markerExists) {
|
|
||||||
// 处理点击标记的逻辑
|
|
||||||
this.sn = e.markerId;
|
|
||||||
this.deviceInfo(0);
|
|
||||||
// this.markers = this.markers.map(item => {
|
|
||||||
// if (item.sn === e.markerId) { // 假设markers数组中的mark对象也有sn属性
|
|
||||||
// // 你可以根据需要设置更大的尺寸
|
|
||||||
// return {
|
|
||||||
// ...item,
|
|
||||||
// width: item.width * 2, // 假设初始宽度是25,这里放大到50
|
|
||||||
// height: item.height * 2 // 假设初始高度是25,这里放大到50
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// return item;
|
|
||||||
// });
|
|
||||||
console.log(this.markers, 'this.markersthis.markers');
|
|
||||||
} else {
|
|
||||||
console.log('标记ID不存在于列表数据中');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 阻止事件冒泡
|
|
||||||
e.stopPropagation();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getmarks() {
|
|
||||||
let data = {
|
|
||||||
areaId: this.areaInfo.areaId
|
|
||||||
};
|
|
||||||
if (this.areaInfo.areaId) {
|
|
||||||
this.$u.get(`/app/allVehicleByArea`, data).then((res) => {
|
|
||||||
if (res.code === 200 && res.data != '') {
|
|
||||||
this.listData = res.data
|
|
||||||
// this.listData[0].onlineStatus=0
|
|
||||||
// this.listData = res.data.filter(item => item.onlineStatus != 0);
|
|
||||||
const newDeviceMarkers = this.listData.map(item => ({
|
|
||||||
id: parseFloat(item.sn),
|
|
||||||
latitude: parseFloat(item.latitude),
|
|
||||||
longitude: parseFloat(item.longitude),
|
|
||||||
width: 40,
|
|
||||||
height: 28, // 确保这里是数字类型
|
|
||||||
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
|
|
||||||
isDeviceMarker: true // 区分为设备标记
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 保留停车场标记
|
|
||||||
const preservedMarkers = this.markers.filter(marker => marker.isParkingMarker);
|
|
||||||
|
|
||||||
// 更新markers数组,避免删除已标识的重要标记
|
|
||||||
this.markers = [...newDeviceMarkers, ...preservedMarkers];
|
|
||||||
this.$set(this, 'markers', [...this.markers]);
|
|
||||||
|
|
||||||
this.oldMarkers = [...this.markers];
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("Error fetching device data:", error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isMarkersChanged(newMarkers) {
|
isMarkersChanged(newMarkers) {
|
||||||
if (this.oldMarkers.length !== newMarkers.length) {
|
if (this.oldMarkers.length !== newMarkers.length) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -4121,106 +4404,7 @@
|
||||||
console.error("Error fetching area data:", error);
|
console.error("Error fetching area data:", error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
toggleIconAndCallout() {
|
|
||||||
this.showIconAndCallout = !this.showIconAndCallout;
|
|
||||||
this.markers = this.markers.map(marker => {
|
|
||||||
if (this.showIconAndCallout) {
|
|
||||||
// 显示气泡
|
|
||||||
if (marker.isParkingMarker) {
|
|
||||||
marker.callout.display = 'ALWAYS';
|
|
||||||
marker.isCalloutVisible = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 隐藏气泡
|
|
||||||
if (marker.isParkingMarker) {
|
|
||||||
marker.callout.display = 'BYCLICK';
|
|
||||||
marker.isCalloutVisible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return marker;
|
|
||||||
});
|
|
||||||
// 强制更新markers数组
|
|
||||||
this.$set(this, 'markers', [...this.markers]);
|
|
||||||
},
|
|
||||||
getParking() {
|
|
||||||
// 发送请求获取数据
|
|
||||||
let data = {
|
|
||||||
areaId: this.areaInfo.areaId
|
|
||||||
}
|
|
||||||
this.$u.get('/app/parking/list?', data).then((res) => {
|
|
||||||
if (res.code === 200) {
|
|
||||||
// 处理接口返回的数据
|
|
||||||
const type1Data = [];
|
|
||||||
const type2Data = [];
|
|
||||||
const type3Data = [];
|
|
||||||
|
|
||||||
res.rows.forEach(row => {
|
|
||||||
if (row.type == 1) {
|
|
||||||
type1Data.push(row);
|
|
||||||
} else if (row.type == 2) {
|
|
||||||
type2Data.push(row);
|
|
||||||
} else if (row.type == 3) {
|
|
||||||
type3Data.push(row);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const validBoundaries = type1Data.map(row => row.boundaryStr).filter(
|
|
||||||
boundary =>
|
|
||||||
typeof boundary === 'string' && boundary.trim() !== '');
|
|
||||||
const polylines = this.convertBoundaryToPolylines(validBoundaries, 1);
|
|
||||||
|
|
||||||
const validBoundaries1 = type2Data.map(row => row.boundaryStr).filter(
|
|
||||||
boundary =>
|
|
||||||
typeof boundary === 'string' && boundary.trim() !== '');
|
|
||||||
const polylines1 = this.convertBoundaryToPolylines(validBoundaries1, 2);
|
|
||||||
|
|
||||||
const validBoundaries2 = type3Data.map(row => row.boundaryStr).filter(
|
|
||||||
boundary =>
|
|
||||||
typeof boundary === 'string' && boundary.trim() !== '');
|
|
||||||
const polylines2 = this.convertBoundaryToPolylines(validBoundaries2, 3);
|
|
||||||
// 将处理后的数据添加到 this.polyline 中
|
|
||||||
this.polyline = this.polyline.concat(polylines2);
|
|
||||||
this.polyline = this.polyline.concat(polylines1);
|
|
||||||
this.polyline = this.polyline.concat(polylines);
|
|
||||||
this.parkingList = res.rows;
|
|
||||||
|
|
||||||
// 设置停车场标记并区分
|
|
||||||
const newParkingMarkers = res.rows.map(item => ({
|
|
||||||
id: parseFloat(item.parkingId),
|
|
||||||
latitude: parseFloat(item.latitude),
|
|
||||||
longitude: parseFloat(item.longitude),
|
|
||||||
width: 20,
|
|
||||||
height: 29,
|
|
||||||
iconPath: item.type == 1 ?
|
|
||||||
'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3' :
|
|
||||||
item
|
|
||||||
.type == 2 ?
|
|
||||||
'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' :
|
|
||||||
'https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq',
|
|
||||||
callout: {
|
|
||||||
content: item.parkingName,
|
|
||||||
color: '#ffffff',
|
|
||||||
fontSize: 14,
|
|
||||||
borderRadius: 10,
|
|
||||||
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ?
|
|
||||||
'#FFC107' : '#FF473E',
|
|
||||||
padding: 6,
|
|
||||||
display: 'BYCLICK' // 初始时不显示气泡
|
|
||||||
},
|
|
||||||
isCalloutVisible: false, // 初始时不显示气泡
|
|
||||||
isParkingMarker: true // 区分为停车场标记
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 保留设备标记
|
|
||||||
const preservedMarkers = this.markers.filter(marker => marker.isDeviceMarker);
|
|
||||||
|
|
||||||
// 合并停车场标记和设备标记
|
|
||||||
this.markers = [...newParkingMarkers, ...preservedMarkers];
|
|
||||||
this.$set(this, 'markers', [...this.markers]);
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("Error fetching parking data:", error);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
convertBoundaryToPolyline(boundary) {
|
convertBoundaryToPolyline(boundary) {
|
||||||
if (!boundary) return null;
|
if (!boundary) return null;
|
||||||
|
|
||||||
|
@ -4590,7 +4774,7 @@
|
||||||
duration: 4000
|
duration: 4000
|
||||||
});
|
});
|
||||||
} else if (this.deviceInfos.status == 1) {
|
} else if (this.deviceInfos.status == 1) {
|
||||||
this.routePlanning(res.data.latitude,res.data.longitude)
|
// this.routePlanning(res.data.latitude, res.data.longitude)
|
||||||
this.showdevice = true
|
this.showdevice = true
|
||||||
this.type = 1;
|
this.type = 1;
|
||||||
this.deviceIndex = 1;
|
this.deviceIndex = 1;
|
||||||
|
@ -4633,7 +4817,8 @@
|
||||||
this.deviceInfos = res.data;
|
this.deviceInfos = res.data;
|
||||||
|
|
||||||
if (num == 0) {
|
if (num == 0) {
|
||||||
this.routePlanning(res.data.latitude,res.data.longitude)
|
// this.routePlanning(res.data.latitude,
|
||||||
|
// res.data.longitude)
|
||||||
this.showdevice = true;
|
this.showdevice = true;
|
||||||
this.type = 0;
|
this.type = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -4705,7 +4890,9 @@
|
||||||
} else if (this.deviceInfos
|
} else if (this.deviceInfos
|
||||||
.status ==
|
.status ==
|
||||||
1) {
|
1) {
|
||||||
this.routePlanning(res.data.latitude,res.data.longitude)
|
// this.routePlanning(res.data
|
||||||
|
// .latitude, res.data
|
||||||
|
// .longitude)
|
||||||
this.showdevice = true;
|
this.showdevice = true;
|
||||||
this.type = 1;
|
this.type = 1;
|
||||||
this.deviceIndex = 1;
|
this.deviceIndex = 1;
|
||||||
|
@ -4792,7 +4979,9 @@
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
|
// .fixdivce{
|
||||||
|
|
||||||
|
// }
|
||||||
.maskload {
|
.maskload {
|
||||||
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -5084,7 +5273,7 @@
|
||||||
width: 370rpx;
|
width: 370rpx;
|
||||||
height: 73rpx;
|
height: 73rpx;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 600rpx;
|
bottom: 35.5vh;
|
||||||
left: 38rpx;
|
left: 38rpx;
|
||||||
|
|
||||||
.tipss {
|
.tipss {
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
infonum: {},
|
infonum: {},
|
||||||
rangeMin: 0,
|
rangeMin: 0,
|
||||||
rangMax: 100,
|
rangMax: 100,
|
||||||
rangeValue: [1, 100],
|
rangeValue: [0, 100],
|
||||||
status0: [], //未上架
|
status0: [], //未上架
|
||||||
status1: [], //正常
|
status1: [], //正常
|
||||||
status2: [], //预约中
|
status2: [], //预约中
|
||||||
|
|
|
@ -37,24 +37,36 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="info_li">
|
<view class="info_li">
|
||||||
总营收
|
订单总费用:
|
||||||
|
<span style="color: #4C97E7;" >¥{{displayAmount(info.income.totalFee) }}</span>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="info_li">
|
||||||
|
手续费:
|
||||||
|
<span style="color: #4C97E7;" >¥{{displayAmount(info.income.handlingFee)}}</span>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="info">
|
||||||
|
<view class="info_li">
|
||||||
|
总营收:
|
||||||
<span style="color: #4C97E7;" v-if="info.income.totalIncome">¥{{info.income.totalIncome}}</span>
|
<span style="color: #4C97E7;" v-if="info.income.totalIncome">¥{{info.income.totalIncome}}</span>
|
||||||
<span style="color: #4C97E7;" v-else>¥--</span>
|
<span style="color: #4C97E7;" v-else>¥--</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="info_li">
|
<view class="info_li">
|
||||||
累计待支付
|
累计待支付:
|
||||||
<span style="color: #4C97E7;" v-if="info.income.totalUnpaid">¥{{info.income.totalUnpaid}}</span>
|
<span style="color: #4C97E7;" v-if="info.income.totalUnpaid">¥{{info.income.totalUnpaid}}</span>
|
||||||
<span style="color: #4C97E7;" v-else>¥--</span>
|
<span style="color: #4C97E7;" v-else>¥--</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="info_li">
|
<view class="info_li">
|
||||||
已支付
|
已支付:
|
||||||
<span style="color: #3D3D3D;" v-if="info.income.totalPaid">¥{{info.income.totalPaid}}</span>
|
<span style="color: #3D3D3D;" v-if="info.income.totalPaid">¥{{info.income.totalPaid}}</span>
|
||||||
<span style="color: #3D3D3D;" v-else>¥--</span>
|
<span style="color: #3D3D3D;" v-else>¥--</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="info_li">
|
<view class="info_li">
|
||||||
已退款
|
已退款:
|
||||||
<span style="color: #3D3D3D;" v-if="info.income.totalRefund">¥{{info.income.totalRefund}}</span>
|
<span style="color: #3D3D3D;" v-if="info.income.totalRefund">¥{{info.income.totalRefund}}</span>
|
||||||
<span style="color: #3D3D3D;" v-else>¥--</span>
|
<span style="color: #3D3D3D;" v-else>¥--</span>
|
||||||
</view>
|
</view>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user