Browse Source

信息修改

1002884655 3 years ago
parent
commit
36328361be

+ 2
- 2
src/pages/video/components/VideoListItem/index.jsx View File

8
 
8
 
9
   const toDetail=()=>{
9
   const toDetail=()=>{
10
     if(Data.type=='video'){
10
     if(Data.type=='video'){
11
-      Taro.navigateTo({ url: `/pages/video/videoDetail/index?id=${Data.id}&type=${Data.type}` })
11
+      Taro.navigateTo({ url: `/pages/video/videoDetail/index?id=${Data.id}` })
12
     }else{
12
     }else{
13
-      Taro.navigateTo({ url: `/pages/video/liveDetail/index?id=${Data.id}&type=${Data.type}` })
13
+      Taro.navigateTo({ url: `/pages/video/liveDetail/index?id=${Data.id}` })
14
     }
14
     }
15
     // 
15
     // 
16
   }
16
   }

+ 10
- 18
src/pages/video/liveDetail/index.jsx View File

41
   );
41
   );
42
 
42
 
43
   const getData = () => {
43
   const getData = () => {
44
-    if(type === 'live') { // 直播
45
-      queryLiveDetail(id).then(res => {
46
-        setData(res||{})
47
-        setNavigationBarTitle(res?.name)
48
-        if (res?.liveRoomParam) {
49
-          const { livingid } = JSON.parse(res.liveRoomParam)
50
-          getLivingCode(livingid).then((liveInfo) => {
51
-            livingRef.current = liveInfo
52
-          })
53
-        }
54
-      })
55
-    } else { // 视频
56
-      fetch({url: `${API_VIDEO_DETAIL}/${id}`, method: 'get'}).then((res) => {
57
-        setData(res||{})
58
-        setNavigationBarTitle(res?.name)
59
-        livingRef.current = res
60
-      })
61
-    }
44
+    queryLiveDetail(id).then(res => {
45
+      setData(res||{})
46
+      setNavigationBarTitle(res?.name)
47
+      if (res?.liveRoomParam) {
48
+        const { livingid } = JSON.parse(res.liveRoomParam)
49
+        getLivingCode(livingid).then((liveInfo) => {
50
+          livingRef.current = liveInfo
51
+        })
52
+      }
53
+    })
62
   };
54
   };
63
 
55
 
64
   useEffect(() => {
56
   useEffect(() => {