Authored by 张文文

我的页面添加粉丝数和邀请好友数

... ... @@ -52,16 +52,8 @@ export default class Data extends Component {
let settlementAmount = this.props.settlementInfo.settlementInfoData.settlementAmount;
settlementAmount = settlementAmount ? settlementAmount : '0';
//当前粉丝数空值判断
let fansAmount = this.props.shareTotalInfo.shareTotalInfoData.fans;
fansAmount = fansAmount ? fansAmount : '0';
//邀请好友数空值判断
let invitesAmount = this.props.shareTotalInfo.shareTotalInfoData.inviteNum;
invitesAmount = invitesAmount ? invitesAmount : '0';
return (
<ScrollView style={styles.container} scrollEnabled = {true}>
<ScrollView style={styles.container} scrollEnabled = {scrollEnabled}>
<TipsAlert
tips={this.props.tips}
isShow={isShowTipsAlert}
... ... @@ -146,19 +138,6 @@ export default class Data extends Component {
</ScrollableTabView>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
<View style={styles.statisticsView}>
<View style={styles.attentionView}>
<Text style={[styles.hasWithDrawText,{marginLeft: 10}]}>当前粉丝数</Text>
<Text style={[styles.hasWithDrawText, {marginRight: 10}]}>{fansAmount}</Text>
</View>
<View style={styles.spaceView}/>
<TouchableOpacity activeOpacity={1} style={styles.attentionView} onPress={() => {
this.props.jumpWithUrl && this.props.jumpWithUrl('邀请好友', 'invitedFriends');
}}>
<Text style={[styles.hasWithDrawText],{marginLeft: 10}}>邀请好友数</Text>
<Text style={[styles.hasWithDrawText],{marginRight: 10}}>{invitesAmount}</Text>
</TouchableOpacity>
</View>
</ScrollView>
);
}
... ... @@ -270,26 +249,6 @@ let styles = StyleSheet.create({
width: width,
height: 0.5,
backgroundColor: '#e0e0e0'
},
statisticsView: {
width: width,
height: 50,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
},
attentionView: {
width: width/2,
height: 50,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between'
},
spaceView: {
width: 0.5,
height: 50,
backgroundColor: '#e0e0e0'
},
}
})
;
... ...
... ... @@ -38,6 +38,18 @@ export default class Mine extends Component {
let ico = this.props.profile.head_ico;
let imageUrl = YH_Image.getSlicedUrl(ico, 50, 50, 2);
let nickname = this.props.profile.nickname;
//当前粉丝数空值判断
let fansAmount = this.props.shareTotalInfo.shareTotalInfoData.fans;
fansAmount = fansAmount ? fansAmount : '0';
let fansShow = this.props.shareTotalInfo.shareTotalInfoData.showFans;
let fansShowStyle = fansShow ? {height: 50} : {height: 0};
//邀请好友数空值判断
let invitesAmount = this.props.shareTotalInfo.shareTotalInfoData.inviteNum;
invitesAmount = invitesAmount ? invitesAmount : '0';
return (
<View>
<View style={styles.headerBackground}>
... ... @@ -57,6 +69,27 @@ export default class Mine extends Component {
</View>
</TouchableOpacity>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
<TouchableOpacity activeOpacity={1} style={styles.withdrawView} onPress={() => {
this.props.jumpWithUrl && this.props.jumpWithUrl('邀请好友', 'invitedFriends');
}}>
<Text style={styles.hasWithDrawText}>邀请好友数</Text>
<View style={[styles.textView, {flexDirection: 'row', paddingRight: 15}]}>
<Text style={[styles.hasWithDrawText]}>{invitesAmount}</Text>
<Image style={styles.arrowImage} source={require('../images/arrow.png')}/>
</View>
</TouchableOpacity>
<TouchableOpacity activeOpacity={1} style={styles.withdrawView, fansShowStyle} onPress={() => {
}}>
<Text style={styles.hasWithDrawText}>当前粉丝数</Text>
<View style={[styles.textView, {flexDirection: 'row', paddingRight: 15}]}>
<Text style={[styles.hasWithDrawText]}>{fansAmount}</Text>
<Image style={styles.arrowImage} source={require('../images/arrow.png')}/>
</View>
</TouchableOpacity>
<View style={{height: 10, backgroundColor: '#f0f0f0'}}/>
</View>
);
}
... ...
... ... @@ -60,7 +60,6 @@ class DataContainer extends Component {
componentDidMount() {
this.props.actions.getSettlementInfo();
this.props.actions.getStatisticsInfo(1);
this.props.actions.getShareTotalInfo();
}
componentWillUnmount() {
... ...
... ... @@ -45,6 +45,7 @@ class MineContainer extends Component {
this.props.actions.getMineUserInfo();
this.props.actions.getSettlementInfo();
this.props.actions.getMineResourceInfo();
this.props.actions.getShareTotalInfo();
}
componentWillUnmount() {
... ... @@ -73,6 +74,7 @@ class MineContainer extends Component {
profile,
settlementInfo,
mineResourceInfo,
shareTotalInfo,
} = this.props.alliance;
let isFetching = settlementInfo.isFetching;
return (
... ... @@ -81,6 +83,7 @@ class MineContainer extends Component {
profile={profile}
settlementInfo={settlementInfo}
mineResourceInfo={mineResourceInfo}
shareTotalInfo={shareTotalInfo}
jumpWithUrl={this._jumpWithUrl}
resourceJumpWithUrl={this._resourceJumpWithUrl}
refreshSettlementInfo={this._refreshSettlementInfo}
... ...