Browse Source

静态页面

1002884655 3 years ago
parent
commit
dc632b5528
2 changed files with 40 additions and 30 deletions
  1. 25
    19
      src/pages/video/liveDetail/index.jsx
  2. 15
    11
      src/pages/video/liveDetail/index.scss

+ 25
- 19
src/pages/video/liveDetail/index.jsx View File

@@ -14,10 +14,10 @@ export default withLayout((props) => {
14 14
   const { router, shareContent, trackData, person, page } = props;
15 15
   const { id } = router.params;
16 16
 
17
-  const [data,setData] = useState({})
17
+  const [data, setData] = useState({})
18 18
   // 直播间信息
19 19
   const livingRef = useRef()
20
-  
20
+
21 21
   // 本页面分享或者海报参数
22 22
   const paramsRef = useParams({
23 23
     id,
@@ -26,7 +26,7 @@ export default withLayout((props) => {
26 26
     from: `${page.type}_share`,
27 27
   });
28 28
   const fullTrackData = { ...trackData, buildingId: data?.buildingId };
29
-  
29
+
30 30
   useShare(
31 31
     {
32 32
       title: shareContent.shareContentTitle || data?.name,
@@ -37,14 +37,14 @@ export default withLayout((props) => {
37 37
   );
38 38
 
39 39
   const getData = () => {
40
-    queryLiveDetail(id).then(res=>{
41
-        setData(res)
42
-        if (res?.liveRoomParam) {
43
-          const { livingid } = JSON.parse(res.liveRoomParam)
44
-          getLivingCode(livingid).then((liveInfo) => {
45
-            livingRef.current = liveInfo
46
-          })
47
-        }
40
+    queryLiveDetail(id).then(res => {
41
+      setData(res)
42
+      if (res?.liveRoomParam) {
43
+        const { livingid } = JSON.parse(res.liveRoomParam)
44
+        getLivingCode(livingid).then((liveInfo) => {
45
+          livingRef.current = liveInfo
46
+        })
47
+      }
48 48
     })
49 49
   };
50 50
 
@@ -58,7 +58,7 @@ export default withLayout((props) => {
58 58
     }
59 59
 
60 60
     // https://work.weixin.qq.com/api/doc/90000/90135/93635
61
-    const { livingCode, status  } =  livingRef.current
61
+    const { livingCode, status } = livingRef.current
62 62
 
63 63
     //
64 64
     if (status >= 3) {
@@ -85,13 +85,19 @@ export default withLayout((props) => {
85 85
       getData(id);
86 86
     }
87 87
   }, [id]);
88
-//   
88
+  //   
89 89
   return <view className="liveDetail">
90
-       {data.liveActivityId&&<><Image mode='aspectFill' src={getImgURL(data.detailTypeImg)} className='liveImg'></Image>
91
-       <view className='liveDetail-menu'>
92
-           <view onClick={()=>{Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${data.buildingId}` })}}><text className="iconfont icon-fenxiang"></text><text>查看楼盘</text></view>
93
-           <view onClick={handleLive}><text className="iconfont icon-camera"></text><text>观看直播</text></view>
94
-           <button openType="share"><text className="iconfont icon-fenxiang"></text><text>分享好友</text></button>
95
-       </view></>}
90
+    {data.liveActivityId && <><Image mode='aspectFill' src={getImgURL(data.detailTypeImg)} className='liveImg'></Image>
91
+      <view className='liveDetail-menu flex-h'>
92
+        <view className='flex-item'>
93
+          <view onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${data.buildingId}` }) }}><text className="iconfont icon-fenxiang"></text><text>查看楼盘</text></view>
94
+        </view>
95
+        <view className='flex-item'>
96
+          <view onClick={handleLive}><text className="iconfont icon-camera"></text><text>观看直播</text></view>
97
+        </view>
98
+        <view className='flex-item'>
99
+          <button openType="share"><text className="iconfont icon-fenxiang"></text><text>分享好友</text></button>
100
+        </view>
101
+      </view></>}
96 102
   </view>;
97 103
 });

+ 15
- 11
src/pages/video/liveDetail/index.scss View File

@@ -8,7 +8,7 @@
8 8
     height: 100%;
9 9
   }
10 10
   &-menu {
11
-      margin: auto;
11
+    margin: auto;
12 12
     display: flex;
13 13
     justify-content: space-around;
14 14
     align-items: center;
@@ -21,18 +21,22 @@
21 21
     font-size: 26px;
22 22
     font-family: DengXian;
23 23
     font-weight: bold;
24
-   
24
+
25 25
     line-height: 30px;
26 26
     letter-spacing: 6px;
27
-    text{
28
-         color: #ffffff;
29
-    }
30
-    >button {
31
-      background: none;
32
-      border: none;
33
-      color: #fff;
34
-      &::after {
35
-        display: none;
27
+    > view {
28
+      text-align: center;
29
+      text {
30
+        color: #ffffff;
31
+        font-size: 26px;
32
+      }
33
+      > button {
34
+        background: none;
35
+        border: none;
36
+        color: #fff;
37
+        &::after {
38
+          display: none;
39
+        }
36 40
       }
37 41
     }
38 42
   }