Bladeren bron

静态页面

1002884655 3 jaren geleden
bovenliggende
commit
e3dcf95af3

+ 26
- 17
src/pages/index/buildingDetail/components/BuildingDetailBanner/index.jsx Bestand weergeven

@@ -1,4 +1,4 @@
1
-import { useState } from 'react'
1
+import { useState, useEffect } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { Video } from '@tarojs/components'
4 4
 import { getImgURL } from '@/utils/image'
@@ -17,15 +17,25 @@ export default function BuildingDetailBanner (props) {
17 17
   const shwoVideoBtn = !!videoUrl
18 18
 
19 19
   // JS 中 true + true = 2
20
-  const showBtns = (showPicBtn + showVRBtn + shwoVideoBtn) > 1
20
+  // const showBtns = (showPicBtn + showVRBtn + shwoVideoBtn) > 1
21 21
 
22
-  const [NavList] = useState([
23
-    { name: 'VR', id: 1 },
24
-    { name: '视频', id: 2 },
25
-    { name: '图片', id: 3 }
26
-  ])
22
+  const [NavList, setNavList] = useState([])
27 23
   const [CurrentNavId, setCurrentNavId] = useState(3)
28 24
 
25
+  useEffect(() => {
26
+    let Arr = []
27
+    if (showVRBtn) {
28
+      Arr.push({ name: 'VR', id: 1 })
29
+    }
30
+    if (shwoVideoBtn) {
31
+      Arr.push({ name: '视频', id: 2 })
32
+    }
33
+    if (showPicBtn) {
34
+      Arr.push({ name: '图片', id: 3 })
35
+    }
36
+    setNavList(Arr)
37
+  }, [])
38
+
29 39
   const CutNavId = (id) => {
30 40
     return () => {
31 41
       setCurrentNavId(id)
@@ -56,17 +66,16 @@ export default function BuildingDetailBanner (props) {
56 66
 
57 67
       {/* 切换 */}
58 68
       {
59
-        showBtns && (
60
-          <view className='CutPoint'>
61
-            <view>
62
-              {
63
-                NavList.map((item, index) => (
64
-                  <text key={`NavItem-${index}`} className={CurrentNavId === item.id ? 'active' : ''} onClick={CutNavId(item.id)}>{item.name}</text>
65
-                ))
66
-              }
67
-            </view>
69
+        !!NavList.length &&
70
+        <view className='CutPoint'>
71
+          <view>
72
+            {
73
+              NavList.map((item, index) => (
74
+                <text key={`NavItem-${index}`} className={CurrentNavId === item.id ? 'active' : ''} onClick={CutNavId(item.id)}>{item.name}</text>
75
+              ))
76
+            }
68 77
           </view>
69
-        )
78
+        </view>
70 79
       }
71 80
 
72 81
       {/* VR */}

+ 3
- 0
src/pages/index/buildingDetail/components/BuildingDetailBanner/index.scss Bestand weergeven

@@ -48,6 +48,9 @@
48 48
     z-index: 1;
49 49
     overflow: hidden;
50 50
   }
51
+  >.Video {
52
+    height: 71.5vw;
53
+  }
51 54
   > .Picture {
52 55
     > swiper {
53 56
       width: 100%;

+ 7
- 1
src/pages/index/buildingDetail/components/LivingActivity/index.jsx Bestand weergeven

@@ -15,7 +15,13 @@ export default function LivingActivity (props) {
15 15
     })
16 16
   }
17 17
 
18
-  const gotoDetail = () => {}
18
+  const gotoDetail = (item) => {
19
+    if(item.type=='video'){
20
+      Taro.navigateTo({ url: `/pages/video/videoDetail/index?id=${item.liveActivityId}` })
21
+    }else{
22
+      Taro.navigateTo({ url: `/pages/video/liveDetail/index?id=${item.liveActivityId}` })
23
+    }
24
+  }
19 25
 
20 26
   return List.length > 0 ? (
21 27
     <view className='components LivingActivity'>

+ 0
- 1
src/pages/video/components/VideoListItem/index.jsx Bestand weergeven

@@ -7,7 +7,6 @@ export default function VideoListItem (props) {
7 7
   const { Data = {} } = props
8 8
 
9 9
   const toDetail=()=>{
10
-    console.log(Data,'------------')
11 10
     if(Data.type=='video'){
12 11
       Taro.navigateTo({ url: `/pages/video/videoDetail/index?id=${Data.id}` })
13 12
     }else{

+ 18
- 5
src/subpackages/pages/consultant/myHomepage/index.jsx Bestand weergeven

@@ -5,12 +5,15 @@ import { ScrollView, Image } from '@tarojs/components'
5 5
 import ProjectListItem from '@/components/ProjectListItem/index'
6 6
 import { useSelector } from 'react-redux'
7 7
 import { fetch } from '@/utils/request'
8
-import { API_AGENT_CURRENT, API_ITEMS_DETAIL } from '@/constants/api'
8
+import { API_AGENT_CURRENT, API_ITEMS_DETAIL, API_QUERY_USERINFO_BYID } from '@/constants/api'
9 9
 import { getImgURL } from '@/utils/image'
10 10
 import '@/assets/css/iconfont.css'
11 11
 import './index.scss'
12 12
 
13
-export default withLayout(() => {
13
+export default withLayout((props) => {
14
+
15
+  const { router } = props
16
+  const { id } = router.params
14 17
   
15 18
   const [IsPull, setPull] = useState(false)
16 19
   const [ShowPopup, setShowPopup] = useState(false)
@@ -23,7 +26,13 @@ export default withLayout(() => {
23 26
 
24 27
   useEffect(() => {
25 28
     if (PersonId !== user.userInfo.person.personId) {
26
-      setPersonId(user.userInfo.person.personId)
29
+      if(id) {
30
+        fetch({ url: `${API_QUERY_USERINFO_BYID}/${id}`, method: 'get' }).then((res) => {
31
+          setUserInfo(res)
32
+        })
33
+      } else {
34
+        setPersonId(user.userInfo.person.personId)
35
+      }
27 36
     }
28 37
   }, [user])
29 38
 
@@ -39,6 +48,10 @@ export default withLayout(() => {
39 48
     }
40 49
   }, [UserInfo])
41 50
 
51
+  const Liked = () => {
52
+
53
+  }
54
+
42 55
   const GetUserInfo = () => {
43 56
     fetch({ url: API_AGENT_CURRENT, method: 'get' }).then((res) => {
44 57
       setUserInfo(res)
@@ -81,7 +94,7 @@ export default withLayout(() => {
81 94
                     <text>{UserInfo.nickname} {UserInfo.phone}</text>
82 95
                   </view>
83 96
                   <text className='iconfont icon-dianzan'></text>
84
-                  <text>{UserInfo.likeNum || 0}赞</text>
97
+                  <text onClick={Liked}>{UserInfo.likeNum || 0}赞</text>
85 98
                 </view>
86 99
                 <view className='Tag'>
87 100
                   <view>
@@ -116,7 +129,7 @@ export default withLayout(() => {
116 129
                 }
117 130
               </view>
118 131
               <text className='iconfont icon-renqi'></text>
119
-              <text>人气值{UserInfo.hotNum || 0}</text>
132
+              <text>人气值{UserInfo.hotNum || 999}</text>
120 133
             </view>
121 134
           </view>
122 135