|
@@ -16,7 +16,7 @@ export default class Index extends Component {
|
16
|
16
|
}
|
17
|
17
|
componentWillMount() {
|
18
|
18
|
const { user = {} } = this.props
|
19
|
|
- // this.toggleGrantAvatar()
|
|
19
|
+ this.toggleGrantAvatar()
|
20
|
20
|
}
|
21
|
21
|
|
22
|
22
|
toggleGrantAvatar = () => {
|
|
@@ -53,7 +53,10 @@ export default class Index extends Component {
|
53
|
53
|
// 用户信息保存至服务器
|
54
|
54
|
dispatchUpdateUserInfo(payload).then(res => {
|
55
|
55
|
console.log('更新信息')
|
56
|
|
- this.setState({isLogin:true})
|
|
56
|
+ this.setState({
|
|
57
|
+ isLogin:true,
|
|
58
|
+
|
|
59
|
+ })
|
57
|
60
|
})
|
58
|
61
|
},
|
59
|
62
|
fail: (err) => {
|
|
@@ -70,6 +73,7 @@ export default class Index extends Component {
|
70
|
73
|
}
|
71
|
74
|
|
72
|
75
|
getPhoneNumber(e) {
|
|
76
|
+ const { userInfo: { person: { personId } } } = this.props
|
73
|
77
|
getUserPhone(e, (phoneNumber) => {
|
74
|
78
|
const { dispatchUpdateUserInfoNew } = this.props
|
75
|
79
|
if (!phoneNumber) {
|
|
@@ -79,14 +83,14 @@ export default class Index extends Component {
|
79
|
83
|
})
|
80
|
84
|
return
|
81
|
85
|
} else {
|
82
|
|
- dispatchUpdateUserInfoNew(this.state.user.id)
|
|
86
|
+ dispatchUpdateUserInfoNew(personId)
|
83
|
87
|
this.setState({isPhone:true})
|
84
|
88
|
}
|
85
|
89
|
})
|
86
|
90
|
}
|
87
|
91
|
|
88
|
92
|
render() {
|
89
|
|
- const {user}=this.state
|
|
93
|
+ const { userInfo: { person: { avatarurl,nickname } } } = this.props
|
90
|
94
|
if (!this.state.isLogin) {
|
91
|
95
|
return (
|
92
|
96
|
<View className="avatar-page">
|
|
@@ -101,8 +105,8 @@ export default class Index extends Component {
|
101
|
105
|
} else if (!this.state.isPhone) {
|
102
|
106
|
return (
|
103
|
107
|
<View className='auth-page'>
|
104
|
|
- <Image className="avatar_img" src={user.avatar} />
|
105
|
|
- <View className="user_name">{user.nickname}</View>
|
|
108
|
+ <Image className="avatar_img" src={avatarurl} />
|
|
109
|
+ <View className="user_name">{nickname}</View>
|
106
|
110
|
<Button className='auth-btn' open-type="getPhoneNumber" onGetphonenumber={this.getPhoneNumber}>微信授权一键登录</Button>
|
107
|
111
|
{/* <View className='adver-btn' onClick={this.handleLogin}><Text>我是置业顾问,立即登录~</Text></View> */}
|
108
|
112
|
</View>
|