1
This commit is contained in:
@@ -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">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user