Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
李泽琪琪琪琪西西瓜 committed Mar 2, 2020
1 parent bac44f9 commit 5653398
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export const ENV_PROD = "prod";
const dev = {
env: ENV_DEV,
// BASE_URL: 'http://192.168.1.41:8080',
BASE_URL: 'http://47.94.97.168:8080',
// BASE_URL: 'http://127.0.0.1:8080',
// BASE_URL: 'http://47.94.97.168:8080',
BASE_URL: 'http://127.0.0.1:8080',
};

const product = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mineHomePage/fansOrAttention/fansOrAttention.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class FansOrAttention extends Component{
return <View onClick={ () => {this.redirectToPerson(item.id, item.avatar, item.name)} } className='list'>
<Image className='photo' src={item.avatar} alt={"头像"}/>
<Text className='name'>{item.name}</Text>
{type===1?<Text className='cancelAttention'>取消关注</Text>:null}
{type===1?<View className='cancelAttention'>取消关注</View>:null}
</View>
})
}
Expand Down
46 changes: 44 additions & 2 deletions src/pages/mineHomePage/mineHomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export default class MineHomePage extends Component{
nickName: '',
fans: 0,
follow: 0,
isFollowing: false,
followList: [],
habitNumber: 0,
bigIndex: 0,
recordList: [],
Expand All @@ -45,13 +47,44 @@ export default class MineHomePage extends Component{
habitNumber: res.data.total,
});
});
// myFollowing({
// userId: this.state.userId,
// }).then( res => {
// that.setState({
// followList: res.data,
// follow: res.data.length,
// });
// res.data.map( (item) => {
// if( item.id === this.state.userId){
// that.setState({
// isFollowing: true
// });
// }
// });
// console.log('followList1',res.data);
// console.log('followList2',this.state.followList);
// });
// followedMe({
// userId: this.state.userId,
// }).then( res => {
// that.setState({
// fans: res.data.length,
// });
// });
// console.log('isFollowing:',this.state.isFollowing)
}

componentDidMount() {
let that = this;
myFollowing({
userId: this.state.userId,
}).then( res => {
that.setState({
followList: res.data,
follow: res.data.length,
});
console.log('res',res);
console.log('followList1',res.data);
console.log('followList2',this.state.followList);
});
followedMe({
userId: this.state.userId,
Expand All @@ -60,7 +93,15 @@ export default class MineHomePage extends Component{
fans: res.data.length,
});
console.log('res',res);
})
});
this.state.followList.map( (item) => {
if( item.id === this.state.userId){
this.setState({
isFollowing: true
});
}
});
console.log('isFollowing:',this.state.isFollowing)
}

selectBook(index){
Expand Down Expand Up @@ -161,6 +202,7 @@ export default class MineHomePage extends Component{
<View className="homePage_relate">
<View className="homePage_relate_fans" onClick={this.redirectToPerson.bind(this,"粉丝")}>粉丝 {fans}</View>
<View className="homePage_relate_follow" onClick={this.redirectToPerson.bind(this,"关注")}>关注 {follow}</View>
{/*<View className="homePage_relate_attention">关注TA</View>*/}
</View>
<View className="homePage_insist">
{habitNumber === 0 ? <Text className="homePage_no_habit">快去加入习惯吧!</Text> :
Expand Down

0 comments on commit 5653398

Please sign in to comment.