shaogen1995 10 mēneši atpakaļ
vecāks
revīzija
ca2f678a83

+ 1 - 1
web/src/components/LeftTopLogo/index.module.scss

@@ -1,5 +1,4 @@
 .LeftTopLogo {
-  pointer-events: none;
   position: fixed;
   z-index: 9998;
   top: 20px;
@@ -8,6 +7,7 @@
   :global {
     .leftTopLogo1 {
       height: 40px;
+      cursor: pointer;
     }
     .leftTopLogo2 {
       margin: 0 15px;

+ 7 - 2
web/src/components/LeftTopLogo/index.tsx

@@ -1,6 +1,6 @@
 import React from 'react'
 import styles from './index.module.scss'
-import { baseURL, myData } from '@/utils/history'
+import history, { baseURL, myData } from '@/utils/history'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
 function LeftTopLogo() {
@@ -8,7 +8,12 @@ function LeftTopLogo() {
 
   return (
     <div className={styles.LeftTopLogo}>
-      <img className='leftTopLogo1' src={baseURL + myData.home.logo} alt='' />
+      <img
+        onClick={() => history.push('/')}
+        className='leftTopLogo1'
+        src={baseURL + myData.home.logo}
+        alt=''
+      />
 
       <div className='leftTopLogo2'></div>
       <div className='leftTopLogo3'>

+ 18 - 7
web/src/pages/A3goods/index.tsx

@@ -83,27 +83,28 @@ function A3goods() {
 
   // 点击搜索
   const searchFu = useCallback(
-    (val: string, index: 1 | 2 | 3, classKey: string) => {
+    (val: string, acTxt: string, index: 1 | 2 | 3, classKey: string) => {
       const dataAllTemp =
         index === 1
           ? myData.goods.img.rowArr
           : index === 2
           ? myData.goods.model.rowArr
           : myData.goods.video.rowArr
-      let resData: GoodsRow[] = []
 
-      const acTxt = index === 1 ? ac1 : index === 2 ? ac2 : ac3
+      const dataAll = acTxt === '全部' ? dataAllTemp : dataAllTemp.filter(v => v.type === acTxt)
 
-      const dataAll = dataAllTemp.filter(v => v.type === acTxt)
+      let resData: GoodsRow[] = []
 
       if (val === '') resData = dataAll
       else resData = dataAll.filter(v => v.name.includes(val))
 
+      console.log(123, val, resData, acTxt)
+
       index === 1 ? setData1(resData) : index === 2 ? setData2(resData) : setData3(resData)
 
       sollrTop(classKey)
     },
-    [ac1, ac2, ac3, sollrTop]
+    [sollrTop]
   )
 
   // 打开详情
@@ -187,7 +188,12 @@ function A3goods() {
             {txtFlag ? (
               <Input
                 onEnterPress={() =>
-                  searchFu(index === 1 ? txt1 : index === 2 ? txt2 : txt3, index, 'A2Sorrl' + index)
+                  searchFu(
+                    index === 1 ? txt1 : index === 2 ? txt2 : txt3,
+                    acTxt,
+                    index,
+                    'A2Sorrl' + index
+                  )
                 }
                 placeholder='请输入搜索内容'
                 value={index === 1 ? txt1 : index === 2 ? txt2 : txt3}
@@ -208,7 +214,12 @@ function A3goods() {
                     ? setTxtFlag2(true)
                     : setTxtFlag3(true)
                 } else
-                  searchFu(index === 1 ? txt1 : index === 2 ? txt2 : txt3, index, 'A2Sorrl' + index)
+                  searchFu(
+                    index === 1 ? txt1 : index === 2 ? txt2 : txt3,
+                    acTxt,
+                    index,
+                    'A2Sorrl' + index
+                  )
               }}
             >
               <SearchOutline />