diff --git a/src/components/RankListMini.vue b/src/components/RankListMini.vue index 2a93631..fea3b18 100644 --- a/src/components/RankListMini.vue +++ b/src/components/RankListMini.vue @@ -187,9 +187,15 @@ const props = defineProps({ const clickItem = ref({}); function goDetail(item) { clickItem.value = item; - uni.navigateTo({ - url: `/pages/detail/indexNewsInfo?id=${item.news_id}`, - }); + if (uni.getStorageSync("token")) { + uni.navigateTo({ + url: `/pages/detail/indexNewsInfo?id=${item.news_id}`, + }); + } else { + uni.navigateTo({ + url: "/pages/login/indexMini", + }); + } // if (uni.getStorageSync("token")) { // clickItem.value = item; diff --git a/src/components/mine.vue b/src/components/mine.vue index e0d23b1..8788d69 100644 --- a/src/components/mine.vue +++ b/src/components/mine.vue @@ -2,7 +2,10 @@ - + {{ !isLoginStatus @@ -33,30 +36,53 @@ - + }" + @click="handleClick(-1)" + > - + }" + @click="handleClick(0)" + > - + }" + @click="handleClick(1)" + > - + }" + @click="handleClick(2)" + > - - @@ -83,8 +107,12 @@ - + @@ -151,7 +179,6 @@ const loginOut = () => { uni.reLaunch({ url: "/pages/login/index", }); - }; const handleClick = (val: number) => { diff --git a/src/components/mineMini.vue b/src/components/mineMini.vue index 1771326..068aa17 100644 --- a/src/components/mineMini.vue +++ b/src/components/mineMini.vue @@ -3,7 +3,10 @@ - + {{ !isLoginStatus ? "未登录用户" : maskPhoneNumber() @@ -38,24 +41,41 @@ color: '#333333', }" @click="handleClick(-1)"> --> - + }" + @click="handleClick(0)" + > - + }" + @click="handleClick(1)" + > - + }" + @click="handleClick(2)" + > - - + }" + @click="handleClick(3)" + > @@ -88,8 +112,12 @@ - + @@ -99,9 +127,9 @@ import { onPullDownRefresh, onShow } from "@dcloudio/uni-app"; import { Session } from "@/utils/storage"; import LoginPopup from "@/components/loginPopup/index.vue"; import { useShareStore } from "@/stores/shareStore"; -import Navbar from '@/components/mini/Navbar.vue' +import Navbar from "@/components/mini/Navbar.vue"; -const emit = defineEmits(['logout']) +const emit = defineEmits(["logout"]); const stores = useShareStore(); const curPages = getCurrentPages(); @@ -161,23 +189,23 @@ const loginBtnStatus = () => { // 退出登录,回到登录页面 const loginOut = () => { - uni.clearStorageSync() - emit("logout") + uni.clearStorageSync(); + emit("logout"); }; const handleClick = (val: number) => { + uni.setStorageSync("homeTabIndex", 1); if (val === -1) { uni.navigateTo({ url: "/pages/subscribed/index", }); } else if (val === 3) { wx.openPrivacyContract({ - success: () => { }, // 打开成功 - fail: () => { }, // 打开失败 - complete: () => { }, + success: () => {}, // 打开成功 + fail: () => {}, // 打开失败 + complete: () => {}, }); - } - else { + } else { uni.navigateTo({ url: `/pages/bookmark/index?tabs=${val}`, }); diff --git a/src/components/mini/Tabbar.vue b/src/components/mini/Tabbar.vue index 47982ed..c6cea0c 100644 --- a/src/components/mini/Tabbar.vue +++ b/src/components/mini/Tabbar.vue @@ -33,7 +33,7 @@ 全部 + >我的 diff --git a/src/pages/detail/indexNewsInfo.vue b/src/pages/detail/indexNewsInfo.vue index be76770..e671ced 100644 --- a/src/pages/detail/indexNewsInfo.vue +++ b/src/pages/detail/indexNewsInfo.vue @@ -76,7 +76,12 @@