|
@@ -1,44 +1,74 @@
|
|
1
|
+import { useState, useEffect } from "react";
|
|
2
|
+import withLayout from "@/layout";
|
|
3
|
+import { ScrollView } from "@tarojs/components";
|
|
4
|
+import "@/assets/css/iconfont.css";
|
|
5
|
+import "./index.scss";
|
|
6
|
+import { fetch } from "@/utils/request";
|
|
7
|
+import { API_VIDEO_DETAIL } from "@/constants/api";
|
|
8
|
+import getDateFormat from "@/utils/chatDate";
|
1
|
9
|
|
2
|
|
-import withLayout from '@/layout'
|
3
|
|
-import { ScrollView } from '@tarojs/components'
|
4
|
|
-import '@/assets/css/iconfont.css'
|
5
|
|
-import './index.scss'
|
|
10
|
+export default withLayout((props) => {
|
|
11
|
+ const { id } = props.router.params;
|
6
|
12
|
|
7
|
|
-export default withLayout(() => {
|
|
13
|
+ const [data, setData] = useState({});
|
|
14
|
+ console.log(id, "queryLiveDetail");
|
|
15
|
+ const getData = () => {
|
|
16
|
+ fetch({ url: `${API_VIDEO_DETAIL}/${id}` }).then(res=>{
|
|
17
|
+ setData(res)
|
|
18
|
+ });
|
|
19
|
+ };
|
|
20
|
+
|
|
21
|
+ useEffect(() => {
|
|
22
|
+ if (id) {
|
|
23
|
+ getData();
|
|
24
|
+ }
|
|
25
|
+ }, [id]);
|
8
|
26
|
|
9
|
27
|
return (
|
10
|
|
- <view className='Page videoDetail'>
|
|
28
|
+ <view className="Page videoDetail">
|
11
|
29
|
<ScrollView scroll-y>
|
12
|
|
- <view className='Content'>
|
13
|
|
-
|
|
30
|
+ <view className="Content">
|
14
|
31
|
{/* 视频 */}
|
15
|
|
- <view className='VideoContainer'>
|
16
|
|
- <view>
|
17
|
|
-
|
18
|
|
- </view>
|
|
32
|
+ <view className="VideoContainer">
|
|
33
|
+ <video
|
|
34
|
+ id="myVideo"
|
|
35
|
+ src={data.videoUrl}
|
|
36
|
+ // binderror="videoErrorCallback"
|
|
37
|
+ // danmu-list="{{danmuList}}"
|
|
38
|
+ // enable-danmu
|
|
39
|
+ // danmu-btn
|
|
40
|
+ // show-center-play-btn='{{false}}'
|
|
41
|
+ // show-play-btn="{{true}}"
|
|
42
|
+ // controls
|
|
43
|
+ // picture-in-picture-mode="{{['push', 'pop']}}"
|
|
44
|
+ // bindenterpictureinpicture='bindVideoEnterPictureInPicture'
|
|
45
|
+ // bindleavepictureinpicture='bindVideoLeavePictureInPicture'
|
|
46
|
+ ></video>
|
19
|
47
|
</view>
|
20
|
48
|
|
21
|
49
|
{/* 视频信息 */}
|
22
|
|
- <view className='Info'>
|
23
|
|
- <text className='Name'>视频看好房,直播抢优惠!</text>
|
24
|
|
- <text className='Time'>时间:2021年7月6日 13:00</text>
|
|
50
|
+ <view className="Info">
|
|
51
|
+ <text className="Name">{data.name}</text>
|
|
52
|
+ <text className="Time">时间:{getDateFormat(
|
|
53
|
+ new Date(data.createdTime).valueOf(),
|
|
54
|
+ true,
|
|
55
|
+ 'yyyy年M月d日'
|
|
56
|
+ )}</text>
|
25
|
57
|
</view>
|
26
|
58
|
|
27
|
59
|
{/* 详情 */}
|
28
|
|
- <view className='Detail'>
|
29
|
|
- <view className='Title'>
|
|
60
|
+ <view className="Detail">
|
|
61
|
+ <view className="Title">
|
30
|
62
|
<text>视频详情</text>
|
31
|
63
|
</view>
|
32
|
|
- <view className='Node'>
|
33
|
|
-
|
34
|
|
- </view>
|
35
|
|
- <view className='Share'>
|
|
64
|
+ <view className="Node"></view>
|
|
65
|
+ {data.remark}
|
|
66
|
+ <view className="Share">
|
36
|
67
|
<text>分享好友</text>
|
37
|
68
|
</view>
|
38
|
69
|
</view>
|
39
|
|
-
|
40
|
70
|
</view>
|
41
|
71
|
</ScrollView>
|
42
|
72
|
</view>
|
43
|
|
- )
|
44
|
|
-})
|
|
73
|
+ );
|
|
74
|
+});
|