|
|
@ -16,54 +16,75 @@ |
|
|
|
> |
|
|
|
<!-- 展开状态 --> |
|
|
|
<view v-if="!actualCompactState" class="expanded-content"> |
|
|
|
<template v-if="styleType!='timeShop'"> |
|
|
|
<view class="top-section" > |
|
|
|
<text class="welcome-text">{{ title }}</text> |
|
|
|
<view class="qr-code"> |
|
|
|
<image style="width: 39rpx;height: 39rpx;" src="https://epic.js-dyyj.com/uploads/20250728/88e0991e58e692c86c25e42537edc6ca.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="bottom-section"> |
|
|
|
<view class="stats-section"> |
|
|
|
<view class="stat-item"> |
|
|
|
<text class="stat-number">{{ getStatNumber("权益") }}</text> |
|
|
|
<text class="stat-label">权益</text> |
|
|
|
</view> |
|
|
|
<view class="stat-item"> |
|
|
|
<text class="stat-number">{{ getStatNumber("时间银行") }}</text> |
|
|
|
<text class="stat-label">时间银行</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="divider"></view> |
|
|
|
<view class="action-section"> |
|
|
|
<text class="action-text">{{ actionText }}</text> |
|
|
|
<image class="avatar" src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png" mode="aspectFill"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<template v-if="styleType=='timeShop'"> |
|
|
|
<view class="bottom-section"> |
|
|
|
<view class="stats-section"> |
|
|
|
<view class="stat-item"> |
|
|
|
<text class="stat-number">{{ getStatNumber("时间银行") }}</text> |
|
|
|
<text class="stat-label">时间银行</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="divider"></view> |
|
|
|
<view class="action-section"> |
|
|
|
<view class="action-text-box"> |
|
|
|
<view class="action-text-box-des"> |
|
|
|
在努力一点点,为更好的未来蓄力吧! |
|
|
|
</view> |
|
|
|
<view class="action-text-box-msg"> |
|
|
|
<image class="action-text-box-img" :src="showImg('/uploads/20250728/d7ac383902515c9b507c78fdc8d29520.png')"></image> |
|
|
|
今日点赞和留言<text style="font-size: 30rpx;font-weight: bold;margin: 0 10rpx;">100</text>条 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<image class="avatar" src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png" mode="aspectFill"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<template v-if="styleType != 'timeShop'"> |
|
|
|
<view class="top-section"> |
|
|
|
<text class="welcome-text">{{ title }}</text> |
|
|
|
<view class="qr-code"> |
|
|
|
<image |
|
|
|
style="width: 39rpx; height: 39rpx" |
|
|
|
src="https://epic.js-dyyj.com/uploads/20250728/88e0991e58e692c86c25e42537edc6ca.png" |
|
|
|
></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="bottom-section"> |
|
|
|
<view class="stats-section"> |
|
|
|
<view class="stat-item"> |
|
|
|
<text class="stat-number">{{ getStatNumber("权益") }}</text> |
|
|
|
<text class="stat-label">权益</text> |
|
|
|
</view> |
|
|
|
<view class="stat-item"> |
|
|
|
<text class="stat-number">{{ getStatNumber("时间银行") }}</text> |
|
|
|
<text class="stat-label">时间银行</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="divider"></view> |
|
|
|
<view class="action-section"> |
|
|
|
<text class="action-text">{{ actionText }}</text> |
|
|
|
<image |
|
|
|
class="avatar" |
|
|
|
src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png" |
|
|
|
mode="aspectFill" |
|
|
|
></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<template v-if="styleType == 'timeShop'"> |
|
|
|
<view class="bottom-section"> |
|
|
|
<view class="stats-section"> |
|
|
|
<view class="stat-item"> |
|
|
|
<text class="stat-number">{{ getStatNumber("时间银行") }}</text> |
|
|
|
<text class="stat-label">时间银行</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="divider"></view> |
|
|
|
<view class="action-section"> |
|
|
|
<view class="action-text-box"> |
|
|
|
<view class="action-text-box-des"> |
|
|
|
在努力一点点,为更好的未来蓄力吧! |
|
|
|
</view> |
|
|
|
<view class="action-text-box-msg"> |
|
|
|
<image |
|
|
|
class="action-text-box-img" |
|
|
|
:src=" |
|
|
|
showImg( |
|
|
|
'/uploads/20250728/d7ac383902515c9b507c78fdc8d29520.png' |
|
|
|
) |
|
|
|
" |
|
|
|
></image> |
|
|
|
今日点赞和留言<text |
|
|
|
style="font-size: 30rpx; font-weight: bold; margin: 0 10rpx" |
|
|
|
>100</text |
|
|
|
>条 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<image |
|
|
|
class="avatar" |
|
|
|
src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png" |
|
|
|
mode="aspectFill" |
|
|
|
></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 紧凑状态 --> |
|
|
@ -71,7 +92,7 @@ |
|
|
|
<text class="compact-name">{{ getCompactName() }}</text> |
|
|
|
<image |
|
|
|
class="compact-avatar" |
|
|
|
src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png" |
|
|
|
src="https://epic.js-dyyj.com/uploads/20250728/7d9ba1fe109643681396cb03f60f3218.png" |
|
|
|
mode="aspectFill" |
|
|
|
></image> |
|
|
|
</view> |
|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|