游客模式

This commit is contained in:
徐哼唧L
2023-12-06 16:26:45 +08:00
parent 52b8c4503b
commit 97ff3915c0
10 changed files with 603 additions and 405 deletions

View File

@@ -2,7 +2,7 @@
<view>
<view class="footer_box" :class="{ footer_bg: bg }">
<view v-for="(item, index) of navigationList" :key="index" class="footer_item">
<view class="footer_nav_item" @click="onPageJump(item.pagePath)">
<view class="footer_nav_item" @click="onPageJump(item.pagePath,index+1)">
<image v-if="item.pagePath == path" class="footer_nav_item_image footer_nav_item_image_scale"
:src="'/' + item.selectedIconPath" mode="aspectFit"></image>
<image v-else class="footer_nav_item_image" :src="'/' + item.iconPath" mode="aspectFit"></image>
@@ -49,7 +49,7 @@
iconPath: 'static/tab/icon2_n.png',
selectedIconPath: 'static/tab/icon2_y.png',
text: '我的订单'
},
{
pagePath: 'pages/peanut/mine',
@@ -69,11 +69,23 @@
},
//方法
methods: {
onPageJump(url) {
if (this.path !== url) {
uni.switchTab({
url: '/' + url
});
onPageJump(url,num) {
if (uni.getStorageSync("anonymous") == '0000000000' && (num == 2 || num == 3)) {
uni.showToast({
icon: 'none',
title: '请先登录'
})
// setTimeout(() => {
// uni.navigateTo({
// url: "/pages/user/login"
// });
// }, 1000)
} else {
if (this.path !== url) {
uni.switchTab({
url: '/' + url
});
}
}
},
}
@@ -159,10 +171,10 @@
}
}
.footer_item_text_active {
color: #079307;
font-weight: bold;
}
</style>
</style>