1
This commit is contained in:
@@ -19,6 +19,7 @@ interface MessageItem {
|
|||||||
related_user_avatar?: string;
|
related_user_avatar?: string;
|
||||||
related_user_nickname?: string;
|
related_user_nickname?: string;
|
||||||
activity_image?: string;
|
activity_image?: string;
|
||||||
|
jump_url?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 消息分类类型
|
// 消息分类类型
|
||||||
@@ -68,7 +69,7 @@ const Message = () => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 点击关注标签跳转到新增关注页面
|
// 点击关注标签跳转到新增关注页面
|
||||||
if (tab === "follow") {
|
if (tab === "follow") {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
@@ -76,14 +77,27 @@ const Message = () => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setActiveTab(activeTab === tab ? null : tab);
|
setActiveTab(activeTab === tab ? null : tab);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理查看详情
|
// 处理查看详情
|
||||||
const handleViewDetail = (messageId: string) => {
|
const handleViewDetail = (message: MessageItem) => {
|
||||||
console.log("查看详情:", messageId);
|
|
||||||
// TODO: 根据消息类型跳转到对应详情页
|
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">
|
<View className="navbar-left">
|
||||||
<Avatar
|
<Avatar
|
||||||
className="navbar-avatar"
|
className="navbar-avatar"
|
||||||
src={userInfo?.avatar_url }
|
src={userInfo?.avatar_url}
|
||||||
size="28px"
|
size="28px"
|
||||||
/>
|
/>
|
||||||
<Text className="navbar-title">消息</Text>
|
<Text className="navbar-title">消息</Text>
|
||||||
@@ -166,9 +180,9 @@ const Message = () => {
|
|||||||
className={`tab-item ${activeTab === "comment" ? "active" : ""}`}
|
className={`tab-item ${activeTab === "comment" ? "active" : ""}`}
|
||||||
onClick={() => handleTabClick("comment")}
|
onClick={() => handleTabClick("comment")}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
className="tab-icon"
|
className="tab-icon"
|
||||||
src={require('@/static/message/comment-icon.svg')}
|
src={require('@/static/message/comment-icon.svg')}
|
||||||
/>
|
/>
|
||||||
<Text className="tab-text">评论和回复</Text>
|
<Text className="tab-text">评论和回复</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -176,9 +190,9 @@ const Message = () => {
|
|||||||
className={`tab-item ${activeTab === "follow" ? "active" : ""}`}
|
className={`tab-item ${activeTab === "follow" ? "active" : ""}`}
|
||||||
onClick={() => handleTabClick("follow")}
|
onClick={() => handleTabClick("follow")}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
className="tab-icon"
|
className="tab-icon"
|
||||||
src={require('@/static/message/follow-icon.svg')}
|
src={require('@/static/message/follow-icon.svg')}
|
||||||
/>
|
/>
|
||||||
<Text className="tab-text">新增关注</Text>
|
<Text className="tab-text">新增关注</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -212,7 +226,7 @@ const Message = () => {
|
|||||||
</View>
|
</View>
|
||||||
<View className="card-footer">
|
<View className="card-footer">
|
||||||
<View className="footer-divider"></View>
|
<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>
|
<Text className="action-text">查看详情</Text>
|
||||||
<View className="action-arrow">
|
<View className="action-arrow">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user