daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ganhar_voo(){
  2.     var dados = {
  3.         "VooId": 136,
  4.         "Nome": 'Bruno Domenico di Santo',
  5.         "Email": 'brunodisanto@gmail.com',
  6.         "Telefone": '13997437729',
  7.         "TipoDocumento": 1,
  8.         "Documento": '333.407.828-06',
  9.         "FacebookId": parseInt($('input[name="FacebookId"]').val()),
  10.         "FacebookFoto": $('input[name="FacebookFoto"]').val(),
  11.         "Termo": true,
  12.         "Informativo": true
  13.     };
  14.  
  15.     $.ajax({
  16.         type: 'POST',
  17.         url: apiEndPoint + '/embarcar',
  18.         dataType: 'json',
  19.         headers: {
  20.             'Authorization': $auth,
  21.             'Content-Type': 'application/json; charset=utf-8'
  22.         },
  23.         data: JSON.stringify(dados),
  24.         success: function success(_success2) {
  25.  
  26.             $('[data-component="boarding"] .places .busy').text(_success2.Retorno.AssentosOcupados);
  27.  
  28.             $progress = parseInt(_success2.Retorno.AssentosOcupados) * 100 / parseInt(_success2.Retorno.TotalAssentos);
  29.             $progress = $progress + '%';
  30.  
  31.             $('[data-component="boarding"] .progress span').width($progress);
  32.  
  33.             $('[data-component="sit"] .list .thumb').each(function (index, value) {
  34.  
  35.                 if (_success2.Retorno.VooAssento[index] && _success2.Retorno.VooAssento[index].Embarque != null) {
  36.                     $(this).html("<img src='" + _success2.Retorno.VooAssento[index].Embarque.Cliente.FacebookFoto + "' alt='" + _success2.Retorno.VooAssento[index].Embarque.Cliente.Nome + "'> <div class='tooltip'>" + _success2.Retorno.VooAssento[index].Embarque.Cliente.Nome + "</div>");
  37.                     $faceId = _success2.Retorno.VooAssento[index].Embarque.Cliente.FacebookId;
  38.                     $photo = _success2.Retorno.VooAssento[index].Embarque.Cliente.FacebookFoto;
  39.                     $sit = _success2.Retorno.VooAssento[index].Assento;
  40.                     $flyId = _success2.Retorno.Id;
  41.  
  42.                     if (_success2.Retorno.VooAssento[index].Embarque.Cliente.FacebookId == $userID) {
  43.                         $('[data-component="sit"] #plane .alert h3').html("Pronto! Agora é só torcer.");
  44.                         $('[data-component="sit"] #plane .alert p').html("O seu assento é <b>" + _success2.Retorno.VooAssento[index].Assento + "</b> e o número da sorte é <b>" + _success2.Retorno.VooAssento[index].CodigoCaixa + "</b>.");
  45.                         console.log("SUCESSO!!!!!!!!!!! "+JSON.stringify(_success2));
  46.                     }
  47.                 }
  48.             });
  49.  
  50.             $('[data-component="flys"] ul').html('');
  51.  
  52.             updateFlys($flyId, $faceId, $sit, $photo);
  53.  
  54.             $('.loader-sit').fadeOut(300);
  55.             $('[data-component="sit"] #plane').delay(350).fadeIn(400);
  56.         },
  57.         error: function error(_error4) {
  58.             console.log("ERROR:"+JSON.stringify(_error4));
  59.             $('[data-component="sit"] #plane .alert h3').html("Ocorreu algum erro no embarque do voo.");
  60.             $('[data-component="sit"] #plane .alert p').html("" + _error4.responseJSON.Mensagem + "");
  61.  
  62.             $('.loader-sit').fadeOut(300);
  63.             $('[data-component="sit"] #plane').delay(350).fadeIn(400);
  64.         }
  65.  
  66.     });
  67. };
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top