功能完善
This commit is contained in:
@@ -4,6 +4,13 @@ import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
|
||||
const props = defineProps({
|
||||
signin: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
const tabs = [
|
||||
{ image: "../static/tab-vip.png" },
|
||||
{ image: "../static/tab-grow.png" },
|
||||
@@ -11,12 +18,7 @@ const tabs = [
|
||||
];
|
||||
|
||||
function handleTabClick(index) {
|
||||
if (!user.value.id) {
|
||||
return uni.showToast({
|
||||
title: "还未登录",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
if (!user.value.id) return props.signin();
|
||||
if (index === 1) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/my-growth",
|
||||
|
||||
Reference in New Issue
Block a user