浏览代码

静态页面

1002884655 3 年前
父节点
当前提交
dc632b5528
共有 2 个文件被更改,包括 40 次插入30 次删除
  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 查看文件

14
   const { router, shareContent, trackData, person, page } = props;
14
   const { router, shareContent, trackData, person, page } = props;
15
   const { id } = router.params;
15
   const { id } = router.params;
16
 
16
 
17
-  const [data,setData] = useState({})
17
+  const [data, setData] = useState({})
18
   // 直播间信息
18
   // 直播间信息
19
   const livingRef = useRef()
19
   const livingRef = useRef()
20
-  
20
+
21
   // 本页面分享或者海报参数
21
   // 本页面分享或者海报参数
22
   const paramsRef = useParams({
22
   const paramsRef = useParams({
23
     id,
23
     id,
26
     from: `${page.type}_share`,
26
     from: `${page.type}_share`,
27
   });
27
   });
28
   const fullTrackData = { ...trackData, buildingId: data?.buildingId };
28
   const fullTrackData = { ...trackData, buildingId: data?.buildingId };
29
-  
29
+
30
   useShare(
30
   useShare(
31
     {
31
     {
32
       title: shareContent.shareContentTitle || data?.name,
32
       title: shareContent.shareContentTitle || data?.name,
37
   );
37
   );
38
 
38
 
39
   const getData = () => {
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
     }
58
     }
59
 
59
 
60
     // https://work.weixin.qq.com/api/doc/90000/90135/93635
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
     if (status >= 3) {
64
     if (status >= 3) {
85
       getData(id);
85
       getData(id);
86
     }
86
     }
87
   }, [id]);
87
   }, [id]);
88
-//   
88
+  //   
89
   return <view className="liveDetail">
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
   </view>;
102
   </view>;
97
 });
103
 });

+ 15
- 11
src/pages/video/liveDetail/index.scss 查看文件

8
     height: 100%;
8
     height: 100%;
9
   }
9
   }
10
   &-menu {
10
   &-menu {
11
-      margin: auto;
11
+    margin: auto;
12
     display: flex;
12
     display: flex;
13
     justify-content: space-around;
13
     justify-content: space-around;
14
     align-items: center;
14
     align-items: center;
21
     font-size: 26px;
21
     font-size: 26px;
22
     font-family: DengXian;
22
     font-family: DengXian;
23
     font-weight: bold;
23
     font-weight: bold;
24
-   
24
+
25
     line-height: 30px;
25
     line-height: 30px;
26
     letter-spacing: 6px;
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
   }