|
@@ -150,6 +150,7 @@ const pointSize = {
|
|
|
androidX: -14,
|
|
androidX: -14,
|
|
|
androidCurrentX: -20,
|
|
androidCurrentX: -20,
|
|
|
};
|
|
};
|
|
|
|
|
+import { deCode } from "../../utils/code";
|
|
|
import { fetchToken, login, onLogin } from "@/api/auth";
|
|
import { fetchToken, login, onLogin } from "@/api/auth";
|
|
|
import { fetchStations } from "@/api/charge";
|
|
import { fetchStations } from "@/api/charge";
|
|
|
import { fetchCollectList } from "@/api/user";
|
|
import { fetchCollectList } from "@/api/user";
|
|
@@ -248,7 +249,7 @@ const refreshStation = (location: any) => {
|
|
|
let available = 0;
|
|
let available = 0;
|
|
|
const { latitude, longitude } = location;
|
|
const { latitude, longitude } = location;
|
|
|
if (!token.value) {
|
|
if (!token.value) {
|
|
|
- return
|
|
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
return fetchStations(
|
|
return fetchStations(
|
|
|
stationPage.value.page,
|
|
stationPage.value.page,
|
|
@@ -266,14 +267,14 @@ const refreshStation = (location: any) => {
|
|
|
const _markers: any[] = res.map((item, index) => {
|
|
const _markers: any[] = res.map((item, index) => {
|
|
|
length = 0;
|
|
length = 0;
|
|
|
available = 0;
|
|
available = 0;
|
|
|
- item.EquipmentInfos &&
|
|
|
|
|
- item.EquipmentInfos.forEach((eq: any) => {
|
|
|
|
|
- eq.ConnectorInfos &&
|
|
|
|
|
- eq.ConnectorInfos.forEach((co: any) => {
|
|
|
|
|
|
|
+ item.equipmentInfos &&
|
|
|
|
|
+ item.equipmentInfos.forEach((eq: any) => {
|
|
|
|
|
+ eq.connectorInfos &&
|
|
|
|
|
+ eq.connectorInfos.forEach((co: any) => {
|
|
|
length += 1;
|
|
length += 1;
|
|
|
if (
|
|
if (
|
|
|
- co.ConnectorStatusInfo &&
|
|
|
|
|
- co.ConnectorStatusInfo.Status === 1
|
|
|
|
|
|
|
+ co.connectorStatusInfo &&
|
|
|
|
|
+ co.connectorStatusInfo.status === 1
|
|
|
) {
|
|
) {
|
|
|
available += 1;
|
|
available += 1;
|
|
|
}
|
|
}
|
|
@@ -334,7 +335,7 @@ const refreshStation = (location: any) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const refresh = () => {
|
|
const refresh = () => {
|
|
|
- console.log('刷新电站')
|
|
|
|
|
|
|
+ console.log("刷新电站");
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: "加载中",
|
|
title: "加载中",
|
|
|
});
|
|
});
|
|
@@ -371,6 +372,7 @@ onLoad((query: any) => {
|
|
|
console.log(fetchToken, login, onLogin);
|
|
console.log(fetchToken, login, onLogin);
|
|
|
// 扫普通码
|
|
// 扫普通码
|
|
|
if (query.q) {
|
|
if (query.q) {
|
|
|
|
|
+ console.log("扫普通码", decodeURIComponent(query.q));
|
|
|
getApp<any>().globalData.normalCode = decodeURIComponent(query.q); // 获取到二维码原始链接内容
|
|
getApp<any>().globalData.normalCode = decodeURIComponent(query.q); // 获取到二维码原始链接内容
|
|
|
}
|
|
}
|
|
|
const menu = uni.getMenuButtonBoundingClientRect();
|
|
const menu = uni.getMenuButtonBoundingClientRect();
|
|
@@ -408,7 +410,7 @@ onLoad((query: any) => {
|
|
|
if (getApp<any>().globalData.normalCode) {
|
|
if (getApp<any>().globalData.normalCode) {
|
|
|
const code: string = getApp<any>().globalData.normalCode;
|
|
const code: string = getApp<any>().globalData.normalCode;
|
|
|
getApp<any>().globalData.normalCode = "";
|
|
getApp<any>().globalData.normalCode = "";
|
|
|
- getApp<any>().deCode(code);
|
|
|
|
|
|
|
+ deCode(code);
|
|
|
}
|
|
}
|
|
|
token.value = _token;
|
|
token.value = _token;
|
|
|
fetchCollectList().then(() => {
|
|
fetchCollectList().then(() => {
|
|
@@ -421,7 +423,7 @@ onLoad((query: any) => {
|
|
|
if (getApp<any>().globalData.normalCode) {
|
|
if (getApp<any>().globalData.normalCode) {
|
|
|
const code: string = getApp<any>().globalData.normalCode;
|
|
const code: string = getApp<any>().globalData.normalCode;
|
|
|
getApp<any>().globalData.normalCode = "";
|
|
getApp<any>().globalData.normalCode = "";
|
|
|
- getApp<any>().deCode(code);
|
|
|
|
|
|
|
+ deCode(code);
|
|
|
}
|
|
}
|
|
|
refresh();
|
|
refresh();
|
|
|
});
|
|
});
|