refactor(app): 重构应用主题和页面结构
- 移除动态主题切换功能,改为全局统一深色主题 - 实现自定义TabBar组件替换原生tabBar,解决iOS闪白问题 - 创建main容器页面统一管理三个tab页面的生命周期和状态 - 将所有页面的onShow/onHide等生命周期方法迁移到子组件内部 - 更新页面路径从index改为main,并调整路由跳转逻辑 - 移除theme-mixin和相关主题工具函数 - 统一页面背景色设置,优化用户体验一致性
This commit is contained in:
+5
-7
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view :class="themeClass" class="page-container card-page">
|
||||
<view class="page-container card-page">
|
||||
<view class="card-nav" :style="{ paddingTop: (statusBarHeight + 12) + 'px' }">
|
||||
<view class="step-back" @click="goBack">
|
||||
<text class="step-back-arrow">‹</text>
|
||||
@@ -42,12 +42,10 @@ import DrinkCard from '../../components/DrinkCard.vue'
|
||||
import client from '../../common/api'
|
||||
import { calcStandardCups, unitToMl } from '../../common/utils'
|
||||
import { DRINK_CATEGORIES, FOOD_CATEGORIES, DRINK_QUOTES, FEELINGS } from '../../common/constants'
|
||||
import themeMixin from '../../common/theme-mixin'
|
||||
|
||||
const UNIT_NAMES = { ml: 'ml', liang: '两', bottle: '瓶', cup: '杯', can: '听', shot: 'shot' }
|
||||
|
||||
export default {
|
||||
mixins: [themeMixin],
|
||||
components: { DrinkCard },
|
||||
data() {
|
||||
const sysInfo = uni.getSystemInfoSync()
|
||||
@@ -761,7 +759,7 @@ export default {
|
||||
})
|
||||
},
|
||||
closeToHome() {
|
||||
uni.switchTab({ url: '/pages/index/index' })
|
||||
uni.reLaunch({ url: '/pages/main/main?tab=0' })
|
||||
},
|
||||
_doBack() {
|
||||
console.log('_doBack called, pages:', getCurrentPages().length)
|
||||
@@ -769,12 +767,12 @@ export default {
|
||||
uni.navigateBack({
|
||||
fail: (err) => {
|
||||
console.error('navigateBack fail:', err)
|
||||
uni.reLaunch({ url: '/pages/index/index' })
|
||||
uni.reLaunch({ url: '/pages/main/main?tab=0' })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('no pages to go back to, reLaunch to index')
|
||||
uni.reLaunch({ url: '/pages/index/index' })
|
||||
uni.reLaunch({ url: '/pages/main/main?tab=0' })
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -788,7 +786,7 @@ export default {
|
||||
: '今晚的酒局记录 - 碰盏日记'
|
||||
return {
|
||||
title,
|
||||
path: '/pages/index/index',
|
||||
path: '/pages/main/main?tab=0',
|
||||
imageUrl: this.posterPath || undefined
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user