...
|
...
|
@@ -31,7 +31,54 @@ export default class UserLogoutReason extends Component { |
|
|
image0Degree: 0,
|
|
|
image1Degree: 0,
|
|
|
image2Degree: 0,
|
|
|
image3Degree: 0
|
|
|
image3Degree: 0,
|
|
|
countDown: 59,
|
|
|
tickTimeOut: false,
|
|
|
resendBtnText: '获取',
|
|
|
}
|
|
|
}
|
|
|
|
|
|
_startTimer() {
|
|
|
this.timer = setInterval(function () {
|
|
|
let count = this.state.countDown - 1;
|
|
|
if (count < 0) {
|
|
|
count = 60;
|
|
|
this.setState({
|
|
|
countDown: count,
|
|
|
tickTimeOut: true,
|
|
|
resendBtnText: '获取',
|
|
|
});
|
|
|
}
|
|
|
if (!this.state.tickTimeOut) {
|
|
|
this.setState({
|
|
|
countDown: count,
|
|
|
resendBtnText: count+'s',
|
|
|
});
|
|
|
}
|
|
|
}.bind(this), 1000);
|
|
|
|
|
|
}
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
this.timer && clearInterval(this.timer);
|
|
|
}
|
|
|
|
|
|
_sendConfirmPaySnsCode() {
|
|
|
if (this.state.mobile == '') {
|
|
|
this.props.mobileEmptyTip();
|
|
|
return;
|
|
|
}
|
|
|
if (this.state.resendBtnText !== '获取') {
|
|
|
return;
|
|
|
}else {
|
|
|
this.setState({
|
|
|
countDown: 60,
|
|
|
tickTimeOut: false,
|
|
|
resendBtnText: '59s',
|
|
|
});
|
|
|
this._startTimer();
|
|
|
var degrees = this.state.image0Degree + ',' + this.state.image1Degree + ',' + this.state.image2Degree + ',' + this.state.image3Degree;
|
|
|
this.props.fetchCanleCode && this.props.fetchCanleCode(this.state.mobile, degrees)
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -103,10 +150,9 @@ export default class UserLogoutReason extends Component { |
|
|
<TouchableOpacity
|
|
|
style={{width:70,height:35,marginRight:5}}
|
|
|
onPress={() => {
|
|
|
var degrees = this.state.image0Degree + ',' + this.state.image1Degree + ',' + this.state.image2Degree + ',' + this.state.image3Degree;
|
|
|
this.props.fetchCanleCode && this.props.fetchCanleCode(this.state.mobile, degrees)
|
|
|
this._sendConfirmPaySnsCode()
|
|
|
}}>
|
|
|
<Text style={{lineHeight:30,textAlign:'right',fontSize:14,color:'#444444',letterSpacing:-0.34}}>获取</Text>
|
|
|
<Text style={{lineHeight:30,textAlign:'right',fontSize:14,color:'#444444',letterSpacing:-0.34}}>{this.state.resendBtnText}</Text>
|
|
|
</TouchableOpacity>
|
|
|
</View>
|
|
|
{this.props.imageCheckSwitchState ?
|
...
|
...
|
|