|
|
@@ -95,14 +95,14 @@
|
|
|
class="swiper"
|
|
|
circular
|
|
|
:indicator-dots="true"
|
|
|
- :autoplay="true"
|
|
|
+ :autoplay="mapBanner.length > 1"
|
|
|
:interval="3000"
|
|
|
>
|
|
|
<swiper-item
|
|
|
class="full-percent"
|
|
|
v-for="(item, index) in mapBanner"
|
|
|
:key="index"
|
|
|
- @click="toActivity(index)"
|
|
|
+ @click="to(`/pages-common/activity/activity?id=${item.activityId}`);"
|
|
|
>
|
|
|
<view
|
|
|
class="full-percent"
|
|
|
@@ -122,9 +122,11 @@
|
|
|
id="map"
|
|
|
:style="{
|
|
|
width: '100%',
|
|
|
- height: `calc(100vh - ${styleData.dialogHeight}px - ${
|
|
|
- styleData.cardHeight - 24
|
|
|
- }px)`,
|
|
|
+ height: styleData.dialogHeight
|
|
|
+ ? `calc(100vh - ${styleData.dialogHeight}px - ${
|
|
|
+ styleData.cardHeight - 24
|
|
|
+ }px)`
|
|
|
+ : '50vh',
|
|
|
zIndex: 1,
|
|
|
pointerEvents: loading || !mapMode ? 'none' : 'auto',
|
|
|
}"
|
|
|
@@ -265,9 +267,8 @@ import { fetchStations, fetchChargeStatus } from "@/api/charge";
|
|
|
import { fetchCollectList } from "@/api/user";
|
|
|
import { fetchLocation } from "@/utils/location";
|
|
|
import { to } from "@/utils/navigate";
|
|
|
-import { onLoad } from "@dcloudio/uni-app";
|
|
|
+import { onLoad, onShow } from "@dcloudio/uni-app";
|
|
|
import { ref } from "vue";
|
|
|
-import { WxRequest } from "@/utils/http";
|
|
|
|
|
|
const isIOS = ref(false);
|
|
|
const token = ref<string>();
|
|
|
@@ -500,17 +501,13 @@ const handleNavReady = (e: any) => {
|
|
|
|
|
|
const toSearch = () => {
|
|
|
if (!ready.value || station.value.length) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
uni.navigateTo({
|
|
|
url: "/pages-charge/search/search",
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const toActivity = (index: number) => {
|
|
|
- to(`/${mapBanner.value[index].linkUrl}`);
|
|
|
-};
|
|
|
-
|
|
|
onLoad((query: any) => {
|
|
|
// 只为了打包进tab-bar使用
|
|
|
console.log(fetchToken, login, onLogin);
|
|
|
@@ -570,6 +567,12 @@ onLoad((query: any) => {
|
|
|
}, 300);
|
|
|
});
|
|
|
|
|
|
+onShow(() => {
|
|
|
+ if (token.value) {
|
|
|
+ fetchCharging();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
const fetchCharging = () => {
|
|
|
fetchChargeStatus().then((res) => {
|
|
|
if (res && [1, 2].includes(res.chargeStatus)) {
|
|
|
@@ -584,9 +587,9 @@ const fetchBanner = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const checkDiscounts = () => {
|
|
|
- filterDialog.value.discounts = !filterDialog.value.discounts;
|
|
|
-};
|
|
|
+// const checkDiscounts = () => {
|
|
|
+// filterDialog.value.discounts = !filterDialog.value.discounts;
|
|
|
+// };
|
|
|
|
|
|
const checkFilterDistance = () => {
|
|
|
if (!mapMode.value) {
|
|
|
@@ -724,20 +727,6 @@ const toCharging = () => {
|
|
|
: `/pages-charge/ordering/ordering?sn=${charging.value.connectorId}&start=1`
|
|
|
);
|
|
|
};
|
|
|
-
|
|
|
-// TORM
|
|
|
-// const changeMarker = (e: any) => {
|
|
|
-// _changeMarker(e.detail.current);
|
|
|
-// };
|
|
|
-// const emptyTap = () => {};
|
|
|
-// const changeFilterStatus = (index: number) => {
|
|
|
-// filterDialog.value.options.status = index;
|
|
|
-// };
|
|
|
-// const resetFilter = () => {
|
|
|
-// filterDialog.value.options.distance = defaulDistance;
|
|
|
-// filterDialog.value.options.status = 0;
|
|
|
-// refresh();
|
|
|
-// };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|