1002884655 преди 3 години
родител
ревизия
36328361be
променени са 2 файла, в които са добавени 12 реда и са изтрити 20 реда
  1. 2
    2
      src/pages/video/components/VideoListItem/index.jsx
  2. 10
    18
      src/pages/video/liveDetail/index.jsx

+ 2
- 2
src/pages/video/components/VideoListItem/index.jsx Целия файл

@@ -8,9 +8,9 @@ export default function VideoListItem (props) {
8 8
 
9 9
   const toDetail=()=>{
10 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 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 Целия файл

@@ -41,24 +41,16 @@ export default withLayout((props) => {
41 41
   );
42 42
 
43 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 56
   useEffect(() => {