修正得獎資訊團體賽的名稱
This commit is contained in:
@@ -398,7 +398,7 @@ export default function CompetitionPage() {
|
||||
{monthAwards.map((award) => (
|
||||
<Card
|
||||
key={award.id}
|
||||
className="relative overflow-hidden border-0 shadow-lg bg-gradient-to-br from-white to-gray-50 hover:shadow-xl transition-shadow cursor-pointer"
|
||||
className="relative overflow-hidden border-0 shadow-lg bg-gradient-to-br from-white to-gray-50 hover:shadow-xl transition-shadow cursor-pointer h-[320px] flex flex-col"
|
||||
onClick={() => handleShowAwardDetail(award)}
|
||||
>
|
||||
{/* Rank Badge */}
|
||||
@@ -422,7 +422,7 @@ export default function CompetitionPage() {
|
||||
|
||||
<div className="absolute top-4 right-4 text-3xl">{award.icon}</div>
|
||||
|
||||
<CardHeader className="pb-3 pt-12">
|
||||
<CardHeader className="pb-3 pt-12 flex-shrink-0">
|
||||
<div className="space-y-2">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Badge
|
||||
@@ -450,11 +450,33 @@ export default function CompetitionPage() {
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
<CardTitle className="text-lg line-clamp-2">
|
||||
{award.competitionType === "team"
|
||||
? (award.teamName || "團隊名稱")
|
||||
: (award.appName || award.proposalTitle || "應用名稱")
|
||||
}
|
||||
<CardTitle className="text-lg line-clamp-2 min-h-[2.5rem]">
|
||||
{(() => {
|
||||
console.log('🔍 獎項資料:', {
|
||||
id: award.id,
|
||||
competitionType: award.competitionType,
|
||||
teamName: award.teamName,
|
||||
appName: award.appName,
|
||||
proposalTitle: award.proposalTitle,
|
||||
team_name: (award as any).team_name,
|
||||
team_name_from_teams: (award as any).team_name_from_teams
|
||||
});
|
||||
|
||||
// 團體賽優先顯示團隊名稱
|
||||
if (award.competitionType === "team") {
|
||||
// 優先使用從teams表查詢的團隊名稱,其次使用獎項表中的團隊名稱
|
||||
const teamName = (award as any).team_name_from_teams || award.teamName || (award as any).team_name;
|
||||
return teamName || "團隊名稱";
|
||||
}
|
||||
|
||||
// 提案賽顯示提案標題
|
||||
if (award.competitionType === "proposal") {
|
||||
return award.proposalTitle || "提案標題";
|
||||
}
|
||||
|
||||
// 個人賽顯示應用名稱
|
||||
return award.appName || "應用名稱";
|
||||
})()}
|
||||
</CardTitle>
|
||||
<p className="text-sm text-gray-500">by {award.creator}</p>
|
||||
<div className="text-xs text-gray-400">
|
||||
@@ -463,8 +485,8 @@ export default function CompetitionPage() {
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent className="pt-0">
|
||||
<div className="space-y-4">
|
||||
<CardContent className="pt-0 flex-grow flex flex-col justify-between">
|
||||
<div className="space-y-4 flex-grow">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm text-gray-600">
|
||||
{award.competitionType === "proposal"
|
||||
@@ -483,17 +505,17 @@ export default function CompetitionPage() {
|
||||
: award.score}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className="w-full bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
handleShowAwardDetail(award)
|
||||
}}
|
||||
>
|
||||
查看得獎詳情
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className="w-full bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 mt-4"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
handleShowAwardDetail(award)
|
||||
}}
|
||||
>
|
||||
查看得獎詳情
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
))}
|
||||
|
Reference in New Issue
Block a user