|
@@ -17,10 +17,7 @@
|
|
|
@click="toSearch"
|
|
@click="toSearch"
|
|
|
></image>
|
|
></image>
|
|
|
</view>
|
|
</view>
|
|
|
- <view
|
|
|
|
|
- class="height-72 flex"
|
|
|
|
|
- style="background-color: #f9f9f9"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <view class="height-72 flex" style="background-color: #f9f9f9">
|
|
|
<view class="width-half flex-center" @click.stop="checkFilterDistance">
|
|
<view class="width-half flex-center" @click.stop="checkFilterDistance">
|
|
|
<view class="fs-26 color-000-6 mr-8">距离</view>
|
|
<view class="fs-26 color-000-6 mr-8">距离</view>
|
|
|
<view
|
|
<view
|
|
@@ -94,7 +91,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- <view class="dialog_event" v-if="ready && !filterDialog.distanceSelector">
|
|
<!-- <view class="dialog_event" v-if="ready && !filterDialog.distanceSelector">
|
|
|
- // TODO 接入接口
|
|
|
|
|
|
|
+ // TODO 接入活动接口
|
|
|
<swiper
|
|
<swiper
|
|
|
class="swiper"
|
|
class="swiper"
|
|
|
circular
|
|
circular
|
|
@@ -112,16 +109,18 @@
|
|
|
</view> -->
|
|
</view> -->
|
|
|
</view>
|
|
</view>
|
|
|
<view
|
|
<view
|
|
|
- v-if="styleData.dialogHeight"
|
|
|
|
|
- :style="{ height: `${styleData.dialogHeight}px` }"
|
|
|
|
|
|
|
+ v-if="styleData.dialogPlaceHolderHeight"
|
|
|
|
|
+ :style="{ height: `${styleData.dialogPlaceHolderHeight}px` }"
|
|
|
></view>
|
|
></view>
|
|
|
<map
|
|
<map
|
|
|
id="map"
|
|
id="map"
|
|
|
:style="{
|
|
:style="{
|
|
|
width: '100%',
|
|
width: '100%',
|
|
|
- height: `calc(100vh - ${styleData.dialogHeight}px - ${styleData.cardHeight}px)`,
|
|
|
|
|
|
|
+ height: `calc(100vh - ${styleData.dialogHeight}px - ${
|
|
|
|
|
+ styleData.cardHeight - 24
|
|
|
|
|
+ }px)`,
|
|
|
zIndex: 1,
|
|
zIndex: 1,
|
|
|
- pointerEvents: loading ? 'none' : 'auto',
|
|
|
|
|
|
|
+ pointerEvents: loading || !mapMode ? 'none' : 'auto',
|
|
|
}"
|
|
}"
|
|
|
:latitude="mapProps.latitude"
|
|
:latitude="mapProps.latitude"
|
|
|
:longitude="mapProps.longitude"
|
|
:longitude="mapProps.longitude"
|
|
@@ -134,8 +133,20 @@
|
|
|
@markertap="tapMarker"
|
|
@markertap="tapMarker"
|
|
|
:show-scale="true"
|
|
:show-scale="true"
|
|
|
></map>
|
|
></map>
|
|
|
- <view class="card" :style="{ height: `${styleData.cardHeight}px` }">
|
|
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="card"
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ height: mapMode
|
|
|
|
|
+ ? `${styleData.cardHeight}px`
|
|
|
|
|
+ : `calc(100vh - ${styleData.dialogHeight}px)`,
|
|
|
|
|
+ bottom: '0px',
|
|
|
|
|
+ borderRadius: mapMode ? '16rpx 16rpx 0px 0px' : '0px',
|
|
|
|
|
+ }"
|
|
|
|
|
+ @touchstart.stop="touchCardStart"
|
|
|
|
|
+ @touchmove.stop="touchCardMove"
|
|
|
|
|
+ >
|
|
|
<view
|
|
<view
|
|
|
|
|
+ v-if="mapMode"
|
|
|
class="card_location height-64 width-64 bg-fff flex-center"
|
|
class="card_location height-64 width-64 bg-fff flex-center"
|
|
|
@click="resetLocation"
|
|
@click="resetLocation"
|
|
|
>
|
|
>
|
|
@@ -147,36 +158,40 @@
|
|
|
</view>
|
|
</view>
|
|
|
<block v-if="station.length">
|
|
<block v-if="station.length">
|
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
|
- <!-- <view class="station" v-for="(item, index) in station" :key="index">
|
|
|
|
|
- <view v-if="index !== 0" class="card_line"></view>
|
|
|
|
|
- <charge-station
|
|
|
|
|
- :title="item.stationName"
|
|
|
|
|
- :address="item.address"
|
|
|
|
|
- :price="item.totalFee"
|
|
|
|
|
- :fast="item.fastEquipmentInfos"
|
|
|
|
|
- :slow="item.slowEquipmentInfos"
|
|
|
|
|
- :sId="item.StationID"
|
|
|
|
|
- :distance="item.stationLatDistance"
|
|
|
|
|
- :latitude="item.location.stationLat"
|
|
|
|
|
- :longitude="item.location.stationLng"
|
|
|
|
|
- :fromMap="true"
|
|
|
|
|
- ></charge-station>
|
|
|
|
|
- </view> -->
|
|
|
|
|
- <!-- 单个 -->
|
|
|
|
|
- <view class="station">
|
|
|
|
|
- <charge-station
|
|
|
|
|
- :title="station[markersIndex].stationName"
|
|
|
|
|
- :address="station[markersIndex].address"
|
|
|
|
|
- :price="station[markersIndex].totalFee"
|
|
|
|
|
- :fast="station[markersIndex].fastEquipmentInfos"
|
|
|
|
|
- :slow="station[markersIndex].slowEquipmentInfos"
|
|
|
|
|
- :sId="station[markersIndex].StationID"
|
|
|
|
|
- :distance="station[markersIndex].stationLatDistance"
|
|
|
|
|
- :latitude="station[markersIndex].location.stationLat"
|
|
|
|
|
- :longitude="station[markersIndex].location.stationLng"
|
|
|
|
|
- :fromMap="true"
|
|
|
|
|
- ></charge-station>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <block v-if="!mapMode">
|
|
|
|
|
+ <view class="station" v-for="(item, index) in station" :key="index">
|
|
|
|
|
+ <view v-if="index !== 0" class="card_line"></view>
|
|
|
|
|
+ <charge-station
|
|
|
|
|
+ :title="item.stationName"
|
|
|
|
|
+ :address="item.address"
|
|
|
|
|
+ :price="item.totalFee"
|
|
|
|
|
+ :fast="item.fastEquipmentInfos"
|
|
|
|
|
+ :slow="item.slowEquipmentInfos"
|
|
|
|
|
+ :sId="item.StationID"
|
|
|
|
|
+ :distance="item.stationLatDistance"
|
|
|
|
|
+ :latitude="item.location.stationLat"
|
|
|
|
|
+ :longitude="item.location.stationLng"
|
|
|
|
|
+ :fromMap="true"
|
|
|
|
|
+ ></charge-station>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </block>
|
|
|
|
|
+ <block v-else>
|
|
|
|
|
+ <!-- 单个 -->
|
|
|
|
|
+ <view class="station">
|
|
|
|
|
+ <charge-station
|
|
|
|
|
+ :title="station[markersIndex].stationName"
|
|
|
|
|
+ :address="station[markersIndex].address"
|
|
|
|
|
+ :price="station[markersIndex].totalFee"
|
|
|
|
|
+ :fast="station[markersIndex].fastEquipmentInfos"
|
|
|
|
|
+ :slow="station[markersIndex].slowEquipmentInfos"
|
|
|
|
|
+ :sId="station[markersIndex].StationID"
|
|
|
|
|
+ :distance="station[markersIndex].stationLatDistance"
|
|
|
|
|
+ :latitude="station[markersIndex].location.stationLat"
|
|
|
|
|
+ :longitude="station[markersIndex].location.stationLng"
|
|
|
|
|
+ :fromMap="true"
|
|
|
|
|
+ ></charge-station>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </block>
|
|
|
</block>
|
|
</block>
|
|
|
<block v-else>
|
|
<block v-else>
|
|
|
<view class="card_empty flex-column flex-align-center pt-20">
|
|
<view class="card_empty flex-column flex-align-center pt-20">
|
|
@@ -231,7 +246,8 @@ import { fetchLocation } from "@/utils/location";
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
|
|
|
|
|
|
-// TODO 手势拖动
|
|
|
|
|
|
|
+// TODO 支持省钱充电
|
|
|
|
|
+// TODO 充电中
|
|
|
|
|
|
|
|
const isIOS = ref(false);
|
|
const isIOS = ref(false);
|
|
|
const token = ref<string>();
|
|
const token = ref<string>();
|
|
@@ -240,6 +256,7 @@ const loading = ref(false);
|
|
|
const styleData = ref({
|
|
const styleData = ref({
|
|
|
dialog: "",
|
|
dialog: "",
|
|
|
dialogHeight: 0,
|
|
dialogHeight: 0,
|
|
|
|
|
+ dialogPlaceHolderHeight: 0,
|
|
|
cardHeight: 0,
|
|
cardHeight: 0,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -312,6 +329,7 @@ const stationPage = ref({
|
|
|
});
|
|
});
|
|
|
const station = ref<any[]>([]);
|
|
const station = ref<any[]>([]);
|
|
|
|
|
|
|
|
|
|
+const mapMode = ref(true);
|
|
|
const mapProps = ref({
|
|
const mapProps = ref({
|
|
|
latitude: 23.098994,
|
|
latitude: 23.098994,
|
|
|
longitude: 113.32252,
|
|
longitude: 113.32252,
|
|
@@ -449,20 +467,20 @@ const refresh = () => {
|
|
|
|
|
|
|
|
const handleNavReady = (e: any) => {
|
|
const handleNavReady = (e: any) => {
|
|
|
styleData.value.dialog = `padding-top:${e.detail.statusBarHeight - 6}px;`;
|
|
styleData.value.dialog = `padding-top:${e.detail.statusBarHeight - 6}px;`;
|
|
|
|
|
+ const searchHeight = rpxToPx(88);
|
|
|
|
|
+ const filterHeight = rpxToPx(72);
|
|
|
styleData.value.dialogHeight =
|
|
styleData.value.dialogHeight =
|
|
|
- e.detail.statusBarHeight -
|
|
|
|
|
- 6 +
|
|
|
|
|
- rpxToPx(88) +
|
|
|
|
|
- rpxToPx(72) -
|
|
|
|
|
- e.detail.navigationBarHeight;
|
|
|
|
|
- styleData.value.cardHeight = rpxToPx(402);
|
|
|
|
|
|
|
+ e.detail.statusBarHeight - 6 + searchHeight + filterHeight;
|
|
|
|
|
+ styleData.value.dialogPlaceHolderHeight =
|
|
|
|
|
+ styleData.value.dialogHeight - e.detail.navigationBarHeight;
|
|
|
|
|
+ styleData.value.cardHeight = rpxToPx(410);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const toSearch = () => {
|
|
const toSearch = () => {
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: "/pages-charge/search/search",
|
|
url: "/pages-charge/search/search",
|
|
|
});
|
|
});
|
|
|
-}
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
onLoad((query: any) => {
|
|
onLoad((query: any) => {
|
|
|
// 只为了打包进tab-bar使用
|
|
// 只为了打包进tab-bar使用
|
|
@@ -524,6 +542,9 @@ const checkDiscounts = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const checkFilterDistance = () => {
|
|
const checkFilterDistance = () => {
|
|
|
|
|
+ if (!mapMode.value) {
|
|
|
|
|
+ mapMode.value = true
|
|
|
|
|
+ }
|
|
|
filterDialog.value.distanceSelector = !filterDialog.value.distanceSelector;
|
|
filterDialog.value.distanceSelector = !filterDialog.value.distanceSelector;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -624,6 +645,31 @@ const loginMask = (e: any) => {
|
|
|
login(e);
|
|
login(e);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+let startpageY = 0;
|
|
|
|
|
+const touchCardStart = (e: any) => {
|
|
|
|
|
+ if (loading.value || station.value.length <= 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (e.touches && e.touches.length) {
|
|
|
|
|
+ startpageY = e.touches[0].pageY;
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const touchCardMove = (e: any) => {
|
|
|
|
|
+ if (!startpageY) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const threshold = 150;
|
|
|
|
|
+ if (e.touches && e.touches.length) {
|
|
|
|
|
+ if (mapMode.value && startpageY - e.touches[0].pageY > threshold) {
|
|
|
|
|
+ mapMode.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!mapMode.value && e.touches[0].pageY - startpageY > threshold) {
|
|
|
|
|
+ mapMode.value = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// TORM
|
|
// TORM
|
|
|
// const changeMarker = (e: any) => {
|
|
// const changeMarker = (e: any) => {
|
|
|
// _changeMarker(e.detail.current);
|
|
// _changeMarker(e.detail.current);
|
|
@@ -747,15 +793,14 @@ page {
|
|
|
.card {
|
|
.card {
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- /* max-height: 622rpx; */
|
|
|
|
|
left: 0px;
|
|
left: 0px;
|
|
|
- bottom: 0rpx;
|
|
|
|
|
z-index: 999;
|
|
z-index: 999;
|
|
|
|
|
+ transition: all 0.3s;
|
|
|
box-shadow: 0px 8rpx 20rpx rgba(0, 0, 0, 0.2);
|
|
box-shadow: 0px 8rpx 20rpx rgba(0, 0, 0, 0.2);
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
margin-bottom: constant(safe-area-inset-bottom);
|
|
margin-bottom: constant(safe-area-inset-bottom);
|
|
|
margin-bottom: env(safe-area-inset-bottom);
|
|
margin-bottom: env(safe-area-inset-bottom);
|
|
|
- border-radius: 16rpx 16rpx 0px 0px;
|
|
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
|
|
|
&_location {
|
|
&_location {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -780,5 +825,4 @@ page {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
</style>
|
|
</style>
|