diff --git a/src/pages/Lineup.tsx b/src/pages/Lineup.tsx index ab6787d..7383cfe 100644 --- a/src/pages/Lineup.tsx +++ b/src/pages/Lineup.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, {useState, useEffect} from "react"; import * as EpicApi from '@/api/index'; const Lineup: React.FC = () => { @@ -32,21 +32,21 @@ const Lineup: React.FC = () => { const availableTags = ["PVP", "PVE", "爆发", "控制", "持续", "防守", "快速"]; const filteredLineups = lineups.filter(lineup => { - const matchesSearch = + const matchesSearch = lineup.battleStrategy.toLowerCase().includes(searchTerm.toLowerCase()) || lineup.defenseHeroes.some(hero => hero.toLowerCase().includes(searchTerm.toLowerCase())) || lineup.attackHeroes.some(hero => hero.toLowerCase().includes(searchTerm.toLowerCase())); - + // 根据阵容的难度进行筛选 - const matchesDifficulty = selectedDifficulty === "All" || + const matchesDifficulty = selectedDifficulty === "All" || (selectedDifficulty === "简单" && lineup.id % 3 === 1) || (selectedDifficulty === "中等" && lineup.id % 3 === 2) || (selectedDifficulty === "困难" && lineup.id % 3 === 0); - + // 根据标签进行筛选 - const matchesTags = selectedTags.length === 0 || + const matchesTags = selectedTags.length === 0 || selectedTags.some(tag => lineup.battleStrategy.toLowerCase().includes(tag.toLowerCase())); - + return matchesSearch && matchesDifficulty && matchesTags; }); @@ -57,13 +57,15 @@ const Lineup: React.FC = () => {
{lineup.equipmentInfo}
{lineup.artifacts}
{lineup.prerequisites}