SHARE
TWEET
Untitled
a guest
Jan 29th, 2018
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- function ganhar_voo(){
- var dados = {
- "VooId": 136,
- "Nome": 'Bruno Domenico di Santo',
- "Email": 'brunodisanto@gmail.com',
- "Telefone": '13997437729',
- "TipoDocumento": 1,
- "Documento": '333.407.828-06',
- "FacebookId": parseInt($('input[name="FacebookId"]').val()),
- "FacebookFoto": $('input[name="FacebookFoto"]').val(),
- "Termo": true,
- "Informativo": true
- };
- $.ajax({
- type: 'POST',
- url: apiEndPoint + '/embarcar',
- dataType: 'json',
- headers: {
- 'Authorization': $auth,
- 'Content-Type': 'application/json; charset=utf-8'
- },
- data: JSON.stringify(dados),
- success: function success(_success2) {
- $('[data-component="boarding"] .places .busy').text(_success2.Retorno.AssentosOcupados);
- $progress = parseInt(_success2.Retorno.AssentosOcupados) * 100 / parseInt(_success2.Retorno.TotalAssentos);
- $progress = $progress + '%';
- $('[data-component="boarding"] .progress span').width($progress);
- $('[data-component="sit"] .list .thumb').each(function (index, value) {
- if (_success2.Retorno.VooAssento[index] && _success2.Retorno.VooAssento[index].Embarque != null) {
- $(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>");
- $faceId = _success2.Retorno.VooAssento[index].Embarque.Cliente.FacebookId;
- $photo = _success2.Retorno.VooAssento[index].Embarque.Cliente.FacebookFoto;
- $sit = _success2.Retorno.VooAssento[index].Assento;
- $flyId = _success2.Retorno.Id;
- if (_success2.Retorno.VooAssento[index].Embarque.Cliente.FacebookId == $userID) {
- $('[data-component="sit"] #plane .alert h3').html("Pronto! Agora é só torcer.");
- $('[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>.");
- console.log("SUCESSO!!!!!!!!!!! "+JSON.stringify(_success2));
- }
- }
- });
- $('[data-component="flys"] ul').html('');
- updateFlys($flyId, $faceId, $sit, $photo);
- $('.loader-sit').fadeOut(300);
- $('[data-component="sit"] #plane').delay(350).fadeIn(400);
- },
- error: function error(_error4) {
- console.log("ERROR:"+JSON.stringify(_error4));
- $('[data-component="sit"] #plane .alert h3').html("Ocorreu algum erro no embarque do voo.");
- $('[data-component="sit"] #plane .alert p').html("" + _error4.responseJSON.Mensagem + "");
- $('.loader-sit').fadeOut(300);
- $('[data-component="sit"] #plane').delay(350).fadeIn(400);
- }
- });
- };
RAW Paste Data

