|
@@ -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(() => {
|