zhejiushizhuce 2 rokov pred
rodič
commit
18b47e5d5d

+ 2 - 2
src/components/GameList/index.jsx

@@ -194,7 +194,7 @@ const GameList=({data,status,reqMore,user})=>{
                     {
                         list.map((item, index) => {
                             let gridNum=item.gridNum!=null?item.gridNum:1;
-                            gridNum=Math.floor(Math.random()*3)+1;
+                            // gridNum=Math.floor(Math.random()*3)+1;
                             let whStyle=gridInfo[gridNum];
                             if (whStyle==null)return (<></>);
                             return (
@@ -278,7 +278,7 @@ const GameList=({data,status,reqMore,user})=>{
                                                 }
                                             }
                                             let gridNum=item.gridNum!=null?item.gridNum:1;
-                                            gridNum=Math.floor(Math.random()*3)+1;
+                                            // gridNum=Math.floor(Math.random()*3)+1;
                                             let whStyle=gridInfo[gridNum];
                                             return (
                                                 <GameItem key={col} data={item} handleRoom={(e,data)=>{

+ 7 - 7
src/components/GameSmallList/index.jsx

@@ -126,6 +126,7 @@ const GameSmallList=({data,user})=>{
             let gap=0;
             if (gridList.children&&gridList.children.length>0){
                 let first=gridList.children[0];
+                if (first&&first.children.length>0)first=first.children[0];
                 let cB=rect.top+first.clientHeight;
                 let cH = document.documentElement.clientHeight;
                 if (cH-cB>90){
@@ -308,7 +309,7 @@ const GameSmallList=({data,user})=>{
                     {
                         list.map((item, index) => {
                             let gridNum=item.gridNum!=null?item.gridNum:1;
-                            gridNum=Math.floor(Math.random()*3)+1;
+                            // gridNum=Math.floor(Math.random()*3)+1;
                             let whStyle=gridInfo[gridNum];
                             if (whStyle==null)return (<></>);
                             return (
@@ -339,18 +340,17 @@ const GameSmallList=({data,user})=>{
             }
             else
             {
-                if (len<5){
+                if (len<=3){
                     gridStyle.paddingBottom=`${roomHeight+rowGap}rem`;
                 }
-                else gridStyle.rowGap=`${rowTop}rem`;
+                else gridStyle.gap=`${rowTop}rem`;
             }
         }
         let rowlist=formatMList(list);
-        console.log(rowlist);
         return (
             <>
-                <div className={`${styles.grid_list_m}`} ref={gridListMRef} style={gridStyle}>
-                    <div className={styles.grid_row_con}>
+                <div className={`${styles.grid_list_m}`} ref={gridListMRef}>
+                    <div className={styles.grid_row_con} style={gridStyle}>
                         {
                             rowlist.map((ritem,rindex)=>{
                                 if (ritem==null)return (<></>);
@@ -370,7 +370,7 @@ const GameSmallList=({data,user})=>{
                                                     }
                                                 }
                                                 let gridNum=item.gridNum!=null?item.gridNum:1;
-                                                gridNum=Math.floor(Math.random()*3)+1;
+                                                // gridNum=Math.floor(Math.random()*3)+1;
                                                 let whStyle=gridInfo[gridNum];
                                                 if (whStyle==null)return (<></>);
                                                 return (

+ 2 - 0
src/components/GameSmallList/styles.module.scss

@@ -116,6 +116,8 @@
       display: flex;
       flex-direction: column;
       gap: .75rem;
+      transition: all var(--transition);
+      padding-top: .75rem;
       & .grid_row{
         display: grid;
         gap:.75rem;