diff --git a/components/DynamicIsland.vue b/components/DynamicIsland.vue index 068aa26..a480911 100644 --- a/components/DynamicIsland.vue +++ b/components/DynamicIsland.vue @@ -16,54 +16,75 @@ > - - + + @@ -71,7 +92,7 @@ {{ getCompactName() }} @@ -87,7 +108,7 @@ export default { type: Boolean, default: false, }, - styleType: { + styleType: { type: String, default: "", }, @@ -113,9 +134,8 @@ export default { }, // 新增页面标识符,用于区分不同页面的灵动岛实例 pageId: { - type: String, - default: 'default_page' + default: "default_page", }, }, data() { @@ -143,7 +163,7 @@ export default { // 计算固定定位的top值 fixedTopPosition() { // 状态栏高度 + 导航栏高度(40px) + 间距(20px) - return this.statusBarHeight + 40+20 ; + return this.statusBarHeight + 40 + 20; }, // 计算占位区域高度 - 始终保持固定高度,等于灵动岛大卡片高度 placeholderHeight() { @@ -209,7 +229,7 @@ export default { addScrollListener() { // 只监听带页面ID的滚动事件,避免不同页面间的状态冲突 const eventName = `pageScroll_${this.pageId}`; - console.log('DynamicIsland 添加滚动监听:', eventName); + console.log("DynamicIsland 添加滚动监听:", eventName); uni.$on(eventName, this.handlePageScroll); }, // 移除滚动监听 @@ -222,18 +242,9 @@ export default { handlePageScroll(e) { const scrollTop = e.scrollTop || e; const shouldScroll = scrollTop > this.scrollThreshold; - - console.log('DynamicIsland 接收到滚动事件:', { - pageId: this.pageId, - scrollTop, - shouldScroll, - currentIsScrolled: this.isScrolled - }); if (this.isScrolled !== shouldScroll) { this.isScrolled = shouldScroll; - console.log('DynamicIsland 状态切换:', shouldScroll ? '紧凑模式' : '展开模式'); - // 添加触觉反馈 if (uni.vibrateShort) { uni.vibrateShort(); @@ -278,7 +289,11 @@ export default { // 获取用户信息 getUserInfo() { try { - this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {}; + this.userInfo = + (uni.getStorageSync("userInfo") && + JSON.parse(uni.getStorageSync("userInfo"))) || + this.$store.state.user.userInfo || + {}; // 更新标题显示用户昵称 if (this.userInfo && this.userInfo.nickname) { this.currentTitle = `Hi!${this.userInfo.nickname},欢迎回来~`; @@ -321,8 +336,8 @@ export default { -webkit-backdrop-filter: blur(20rpx); border: 1rpx solid rgba(255, 255, 255, 0.1); border-radius: 40rpx; - box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.3), - 0 0 0 1rpx rgba(255, 255, 255, 0.05) inset; + box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.3), + 0 0 0 1rpx rgba(255, 255, 255, 0.05) inset; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; @@ -395,7 +410,6 @@ export default { .qr-code { width: 32rpx; height: 32rpx; - } .qr-icon { @@ -563,22 +577,22 @@ export default { // } // } // } -.action-text-box{ - color: white; - - .action-text-box-des{ - font-size: 20rpx; - } - .action-text-box-msg{ - font-size: 24rpx; - display: flex; - align-items: center; - margin-top: 20rpx; - } - .action-text-box-img{ - width: 57rpx; - height: 46rpx; - margin-right: 10rpx; - } +.action-text-box { + color: white; + + .action-text-box-des { + font-size: 20rpx; + } + .action-text-box-msg { + font-size: 24rpx; + display: flex; + align-items: center; + margin-top: 20rpx; + } + .action-text-box-img { + width: 57rpx; + height: 46rpx; + margin-right: 10rpx; + } } diff --git a/components/WaterfallLayout.vue b/components/WaterfallLayout.vue index 4733d39..1796127 100644 --- a/components/WaterfallLayout.vue +++ b/components/WaterfallLayout.vue @@ -1,49 +1,69 @@