-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathMyPage.js
81 lines (70 loc) · 1.86 KB
/
MyPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* Created by guoshuyu on 2017/11/10.
*/
import React, {Component} from 'react';
import {InteractionManager} from 'react-native';
import loginActions from '../store/actions/login'
import userActions from '../store/actions/user'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import BasePersonPage from "./widget/BasePersonPage";
/**
* 我的
*/
@connect(
state => ({
userState: state.user,
}),dispatch => ({
loginAction: bindActionCreators(loginActions, dispatch),
userAction: bindActionCreators(userActions, dispatch)
})
)
export default class MyPage extends BasePersonPage {
constructor(props) {
super(props);
this.refreshUnRead = this.refreshUnRead.bind(this);
this.showType = 0;
}
componentDidMount() {
super.componentDidMount();
InteractionManager.runAfterInteractions(() => {
this.refreshUnRead();
this._getOrgsList();
});
}
_refresh() {
super._refresh();
this.refreshUnRead();
userActions.getUserInfo().then((res)=>{
if(__DEV__) {
console.log("***MyPage***", res)
}
})
}
getBackNotifyCall() {
this.refreshUnRead();
}
refreshUnRead() {
userActions.getNotifation(false, false, 0).then((res) => {
if (res && res.result && res.data && res.data.length > 0) {
this.setState({
unRead: true,
});
} else {
this.setState({
unRead: false,
})
}
})
}
getUserInfo() {
let {userState} = this.props;
return (userState.userInfo) ? userState.userInfo : {};
}
getSetting() {
return true
}
getSettingNeed() {
return true
}
}