shaogen1995 2 лет назад
Родитель
Сommit
c9699c46e3

+ 1 - 1
文物展示系统/vueapp/src/data/category.js

@@ -386,7 +386,7 @@ let three = {
     imgs: [
       {
         id: '1.1',
-        url: '',
+        url: 'https://4dscene.4dage.com/culturalrelics/LSDFBWG/Model2.html?m=lsdf112',
         name: '五代十国画像陶棺(残)'
       }
     ],

+ 7 - 4
重写子系统/src/pages/A2Goods/index.tsx

@@ -54,14 +54,12 @@ function A2Goods({ id, closePageFu }: Props) {
     const dom = audioRef.current;
     if (dom) {
       if (audioSta) {
-        setAudioSta(true);
         dom.play();
         dom.onended = () => {
           // 音频播放结束
           setAudioSta(false);
         };
       } else {
-        setAudioSta(false);
         dom.pause();
       }
     }
@@ -75,7 +73,12 @@ function A2Goods({ id, closePageFu }: Props) {
         // 处理附件信息
 
         const tempArr = res.data.file || [];
-        const delAudioArr = tempArr.filter((v: any) => v.type !== "audio");
+
+        const tempSta = "model,img,video";
+
+        const delAudioArr = tempArr.filter((v: any) =>
+          tempSta.includes(v.type)
+        );
 
         if (delAudioArr.length === 0) setNoFile(true);
 
@@ -95,7 +98,7 @@ function A2Goods({ id, closePageFu }: Props) {
         else if (fileArr.find((v) => v.type === "video")) setType("video");
 
         fileArr.forEach((v) => {
-          obj[v.type].push(v);
+          if (obj[v.type]) obj[v.type].push(v);
 
           // 处理音频信息
           if (v.type === "audio") audioTemp = v.filePath;

+ 7 - 4
重写子系统/src/pages/A2GoodsM/index.tsx

@@ -55,14 +55,12 @@ function A2GoodsM({ id, closePageFu }: Props) {
     const dom = audioRef.current;
     if (dom) {
       if (audioSta) {
-        setAudioSta(true);
         dom.play();
         dom.onended = () => {
           // 音频播放结束
           setAudioSta(false);
         };
       } else {
-        setAudioSta(false);
         dom.pause();
       }
     }
@@ -76,7 +74,12 @@ function A2GoodsM({ id, closePageFu }: Props) {
         // 处理附件信息
 
         const tempArr = res.data.file || [];
-        const delAudioArr = tempArr.filter((v: any) => v.type !== "audio");
+
+        const tempSta = "model,img,video";
+
+        const delAudioArr = tempArr.filter((v: any) =>
+          tempSta.includes(v.type)
+        );
 
         if (delAudioArr.length === 0) setNoFile(true);
 
@@ -96,7 +99,7 @@ function A2GoodsM({ id, closePageFu }: Props) {
         else if (fileArr.find((v) => v.type === "video")) setType("video");
 
         fileArr.forEach((v) => {
-          obj[v.type].push(v);
+          if (obj[v.type]) obj[v.type].push(v);
 
           // 处理音频信息
           if (v.type === "audio") audioTemp = v.filePath;