|
|
@@ -267,6 +267,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import {throttle} from "@/utils/util";
|
|
|
+
|
|
|
const defaulDistance = 3;
|
|
|
const defaultScale = 12;
|
|
|
const pointSize = {
|
|
|
@@ -408,24 +410,29 @@ const refreshStation = (location: any) => {
|
|
|
}
|
|
|
).then((res) => {
|
|
|
const _markersIndex = stationPage.value.page === 1 ? 0 : markersIndex.value;
|
|
|
+ console.log("xxxxx",res)
|
|
|
const _markers: any[] = res.map((item, index) => {
|
|
|
+ item.totalFee =(Number(item.serviceFee)+Number(item.electricityFee)).toFixed(2)
|
|
|
length = 0;
|
|
|
available = 0;
|
|
|
- item.equipmentInfos &&
|
|
|
- item.equipmentInfos.forEach((eq: any) => {
|
|
|
- eq.connectorInfos &&
|
|
|
- eq.connectorInfos.forEach((co: any) => {
|
|
|
- length += 1;
|
|
|
- if (
|
|
|
- co.connectorStatusInfo &&
|
|
|
- co.connectorStatusInfo.status === 1
|
|
|
- ) {
|
|
|
- available += 1;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ // item.equipmentInfos &&
|
|
|
+ // item.equipmentInfos.forEach((eq: any) => {
|
|
|
+ // eq.connectorInfos &&
|
|
|
+ // eq.connectorInfos.forEach((co: any) => {
|
|
|
+ // length += 1;
|
|
|
+ // if (
|
|
|
+ // co.connectorStatusInfo &&
|
|
|
+ // co.connectorStatusInfo.status === 1
|
|
|
+ // ) {
|
|
|
+ // available += 1;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ console.log(item.serviceFee,item.StationID)
|
|
|
return {
|
|
|
id: Number(item.StationID),
|
|
|
+ totalFee:"12",
|
|
|
+ // (Number()+Number(item.electricityFee)||0).toFixed(2),
|
|
|
latitude: item.location.stationLat,
|
|
|
longitude: item.location.stationLng,
|
|
|
iconPath:
|
|
|
@@ -437,7 +444,7 @@ const refreshStation = (location: any) => {
|
|
|
height:
|
|
|
index === _markersIndex ? pointSize.currentHeight : pointSize.height,
|
|
|
label: {
|
|
|
- content: `${available}/${length}`,
|
|
|
+ content: `${item.availableParkingNum||0}/${item.parkingNum||0}`,
|
|
|
color: "#ffffff",
|
|
|
fontSize:
|
|
|
index === _markersIndex
|
|
|
@@ -474,6 +481,7 @@ const refreshStation = (location: any) => {
|
|
|
stationPage.value.page === 1 ? res : [...station.value, ...res];
|
|
|
markersIndex.value = _markersIndex;
|
|
|
markers.value = _markers;
|
|
|
+ console.log(">>>>>>>>>>>>>",stationPage.value,station.value,mapMode.value,markersIndex.value)
|
|
|
return res;
|
|
|
});
|
|
|
};
|
|
|
@@ -673,16 +681,20 @@ const mapChange = (e: any) => {
|
|
|
return;
|
|
|
}
|
|
|
if (e.type === "end" && markers.value.length) {
|
|
|
+ //TODO 防抖500ms触发一次
|
|
|
+ throttle(()=>{
|
|
|
+ const current = e.target.centerLocation;
|
|
|
+ const { latitude, longitude } = current;
|
|
|
+ stationPage.value.page = 1;
|
|
|
+ refreshStation({
|
|
|
+ latitude,
|
|
|
+ longitude,
|
|
|
+ });
|
|
|
+ },500)
|
|
|
// console.log("map change end", {
|
|
|
// ...e.detail.centerLocation,
|
|
|
// });
|
|
|
- const current = e.target.centerLocation;
|
|
|
- const { latitude, longitude } = current;
|
|
|
- stationPage.value.page = 1;
|
|
|
- refreshStation({
|
|
|
- latitude,
|
|
|
- longitude,
|
|
|
- });
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
const _changeMarker = (current: number) => {
|