|
@@ -1,5 +1,5 @@
|
|
|
"use client";
|
|
|
-import { getGamesApi } from "@/api/home";
|
|
|
+import { Category, GameListRep, getGamesApi } from "@/api/home";
|
|
|
import Box from "@/components/Box";
|
|
|
import { SwiperGroup } from "@/components/Card";
|
|
|
import { useRouter } from "@/i18n";
|
|
@@ -73,7 +73,7 @@ const Tabs: FC = () => {
|
|
|
</Swiper>
|
|
|
);
|
|
|
};
|
|
|
-const Manufacturer = (props: { data: EntityGameListRep[] }) => {
|
|
|
+const Manufacturer = (props: { data: GameListRep[] }) => {
|
|
|
const { data } = props;
|
|
|
const elements = data.map((item, index) => {
|
|
|
return <img key={index} src={item.game_icon} alt="" />;
|
|
@@ -83,15 +83,16 @@ const Manufacturer = (props: { data: EntityGameListRep[] }) => {
|
|
|
};
|
|
|
|
|
|
const HomeSwiper: FC<PropsWithChildren<Props>> = (props) => {
|
|
|
- const [groupGames, setGroupGames] = useState<EntityHomeRep[]>([]);
|
|
|
+ const [groupGames, setGroupGames] = useState<Category[]>([]);
|
|
|
const router = useRouter();
|
|
|
useEffect(() => {
|
|
|
getGamesApi().then((res) => {
|
|
|
- setGroupGames(res.data);
|
|
|
+ const games = res.data[0];
|
|
|
+ setGroupGames(games.category);
|
|
|
});
|
|
|
}, []);
|
|
|
- return null;
|
|
|
- const todoHandler = (item: EntityCategory) => {
|
|
|
+
|
|
|
+ const todoHandler = (item: Category) => {
|
|
|
router.push(`/gameList/${item.line_config_amount}`);
|
|
|
};
|
|
|
|
|
@@ -101,7 +102,7 @@ const HomeSwiper: FC<PropsWithChildren<Props>> = (props) => {
|
|
|
<Tabs></Tabs>
|
|
|
</Box>
|
|
|
{groupGames.map((group, index) => {
|
|
|
- if (group.to_tal !== 3) {
|
|
|
+ if (group.type !== 2) {
|
|
|
return (
|
|
|
<SwiperGroup
|
|
|
key={index}
|
|
@@ -111,6 +112,7 @@ const HomeSwiper: FC<PropsWithChildren<Props>> = (props) => {
|
|
|
></SwiperGroup>
|
|
|
);
|
|
|
} else {
|
|
|
+ // 厂商
|
|
|
return (
|
|
|
<SwiperGroup
|
|
|
key={index}
|