|
|
@@ -36,7 +36,7 @@
|
|
|
<template v-if="isLogin">
|
|
|
<WashStation v-for="item in state.stationList" :key="item.id" :item="item"></WashStation>
|
|
|
</template>
|
|
|
- <uv-empty v-else mode="order" text="请先登录" :marginTop="100"></uv-empty>
|
|
|
+ <uv-empty v-else mode="order" text="请先登录" :marginTop="100" @click="gotoLogin"></uv-empty>
|
|
|
</view>
|
|
|
<!--
|
|
|
<movable-area class="mov-area">
|
|
|
@@ -182,6 +182,7 @@ onShow(() => {
|
|
|
isLogin.value = true;
|
|
|
}).catch(e => {
|
|
|
console.error(e)
|
|
|
+ gotoLogin()
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -192,11 +193,14 @@ onShow(() => {
|
|
|
|
|
|
console.log("show index>>>>", isLogin.value, state.stationList, state.location)
|
|
|
let locationData = getApp<any>().globalData.location;
|
|
|
- if (!locationData || !locationData.longitude) {
|
|
|
- loadCurrentLocation();
|
|
|
- } else {
|
|
|
- state.location = locationData;
|
|
|
- loadWashStationList();
|
|
|
+ if(isLogin.value) {
|
|
|
+ if (!locationData || !locationData.longitude) {
|
|
|
+ loadCurrentLocation();
|
|
|
+ } else {
|
|
|
+ state.location = locationData;
|
|
|
+ loadWashStationList();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
loadBannerList();
|
|
|
@@ -251,6 +255,13 @@ const handleBannerClick = (index: number) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const gotoLogin = () => {
|
|
|
+ console.log("gotoLogin");
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages-user/login/index'
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
const handleMenuClick = (menu: any) => {
|
|
|
let {auth,name} = menu;
|
|
|
if(auth){
|