shaogen1995 2 年之前
父节点
当前提交
7b36af1276

+ 16 - 0
webNew/src/components/Model/index.module.scss

@@ -134,6 +134,22 @@
       }
       }
     }
     }
 
 
+    .nullRightTxt{
+      background-image: none;
+      &::before{
+        background-color: transparent;
+      }
+      .model_txt{
+        display: none;
+      }
+      .model_size{
+        display: none;
+      }
+      .model_floo{
+        display: none;
+      }
+    }
+
     .flootBtnBox {
     .flootBtnBox {
       position: absolute;
       position: absolute;
       z-index: 10;
       z-index: 10;

+ 7 - 1
webNew/src/components/Model/index.tsx

@@ -7,6 +7,7 @@ import musicImg from "@/assets/img/music.png";
 import musicImgAc from "@/assets/img/musicAc.png";
 import musicImgAc from "@/assets/img/musicAc.png";
 import styles from "./index.module.scss";
 import styles from "./index.module.scss";
 import { baseURL } from "@/utils/http";
 import { baseURL } from "@/utils/http";
+import classNames from "classnames";
 
 
 type props = {
 type props = {
   modelId: number;
   modelId: number;
@@ -89,7 +90,12 @@ export default function Model({ modelId, closeModel }: props) {
         ) : null}
         ) : null}
       </div>
       </div>
       {/* 右边介绍 */}
       {/* 右边介绍 */}
-      <div className="rightTxt">
+      <div
+        className={classNames(
+          "rightTxt",
+          info.isDetail === 0 ? "nullRightTxt" : ""
+        )}
+      >
         <div className="model_title">{info.name}</div>
         <div className="model_title">{info.name}</div>
         {info.description ? (
         {info.description ? (
           <div
           <div

+ 9 - 10
webNew/src/pages/Home/index.module.scss

@@ -9,7 +9,6 @@
       z-index: 10;
       z-index: 10;
       opacity: 0;
       opacity: 0;
       pointer-events: none;
       pointer-events: none;
-      transition: opacity .3s;
       position: fixed;
       position: fixed;
       top: 0;
       top: 0;
       left: 0;
       left: 0;
@@ -121,16 +120,16 @@
         overflow-y: auto;
         overflow-y: auto;
         display: flex;
         display: flex;
         flex-wrap: wrap;
         flex-wrap: wrap;
-        padding: 20px 20px 0;
+        padding: 20px 15px 0;
 
 
         .modelBox_row {
         .modelBox_row {
           border-radius: 6px;
           border-radius: 6px;
           overflow: hidden;
           overflow: hidden;
           cursor: pointer;
           cursor: pointer;
-          width: 300px;
-          height: 300px;
+          width: 264px;
+          height: 264px;
           background-color: #CFCABD;
           background-color: #CFCABD;
-          margin: 0 40px 40px 0;
+          margin: 0 10px 10px 0;
           position: relative;
           position: relative;
 
 
           .modelBox_row_hover {
           .modelBox_row_hover {
@@ -141,12 +140,12 @@
             display: flex;
             display: flex;
             justify-content: center;
             justify-content: center;
             align-items: center;
             align-items: center;
-            color: #FFE39C;
+            color: #fff;
             padding: 50px;
             padding: 50px;
             font-size: 24px;
             font-size: 24px;
             line-height: 34px;
             line-height: 34px;
             backdrop-filter: blur(4px);
             backdrop-filter: blur(4px);
-            background-color: rgba(150, 16, 20, 0.7000);
+            background-color: rgba(0,0,0,.8);
             position: absolute;
             position: absolute;
             top: 0;
             top: 0;
             left: 0;
             left: 0;
@@ -161,13 +160,13 @@
             }
             }
           }
           }
 
 
-          &:nth-of-type(4n) {
+          &:nth-of-type(5n) {
             margin-right: 0;
             margin-right: 0;
           }
           }
 
 
           &>img {
           &>img {
-            width: 300px;
-            height: 260px;
+            width: 264px;
+            height: 224px;
             object-fit: cover;
             object-fit: cover;
           }
           }
 
 

+ 13 - 7
webNew/src/pages/Home/index.tsx

@@ -87,7 +87,7 @@ export default function Home() {
 
 
   const fromData = useRef({
   const fromData = useRef({
     pageNum: 1,
     pageNum: 1,
-    pageSize: 12,
+    pageSize: 15,
     searchKey: "",
     searchKey: "",
     dictTextureId: -1,
     dictTextureId: -1,
     dictAgeId: -1,
     dictAgeId: -1,
@@ -97,11 +97,15 @@ export default function Home() {
     setPageNum(page);
     setPageNum(page);
     getModelList();
     getModelList();
   };
   };
+
+  // 第一次进页面不要显示暂无数据
+  const [dataOne, setDataOne] = useState(false);
+
   // 封装一个发送请求获取列表的函数
   // 封装一个发送请求获取列表的函数
-  const getModelList = () => {
+  const getModelList = async () => {
     const sroolDom = modelBoxRef.current;
     const sroolDom = modelBoxRef.current;
     sroolDom!.scrollTop = 0;
     sroolDom!.scrollTop = 0;
-    dispatch(
+    await dispatch(
       getListAction({
       getListAction({
         ...fromData.current,
         ...fromData.current,
         dictTextureId:
         dictTextureId:
@@ -113,6 +117,8 @@ export default function Home() {
           fromData.current.dictAgeId === -1 ? null : fromData.current.dictAgeId,
           fromData.current.dictAgeId === -1 ? null : fromData.current.dictAgeId,
       })
       })
     );
     );
+
+    if (!dataOne) setDataOne(true);
   };
   };
   useEffect(() => {
   useEffect(() => {
     fromData.current.dictTextureId = sort;
     fromData.current.dictTextureId = sort;
@@ -205,24 +211,24 @@ export default function Home() {
                 </p>
                 </p>
               </div>
               </div>
             ))
             ))
-          ) : (
+          ) : dataOne ? (
             <div className="noneList">
             <div className="noneList">
               <div className="incoBox">
               <div className="incoBox">
                 <ExclamationOutlined />
                 <ExclamationOutlined />
               </div>
               </div>
               <p>暂无内容</p>
               <p>暂无内容</p>
             </div>
             </div>
-          )}
+          ) : null}
         </div>
         </div>
 
 
         {/* 分页器 */}
         {/* 分页器 */}
         <div className="page">
         <div className="page">
           <Pagination
           <Pagination
-            showQuickJumper 
+            showQuickJumper
             size="small"
             size="small"
             current={pageNum}
             current={pageNum}
             total={total}
             total={total}
-            pageSize={12}
+            pageSize={15}
             hideOnSinglePage={true}
             hideOnSinglePage={true}
             onChange={pageChangeFu}
             onChange={pageChangeFu}
             showSizeChanger={false}
             showSizeChanger={false}

+ 10 - 4
webNew/src/pages/HomeM/index.tsx

@@ -90,13 +90,17 @@ export default function HomeM() {
 
 
   // 滚动盒子ref
   // 滚动盒子ref
   const modelBoxRef = useRef<HTMLDivElement>(null);
   const modelBoxRef = useRef<HTMLDivElement>(null);
+
+  // 第一次进页面不要显示暂无数据
+  const [dataOne, setDataOne] = useState(false);
+
   // 封装一个发送请求获取列表的函数
   // 封装一个发送请求获取列表的函数
-  const getModelList = (flag?: boolean) => {
+  const getModelList = async (flag?: boolean) => {
     if (!flag) {
     if (!flag) {
       const sroolDom = modelBoxRef.current;
       const sroolDom = modelBoxRef.current;
       sroolDom!.scrollTop = 0;
       sroolDom!.scrollTop = 0;
     }
     }
-    dispatch(
+    await dispatch(
       getListAction(
       getListAction(
         {
         {
           ...fromData.current,
           ...fromData.current,
@@ -113,6 +117,8 @@ export default function HomeM() {
         flag
         flag
       )
       )
     );
     );
+
+    if (!dataOne) setDataOne(true);
   };
   };
 
 
   // 点击每个模型出来的页面
   // 点击每个模型出来的页面
@@ -196,14 +202,14 @@ export default function HomeM() {
             </div>
             </div>
             <InfiniteScroll loadMore={loadMore} hasMore={total > list.length} />
             <InfiniteScroll loadMore={loadMore} hasMore={total > list.length} />
           </>
           </>
-        ) : (
+        ) : dataOne ? (
           <div className="noneList">
           <div className="noneList">
             <div className="incoBox">
             <div className="incoBox">
               <ExclamationOutlined />
               <ExclamationOutlined />
             </div>
             </div>
             <p>暂无内容</p>
             <p>暂无内容</p>
           </div>
           </div>
-        )}
+        ) : null}
       </div>
       </div>
     </div>
     </div>
   );
   );

+ 16 - 0
webNew/src/pages/Model/index.module.scss

@@ -133,6 +133,22 @@
         }
         }
       }
       }
     }
     }
+    .nullRightTxt{
+      background-image: none;
+      &::before{
+        background-color: transparent;
+      }
+      .model_txt{
+        display: none;
+      }
+      .model_size{
+        display: none;
+      }
+      .model_floo{
+        display: none;
+      }
+    }
+
 
 
     .flootBtnBox {
     .flootBtnBox {
       position: absolute;
       position: absolute;

+ 7 - 1
webNew/src/pages/Model/index.tsx

@@ -8,6 +8,7 @@ import { useLocation } from "react-router-dom";
 import { useDispatch, useSelector } from "react-redux";
 import { useDispatch, useSelector } from "react-redux";
 import { getModelInfo } from "@/store/action/home";
 import { getModelInfo } from "@/store/action/home";
 import { RootState } from "@/store";
 import { RootState } from "@/store";
+import classNames from "classnames";
 
 
 export default function Model() {
 export default function Model() {
   const location = useLocation();
   const location = useLocation();
@@ -79,7 +80,12 @@ export default function Model() {
         ) : null}
         ) : null}
       </div>
       </div>
       {/* 右边介绍 */}
       {/* 右边介绍 */}
-      <div className="rightTxt">
+      <div
+        className={classNames(
+          "rightTxt",
+          info.isDetail === 0 ? "nullRightTxt" : ""
+        )}
+      >
         <div className="model_title">{info.name}</div>
         <div className="model_title">{info.name}</div>
         {info.description ? (
         {info.description ? (
           <div
           <div

+ 1 - 0
webNew/src/types/store/home.d.ts

@@ -34,6 +34,7 @@ export type modelItem = {
   type: string;
   type: string;
   updateTime: string;
   updateTime: string;
   visit: number;
   visit: number;
+  isDetail:number
 }
 }
 
 
 export type HomeModelType = {
 export type HomeModelType = {