Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- auth(){
- let d = {
- Phone: parseInt(this.state.Phone.replace(/\D+/g,"")),
- ActivationCode: this.state.ActivationCode
- };
- if(isNaN(d.Phone)||d.ActivationCode==''){
- Toast.show({
- text: 'Заполните все поля!',
- position: "top"
- });
- }
- else{
- global.BS.request('Driver','activation',{
- Phone: parseInt(this.state.Phone.replace(/\D+/g,"")),
- ActivationCode: this.state.ActivationCode
- }).then((data)=>{
- AsyncStorage.setItem("CardId",data.body.CardId);
- global.BS.session.CardId = data.body.CardId;
- this.props.navigation.navigate('Main');
- }).catch((err)=>{
- Toast.show({
- text: err.body.body.Error.Message,
- position: "top"
- });
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement