Authored by 张文文

提现记录页面获取身份证绑定状态

@@ -17,17 +17,21 @@ export default class WithdrawalRecord extends Component { @@ -17,17 +17,21 @@ export default class WithdrawalRecord extends Component {
17 } 17 }
18 18
19 _renderHeader() { 19 _renderHeader() {
  20 + let uploadStatus = this.props.identityCardInfo.data;
20 return (<View> 21 return (<View>
21 22
22 - <View style={styles.uploadContainer}>  
23 - <Text style={styles.loadStyle}>{'结算收益时需按照国家规定预扣个税,因此需先上传身份证信息 。若未提供正确有效的身份信息将导致扣税失败而影响提现。'}</Text>  
24 - <TouchableOpacity style={styles.uploadButton} onPress={()=> {  
25 -  
26 - }}>  
27 - <Text style={styles.buttonText}>{'去上传'}</Text>  
28 - </TouchableOpacity>  
29 - </View>  
30 - 23 + { uploadStatus ?
  24 + null
  25 + :
  26 + <View style={styles.uploadContainer}>
  27 + <Text style={styles.loadStyle}>{'结算收益时需按照国家规定预扣个税,因此需先上传身份证信息 。若未提供正确有效的身份信息将导致扣税失败而影响提现。'}</Text>
  28 + <TouchableOpacity style={styles.uploadButton} onPress={()=> {
  29 + this.props.jumpWithUrl && this.props.jumpWithUrl('我的身份证', 'nameAuthen')
  30 + }}>
  31 + <Text style={styles.buttonText}>{'去上传'}</Text>
  32 + </TouchableOpacity>
  33 + </View>
  34 + }
31 35
32 <View style={styles.withdrawContainer}> 36 <View style={styles.withdrawContainer}>
33 <Text style={styles.tipStyle}>{'每月20日结算上个月预估佣金并预扣个税'}</Text> 37 <Text style={styles.tipStyle}>{'每月20日结算上个月预估佣金并预扣个税'}</Text>
@@ -8,7 +8,7 @@ import {Map} from 'immutable'; @@ -8,7 +8,7 @@ import {Map} from 'immutable';
8 import * as allianceActions from '../reducers/alliance/allianceActions'; 8 import * as allianceActions from '../reducers/alliance/allianceActions';
9 import WithdrawalRecord from "../components/WithdrawalRecord"; 9 import WithdrawalRecord from "../components/WithdrawalRecord";
10 import LoadingIndicator from '../../common/components/LoadingIndicator'; 10 import LoadingIndicator from '../../common/components/LoadingIndicator';
11 -import {StyleSheet, View} from "react-native"; 11 +import ReactNative, {StyleSheet, View} from "react-native";
12 12
13 const actions = [ 13 const actions = [
14 allianceActions, 14 allianceActions,
@@ -37,28 +37,37 @@ class WithdrawalRecordContainer extends Component { @@ -37,28 +37,37 @@ class WithdrawalRecordContainer extends Component {
37 constructor(props) { 37 constructor(props) {
38 super(props); 38 super(props);
39 this._onEndReached = this._onEndReached.bind(this); 39 this._onEndReached = this._onEndReached.bind(this);
  40 + this._jumpWithUrl = this._jumpWithUrl.bind(this);
40 } 41 }
41 42
42 componentDidMount() { 43 componentDidMount() {
43 this.props.actions.getSettlementRecord(); 44 this.props.actions.getSettlementRecord();
  45 + this.props.actions.getIdentityCardInfo();
44 } 46 }
45 47
46 componentWillUnmount() { 48 componentWillUnmount() {
47 49
48 } 50 }
49 51
  52 + _jumpWithUrl(title = '', type = '') {
  53 + let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.minealliance","params":{"title":"${title}","type":"${type}"}}`;
  54 + ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
  55 + }
  56 +
50 _onEndReached() { 57 _onEndReached() {
51 this.props.actions.getSettlementRecord(); 58 this.props.actions.getSettlementRecord();
52 } 59 }
53 60
54 render() { 61 render() {
55 - let {settlementRecordList} = this.props.alliance; 62 + let {settlementRecordList, identityCardInfo} = this.props.alliance;
56 let isFetching = settlementRecordList.isFetching; 63 let isFetching = settlementRecordList.isFetching;
57 return ( 64 return (
58 <View style={styles.container}> 65 <View style={styles.container}>
59 <WithdrawalRecord 66 <WithdrawalRecord
60 settlementRecordList={settlementRecordList} 67 settlementRecordList={settlementRecordList}
61 - onEndReached={this._onEndReached}/> 68 + identityCardInfo={identityCardInfo}
  69 + onEndReached={this._onEndReached}
  70 + jumpWithUrl={this._jumpWithUrl}/>
62 <LoadingIndicator isVisible={isFetching}/> 71 <LoadingIndicator isVisible={isFetching}/>
63 </View> 72 </View>
64 ) 73 )
@@ -71,4 +80,4 @@ let styles = StyleSheet.create({ @@ -71,4 +80,4 @@ let styles = StyleSheet.create({
71 }, 80 },
72 }); 81 });
73 82
74 -export default connect(mapStateToProps, mapDispatchToProps)(WithdrawalRecordContainer);  
  83 +export default connect(mapStateToProps, mapDispatchToProps)(WithdrawalRecordContainer);