Browse Source

静态页面

1002884655 3 years ago
parent
commit
e3dcf95af3

+ 26
- 17
src/pages/index/buildingDetail/components/BuildingDetailBanner/index.jsx View File

1
-import { useState } from 'react'
1
+import { useState, useEffect } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import { Video } from '@tarojs/components'
3
 import { Video } from '@tarojs/components'
4
 import { getImgURL } from '@/utils/image'
4
 import { getImgURL } from '@/utils/image'
17
   const shwoVideoBtn = !!videoUrl
17
   const shwoVideoBtn = !!videoUrl
18
 
18
 
19
   // JS 中 true + true = 2
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
   const [CurrentNavId, setCurrentNavId] = useState(3)
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
   const CutNavId = (id) => {
39
   const CutNavId = (id) => {
30
     return () => {
40
     return () => {
31
       setCurrentNavId(id)
41
       setCurrentNavId(id)
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
           </view>
77
           </view>
69
-        )
78
+        </view>
70
       }
79
       }
71
 
80
 
72
       {/* VR */}
81
       {/* VR */}

+ 3
- 0
src/pages/index/buildingDetail/components/BuildingDetailBanner/index.scss View File

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

+ 7
- 1
src/pages/index/buildingDetail/components/LivingActivity/index.jsx View File

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
   return List.length > 0 ? (
26
   return List.length > 0 ? (
21
     <view className='components LivingActivity'>
27
     <view className='components LivingActivity'>

+ 0
- 1
src/pages/video/components/VideoListItem/index.jsx View File

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

+ 18
- 5
src/subpackages/pages/consultant/myHomepage/index.jsx View File

5
 import ProjectListItem from '@/components/ProjectListItem/index'
5
 import ProjectListItem from '@/components/ProjectListItem/index'
6
 import { useSelector } from 'react-redux'
6
 import { useSelector } from 'react-redux'
7
 import { fetch } from '@/utils/request'
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
 import { getImgURL } from '@/utils/image'
9
 import { getImgURL } from '@/utils/image'
10
 import '@/assets/css/iconfont.css'
10
 import '@/assets/css/iconfont.css'
11
 import './index.scss'
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
   const [IsPull, setPull] = useState(false)
18
   const [IsPull, setPull] = useState(false)
16
   const [ShowPopup, setShowPopup] = useState(false)
19
   const [ShowPopup, setShowPopup] = useState(false)
23
 
26
 
24
   useEffect(() => {
27
   useEffect(() => {
25
     if (PersonId !== user.userInfo.person.personId) {
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
   }, [user])
37
   }, [user])
29
 
38
 
39
     }
48
     }
40
   }, [UserInfo])
49
   }, [UserInfo])
41
 
50
 
51
+  const Liked = () => {
52
+
53
+  }
54
+
42
   const GetUserInfo = () => {
55
   const GetUserInfo = () => {
43
     fetch({ url: API_AGENT_CURRENT, method: 'get' }).then((res) => {
56
     fetch({ url: API_AGENT_CURRENT, method: 'get' }).then((res) => {
44
       setUserInfo(res)
57
       setUserInfo(res)
81
                     <text>{UserInfo.nickname} {UserInfo.phone}</text>
94
                     <text>{UserInfo.nickname} {UserInfo.phone}</text>
82
                   </view>
95
                   </view>
83
                   <text className='iconfont icon-dianzan'></text>
96
                   <text className='iconfont icon-dianzan'></text>
84
-                  <text>{UserInfo.likeNum || 0}赞</text>
97
+                  <text onClick={Liked}>{UserInfo.likeNum || 0}赞</text>
85
                 </view>
98
                 </view>
86
                 <view className='Tag'>
99
                 <view className='Tag'>
87
                   <view>
100
                   <view>
116
                 }
129
                 }
117
               </view>
130
               </view>
118
               <text className='iconfont icon-renqi'></text>
131
               <text className='iconfont icon-renqi'></text>
119
-              <text>人气值{UserInfo.hotNum || 0}</text>
132
+              <text>人气值{UserInfo.hotNum || 999}</text>
120
             </view>
133
             </view>
121
           </view>
134
           </view>
122
 
135