|
@@ -16,6 +16,7 @@ export default class Index extends Component {
|
16
|
16
|
}
|
17
|
17
|
}
|
18
|
18
|
getUserInfo() {
|
|
19
|
+ Taro.showLoading({ mask: true, title: '授权中...' });
|
19
|
20
|
const { dispatchUpdateUserInfo } = this.props
|
20
|
21
|
const sessionKey = Taro.getStorageSync('sessionKey')
|
21
|
22
|
Taro.getUserInfo({
|
|
@@ -35,11 +36,12 @@ export default class Index extends Component {
|
35
|
36
|
dispatchUpdateUserInfo(payload).then(res => {
|
36
|
37
|
console.log('更新信息')
|
37
|
38
|
this.props.onSuccess();
|
|
39
|
+ Taro.hideLoading()
|
38
|
40
|
})
|
39
|
41
|
},
|
40
|
42
|
fail: (err) => {
|
41
|
43
|
console.error(err)
|
42
|
|
-
|
|
44
|
+ Taro.hideLoading()
|
43
|
45
|
Taro.showToast({
|
44
|
46
|
title: '获取用户信息失败',
|
45
|
47
|
icon: 'none'
|
|
@@ -56,7 +58,7 @@ export default class Index extends Component {
|
56
|
58
|
<View className="content">
|
57
|
59
|
<View className="title">请允许获取昵称、头像、地区及性别</View>
|
58
|
60
|
<View className="touxiang"><open-data type="userAvatarUrl"></open-data></View>
|
59
|
|
- <View className="name"><open-data type="userNickName"></open-data></View>
|
|
61
|
+ <View className="name"><open-data type="userNickName"></open-data></View>
|
60
|
62
|
<Button className="btn" open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>好</Button>
|
61
|
63
|
</View>
|
62
|
64
|
</View>
|