|
@@ -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
|
|