Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. auth(){
  2. let d = {
  3. Phone: parseInt(this.state.Phone.replace(/\D+/g,"")),
  4. ActivationCode: this.state.ActivationCode
  5. };
  6. if(isNaN(d.Phone)||d.ActivationCode==''){
  7. Toast.show({
  8. text: 'Заполните все поля!',
  9. position: "top"
  10. });
  11. }
  12. else{
  13. global.BS.request('Driver','activation',{
  14. Phone: parseInt(this.state.Phone.replace(/\D+/g,"")),
  15. ActivationCode: this.state.ActivationCode
  16. }).then((data)=>{
  17. AsyncStorage.setItem("CardId",data.body.CardId);
  18. global.BS.session.CardId = data.body.CardId;
  19. this.props.navigation.navigate('Main');
  20. }).catch((err)=>{
  21. Toast.show({
  22. text: err.body.body.Error.Message,
  23. position: "top"
  24. });
  25. })
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement