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;
}
// 消息分类类型
@@ -81,9 +82,22 @@ const Message = () => {
};
// 处理查看详情
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>
@@ -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">