feat:增加设置模块

This commit is contained in:
2025-06-23 22:42:01 +08:00
parent e09aed87d1
commit 4956c1822e
14 changed files with 184 additions and 8 deletions

View File

@@ -6,10 +6,17 @@
<script setup lang="ts">
import { useRouter } from 'vue-router'
import { isMobile } from 'vue3-common/utils/layoutUtil'
import { ElMessage } from 'element-plus'
const router = useRouter()
const loginClick = () => {
if (!isMobile()) {
ElMessage.error('暂不支持PC端')
return
}
router.push('/record')
}
</script>

View File

@@ -1,12 +1,37 @@
<template>
<div class="common-mobile-view profile">
个人中心
<div>
<span>版本号</span>
<span>{{ appStore.version }}</span>
</div>
<div class="button-container">
<el-button type="primary" @click="viewLatestVersionClick">检查新版本</el-button>
<el-button type="primary" @click="logoutClick">退出登录</el-button>
</div>
</div>
</template>
<script setup lang="ts">
import { useAppStore } from '@/store/app.ts'
import { useRouter } from 'vue-router'
const appStore = useAppStore()
const router = useRouter()
const viewLatestVersionClick = () => {
location.reload()
}
const logoutClick = () => {
router.push('/')
}
</script>
<style scoped>
<style lang="scss">
.profile {
display: flex;
flex-direction: column;
gap: 10px;
}
</style>

View File

@@ -38,7 +38,7 @@ import FoodTimeline from '@/components/Food/FoodTimeline.vue'
import { Search } from '@element-plus/icons-vue'
import { onMounted, reactive } from 'vue'
import { useFoodStore } from '@/store/food'
import { IFoodSegment } from '@/types/food'
import type { IFoodSegment } from '@/types/food'
const foodStore = useFoodStore()