- 将应用名称从"喝了么"更改为"干杯日记" - 更新所有相关文件中的品牌标识和描述信息 - 升级HaveADrink依赖包从1.0.3到1.0.4版本 - 在pages.json中新增分享个人资料页面配置 - 重构DrinkCard组件UI,增加装饰背景、酒类图标支持、饮酒感受徽章等功能 - 优化API错误处理逻辑,增加静默模式支持 - 修改白酒类别图标为 urn emoji,黄酒图标为 tea emoji - 添加分享功能按钮并优化页面返回交互体验 - 引入新的工具函数用于获取酒类图标和路径判断 - 更新主题混入、常量定义等基础配置文件 - 调整全局样式和设计令牌以匹配新品牌形象
29 lines
633 B
JavaScript
29 lines
633 B
JavaScript
/* 干杯日记 - 主题混入 (Theme Mixin)
|
|
* 每个页面混入此mixin,自动在onShow时刷新日夜主题
|
|
* 页面根视图需绑定 :class="themeClass"
|
|
*/
|
|
import { getCurrentTheme, applyTheme } from './utils'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
themeClass: 'theme-dark',
|
|
currentTheme: 'dark'
|
|
}
|
|
},
|
|
created() {
|
|
this._refreshTheme()
|
|
},
|
|
onShow() {
|
|
this._refreshTheme()
|
|
},
|
|
methods: {
|
|
_refreshTheme() {
|
|
const theme = getCurrentTheme()
|
|
this.currentTheme = theme
|
|
this.themeClass = theme === 'light' ? 'theme-light' : 'theme-dark'
|
|
applyTheme(theme)
|
|
}
|
|
}
|
|
}
|