|
|
@ -19,9 +19,7 @@ |
|
|
|
<view class="top-section"> |
|
|
|
<text class="welcome-text">{{ title }}</text> |
|
|
|
<view class="qr-code"> |
|
|
|
<view class="qr-icon"> |
|
|
|
<image style="width: 39rpx;height: 39rpx;" src="https://epic.js-dyyj.com/uploads/20250728/ce88153acc92e0e2fca7acaa4ccec5c1.png"></image> |
|
|
|
</view> |
|
|
|
<image style="width: 39rpx;height: 39rpx;" src="https://epic.js-dyyj.com/uploads/20250728/88e0991e58e692c86c25e42537edc6ca.png"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="bottom-section"> |
|
|
@ -70,7 +68,7 @@ export default { |
|
|
|
}, |
|
|
|
title: { |
|
|
|
type: String, |
|
|
|
default: "正在播放音乐", |
|
|
|
default: "用户", |
|
|
|
}, |
|
|
|
subtitle: { |
|
|
|
type: String, |
|
|
@ -92,10 +90,11 @@ export default { |
|
|
|
isScrolled: false, |
|
|
|
scrollThreshold: 160, // 灵动岛大卡片高度(160rpx) |
|
|
|
// 内部数据,减少对外部props的依赖 |
|
|
|
currentTitle: "Hi!杰西卡酱,欢迎回来~", |
|
|
|
currentTitle: "Hi!用户,欢迎回来~", |
|
|
|
currentSubtitle: "2个权益 | 120时间银行", |
|
|
|
currentAvatar: "https://picsum.photos/80/80", |
|
|
|
currentAction: "激活你的Agent", |
|
|
|
userInfo: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -143,6 +142,8 @@ export default { |
|
|
|
this.setStatusBarHeight(); |
|
|
|
// 监听页面滚动 |
|
|
|
this.addScrollListener(); |
|
|
|
// 获取用户信息 |
|
|
|
this.getUserInfo(); |
|
|
|
}, |
|
|
|
beforeDestroy() { |
|
|
|
// 清理滚动监听 |
|
|
@ -199,9 +200,11 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
getCompactName() { |
|
|
|
// 从标题中提取姓名 |
|
|
|
|
|
|
|
return "杰西卡酱"; |
|
|
|
// 从用户信息中获取昵称 |
|
|
|
if (this.userInfo && this.userInfo.nickname) { |
|
|
|
return this.userInfo.nickname; |
|
|
|
} |
|
|
|
return "用户"; |
|
|
|
}, |
|
|
|
getStatNumber(type) { |
|
|
|
// 从副标题中解析统计数据 |
|
|
@ -226,6 +229,19 @@ export default { |
|
|
|
this.statusBarHeight = 0; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取用户信息 |
|
|
|
getUserInfo() { |
|
|
|
try { |
|
|
|
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},欢迎回来~`; |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
console.warn("获取用户信息失败:", e); |
|
|
|
this.userInfo = {}; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
@ -329,9 +345,7 @@ export default { |
|
|
|
.qr-code { |
|
|
|
width: 32rpx; |
|
|
|
height: 32rpx; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.qr-icon { |
|
|
|