import CountDownButton from 'react-native-smscode-count-down';
//页面渲染
<CountDownButton
style={styles.codeButton}
textStyle={{color: '#fff'}}
timerCount={60}
timerTitle={'获取验证码'}
enable={this.state.newPhoneNumber.length > 10}
timerActiveTitle={['重新获取(','s)']}
disableColor={"#333"}
onClick={(shouldStartCounting)=>{
this.sendCode(shouldStartCounting);//发送验证码调用的方法
}}
timerEnd={()=>{
}}/>
//发送验证码方法
sendCode(shouldStartCounting){
shouldStartCounting(true);//获取验证码改变状态
}