shaogen1995 2 yıl önce
ebeveyn
işleme
8e4cdedd0d

+ 18 - 7
houtai/src/pages/B2Goods/GoogsDown/index.tsx

@@ -14,16 +14,27 @@ type Props = {
   closeMoalFu: () => void;
 };
 
+
 function GoogsDown({ id, closeMoalFu }: Props) {
+  // 弹窗 文物 标题
+  const [myTile,setMyTitle]=useState('')
   // 通过id发送请求拿数据
   const getInfoFu = useCallback(async (id: number) => {
     const res = await getGoodsInfoByIdAPI(id);
-    const dataRes: FileListType[] = res.data.file;
-    const data: FileListType[] = [];
-    dataRes.forEach((v) => {
-      if (v.type === "img") data.push({ ...v, done: true });
-    });
-    setImgList(data);
+    if(res.code===0){
+      // 弹窗的标题
+      setMyTitle(res.data.entity.name)
+
+
+      const dataRes: FileListType[] = res.data.file;
+      const data: FileListType[] = [];
+      dataRes.forEach((v) => {
+        if (v.type === "img") data.push({ ...v, done: true });
+      });
+      
+      setImgList(data);
+
+    }
   }, []);
 
   useEffect(() => {
@@ -84,7 +95,7 @@ function GoogsDown({ id, closeMoalFu }: Props) {
       wrapClassName={styles.GoogsDown}
       destroyOnClose
       open={true}
-      title="清“乾隆”款珐琅蓝彩十三行通景画瓷碗"
+      title={myTile}
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }

+ 7 - 5
pc/src/pages/A2Main/GoodsInfo/index.tsx

@@ -69,8 +69,12 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
   // 点击点赞
   const likeClickFu = useCallback(async () => {
     if (right4) return;
-    await A2_APIgoodsaddStar(id);
     setRight4(true);
+    try {
+      await A2_APIgoodsaddStar(id);
+    } catch (error) {
+      console.log(error);
+    }
     window.setTimeout(() => {
       setRight4(false);
     }, 3000);
@@ -125,9 +129,7 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
       const width = barrMoveRef.current?.offsetWidth || 0;
 
       if (barrMoveRef.current) {
-        if (barrMoveRef.current) {
-          barrMoveRef.current.style.right = -width - 200 + "px";
-        }
+        barrMoveRef.current.style.right = -width - 200 + "px";
 
         const endNum = -window.innerWidth - width - 200;
         barrMoveRefKill.current?.kill();
@@ -141,7 +143,7 @@ function GoodsInfo({ isOpen, id, closePage }: Props) {
             x: endNum,
             repeat: -1,
           });
-        } else {
+        } else if (barrageAll.length > 1) {
           // 有超过 1 的情况
           barrMoveRefKill.current = gsap.fromTo(
             barrMoveRef.current,

+ 2 - 1
pc/src/pages/A2Main/GoodsSw/index.module.scss

@@ -43,7 +43,8 @@
           height: 100%;
 
           .goddsRow {
-            width: 25vw;
+            min-width: 400px;
+            width: 100%;
             color: #fff;
             padding: 0 10px 0 90px;
             display: flex;

+ 1 - 1
pc/src/pages/A2Main/SwiperCom/index.module.scss

@@ -25,7 +25,7 @@
         border-radius: 4px;
         overflow: hidden;
         color: #fff;
-        border: 2px solid transparent;
+        // border: 2px solid transparent;
 
         &>img {
           width: 100%;