This commit is contained in:
张成
2025-10-01 14:31:46 +08:00
parent 22d8a34c7b
commit ffc8995fc8

View File

@@ -19,6 +19,7 @@ interface MessageItem {
related_user_avatar?: string;
related_user_nickname?: string;
activity_image?: string;
jump_url?: string;
}
// 消息分类类型
@@ -68,7 +69,7 @@ const Message = () => {
});
return;
}
// 点击关注标签跳转到新增关注页面
if (tab === "follow") {
Taro.navigateTo({
@@ -76,14 +77,27 @@ const Message = () => {
});
return;
}
setActiveTab(activeTab === tab ? null : tab);
};
// 处理查看详情
const handleViewDetail = (messageId: string) => {
console.log("查看详情:", messageId);
// TODO: 根据消息类型跳转到对应详情页
const handleViewDetail = (message: MessageItem) => {
if (!message.jump_url) {
console.log("暂无跳转链接");
return;
}
Taro.navigateTo({
url: message.jump_url,
}).catch(() => {
Taro.showToast({
title: "页面不存在",
icon: "none",
duration: 2000,
});
});
};
// 处理滚动到底部
@@ -152,7 +166,7 @@ const Message = () => {
<View className="navbar-left">
<Avatar
className="navbar-avatar"
src={userInfo?.avatar_url }
src={userInfo?.avatar_url}
size="28px"
/>
<Text className="navbar-title"></Text>
@@ -166,9 +180,9 @@ const Message = () => {
className={`tab-item ${activeTab === "comment" ? "active" : ""}`}
onClick={() => handleTabClick("comment")}
>
<Image
className="tab-icon"
src={require('@/static/message/comment-icon.svg')}
<Image
className="tab-icon"
src={require('@/static/message/comment-icon.svg')}
/>
<Text className="tab-text"></Text>
</View>
@@ -176,9 +190,9 @@ const Message = () => {
className={`tab-item ${activeTab === "follow" ? "active" : ""}`}
onClick={() => handleTabClick("follow")}
>
<Image
className="tab-icon"
src={require('@/static/message/follow-icon.svg')}
<Image
className="tab-icon"
src={require('@/static/message/follow-icon.svg')}
/>
<Text className="tab-text"></Text>
</View>
@@ -212,7 +226,7 @@ const Message = () => {
</View>
<View className="card-footer">
<View className="footer-divider"></View>
<View className="footer-action" onClick={() => handleViewDetail(message.id)}>
<View className="footer-action" onClick={() => handleViewDetail(message)}>
<Text className="action-text"></Text>
<View className="action-arrow">