功能:更新消息中心和 YumiNail 模块

This commit is contained in:
xiaowang
2026-05-13 12:43:01 +08:00
parent 6b9eba5aca
commit 2074addc40
284 changed files with 21031 additions and 4533 deletions
@@ -1,110 +1,130 @@
const navigation = require('../../utils/navigation')
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
multipleSlots: true,
},
/**
* 组件的属性列表
*/
properties: {
extClass: {
type: String,
value: ''
value: '',
},
title: {
type: String,
value: ''
value: '',
},
background: {
type: String,
value: ''
value: '',
},
color: {
type: String,
value: ''
value: '',
},
back: {
type: Boolean,
value: true
value: true,
},
showBack: {
type: Boolean,
value: true,
},
isTabPage: {
type: Boolean,
value: false,
},
fallbackPath: {
type: String,
value: '/pages/home/index',
},
loading: {
type: Boolean,
value: false
value: false,
},
homeButton: {
type: Boolean,
value: false,
},
animated: {
// 显示隐藏的时候opacity动画效果
type: Boolean,
value: true
},
show: {
// 显示隐藏导航,隐藏的时候navigation-bar的高度占位还在
type: Boolean,
value: true,
observer: '_showChange'
},
// back为true的时候,返回的页面深度
show: {
type: Boolean,
value: true,
observer: '_showChange',
},
delta: {
type: Number,
value: 1
value: 1,
},
safeAreaMode: {
type: String,
value: 'solid',
},
},
/**
* 组件的初始数据
*/
observers: {
'back, showBack, isTabPage': 'updateResolvedBack',
},
data: {
displayStyle: ''
displayStyle: '',
resolvedShowBack: false,
},
lifetimes: {
attached() {
const rect = wx.getMenuButtonBoundingClientRect()
const platform = (wx.getDeviceInfo() || wx.getSystemInfoSync()).platform
const deviceInfo = (typeof wx.getDeviceInfo === 'function' ? wx.getDeviceInfo() : wx.getSystemInfoSync()) || {}
const windowInfo = (typeof wx.getWindowInfo === 'function' ? wx.getWindowInfo() : wx.getSystemInfoSync()) || {}
const platform = deviceInfo.platform
const isAndroid = platform === 'android'
const isDevtools = platform === 'devtools'
const { windowWidth, safeArea: { top = 0, bottom = 0 } = {} } = wx.getWindowInfo() || wx.getSystemInfoSync()
const safeArea = windowInfo.safeArea || {}
const top = safeArea.top || 0
const windowWidth = windowInfo.windowWidth || deviceInfo.windowWidth || 375
this.setData({
ios: !isAndroid,
innerPaddingRight: `padding-right: ${windowWidth - rect.left}px`,
leftWidth: `width: ${windowWidth - rect.left}px`,
safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${top}px); padding-top: ${top}px` : ``
safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${top}px); padding-top: ${top}px` : '',
})
this.updateResolvedBack()
},
},
/**
* 组件的方法列表
*/
methods: {
updateResolvedBack() {
const resolvedShowBack = !this.data.isTabPage && Boolean(this.data.showBack && this.data.back)
this.setData({
resolvedShowBack,
})
},
_showChange(show) {
const animated = this.data.animated
let displayStyle = ''
if (animated) {
displayStyle = `opacity: ${show ? '1' : '0'
};transition:opacity 0.5s;`
displayStyle = `opacity: ${show ? '1' : '0'};transition:opacity 0.3s;`
} else {
displayStyle = `display: ${show ? '' : 'none'}`
}
this.setData({
displayStyle
displayStyle,
})
},
back() {
const data = this.data
const pages = getCurrentPages()
if (data.delta && pages.length > data.delta) {
if (this.data.delta && pages.length > this.data.delta) {
wx.navigateBack({
delta: data.delta
delta: this.data.delta,
})
return
}
this.triggerEvent('back', { delta: data.delta }, {})
navigation.goBack(this.data.fallbackPath || '/pages/home/index')
},
home() {
wx.switchTab({
url: '/pages/home/index'
url: '/pages/home/index',
})
this.triggerEvent('home', {}, {})
}
},
},
})