setIsDropdownOpen(!isDropdownOpen)}
- >
-
- {selectedHeroes.length > 0 ? (
- selectedHeroes.map((hero) => (
-
+
+ {/* 图片上传区域 */}
+
+
+
+
+
- ))
- ) : (
-
选择防守英雄(最多3个)
- )}
+ 上传图片
+
+
+ 或直接粘贴图片 (Ctrl+V),请参考右侧图片示例
+
+
+
-
- ▼
-
-
-
-
- 搜索
-
-
- 重置
-
-
- {isDropdownOpen && (
-
-
-
setSearchInput(e.target.value)}
- placeholder="输入英雄名称或昵称搜索..."
- className="w-full px-3 py-2 bg-[#1A1412] text-[#E6B17E] border border-[#C17F59]/30 rounded-md focus:outline-none focus:border-[#C17F59]"
- onClick={(e) => e.stopPropagation()}
+ {/* 第一组搜索 */}
+
+
防守阵容 1
+ {renderHeroSearch(1)}
+
+
+ {/* 第二组搜索 */}
+
+
防守阵容 2
+ {renderHeroSearch(2)}
+
+
+
+ {/* 图片预览区域 */}
+ {previewImage && (
+
+
上传图片预览
+
+
- {filteredHeroes.map((hero) => (
-
h.id === hero.id)
- ? "bg-[#2A211E] text-[#E6B17E]"
- : "text-[#E6B17E] hover:bg-[#2A211E]"
- } ${selectedHeroes.length >= 3 && !selectedHeroes.find(h => h.id === hero.id) ? "opacity-50 cursor-not-allowed" : ""}`}
- onClick={() => {
- if (selectedHeroes.length < 3 || selectedHeroes.find(h => h.id === hero.id)) {
- handleHeroSelect(hero);
- }
- }}
- >
-
-

-
{hero.heroName}
- {hero.nickName && (
-
({hero.nickName})
- )}
-
-
- ))}
+ {/* 示例图片提示 */}
+ {previewImage === '/tt.png'}
)}
{/* 加载状态 */}
- {loading && (
+ {(loading || isUploading) && (
@@ -225,82 +366,92 @@ const Lineup: React.FC = () => {
{/* 阵容列表 */}
{!loading && (
- {lineups.map((lineup) => (
-
-
-
- {/* 防守阵容 */}
-
-
防守阵容
-
- {lineup.defenseHeroInfos.map((hero, index) => (
-
-

-
- {hero.heroName}
+ {lineups.length > 0 ? (
+ lineups.map((lineup) => (
+
+
+
+ {/* 防守阵容 */}
+
+
防守阵容
+
+ {lineup.defenseHeroInfos.map((hero, index) => (
+
+

+
+ {hero.heroName}
+
-
- ))}
+ ))}
+
+
+
+ {/* 进攻阵容 */}
+
+
进攻阵容
+
+ {lineup.attackHeroInfos.map((hero, index) => (
+
+

+
+ {hero.heroName}
+
+
+ ))}
+
- {/* 进攻阵容 */}
-
-
进攻阵容
-
- {lineup.attackHeroInfos.map((hero, index) => (
-
-

-
- {hero.heroName}
-
-
- ))}
+
+ {/* 装备信息 */}
+
+
装备信息
+
{lineup.equipmentInfo.replace(/[^\S\n]/g, '')}
+
+
+ {/* 神器信息 */}
+
+
神器信息
+
{lineup.artifacts.replace(/[^\S\n]/g, '')}
-
-
- {/* 装备信息 */}
-
-
装备信息
-
{lineup.equipmentInfo.replace(/[^\S\n]/g, '')}
-
+
+ {/* 前置条件 */}
+
+
前置条件
+
{lineup.prerequisites.replace(/[^\S\n]/g, '')}
+
- {/* 神器信息 */}
-
-
神器信息
-
{lineup.artifacts.replace(/[^\S\n]/g, '')}
-
-
-
-
- {/* 前置条件 */}
-
-
前置条件
-
{lineup.prerequisites.replace(/[^\S\n]/g, '')}
-
-
- {/* 重要提示 */}
-
-
重要提示
-
{lineup.importantNotes.replace(/[^\S\n]/g, '')}
+ {/* 重要提示 */}
+
+
重要提示
+
{lineup.importantNotes.replace(/[^\S\n]/g, '')}
+
+ ))
+ ) : (
+
+
+
暂无对战阵容信息
+
请尝试其他英雄组合
- ))}
+ )}
)}