소스 검색

个人中心

alexcdev1 5 달 전
부모
커밋
33a5d6a68b
2개의 변경된 파일105개의 추가작업 그리고 57개의 파일을 삭제
  1. 1 1
      src/app/page.js
  2. 104 56
      src/app/personal-center/page.jsx

+ 1 - 1
src/app/page.js

@@ -37,7 +37,7 @@ export default function Home() {
                 height={75}
                 // className="mr-2"
               />
-              <span className="text-lg font-bold">智博体育</span>
+              {/* <span className="text-lg font-bold">智博体育</span> */}
             </div>
 
             {/* User Info or Login Button */}

+ 104 - 56
src/app/personal-center/page.jsx

@@ -189,73 +189,121 @@ const PersonalCenter = () => {
             {predictions.map((prediction) => (
               <div
                 key={prediction.id}
-                className="mb-2 border-b border-gray-200 hover:bg-gray-50 transition duration-150 ease-in-out"
+                className="mb-4 border-b border-gray-200 pb-4 hover:bg-gray-50 transition duration-150 ease-in-out"
               >
                 <p className="font-bold text-lg text-blue-700 mb-2">
                   {prediction.matchInfo}
                 </p>
-                <p className=" text-gray-600 mb-2">
-                  比赛时间:{" "}
+                <p className="text-gray-600 mb-2">
+                  比赛时间{" "}
                   <span className="font-medium text-black">
                     {prediction.matchTime}
                   </span>
                 </p>
-                <p className="mb-1">
-                  胜负预测:
-                  <span
-                    className={`font-medium ${
-                      prediction.whoWillWin === "home"
-                        ? "text-red-600"
+                <div className="grid grid-cols-2 gap-2">
+                  <p className="mb-1">
+                    胜负预测:{" "}
+                    <span
+                      className={`font-medium ${
+                        prediction.whoWillWin === "home"
+                          ? "text-red-600"
+                          : prediction.whoWillWin === "away"
+                          ? "text-green-600"
+                          : "text-yellow-600"
+                      }`}
+                    >
+                      {prediction.whoWillWin === "home"
+                        ? "主胜"
                         : prediction.whoWillWin === "away"
-                        ? "text-green-600"
-                        : "text-yellow-600"
-                    }`}
-                  >
-                    {prediction.whoWillWin === "home"
-                      ? "主胜"
-                      : prediction.whoWillWin === "away"
-                      ? "客胜"
-                      : "平局"}
-                  </span>
-                </p>
-                <p className="mb-1">
-                  首先得分:
-                  <span
-                    className={`font-medium ${
-                      prediction.firstTeamToScore === "home"
-                        ? "text-red-600"
+                        ? "客胜"
+                        : "平局"}
+                    </span>
+                  </p>
+                  <p className="mb-1">
+                    结果:{" "}
+                    <span
+                      className={`font-medium ${
+                        prediction.whoWillWinResult === "correct"
+                          ? "text-green-600"
+                          : prediction.whoWillWinResult === "incorrect"
+                          ? "text-red-600"
+                          : "text-gray-600"
+                      }`}
+                    >
+                      {prediction.whoWillWinResult === "correct"
+                        ? "正确"
+                        : prediction.whoWillWinResult === "incorrect"
+                        ? "错误"
+                        : "待定"}
+                    </span>
+                  </p>
+                  <p className="mb-1">
+                    首先得分:{" "}
+                    <span
+                      className={`font-medium ${
+                        prediction.firstTeamToScore === "home"
+                          ? "text-red-600"
+                          : prediction.firstTeamToScore === "away"
+                          ? "text-green-600"
+                          : "text-gray-600"
+                      }`}
+                    >
+                      {prediction.firstTeamToScore === "home"
+                        ? "主队"
                         : prediction.firstTeamToScore === "away"
-                        ? "text-green-600"
-                        : "text-gray-600"
-                    }`}
-                  >
-                    {prediction.firstTeamToScore === "home"
-                      ? "主队"
-                      : prediction.firstTeamToScore === "away"
-                      ? "客队"
-                      : "无进球"}
-                  </span>
-                </p>
-                <p className="mb-1">
-                  总进球数预测:{" "}
-                  <span className="font-medium text-purple-600">
-                    {prediction.totalGoals}
-                  </span>
-                </p>
-                <p className="mb-1">
-                  获得积分:{" "}
+                        ? "客队"
+                        : "无进球"}
+                    </span>
+                  </p>
+                  <p className="mb-1">
+                    结果:{" "}
+                    <span
+                      className={`font-medium ${
+                        prediction.firstTeamToScoreResult === "correct"
+                          ? "text-green-600"
+                          : prediction.firstTeamToScoreResult === "incorrect"
+                          ? "text-red-600"
+                          : "text-gray-600"
+                      }`}
+                    >
+                      {prediction.firstTeamToScoreResult === "correct"
+                        ? "正确"
+                        : prediction.firstTeamToScoreResult === "incorrect"
+                        ? "错误"
+                        : "待定"}
+                    </span>
+                  </p>
+                  <p className="mb-1">
+                    总进球数预测:{" "}
+                    <span className="font-medium text-purple-600">
+                      {prediction.totalGoals}
+                    </span>
+                  </p>
+                  <p className="mb-1">
+                    结果:{" "}
+                    <span
+                      className={`font-medium ${
+                        prediction.totalGoalsResult === "correct"
+                          ? "text-green-600"
+                          : prediction.totalGoalsResult === "incorrect"
+                          ? "text-red-600"
+                          : "text-gray-600"
+                      }`}
+                    >
+                      {prediction.totalGoalsResult === "correct"
+                        ? "正确"
+                        : prediction.totalGoalsResult === "incorrect"
+                        ? "错误"
+                        : "待定"}
+                    </span>
+                  </p>
+                </div>
+                <p className="mt-2">
+                  获得积分:{" "}
                   <span className="font-medium text-orange-600">
-                    {prediction.pointsEarned}
-                  </span>
-                </p>
-                <p>
-                  预测结果:
-                  <span
-                    className={`font-medium ${
-                      prediction.isCorrect ? "text-green-600" : "text-red-600"
-                    }`}
-                  >
-                    {prediction.isCorrect ? "正确" : "错误"}
+                    {prediction.pointsEarned !== null
+                      ? prediction.pointsEarned
+                      : "待定"}
                   </span>
                 </p>
               </div>