fix
This commit is contained in:
@@ -3,19 +3,19 @@
|
||||
<div class="app-root">
|
||||
<RouterView />
|
||||
<van-tabbar v-model="active" v-show="showTabbar">
|
||||
<van-tabbar-item icon="notes" to="/calendar">
|
||||
<van-tabbar-item name="ccalendar" icon="notes" to="/calendar">
|
||||
日历
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="chart-trending-o" to="/statistics">
|
||||
<van-tabbar-item name="statistics" icon="chart-trending-o" to="/statistics">
|
||||
统计
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="balance-list" to="/" @click="handleTabClick('/')">
|
||||
<van-tabbar-item name="balance" icon="balance-list" to="/" @click="handleTabClick('/')">
|
||||
账单
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="records" to="/email" @click="handleTabClick('/email')">
|
||||
<van-tabbar-item name="email" icon="records" to="/email" @click="handleTabClick('/email')">
|
||||
邮件
|
||||
</van-tabbar-item>
|
||||
<van-tabbar-item icon="setting" to="/setting">
|
||||
<van-tabbar-item name="setting" icon="setting" to="/setting">
|
||||
设置
|
||||
</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<script setup>
|
||||
import { RouterView, useRoute } from 'vue-router'
|
||||
import { ref, onMounted, onUnmounted, computed } from 'vue'
|
||||
import { ref, onMounted, onUnmounted, computed, watch } from 'vue'
|
||||
import '@/styles/common.css'
|
||||
|
||||
const updateVh = () => {
|
||||
@@ -61,7 +61,7 @@ const showTabbar = computed(() => {
|
||||
route.path === '/statistics'
|
||||
})
|
||||
|
||||
const active = ref(0)
|
||||
const active = ref('')
|
||||
const theme = ref('light')
|
||||
|
||||
// 检测系统深色模式
|
||||
@@ -76,8 +76,32 @@ onMounted(() => {
|
||||
updateTheme()
|
||||
mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
mediaQuery.addEventListener('change', updateTheme)
|
||||
setActive(route.path)
|
||||
})
|
||||
|
||||
// 监听路由变化调整
|
||||
watch(() => route.path, (newPath) => {
|
||||
setActive(newPath)
|
||||
})
|
||||
|
||||
const setActive = (path) => {
|
||||
active.value = (() => {
|
||||
switch (path) {
|
||||
case '/calendar':
|
||||
return 'ccalendar'
|
||||
case '/statistics':
|
||||
return 'statistics'
|
||||
case '/email':
|
||||
return 'email'
|
||||
case '/setting':
|
||||
return 'setting'
|
||||
default:
|
||||
return 'balance'
|
||||
}
|
||||
})()
|
||||
console.log(active.value, path)
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
if (mediaQuery) {
|
||||
mediaQuery.removeEventListener('change', updateTheme)
|
||||
|
||||
@@ -152,3 +152,12 @@
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/* 账单列表滚动容器 */
|
||||
.bills-scroll-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<p v-if="dateTransactions.length">共 {{ dateTransactions.length }} 笔交易</p>
|
||||
</div>
|
||||
|
||||
<div class="bills-scroll-container">
|
||||
<TransactionList
|
||||
:transactions="dateTransactions"
|
||||
:loading="listLoading"
|
||||
@@ -33,6 +34,7 @@
|
||||
@click="viewDetail"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
<!-- 交易详情组件 -->
|
||||
|
||||
@@ -141,13 +141,15 @@
|
||||
<div class="list-header">
|
||||
<h3 style="margin: 16px;">关联账单列表</h3>
|
||||
</div>
|
||||
<TransactionList
|
||||
:transactions="transactionList"
|
||||
:loading="false"
|
||||
:finished="true"
|
||||
:show-delete="false"
|
||||
@click="handleTransactionClick"
|
||||
/>
|
||||
<div class="bills-scroll-container">
|
||||
<TransactionList
|
||||
:transactions="transactionList"
|
||||
:loading="false"
|
||||
:finished="true"
|
||||
:show-delete="false"
|
||||
@click="handleTransactionClick"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
@@ -434,7 +436,13 @@ onMounted(() => {
|
||||
|
||||
.transaction-list-popup {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.list-header{
|
||||
padding: 16px;
|
||||
border-bottom: 1px solid #ebedf0;
|
||||
}
|
||||
|
||||
.email-content {
|
||||
|
||||
@@ -562,7 +562,7 @@ const goToAnalysis = () => {
|
||||
|
||||
// 打开分类账单列表
|
||||
const goToCategoryBills = (classify, type) => {
|
||||
selectedClassify.value = classify || ''
|
||||
selectedClassify.value = classify || '未分类'
|
||||
selectedType.value = type
|
||||
selectedCategoryTitle.value = `${classify || '未分类'} - ${type === 0 ? '支出' : '收入'}`
|
||||
|
||||
@@ -1076,14 +1076,6 @@ onActivated(() => {
|
||||
color: var(--van-text-color-2);
|
||||
}
|
||||
|
||||
/* 账单列表滚动容器 */
|
||||
.bills-scroll-container {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* 修复深色模式下van组件的背景色 */
|
||||
.category-bills :deep(.van-list) {
|
||||
background: transparent;
|
||||
|
||||
Reference in New Issue
Block a user