瀏覽代碼

给游戏列表添加一个游戏类型字段category_name

zcj03 6 月之前
父節點
當前提交
911b5e5c42
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/components/Card/Card.tsx
  2. 1 1
      src/components/Card/SwiperGroup.tsx

+ 1 - 1
src/components/Card/Card.tsx

@@ -94,7 +94,7 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                         <div className={"flex w-[2.2rem] justify-around"}>
                             {/* 只是pp游戏展示demo试玩按钮 */}
                             {
-                               (item?.game_id + '').startsWith('1') && <Button
+                               item?.category_name === 'PP' && <Button
                                     onClick={() => playGameHandler({...item!, demo: 1})}
                                     className={
                                     "h-[0.39rem] w-[0.89rem] rounded-[0.05rem] text-[0.15rem]" +

+ 1 - 1
src/components/Card/SwiperGroup.tsx

@@ -60,7 +60,7 @@ const HomeSwiper: FC<PropsWithChildren<SwiperGroupProps>> = (props) => {
         .map((_, index) => {
             return {
                 key: index,
-                data: gameList.slice(index * lineNum, index * lineNum + lineNum),
+                data: gameList.slice(index * lineNum, index * lineNum + lineNum).map(subItem => ({ ...subItem, category_name: group.category_name }))
             };
         });
     const prev = () => {