This commit is contained in:
Sliverber 2024-06-25 18:02:39 +08:00
parent 99fa5950b8
commit c810ff144b
11 changed files with 930 additions and 657 deletions

View File

@ -6,6 +6,10 @@
height='45'></u-navbar> height='45'></u-navbar>
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude" <map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
:show-location="true" :markers="markers" :polygons="polyline" @markertap="onMarkerTap"> :show-location="true" :markers="markers" :polygons="polyline" @markertap="onMarkerTap">
<cover-view class="park" @click="toggleIconAndCallout">
<cover-image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/uRiYQZQEb3l2LsltEsyW"
mode=""></cover-image>
</cover-view>
</map> </map>
<view class="bot"> <view class="bot">
<view class="btn" @click="topage()"> <view class="btn" @click="topage()">
@ -81,6 +85,44 @@
}, },
}, },
methods: { methods: {
toggleIconAndCallout() {
this.showIconAndCallout = !this.showIconAndCallout;
if (this.showIconAndCallout) {
const newMarkers = [];
this.parkingList.forEach(item => {
newMarkers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 28.95,
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: 'ALWAYS'
},
isCalloutVisible: true //
});
});
this.$set(this, 'markers', [...this.markers, ...newMarkers]);
} else {
//
this.$set(this, 'markers', this.markers.filter(marker => !marker.isCalloutVisible));
}
},
onMarkerTap(e) { onMarkerTap(e) {
console.log('点击了标记:', e); console.log('点击了标记:', e);
this.sn = e.detail.markerId; this.sn = e.detail.markerId;
@ -92,7 +134,10 @@
}); });
}, },
getmarks() { getmarks() {
this.$u.get(`/appVerify/adminOrder/list?adminId=` + this.userId).then((res) => { let data ={
areaId:this.areaId
}
this.$u.get(`/appVerify/adminOrder/list?adminId=` ,data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log('调用了'); console.log('调用了');
this.listData = res.rows; this.listData = res.rows;
@ -259,8 +304,11 @@
}, },
getParking() { getParking() {
// // \
this.$u.get('/app/parking/list').then((res) => { let data ={
areaId:this.areaId
}
this.$u.get('/app/parking/list?',data).then((res) => {
if (res.code === 200) { if (res.code === 200) {
// //
const type1Data = []; const type1Data = [];
@ -294,66 +342,7 @@
this.polyline = this.polyline.concat(polylines); this.polyline = this.polyline.concat(polylines);
// console.log(this.polyline); // console.log(this.polyline);
res.rows.forEach(item => { this.parkingList = res.rows
if(item.type==1){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#3A7EDB', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==2){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FFC107', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==3){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FF473E', //
padding: 6, //
display: 'ALWAYS' //
}
});
}
})
setTimeout(()=>{
},200)
} }
}).catch(error => { }).catch(error => {
@ -387,8 +376,28 @@
width: 750rpx; width: 750rpx;
.map { .map {
position: relative;
width: 750rpx; width: 750rpx;
height: 1250rpx; height: 1250rpx;
.park {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
right: 30rpx;
bottom: 200rpx;
// background-color: #fff;
border-radius: 50%;
width: 82rpx;
height: 82rpx;
z-index: 10;
.img {
width: 82rpx;
height: 82rpx;
}
}
} }
.bot { .bot {

View File

@ -63,9 +63,12 @@
<view class="cont_info_left"> <view class="cont_info_left">
故障部位 故障部位
</view> </view>
<view class="cont_info_right"> <view class="cont_info_right" v-if="item.faultTypeStr">
{{item.faultTypeStr}} {{item.faultTypeStr}}
</view> </view>
<view class="cont_info_right" v-else>
--
</view>
</view> </view>
<view class="card_bot"> <view class="card_bot">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uklW7KIegcLR6E7DTOGO" mode=""></image>
@ -134,16 +137,19 @@
<view class="stause" v-if="item.status==4"> <view class="stause" v-if="item.status==4">
已完成 已完成
</view> </view>
<view class="stause" v-if="item.status==2&&item.type==2"> <view class="stause" v-if="item.status==4" style="background-color: #3BBBA1 ;">
已完成
</view>
<view class="stause" v-if="item.status==2&&item.type==2" style="background-color: #F76D6D ;">
待换电 待换电
</view> </view>
<view class="stause" v-if="item.status==2&&item.type==1"> <view class="stause" v-if="item.status==2&&item.type==1" style="background-color: #F76D6D ;">
待维修 待维修
</view> </view>
<view class="stause" v-if="item.status==3&&item.type==2"> <view class="stause" v-if="item.status==3&&item.type==2" style="background-color: #4C97E7 ;">
换电中 换电中
</view> </view>
<view class="stause" v-if="item.status==3&&item.type==1"> <view class="stause" v-if="item.status==3&&item.type==1" style="background-color: #4C97E7 ;">
维修中 维修中
</view> </view>
</view> </view>

View File

@ -21,7 +21,7 @@
时长{{ item.duration }} 时长{{ item.duration }}
</view> </view>
<view class="info" v-if="item.distance"> <view class="info" v-if="item.distance">
距离{{item.distance}}公里 距离{{ (item.distance / 1000).toFixed(2) }} 公里
</view> </view>
<view class="info" v-else> <view class="info" v-else>
距离--公里 距离--公里

View File

@ -163,7 +163,7 @@
}, },
getword(id) { getword(id) {
this.$u.get("/app/article/list??classifyId="+id ).then((res) => { this.$u.get("/app/article/list?classifyId="+id ).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.wordlist = res.rows this.wordlist = res.rows

View File

@ -4,7 +4,9 @@
height='45'></u-navbar> height='45'></u-navbar>
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude" <map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
:show-location='true' :markers="markers" :polygons="polygons" :polyline="polyline"> </map> :show-location='true' :markers="markers" :polygons="polygons" :polyline="polyline"> </map>
<view class="park" @click="toggleIconAndCallout">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uRiYQZQEb3l2LsltEsyW" mode=""></image>
</view>
<!-- <map class="map" id="map" ref="map" <!-- <map class="map" id="map" ref="map"
\> </map> --> \> </map> -->
<view class="bot_btn" v-if="false"> <view class="bot_btn" v-if="false">
@ -54,7 +56,8 @@
骑行距离 骑行距离
</view> </view>
<view class="right" style="font-size:26rpx ;" v-if="orderInfo.distance"> <view class="right" style="font-size:26rpx ;" v-if="orderInfo.distance">
{{orderInfo.distance}}公里 <!-- {{orderInfo.distance}}公里 -->
{{ (orderInfo.distance / 1000).toFixed(2) }} 公里
</view> </view>
<view class="right" style="font-size:26rpx ;" v-else> <view class="right" style="font-size:26rpx ;" v-else>
--公里 --公里
@ -100,6 +103,7 @@
orderId: '', orderId: '',
orderInfo: {}, orderInfo: {},
loading: false, loading: false,
showIconAndCallout:false
} }
}, },
@ -257,7 +261,10 @@
}, },
getParking() { getParking() {
// //
this.$u.get('/app/parking/list').then((res) => { let data={
areaId:this.orderInfo.areaId
}
this.$u.get('/app/parking/list?',data).then((res) => {
if (res.code === 200) { if (res.code === 200) {
// //
const type1Data = []; const type1Data = [];
@ -291,70 +298,48 @@
this.polygons = this.polygons.concat(polylines); this.polygons = this.polygons.concat(polylines);
// console.log(this.polyline); // console.log(this.polyline);
res.rows.forEach(item => {
if(item.type==1){ this.parkingList = res.rows
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#3A7EDB', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==2){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FFC107', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==3){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FF473E', //
padding: 6, //
display: 'ALWAYS' //
}
});
}
})
} }
}).catch(error => { }).catch(error => {
console.error("Error fetching parking data:", error); console.error("Error fetching parking data:", error);
}); });
}, },
toggleIconAndCallout() {
this.showIconAndCallout = !this.showIconAndCallout;
if (this.showIconAndCallout) {
const newMarkers = [];
this.parkingList.forEach(item => {
newMarkers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 28.95,
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: 'ALWAYS'
},
isCalloutVisible: true //
});
});
this.$set(this, 'markers', [...this.markers, ...newMarkers]);
} else {
//
this.$set(this, 'markers', this.markers.filter(marker => !marker.isCalloutVisible));
}
},
getArea() { getArea() {
// this.$u.get("/app/area/" + this.orderInfo.areaId).then((res) => {
this.$u.get("/app/area/" + this.orderInfo.areaId).then((res) => { this.$u.get("/app/area/" + this.orderInfo.areaId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -400,39 +385,42 @@
this.loading = true; this.loading = true;
this.getArea(); this.getArea();
let abb; if(res.data.tripRouteStr){
try { let abb;
abb = JSON.parse(res.data.tripRouteStr); try {
} catch (error) { abb = JSON.parse(res.data.tripRouteStr);
console.error("Error parsing tripRouteStr:", error); } catch (error) {
return; console.error("Error parsing tripRouteStr:", error);
} return;
if (abb.length > 2) { }
this.latitude = parseFloat(abb[0][1]); if (abb.length > 2) {
this.longitude = parseFloat(abb[0][0]); this.latitude = parseFloat(abb[0][1]);
this.polyline[0].points = abb.map(coord => ({ this.longitude = parseFloat(abb[0][0]);
latitude: coord[1], this.polyline[0].points = abb.map(coord => ({
longitude: coord[0] latitude: coord[1],
})); longitude: coord[0]
this.markers.push({ }));
id: 0, this.markers.push({
latitude: abb[0][1], id: 0,
longitude: abb[0][0], latitude: abb[0][1],
width: 25, longitude: abb[0][0],
height: 38, width: 25,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u06paUGiHLvL08Pw7BGr' height: 38,
}, { iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u06paUGiHLvL08Pw7BGr'
id: 1, }, {
latitude: abb[abb.length - 1][1], id: 1,
longitude: abb[abb.length - 1][0], latitude: abb[abb.length - 1][1],
width: 25, longitude: abb[abb.length - 1][0],
height: 38, width: 25,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/uwpAj9vYtPRmhtTOtflx' height: 38,
}); iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/uwpAj9vYtPRmhtTOtflx'
}else{ });
this.latitude = parseFloat(abb[0][1]); }else{
this.longitude = parseFloat(abb[0][0]); this.latitude = parseFloat(abb[0][1]);
this.longitude = parseFloat(abb[0][0]);
}
} }
uni.hideLoading(); uni.hideLoading();
} }
}).catch(error => { }).catch(error => {
@ -456,7 +444,24 @@
width: 750rpx; width: 750rpx;
height: 100vh; height: 100vh;
} }
.park {
position: fixed;
display: flex;
align-items: center;
justify-content: center;
right: 30rpx;
bottom: 500rpx;
// background-color: #fff;
border-radius: 50%;
width: 82rpx;
height: 82rpx;
z-index: 10;
.img {
width: 82rpx;
height: 82rpx;
}
}
.bot { .bot {
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -4,9 +4,9 @@
<image src="https://lxnapi.ccttiot.com/bike/img/static/uVcMTydm81zCMhHomXl1" mode="" @click="topage(6)"> <image src="https://lxnapi.ccttiot.com/bike/img/static/uVcMTydm81zCMhHomXl1" mode="" @click="topage(6)">
</image> </image>
<view class="txts" v-if="gps.deptId==100"> <view class="txts" v-if="gps.deptId==100">
{{areaInfo.areaName}} {{areaInfo.areaName}}
</view> </view>
<view class="txts" v-if="gps.deptId==101"> <view class="txts" v-if="gps.deptId==101">
嵛你出行 嵛你出行
</view> </view>
</view> </view>
@ -14,7 +14,7 @@
title-size='36' height='36'></u-navbar> --> title-size='36' height='36'></u-navbar> -->
<map class="map" id="map" ref="map" :scale="zoomSize" show-location v-if="showmap" :latitude="latitude" <map class="map" id="map" ref="map" :scale="zoomSize" show-location v-if="showmap" :latitude="latitude"
:longitude="longitude" :show-location="true" :markers="markers" :polygons="polyline" :longitude="longitude" :show-location="true" :markers="markers" :polygons="polyline"
@markertap="onMarkerTap" @tap="onMapTap"> @markertap="onMarkerTap" @tap="onMapTap" @regionchange="onMapRegionChange">
</map> </map>
<view class="my-location" @click="setMapScale"> <view class="my-location" @click="setMapScale">
@ -232,7 +232,7 @@
<view class="btn" @click="sub1()" v-if="type==1"> <view class="btn" @click="sub1()" v-if="type==1">
确认开锁 确认开锁
</view> </view>
<view class="btn" @click="sub3()" v-if="type==2"> <view class="btn" @click="sub3()" v-if="type==2">
确认预约 确认预约
</view> </view>
@ -262,7 +262,7 @@
<view class="text"> <view class="text">
可继续行驶{{OrderdeviceInfos.remainingMileage}}公里 可继续行驶{{OrderdeviceInfos.remainingMileage}}公里
</view> </view>
<view class="speed"> <view class="speed" style="background: #ccc; ">
<view class="speeds" :style="{ width: OrderdeviceInfos.remainingPower + '%' }"> <view class="speeds" :style="{ width: OrderdeviceInfos.remainingPower + '%' }">
</view> </view>
@ -301,11 +301,11 @@
@click="unloackdevices()"> @click="unloackdevices()">
解锁用车 解锁用车
</view> </view>
<view class="btn1" @click="backDevice()"> <view class="btn1" @click="backDevicecar()">
还车 还车
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="page4" v-if="deviceIndex==3"> <view class="page4" v-if="deviceIndex==3">
@ -373,9 +373,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="guangggao"> <view class="guangggao" v-if="gps.deptId==100">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uvHYQhuouHZQQL3qfLzP" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uvHYQhuouHZQQL3qfLzP" mode=""></image>
</view> </view>
<view class="guangggao" v-if="gps.deptId==101" @click="gotowzysd()">
<image src="https://lxnapi.ccttiot.com/bike/img/static/un0FWzTJzJ35dYU7mgdl" mode=""></image>
</view>
</view> </view>
<view class="tipss_box"> <view class="tipss_box">
@ -583,6 +586,27 @@
</view> </view>
</view> </view>
<!-- 是否确认还车 -->
<u-mask :show="isbackcar" :z-index='100' duration='0' />
<view class="pops" @click="isbackcar = false" v-if="isbackcar">
<view class="tit" style="font-weight: 600;">
温馨提示
</view>
<view class="cont_box" style="text-align: center;color: #808080;justify-content: center;font-size: 36rpx;">
为了避免误触请问是否确定还车
</view>
<view class="btn_box">
<view class="btn1" @click="isbackcar = false">
取消
</view>
<view class="btn2" @click="backDevice()">
确定
</view>
</view>
</view>
</view> </view>
</template> </template>
@ -680,7 +704,8 @@
isnoline: false, isnoline: false,
carstause: false, carstause: false,
isbackdevice: false isbackdevice: false,
isbackcar:false
} }
}, },
@ -690,11 +715,11 @@
// console.log('userId ', newValue, oldValue); // console.log('userId ', newValue, oldValue);
this.getisInOrder() this.getisInOrder()
}, },
}, },
onLoad(e) { onLoad(e) {
this.gps.deptId= uni.getStorageSync('deptId'); this.gps.deptId = uni.getStorageSync('deptId');
console.log(e, 'eeeeeeeeeeeeeeeeeee'); console.log(e, 'eeeeeeeeeeeeeeeeeee');
if (e.q) { if (e.q) {
this.qParam = e.q this.qParam = e.q
@ -703,17 +728,17 @@
} }
if (e.qParam) { if (e.qParam) {
this.qParam = e.qParam this.qParam = e.qParam
} }
if(this.gps.deptId==101){ if (this.gps.deptId == 101) {
if(this.showagre){ if (this.showagre) {
uni.redirectTo({ uni.redirectTo({
url:'/page_user/agreement?needback=true&qParam='+this.qParam url: '/page_user/agreement?needback=true&qParam=' + this.qParam
}) })
} }
} }
if (e.sn) { if (e.sn) {
this.sn = e.sn this.sn = e.sn
if (this.sn != '') { if (this.sn != '') {
@ -734,38 +759,38 @@
}, 500) }, 500)
}, },
onShow() { onShow() {
this.timers = setInterval(() => { // this.timers = setInterval(() => {
// console.log('...'); // // console.log('...');
this.getmarks() // this.getmarks()
// // //
}, 3000); // // }, 3000); //
if (this.seeDetail == false) { if (this.seeDetail == false) {
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
success: function(lb) { success: function(lb) {
that.latitude = 23.440359 // that.latitude = 23.440359
that.longitude =117.074552 // that.longitude = 117.074552
that.gps.latitude =23.440359 // that.gps.latitude = 23.440359
that.gps.longitude = 117.074552; // that.gps.longitude = 117.074552;
// that.gps.latitude = lb.latitude; that.gps.latitude = lb.latitude;
// that.gps.longitude = lb.longitude; that.gps.longitude = lb.longitude;
// that.latitude = Number(lb.latitude.toFixed(5)) - 0.005 that.latitude = Number(lb.latitude.toFixed(5)) - 0.005
// that.longitude = Number(lb.longitude.toFixed(5)) + 0.005 that.longitude = Number(lb.longitude.toFixed(5)) + 0.005
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) {
let qParam = that.qParam let qParam = that.qParam
console.log(qParam,'qParamqParamqParam'); console.log(qParam, 'qParamqParamqParam');
// 2: URLq // 2: URLq
let decodedUrl = decodeURIComponent(qParam); let decodedUrl = decodeURIComponent(qParam);
@ -882,16 +907,103 @@
isMeal() { isMeal() {
return this.$store.getters.isMeal; return this.$store.getters.isMeal;
}, },
showagre() { showagre() {
return this.$store.getters.showagre; return this.$store.getters.showagre;
}, },
}, },
methods: { methods: {
backDevicecar(){
this.isbackcar=true
},
gotowzysd() {
uni.navigateToMiniProgram({
appId: 'wxd7c0bb79b9d616c3', //appid
path: '/pages/index/index', //
extraData: {
'data1': 'test'
},
envVersion: 'trial', //developtrialrelease
success(res) {
//
}
})
},
onMapRegionChange(event) {
console.log('regionchange', event)
if (event.detail.type == 'end') {
// this.getCenterLanLat()
}
//
},
getCenterLanLat() {
let that = this
uni.createMapContext("map", this).getCenterLocation({
type: 'gcj02',
success: (res) => {
console.log("当前地图中心的经纬度", res)
that.gps.latitude = res.latitude;
that.gps.longitude = res.longitude;
that.getAreas()
//
},
fail: (err) => {}
})
},
getAreas() {
this.$u.get('/app/area/info?', this.gps).then((res) => {
this.showmap = true
if (res.code === 200) {
// 线
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
// console.log(polylines,'polylinespolylinespolylines');
// .filter(area => area.boundaryStr) // boundary
// .map(area => this.convertBoundaryToPolyline(area.boundaryStr));
// 线
this.areaInfo = res.data
this.polyline.push(polylines)
console.log();
// console.log(this.areaInfo, 'areaInfoareaInfo');
uni.setStorageSync('areaId', res.data.areaId);
// this.getinfo()
// this.getmarks()
// this.getlist()
this.getParking()
// this.setMapScale()
// if(!hasShownPopup){
// console.log(typeof(hasShownPopup),'hasShownPopuphasShownPopup');
// this.showTips=uni.getStorageSync('hasShownPopup')
// }else{
// this.showTips=true
// uni.setStorageSync('hasShownPopup', true);
// }
// this.$store.commit('SET_SHOWTIPS', true);
// console.log(this.polyline);
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
},
keepback() { keepback() {
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
success: function(lb) { success: function(lb) {
@ -927,7 +1039,7 @@
duration: 1000 duration: 1000
}); });
setTimeout(() => { setTimeout(() => {
that.isbackdevice=false that.isbackdevice = false
that.isnoline = true that.isnoline = true
}, 1300) }, 1300)
} }
@ -950,7 +1062,7 @@
onlinebackDevice() { onlinebackDevice() {
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
success: function(lb) { success: function(lb) {
@ -1093,7 +1205,7 @@
'isStart': false 'isStart': false
}); });
setTimeout(() => { setTimeout(() => {
if (this.devicesList.length == 0) { if (this.devicesList.length == 0) {
uni.showToast({ uni.showToast({
title: '暂无发现对应设备,请靠近设备', title: '暂无发现对应设备,请靠近设备',
@ -1124,8 +1236,8 @@
} }
}); });
} }
}, 200) }, 200)
// //
@ -1245,7 +1357,7 @@
setTimeout(() => { setTimeout(() => {
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
success: function(lb) { success: function(lb) {
@ -1345,20 +1457,22 @@
setTimeout(() => { setTimeout(() => {
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'gcj02',
success: function(lb) { success: function(lb) {
let data = { let data = {
latitude: lb.latitude, latitude: lb.latitude,
longitude: lb.longitude, longitude: lb.longitude,
areaId: that.areaInfo.areaId areaId: that.areaInfo.areaId
} }
that.$u.post('/appVerify/device/lock?sn=' + that.OrderdeviceInfos.sn + '&orderNo=' + that.$u.post('/appVerify/device/lock?sn=' + that.OrderdeviceInfos
.sn + '&orderNo=' +
that that
.orderinfo .orderinfo
.orderNo + '&isBluetooth=true'+ '&lon=' + lb.longitude + '&lat='+lb.latitude).then((res) => { .orderNo + '&isBluetooth=true' + '&lon=' + lb.longitude +
'&lat=' + lb.latitude).then((res) => {
if (res.code === 200) { if (res.code === 200) {
that.getisInOrder() that.getisInOrder()
} else { } else {
@ -1375,10 +1489,10 @@
duration: 2000 duration: 2000
}); });
} }
} }
}) })
}, },
fail: function(error) { fail: function(error) {
uni.showToast({ uni.showToast({
@ -1389,9 +1503,9 @@
// that.getmarks() // that.getmarks()
// //
} }
}) })
}, 300) }, 300)
} else { } else {
uni.showToast({ uni.showToast({
@ -1443,12 +1557,11 @@
console.log("连接回调:" + JSON.stringify(options)); console.log("连接回调:" + JSON.stringify(options));
if (options.result) { if (options.result) {
// uni.hideLoading(); // uni.hideLoading();
uni.showToast({ uni.showToast({
title: '连接成功', title: '连接成功',
icon: 'none' icon: 'none'
}); }); {
{
xBlufi.notifyInitBleEsp32({ xBlufi.notifyInitBleEsp32({
deviceId: options.data.deviceId deviceId: options.data.deviceId
@ -1532,9 +1645,9 @@
deviceId: e.deviceId, deviceId: e.deviceId,
name name
}); });
setTimeout(()=>{ setTimeout(() => {
uni.hideLoading() uni.hideLoading()
},3000) }, 3000)
// for (var i = 0; i < this.devicesList.length; i++) { // for (var i = 0; i < this.devicesList.length; i++) {
// if (e.deviceId === this.devicesList[i].deviceId) { // if (e.deviceId === this.devicesList[i].deviceId) {
@ -1656,7 +1769,7 @@
this.OrderdeviceInfos = res.data this.OrderdeviceInfos = res.data
// this.OrderdeviceInfos.onlineStatus ='0' // this.OrderdeviceInfos.onlineStatus ='0'
if (this.OrderdeviceInfos.onlineStatus == 0&&this.orderinfo.status != 3) { if (this.OrderdeviceInfos.onlineStatus == 0 && this.orderinfo.status != 3) {
this.mac = this.OrderdeviceInfos.mac this.mac = this.OrderdeviceInfos.mac
if (this.carstause == false) { if (this.carstause == false) {
@ -1665,22 +1778,22 @@
} }
// OrderdeviceInfos // OrderdeviceInfos
const newMarker = { // const newMarker = {
id: parseFloat(this.OrderdeviceInfos.sn), // id: parseFloat(this.OrderdeviceInfos.sn),
latitude: parseFloat(this.OrderdeviceInfos.latitude), // latitude: parseFloat(this.OrderdeviceInfos.latitude),
longitude: parseFloat(this.OrderdeviceInfos.longitude), // longitude: parseFloat(this.OrderdeviceInfos.longitude),
width: 40, // width: 40,
height: 28, // height: 28,
isDeviceMarker: true, // // isDeviceMarker: true, //
iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7', // iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uF9qLejuAZErNTrRuHq7',
}; // };
// // //
const preservedMarkers = this.markers.filter(marker => marker.isCalloutVisible || marker // const preservedMarkers = this.markers.filter(marker => marker.isCalloutVisible || marker
.isDeviceMarker); // .isDeviceMarker);
// 使markers // // 使markers
this.markers = [newMarker, ...preservedMarkers]; // this.markers = [newMarker, ...preservedMarkers];
this.oldMarkers = [...this.markers]; // this.oldMarkers = [...this.markers];
} else { } else {
// //
@ -2006,9 +2119,9 @@
this.freeListIndex = index this.freeListIndex = index
}, },
// //
// //
backDevice() { backDevice() {
if (this.OrderdeviceInfos.onlineStatus == 1) { if (this.OrderdeviceInfos.onlineStatus == 1) {
uni.showLoading({ uni.showLoading({
@ -2231,7 +2344,7 @@
} }
}) })
}, },
sub5() { sub5() {
if (this.orderinfo.ruleId) { if (this.orderinfo.ruleId) {
@ -2765,7 +2878,7 @@
console.log('点击了标记:', e.markerId); console.log('点击了标记:', e.markerId);
// //
// \ // \
const markerExists = this.listData.some(item => item.sn == e.markerId); const markerExists = this.listData.some(item => item.sn == e.markerId);
if (markerExists) { if (markerExists) {
@ -2782,8 +2895,8 @@
} }
}, },
toggleIconAndCallout() { toggleIconAndCallout() {
this.showIconAndCallout = !this.showIconAndCallout; this.showIconAndCallout = !this.showIconAndCallout;
if (this.showIconAndCallout) { if (this.showIconAndCallout) {
@ -2795,7 +2908,11 @@
longitude: parseFloat(item.longitude), longitude: parseFloat(item.longitude),
width: 20, width: 20,
height: 28.95, height: 28.95,
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', 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: { callout: {
content: item.parkingName, content: item.parkingName,
color: '#ffffff', color: '#ffffff',
@ -2938,7 +3055,7 @@
this.$u.get('/app/area/info?', this.gps).then((res) => { this.$u.get('/app/area/info?', this.gps).then((res) => {
this.showmap = true this.showmap = true
if (res.code === 200) { if (res.code === 200) {
// 线 // 线
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr) const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
// console.log(polylines,'polylinespolylinespolylines'); // console.log(polylines,'polylinespolylinespolylines');
@ -2963,7 +3080,7 @@
if (hasShownPopup === '' || hasShownPopup === null) { if (hasShownPopup === '' || hasShownPopup === null) {
console.log('1111111111'); console.log('1111111111');
this.showTips = true; this.showTips = true;
this.startCountdown(); this.startCountdown();
uni.setStorageSync('hasShownPopup', true); uni.setStorageSync('hasShownPopup', true);
@ -2972,10 +3089,10 @@
this.showTips = uni.getStorageSync('hasShownPopup'); this.showTips = uni.getStorageSync('hasShownPopup');
console.log(this.showTips, 'this.showTips'); console.log(this.showTips, 'this.showTips');
this.startCountdown(); this.startCountdown();
} }
this.setMapScale() // this.setMapScale()
// if(!hasShownPopup){ // if(!hasShownPopup){
// console.log(typeof(hasShownPopup),'hasShownPopuphasShownPopup'); // console.log(typeof(hasShownPopup),'hasShownPopuphasShownPopup');
// this.showTips=uni.getStorageSync('hasShownPopup') // this.showTips=uni.getStorageSync('hasShownPopup')
@ -3153,14 +3270,14 @@
// url:'' // url:''
// }) // })
} else if (num == 1) { } else if (num == 1) {
uni.showLoading({ uni.showLoading({
}) })
if (uni.getStorageSync('token')) { if (uni.getStorageSync('token')) {
if (this.areaInfo.authentication == 1) { if (this.areaInfo.authentication == 1) {
this.$u.get("/getAppInfo").then(res => { this.$u.get("/getAppInfo").then(res => {
if (res.code == 200) { if (res.code == 200) {
this.userinfo = res.user; this.userinfo = res.user;
this.$store.commit('SET_USERID', res.user.userId); this.$store.commit('SET_USERID', res.user.userId);
@ -3197,10 +3314,10 @@
}); });
this.showYjTip = false this.showYjTip = false
} }
} else { } else {
let that = this; let that = this;
wx.login({ wx.login({
success(res) { success(res) {
@ -3224,7 +3341,7 @@
if (res.user.isAuthentication == 0) { if (res.user.isAuthentication == 0) {
uni.hideLoading() uni.hideLoading()
that.seeDetail = true; that.seeDetail = true;
uni.navigateTo({ uni.navigateTo({
url: "/page_user/idcard_test" url: "/page_user/idcard_test"
}); });
@ -3298,12 +3415,12 @@
console.error('微信登录接口调用失败:', err); console.error('微信登录接口调用失败:', err);
} }
}); });
this.showYjTip = false this.showYjTip = false
} }
} else if (num == 2) { } else if (num == 2) {
uni.navigateTo({ uni.navigateTo({
url: '/page_user/jfgz' url: '/page_user/jfgz'
@ -3320,9 +3437,9 @@
url: '/page_user/bhks' url: '/page_user/bhks'
}) })
} }
} else if (num == 5) { } else if (num == 5) {
uni.navigateTo({ uni.navigateTo({
url: '/page_user/gzsb' url: '/page_user/gzsb'
}) })
@ -3330,7 +3447,7 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/my' url: '/pages/my'
}) })
} else if (num == 7) { } else if (num == 7) {
uni.navigateTo({ uni.navigateTo({
url: '/page_user/gzsb?sn=' + this.sn url: '/page_user/gzsb?sn=' + this.sn
@ -3347,11 +3464,11 @@
}, },
deviceInfo(num) { deviceInfo(num) {
if (uni.getStorageSync('token')) { if (uni.getStorageSync('token')) {
this.$u.get('/app/device/info?sn=' + this.sn).then((res) => { this.$u.get('/app/device/info?sn=' + this.sn).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.deviceInfos = res.data; this.deviceInfos = res.data;
if (num == 0) { if (num == 0) {
this.showdevice = true; this.showdevice = true;
this.type = 0; this.type = 0;
@ -3438,12 +3555,12 @@
// uni.hideLoading(); // uni.hideLoading();
if (res.code == 200) { if (res.code == 200) {
uni.setStorageSync('token', res.token); uni.setStorageSync('token', res.token);
this.getinfo()
this.$u.get('/app/device/info?sn=' + this.sn).then(( this.$u.get('/app/device/info?sn=' + this.sn).then((
res) => { res) => {
if (res.code === 200) { if (res.code === 200) {
this.deviceInfos = res.data; this.deviceInfos = res.data;
if (num == 0) { if (num == 0) {
this.showdevice = true; this.showdevice = true;
this.type = 0; this.type = 0;
@ -3534,15 +3651,15 @@
}); });
} }
}); });
} }
} }
}, },
}); });
} }
}, },
}, },
} }
@ -3613,7 +3730,7 @@
.txts { .txts {
position: absolute; position: absolute;
left: 150rpx; left: 300rpx;
bottom: 90rpx; bottom: 90rpx;
font-weight: 500; font-weight: 500;
font-size: 36rpx; font-size: 36rpx;
@ -4075,7 +4192,8 @@
.card { .card {
width: 500rpx !important; // // max-width: 600rpx !important; //
width: 450rpx !important;
height: 288rpx; height: 288rpx;
margin-right: 20rpx; margin-right: 20rpx;
position: relative; position: relative;
@ -4098,7 +4216,8 @@
justify-content: center; justify-content: center;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 350rpx; // width: 350rpx;
width: 100%;
height: 70rpx; height: 70rpx;
background: #4C97E7; background: #4C97E7;
border-radius: 0rpx 0rpx 16rpx 16rpx; border-radius: 0rpx 0rpx 16rpx 16rpx;
@ -4314,7 +4433,7 @@
margin-top: 18rpx; margin-top: 18rpx;
width: 226rpx; width: 226rpx;
height: 22rpx; height: 22rpx;
background: #ccc; background: red;
border-radius: 16rpx 16rpx 16rpx 16rpx; border-radius: 16rpx 16rpx 16rpx 16rpx;
.speeds { .speeds {

View File

@ -125,7 +125,7 @@
latitude: 0, latitude: 0,
longitude: 0, longitude: 0,
isMap: false, isMap: false,
zoomSize: 15, zoomSize: 13,
markers: [], markers: [],
polyline: [], polyline: [],
polygons: [], polygons: [],
@ -135,7 +135,7 @@
infonum: {}, infonum: {},
rangeMin: 0, rangeMin: 0,
rangMax: 100, rangMax: 100,
rangeValue: [1, 99], rangeValue: [1, 100],
status0: [], // status0: [], //
status1: [], // status1: [], //
status2: [], // status2: [], //
@ -184,10 +184,10 @@
success: function(lb) { success: function(lb) {
that.latitude = Number(lb.latitude.toFixed(5)) - 0.005 // that.latitude = Number(lb.latitude.toFixed(5)) - 0.005
that.longitude = Number(lb.longitude.toFixed(5)) + 0.005 // that.longitude = Number(lb.longitude.toFixed(5)) + 0.005
console.log(that.areaInfo, 'that.areaInfo'); console.log(that.areaInfo, 'that.areaInfo');
that.setMapScale() // that.setMapScale()
// that.getmarks() // that.getmarks()
@ -669,6 +669,8 @@
this.$u.get("/app/area/" + id).then((res) => { this.$u.get("/app/area/" + id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.latitude =res.data.latitude
this.longitude = res.data.longitude
// this.areaInfo = res.data // this.areaInfo = res.data
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr) const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
this.polyline.push(polylines) this.polyline.push(polylines)

View File

@ -86,8 +86,17 @@
</view> </view>
<view class="info_li"> <view class="info_li">
订单费用{{item.totalFee}} <view class="half_info_li">
订单费用{{item.totalFee}}
</view>
<view class="half_info_li" v-if="item.status==4" >
有无退款<span v-if="item.etRefund==null"></span>
<span v-else style="color: red;"></span>
</view>
</view> </view>
<view class="info_li" v-if="item.unlock_time"> <view class="info_li" v-if="item.unlock_time">
开关时间{{item.unlock_time}} {{ item.return_time ? item.return_time : '--' }} 开关时间{{item.unlock_time}} {{ item.return_time ? item.return_time : '--' }}
</view> </view>
@ -284,9 +293,17 @@
租赁时长{{computedList(item)}} 租赁时长{{computedList(item)}}
</view> </view>
</view> </view>
<view class="info_li"> <view class="info_li">
<view class="half_info_li">
订单费用{{item.totalFee}} 订单费用{{item.totalFee}}
</view> </view>
<view class="half_info_li" v-if="item.status==4" >
有无退款<span v-if="item.etRefund==null"></span>
<span v-else style="color: red;"></span>
</view>
</view>
<view class="info_li" v-if="item.unlock_time"> <view class="info_li" v-if="item.unlock_time">
开关时间{{item.unlock_time}} {{ item.return_time ? item.return_time : '--' }} 开关时间{{item.unlock_time}} {{ item.return_time ? item.return_time : '--' }}
</view> </view>

View File

@ -1,7 +1,10 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar :is-back='false' title="工作台" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36' <view class="toptit" @click="shows()">
height='45'></u-navbar> {{areaInfo.areaName}}
</view>
<!-- <u-navbar :is-back='false' title="工作台" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
height='45'></u-navbar> -->
<view class="cont_box"> <view class="cont_box">
<view class="top"> <view class="top">
@ -47,7 +50,7 @@
</view> </view>
</view> </view>
</view> </view>
<u-select v-model="show" :list="list" title='选择运营区' @confirm="confirm"></u-select>
<tab-bar :indexs='0' style=""></tab-bar> <tab-bar :indexs='0' style=""></tab-bar>
</view> </view>
</template> </template>
@ -59,7 +62,11 @@
bgc: { bgc: {
backgroundColor: "#FFFFFF", backgroundColor: "#FFFFFF",
}, },
sn:'' sn:'',
areaId:0,
areaInfo:{},
list: [],
show: false
} }
}, },
@ -68,6 +75,11 @@
// ... // ...
}); });
if(uni.getStorageSync('adminAreaid')){
this.areaId = uni.getStorageSync('adminAreaid')
this.getArea()
this.getareaList()
}
}, },
computed: { computed: {
@ -76,6 +88,51 @@
}, },
}, },
methods: { methods: {
shows(){
if(this.list.length<2){
}else{
this.show =true
}
},
getareaList(){
this.$u.get('/appVerify/getAreaList').then((res) => {
if(res.code==200){
this.list = res.data.map(item => ({
value: item.areaId,
label: item.areaName
}));
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
},
confirm(e){
// console.log(e);
uni.setStorageSync('adminAreaid', e[0].value);
},
getArea() {
let id = this.areaId
this.$u.get("/app/area/" + id).then((res) => {
if (res.code == 200) {
this.areaInfo=res.data
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
});
},
topage(num){ topage(num){
if(num==0){ if(num==0){
uni.navigateTo({ uni.navigateTo({
@ -146,7 +203,11 @@
.page { .page {
width: 750rpx; width: 750rpx;
.toptit{
margin-top: 100rpx;
margin-left: 100rpx;
font-size: 38rpx;
}
.cont_box{ .cont_box{
padding: 46rpx 50rpx; padding: 46rpx 50rpx;
margin: 68rpx auto; margin: 68rpx auto;

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,12 @@
<u-navbar title="订单详情" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36' <u-navbar title="订单详情" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
height='45'></u-navbar> height='45'></u-navbar>
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude" <map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
:show-location='true' :markers="markers" :polygons="polygons" :polyline="polyline"> </map> :show-location='true' :markers="markers" :polygons="polygons" :polyline="polyline">
<cover-view class="park" @click="toggleIconAndCallout">
<cover-image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/uRiYQZQEb3l2LsltEsyW"
mode=""></cover-image>
</cover-view>
</map>
<view class="info_card"> <view class="info_card">
<view class="info_tit"> <view class="info_tit">
基本信息 基本信息
@ -36,9 +41,7 @@
行驶距离<span>{{orderInfo.distance/1000}}Km</span> 行驶距离<span>{{orderInfo.distance/1000}}Km</span>
</view> </view>
</view> </view>
<view class="info_li">
订单状态<span>{{status()}}</span>
</view>
</view> </view>
</view> </view>
<view class="info_card" style="margin-top: 20rpx;"> <view class="info_card" style="margin-top: 20rpx;">
@ -211,9 +214,9 @@
width: 8, width: 8,
arrowLine: true, arrowLine: true,
color: '#00AF99' color: '#00AF99'
// strokeWidth: 2, // strokeWidth: 2,
// strokeColor: '#00AF99', // strokeColor: '#00AF99',
// fillColor: '#00AF99' // fillColor: '#00AF99'
}, ], }, ],
polygons: [], polygons: [],
@ -236,53 +239,91 @@
}, },
methods: { methods: {
callPhone(){ toggleIconAndCallout() {
this.showIconAndCallout = !this.showIconAndCallout;
if (this.showIconAndCallout) {
const newMarkers = [];
this.parkingList.forEach(item => {
newMarkers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 28.95,
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: 'ALWAYS'
},
isCalloutVisible: true //
});
});
this.$set(this, 'markers', [...this.markers, ...newMarkers]);
} else {
//
this.$set(this, 'markers', this.markers.filter(marker => !marker.isCalloutVisible));
}
},
callPhone() {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber:this.orderInfo.phonenumber phoneNumber: this.orderInfo.phonenumber
}) })
}, },
computedList(item) { computedList(item) {
if(item.status==0||item.status==2){ if (item.status == 0 || item.status == 2) {
const createTime = new Date(item.createTime);
const payTime = Date.now();
const timeDifference = Math.abs(createTime - payTime);
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
let result = '';
if (hours > 0) {
result += `${hours}小时`;
}
if (minutes > 0 || hours > 0) { //
result += `${minutes}`;
}
// result += `${seconds}`; //
return result;
}else{
const createTime = new Date(item.createTime); const createTime = new Date(item.createTime);
const payTime = new Date(item.returnTime); const payTime = Date.now();
const timeDifference = Math.abs(createTime - payTime); const timeDifference = Math.abs(createTime - payTime);
const hours = Math.floor(timeDifference / (1000 * 60 * 60)); const hours = Math.floor(timeDifference / (1000 * 60 * 60));
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60)); const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000); const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
let result = ''; let result = '';
if (hours > 0) { if (hours > 0) {
result += `${hours}小时`; result += `${hours}小时`;
} }
if (minutes > 0 || hours > 0) { // if (minutes > 0 || hours > 0) { //
result += `${minutes}`; result += `${minutes}`;
} }
// result += `${seconds}`; // // result += `${seconds}`; //
return result; return result;
} else {
const createTime = new Date(item.createTime);
const payTime = new Date(item.returnTime);
const timeDifference = Math.abs(createTime - payTime);
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
let result = '';
if (hours > 0) {
result += `${hours}小时`;
}
if (minutes > 0 || hours > 0) { //
result += `${minutes}`;
}
// result += `${seconds}`; //
return result;
} }
}, },
convertBoundaryToPolyline(boundary) { convertBoundaryToPolyline(boundary) {
if (!boundary) return null; if (!boundary) return null;
@ -302,7 +343,7 @@
return polyline; return polyline;
}, },
convertBoundaryToPolylines(boundaries, num) { convertBoundaryToPolylines(boundaries, num) {
if (num == 1) { if (num == 1) {
console.log('判断'); console.log('判断');
@ -391,7 +432,11 @@
}, },
getParking() { getParking() {
// //
this.$u.get('/app/parking/list').then((res) => {
let data = {
areaId: this.orderInfo.areaId
}
this.$u.get('/app/parking/list?', data).then((res) => {
if (res.code === 200) { if (res.code === 200) {
// //
const type1Data = []; const type1Data = [];
@ -425,79 +470,22 @@
this.polygons = this.polygons.concat(polylines); this.polygons = this.polygons.concat(polylines);
// console.log(this.polyline); // console.log(this.polyline);
res.rows.forEach(item => { this.parkingList = res.rows
if(item.type==1){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#3A7EDB', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==2){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FFC107', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==3){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FF473E', //
padding: 6, //
display: 'ALWAYS' //
}
});
}
})
} }
}).catch(error => { }).catch(error => {
console.error("Error fetching parking data:", error); console.error("Error fetching parking data:", error);
}); });
}, },
getArea() { getArea() {
// //
this.$u.get('/app/area/list').then((res) => { let id = this.orderInfo.areaId
this.$u.get("/app/area/" + id).then((res) => {
if (res.code === 200) { if (res.code === 200) {
// 线 // 线
const polylines = res.rows const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
.filter(area => area.boundaryStr) // boundary
.map(area => this.convertBoundaryToPolyline(area.boundaryStr));
// 线 // 线
this.polygons = polylines; this.polygons.push(polylines)
this.getParking() this.getParking()
// console.log(this.polyline); // console.log(this.polyline);
} }
@ -526,6 +514,8 @@
if (res.code === 200) { if (res.code === 200) {
// 线 // 线
this.orderInfo = res.data this.orderInfo = res.data
this.getArea()
this.loading = true this.loading = true
this.latitude = parseFloat(this.orderInfo.latitude) this.latitude = parseFloat(this.orderInfo.latitude)
this.longitude = parseFloat(this.orderInfo.longitude) this.longitude = parseFloat(this.orderInfo.longitude)
@ -535,36 +525,35 @@
})); }));
let abb; let abb;
try { try {
abb = JSON.parse(res.data.tripRouteStr); abb = JSON.parse(res.data.tripRouteStr);
} catch (error) { } catch (error) {
console.error("Error parsing tripRouteStr:", error); console.error("Error parsing tripRouteStr:", error);
return; return;
} }
if (abb.length > 2) { if (abb.length > 2) {
this.latitude = parseFloat(abb[0][1]); this.latitude = parseFloat(abb[0][1]);
this.longitude = parseFloat(abb[0][0]); this.longitude = parseFloat(abb[0][0]);
this.polyline[0].points = abb.map(coord => ({ this.polyline[0].points = abb.map(coord => ({
latitude: coord[1], latitude: coord[1],
longitude: coord[0] longitude: coord[0]
})); }));
this.markers.push({ this.markers.push({
id: 0, id: 0,
latitude: abb[0][1], latitude: abb[0][1],
longitude: abb[0][0], longitude: abb[0][0],
width: 25, width: 25,
height: 38, height: 38,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u06paUGiHLvL08Pw7BGr' iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u06paUGiHLvL08Pw7BGr'
}, { }, {
id: 1, id: 1,
latitude: abb[abb.length - 1][1], latitude: abb[abb.length - 1][1],
longitude: abb[abb.length - 1][0], longitude: abb[abb.length - 1][0],
width: 25, width: 25,
height: 38, height: 38,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/uwpAj9vYtPRmhtTOtflx' iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/uwpAj9vYtPRmhtTOtflx'
}); });
} }
} }
this.getArea()
// console.log(points,''); // console.log(points,'');
// this.polyline[0].points=points // this.polyline[0].points=points
@ -585,6 +574,7 @@
.page { .page {
padding-bottom: 200rpx; padding-bottom: 200rpx;
width: 750rpx; width: 750rpx;
.tip_box { .tip_box {
position: fixed; position: fixed;
left: 72rpx; left: 72rpx;
@ -595,23 +585,23 @@
border-radius: 30rpx 30rpx 30rpx 30rpx; border-radius: 30rpx 30rpx 30rpx 30rpx;
z-index: 110; z-index: 110;
padding-bottom: 100rpx; padding-bottom: 100rpx;
.top { .top {
padding: 52rpx 38rpx 42rpx 36rpx; padding: 52rpx 38rpx 42rpx 36rpx;
.ipt_box { .ipt_box {
margin-top: 22rpx; margin-top: 22rpx;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center; align-items: center;
.text { .text {
width: 96rpx; width: 96rpx;
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
color: #3D3D3D; color: #3D3D3D;
} }
.ipt { .ipt {
padding: 10rpx 18rpx; padding: 10rpx 18rpx;
display: flex; display: flex;
@ -622,13 +612,13 @@
height: 64rpx; height: 64rpx;
border-radius: 0rpx 0rpx 0rpx 0rpx; border-radius: 0rpx 0rpx 0rpx 0rpx;
border: 2rpx solid #979797; border: 2rpx solid #979797;
.input { .input {
width: 80%; width: 80%;
} }
} }
} }
.tip { .tip {
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -636,7 +626,7 @@
font-size: 32rpx; font-size: 32rpx;
color: #3D3D3D; color: #3D3D3D;
} }
.txt { .txt {
margin-top: 32rpx; margin-top: 32rpx;
width: 100%; width: 100%;
@ -646,17 +636,17 @@
color: #3D3D3D; color: #3D3D3D;
} }
} }
.bot { .bot {
position: absolute; position: absolute;
width: 610rpx; width: 610rpx;
// border-top: 2rpx solid #D8D8D8; // border-top: 2rpx solid #D8D8D8;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
// height: 100%; // height: 100%;
bottom: -20rpx; bottom: -20rpx;
.bot_left { .bot_left {
border-radius: 0rpx 0rpx 0rpx 30rpx; border-radius: 0rpx 0rpx 0rpx 30rpx;
width: 50%; width: 50%;
@ -669,7 +659,7 @@
color: #3D3D3D; color: #3D3D3D;
background: #EEEEEE; background: #EEEEEE;
} }
.bot_right { .bot_right {
border-radius: 0rpx 0rpx 30rpx 0rpx; border-radius: 0rpx 0rpx 30rpx 0rpx;
width: 50%; width: 50%;
@ -683,16 +673,35 @@
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
// color: #4C97E7; // color: #4C97E7;
} }
} }
} }
.map { .map {
position: relative;
width: 750rpx; width: 750rpx;
height: 752rpx; height: 752rpx;
.park {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
right: 30rpx;
bottom: 40rpx;
// background-color: #fff;
border-radius: 50%;
width: 82rpx;
height: 82rpx;
z-index: 10;
.img {
width: 82rpx;
height: 82rpx;
}
}
} }
.info_card { .info_card {
@ -771,6 +780,7 @@
overflow: hidden; overflow: hidden;
/* 超出部分隐藏 */ /* 超出部分隐藏 */
text-overflow: ellipsis; text-overflow: ellipsis;
.text { .text {
display: inline; display: inline;
// width: 70%; // width: 70%;