|
|
@@ -41,8 +41,13 @@
|
|
|
</view>
|
|
|
<!-- 站点清单 end-->
|
|
|
|
|
|
-<!-- <login-bar class="w100 text-center loginbar"></login-bar>-->
|
|
|
- <tab-bar :index="0" style="height: 110rpx;"></tab-bar>
|
|
|
+<!-- <cover-view class="login_bar">
|
|
|
+ <login-bar class="w100 text-center"></login-bar>
|
|
|
+ </cover-view>-->
|
|
|
+ <cover-view class="login_bar" v-if="!isLogin">
|
|
|
+ <login-bar class="w100 text-center"></login-bar>
|
|
|
+ </cover-view>
|
|
|
+ <tab-bar :index="0" ></tab-bar>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -54,9 +59,10 @@ import LoginBar from "@/components/login-bar/index.vue";
|
|
|
import WashStation from "@/components/station/index.vue"
|
|
|
import {get, post} from "@/utils/https";
|
|
|
import {calcMapDistance} from "@/utils/common"
|
|
|
+import {checkLogin} from "@/utils/auth";
|
|
|
|
|
|
const title = ref('Hello')
|
|
|
-const qrcode_ref = ref()
|
|
|
+const isLogin = ref(false)
|
|
|
|
|
|
const change = () => {
|
|
|
console.log("change")
|
|
|
@@ -110,12 +116,15 @@ onLoad((e: any) => {
|
|
|
})
|
|
|
|
|
|
onShow(() => {
|
|
|
- let gd = getApp<any>().globalData;
|
|
|
- if (!gd.token) {
|
|
|
- console.log(gd)
|
|
|
+ const userData = getApp<any>().globalData.user;
|
|
|
+ if (userData&&userData.id) {
|
|
|
+ isLogin.value = true;
|
|
|
}
|
|
|
+ console.log("show index>>>>",isLogin.value)
|
|
|
loadCurrentLocation();
|
|
|
-
|
|
|
+ uni.$on('loginEvent', function (data) {
|
|
|
+ isLogin.value = data.isLogin;
|
|
|
+ })
|
|
|
|
|
|
});
|
|
|
|
|
|
@@ -123,16 +132,18 @@ onHide(() => {
|
|
|
Object.assign(state, initState());
|
|
|
})
|
|
|
|
|
|
-const handleMenuClick = (menu:any) => {
|
|
|
- if(menu.title==='洗车'){
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages-wash/scan/index'
|
|
|
- })
|
|
|
- }else if(menu.title==='充值'){
|
|
|
- uni.navigateTo({
|
|
|
- url:'/pages-user/wallet/recharge'
|
|
|
- })
|
|
|
- }
|
|
|
+const handleMenuClick = (menu:any) => {
|
|
|
+ checkLogin().then((res)=>{
|
|
|
+ if(menu.title==='洗车'){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages-wash/scan/index'
|
|
|
+ })
|
|
|
+ }else if(menu.title==='充值'){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages-user/wallet/recharge'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/**
|