|
@@ -33,7 +33,7 @@
|
|
|
></uni-icons>
|
|
></uni-icons>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="width-half flex-center" @click.stop="checkDiscounts">
|
|
|
|
|
|
|
+ <view class="width-half flex-center" style="opacity: 0">
|
|
|
<view
|
|
<view
|
|
|
class="width-32 height-32 br-round lh-20 text-center"
|
|
class="width-32 height-32 br-round lh-20 text-center"
|
|
|
:style="{
|
|
:style="{
|
|
@@ -90,8 +90,7 @@
|
|
|
>
|
|
>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="dialog_event" v-if="ready && !filterDialog.distanceSelector">
|
|
|
|
|
- // TODO 接入活动接口
|
|
|
|
|
|
|
+ <view class="dialog_event" v-if="ready && !filterDialog.distanceSelector">
|
|
|
<swiper
|
|
<swiper
|
|
|
class="swiper"
|
|
class="swiper"
|
|
|
circular
|
|
circular
|
|
@@ -99,14 +98,21 @@
|
|
|
:autoplay="true"
|
|
:autoplay="true"
|
|
|
:interval="3000"
|
|
:interval="3000"
|
|
|
>
|
|
>
|
|
|
- <swiper-item class="full-percent">
|
|
|
|
|
- <view class="full-percent bg-666"></view>
|
|
|
|
|
- </swiper-item>
|
|
|
|
|
- <swiper-item class="full-percent">
|
|
|
|
|
- <view class="full-percent bg-fff"></view>
|
|
|
|
|
|
|
+ <swiper-item
|
|
|
|
|
+ class="full-percent"
|
|
|
|
|
+ v-for="(item, index) in mapBanner"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ @click="toActivity(index)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="full-percent"
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ backgroundImage: `url(${item.bannerUrl})`,
|
|
|
|
|
+ }"
|
|
|
|
|
+ ></view>
|
|
|
</swiper-item>
|
|
</swiper-item>
|
|
|
</swiper>
|
|
</swiper>
|
|
|
- </view> -->
|
|
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
<view
|
|
<view
|
|
|
v-if="styleData.dialogPlaceHolderHeight"
|
|
v-if="styleData.dialogPlaceHolderHeight"
|
|
@@ -214,6 +220,20 @@
|
|
|
</view>
|
|
</view>
|
|
|
</block>
|
|
</block>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="charging flex-align-center"
|
|
|
|
|
+ v-if="charging"
|
|
|
|
|
+ @click="toCharging"
|
|
|
|
|
+ >
|
|
|
|
|
+ <image
|
|
|
|
|
+ class="width-64 ml-12"
|
|
|
|
|
+ src="/static/images/map-charging.png"
|
|
|
|
|
+ mode="widthFix"
|
|
|
|
|
+ ></image>
|
|
|
|
|
+ <view class="fs-26 color-fff ml-12">{{
|
|
|
|
|
+ charging.isBooking === 0 ? "充电中" : "已预约"
|
|
|
|
|
+ }}</view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="login-mask" v-if="!token">
|
|
<view class="login-mask" v-if="!token">
|
|
|
<button open-type="getPhoneNumber" @getphonenumber="loginMask" class="full">
|
|
<button open-type="getPhoneNumber" @getphonenumber="loginMask" class="full">
|
|
@@ -237,18 +257,17 @@ const pointSize = {
|
|
|
androidX: -14,
|
|
androidX: -14,
|
|
|
androidCurrentX: -20,
|
|
androidCurrentX: -20,
|
|
|
};
|
|
};
|
|
|
|
|
+import { fetchHomeBanner } from "@/api";
|
|
|
import { deCode } from "../../utils/code";
|
|
import { deCode } from "../../utils/code";
|
|
|
import { rpxToPx } from "../../utils/device";
|
|
import { rpxToPx } from "../../utils/device";
|
|
|
import { fetchToken, login, onLogin } from "@/api/auth";
|
|
import { fetchToken, login, onLogin } from "@/api/auth";
|
|
|
-import { fetchStations } from "@/api/charge";
|
|
|
|
|
|
|
+import { fetchStations, fetchChargeStatus } from "@/api/charge";
|
|
|
import { fetchCollectList } from "@/api/user";
|
|
import { fetchCollectList } from "@/api/user";
|
|
|
import { fetchLocation } from "@/utils/location";
|
|
import { fetchLocation } from "@/utils/location";
|
|
|
|
|
+import { to } from "@/utils/navigate";
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
-// TODO 支持省钱充电
|
|
|
|
|
-// TODO 充电中
|
|
|
|
|
-
|
|
|
|
|
const isIOS = ref(false);
|
|
const isIOS = ref(false);
|
|
|
const token = ref<string>();
|
|
const token = ref<string>();
|
|
|
const ready = ref(false);
|
|
const ready = ref(false);
|
|
@@ -328,6 +347,7 @@ const stationPage = ref({
|
|
|
hasNext: false,
|
|
hasNext: false,
|
|
|
});
|
|
});
|
|
|
const station = ref<any[]>([]);
|
|
const station = ref<any[]>([]);
|
|
|
|
|
+const charging = ref<any>();
|
|
|
|
|
|
|
|
const mapMode = ref(true);
|
|
const mapMode = ref(true);
|
|
|
const mapProps = ref({
|
|
const mapProps = ref({
|
|
@@ -339,6 +359,7 @@ const mapProps = ref({
|
|
|
});
|
|
});
|
|
|
const markersIndex = ref(-1);
|
|
const markersIndex = ref(-1);
|
|
|
const markers = ref<any[]>([]);
|
|
const markers = ref<any[]>([]);
|
|
|
|
|
+const mapBanner = ref<any[]>([]);
|
|
|
|
|
|
|
|
let isIgnoreChangeLocation = false;
|
|
let isIgnoreChangeLocation = false;
|
|
|
|
|
|
|
@@ -473,13 +494,15 @@ const handleNavReady = (e: any) => {
|
|
|
e.detail.statusBarHeight - 6 + searchHeight + filterHeight;
|
|
e.detail.statusBarHeight - 6 + searchHeight + filterHeight;
|
|
|
styleData.value.dialogPlaceHolderHeight =
|
|
styleData.value.dialogPlaceHolderHeight =
|
|
|
styleData.value.dialogHeight - e.detail.navigationBarHeight;
|
|
styleData.value.dialogHeight - e.detail.navigationBarHeight;
|
|
|
- styleData.value.cardHeight = rpxToPx(410);
|
|
|
|
|
|
|
+ styleData.value.cardHeight = rpxToPx(402);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const toSearch = () => {
|
|
const toSearch = () => {
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: "/pages-charge/search/search",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ to("/pages-charge/search/search");
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const toActivity = (index: number) => {
|
|
|
|
|
+ to(`/${mapBanner.value[index].linkUrl}`);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onLoad((query: any) => {
|
|
onLoad((query: any) => {
|
|
@@ -522,6 +545,8 @@ onLoad((query: any) => {
|
|
|
token.value = _token;
|
|
token.value = _token;
|
|
|
fetchCollectList().then(() => {
|
|
fetchCollectList().then(() => {
|
|
|
refresh();
|
|
refresh();
|
|
|
|
|
+ fetchCharging();
|
|
|
|
|
+ fetchBanner();
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
return;
|
|
return;
|
|
@@ -533,17 +558,33 @@ onLoad((query: any) => {
|
|
|
deCode(code);
|
|
deCode(code);
|
|
|
}
|
|
}
|
|
|
refresh();
|
|
refresh();
|
|
|
|
|
+ fetchCharging();
|
|
|
|
|
+ fetchBanner();
|
|
|
});
|
|
});
|
|
|
}, 300);
|
|
}, 300);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const fetchCharging = () => {
|
|
|
|
|
+ fetchChargeStatus().then((res) => {
|
|
|
|
|
+ if (res && [1, 2].includes(res.chargeStatus)) {
|
|
|
|
|
+ charging.value = res;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const fetchBanner = () => {
|
|
|
|
|
+ fetchHomeBanner().then((res) => {
|
|
|
|
|
+ mapBanner.value = res;
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const checkDiscounts = () => {
|
|
const checkDiscounts = () => {
|
|
|
filterDialog.value.discounts = !filterDialog.value.discounts;
|
|
filterDialog.value.discounts = !filterDialog.value.discounts;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const checkFilterDistance = () => {
|
|
const checkFilterDistance = () => {
|
|
|
if (!mapMode.value) {
|
|
if (!mapMode.value) {
|
|
|
- mapMode.value = true
|
|
|
|
|
|
|
+ mapMode.value = true;
|
|
|
}
|
|
}
|
|
|
filterDialog.value.distanceSelector = !filterDialog.value.distanceSelector;
|
|
filterDialog.value.distanceSelector = !filterDialog.value.distanceSelector;
|
|
|
};
|
|
};
|
|
@@ -670,6 +711,14 @@ const touchCardMove = (e: any) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const toCharging = () => {
|
|
|
|
|
+ to(
|
|
|
|
|
+ charging.value.isBooking === 1
|
|
|
|
|
+ ? `/pages-charge/appointment/appointment?sn=${charging.value.connectorId}`
|
|
|
|
|
+ : `/pages-charge/ordering/ordering?sn=${charging.value.connectorId}&start=1`
|
|
|
|
|
+ );
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// TORM
|
|
// TORM
|
|
|
// const changeMarker = (e: any) => {
|
|
// const changeMarker = (e: any) => {
|
|
|
// _changeMarker(e.detail.current);
|
|
// _changeMarker(e.detail.current);
|
|
@@ -717,7 +766,7 @@ page {
|
|
|
top: 0;
|
|
top: 0;
|
|
|
left: 0;
|
|
left: 0;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- z-index: 999;
|
|
|
|
|
|
|
+ z-index: 99;
|
|
|
|
|
|
|
|
&_event {
|
|
&_event {
|
|
|
margin-top: 20rpx;
|
|
margin-top: 20rpx;
|
|
@@ -727,6 +776,11 @@ page {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
border-radius: 16rpx;
|
|
border-radius: 16rpx;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
|
|
+ view {
|
|
|
|
|
+ background-position: center;
|
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
|
+ background-size: cover;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -825,4 +879,17 @@ page {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.charging {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ z-index: 999;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 164rpx;
|
|
|
|
|
+ width: 186rpx;
|
|
|
|
|
+ height: 88rpx;
|
|
|
|
|
+ border-radius: 88rpx 0px 0px 88rpx;
|
|
|
|
|
+ background: linear-gradient(106deg, #34b6ff 15.97%, #347dff 72.38%);
|
|
|
|
|
+ margin-bottom: constant(safe-area-inset-bottom);
|
|
|
|
|
+ margin-bottom: env(safe-area-inset-bottom);
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|