完成首页UI

This commit is contained in:
kron
2026-01-13 11:35:36 +08:00
parent a05ed12541
commit f6f5793e41
18 changed files with 862 additions and 7 deletions

View File

@@ -1,11 +1,19 @@
<script setup>
import { ref } from "vue";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const { user } = storeToRefs(useStore());
const props = defineProps({
selected: {
type: Number,
default: 0,
},
onSignin: {
type: Function,
default: () => {},
},
onChange: {
type: Function,
default: () => {},
@@ -32,6 +40,10 @@ const onTabChange = (index) => {
});
}
if (index === 4) {
if (!user.value.id) {
props.onSignin();
return;
}
return uni.navigateTo({
url: "/pages/user",
});
@@ -39,7 +51,9 @@ const onTabChange = (index) => {
// props.onChange(index);
};
const getTabSrc = (key, index) => {
return `../static/tab-${tabs[key]}${props.selected === index ? "" : "-o"}.png`;
return `../static/tab-${tabs[key]}${
props.selected === index ? "" : "-o"
}.png`;
};
</script>