PageSourceSearch

https://unioentregas-app.com.br/js/scriptEE.js?v=4

js unioentregas-app.com.br collected 2026-10-02 01:19:08 UTC 18,989 bytes, 629 lines download raw bytes

1function apareceDiv(div) { // função aparecer
2    if (document.getElementById(div)) {
3        document.getElementById(div).style.display = "block";
4    }
5}
6
7function ocultaDiv(div) {  // função ocultar
8    if (document.getElementById(div)) {
9        document.getElementById(div).style.display = "none";
10    }
11}
12function abrirDivLentamente(idDiv) {
13
14    $('#' + idDiv).show(1000);
15
16}
17function escondeDivLentamente(idDiv) {
18    $('#' + idDiv).hide("slow");
19}
20function alteraCorFundoDiv(idDiv, cor) {
21    document.getElementById(idDiv).style.background = cor;
22}
23function alteraConteudoDiv(idDiv, conteudo) {
24    document.getElementById(idDiv).innerHTML = conteudo;
25}
26
27function sairApp() {
28    chaveMain.sair();
29    document.location.href = "mobileUsuarioLogadoSair.php"
30}
31
32function abrirLoginCadastro(identificador, cores = 'N') {
33
34    var escuro = "#ff171f";
35    var claro = "#ff7575";
36    if (cores == 'S') {
37        escuro = "#333756";
38        claro = "#33c0f0";
39    }
40
41    if (identificador == "P") {
42        /**
43         *abrir div pedidos / simulação
44         */
45        escondeDivLentamente('divLogarCadastrar');
46        abrirDivLentamente('divPedidosSimulacao');
47
48
49        document.getElementById("btnPS").style.background = claro;
50        document.getElementById("btnLC").style.background = escuro;
51
52
53    } else {
54        /**
55         *abrir div de cadastros / login
56         */
57        escondeDivLentamente('divPedidosSimulacao');
58        abrirDivLentamente('divLogarCadastrar');
59
60        document.getElementById("btnPS").style.background = escuro;
61        document.getElementById("btnLC").style.background = claro;
62
63
64
65        $.post("cadastroUsuarioPasta/ajaxVerificarSessao.php", {
66        },
67            function (retorno) {
68                $('#divVerificaSessaoUsuario').html(retorno);
69            }, 'html');
70    }
71
72
73
74
75}
76
77
78function salvarEnderecoCliente() {
79
80
81    document.getElementById('retorno').innerHTML = '<img src="imagens/carregando.gif" />';
82    var rua = document.getElementById("rua").value;
83    var numero = document.getElementById("numero").value;
84    var complemento = document.getElementById("complemento").value;
85    var bairro = document.getElementById("bairro").value;
86    var cidade = document.getElementById("cidade").value;
87    var estado = document.getElementById("estado").value;
88    var idCliente = document.getElementById("id").value;
89    var nEntregadores = document.getElementById("nEntregadores").value;
90
91
92    $.post("cadastroEndereco/salvarEnderecoCliente.php", {
93        rua: rua,
94        numero: numero,
95        complemento: complemento,
96        bairro: bairro,
97        cidade: cidade,
98        estado: estado,
99        idCliente: idCliente,
100        nEntregadores: nEntregadores
101    },
102        function (retorno) {
103            document.getElementById('retorno').innerHTML = '';
104            $('#retorno').html(retorno);
105        }, 'html');
106
107}
108function ajaxPassandoParametro(div, param1, param2, param3, param4, url, eventoDisparadoCliente = 'S', escolheouSimNao = 'N') {
109    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
110
111    $.post(url, {
112        param1: param1,
113        param2: param2,
114        param3: param3,
115        param4: param4,
116        eventoDisparadoCliente: eventoDisparadoCliente,
117        escolheouSimNao: escolheouSimNao
118    },
119        function (retorno) {
120            $('#' + div).html(retorno);
121        }, 'html');
122
123}
124function enviarServicoParaEntregador(div, idServico, idEntregador, aux, url, eventoDisparadoCliente = 'S', escolheuSimNao = 'N') {
125
126    console.log('div :: ' + div + ' | idServico :: ' + idServico + ' | idEntregador :: ' + idEntregador + ' | aux :: ' + aux + ' | url :: ' + url);
127
128    if (document.getElementById(div)) {
129        document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
130    }
131
132    if (idEntregador === '') {
133
134        idEntregador = radionSelecionado('profissionais' + idServico);
135    }
136    // alert('idp '+idEntregador);
137
138    if (idEntregador === null) {
139        if (document.getElementById(div)) {
140            document.getElementById(div).innerHTML = "<br />Favor marcar o entregador";
141        }
142    } else {
143
144        $.post(url, {
145            idServico: idServico,
146            idEntregador: idEntregador,
147            aux: aux,
148            eventoDisparadoCliente: eventoDisparadoCliente,
149            escolheuSimNao: escolheuSimNao
150        },
151            function (retorno) {
152                $('#' + div).html(retorno);
153            }, 'html');
154    }
155}
156function pagarServicoEmDinheiro(div, idServico) {
157
158    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
159
160
161    $.post("ouvirAceiteProfissional/ajaxPagarServicoEmDinheiro.php", {
162        idServico: idServico
163    },
164        function (retorno) {
165            $('#' + div).html(retorno);
166        }, 'html');
167
168}
169
170function pagarServicoEmFaturado(div, idServico) {
171
172    document.getElementById(div).style.display = "block";
173    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
174
175    $.post("ouvirAceiteProfissional/ajaxPagarServicoFaturado.php", {
176        idServico: idServico,
177
178    },
179        function (retorno) {
180            $('#' + div).html(retorno);
181        }, 'html');
182}
183function pagarServicoEmDinheiroInformandoPonto(div, idServico, idEndereco) {
184
185    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
186
187    var ponto = '';
188    var nomeTel = '';
189    var validar = 'S';
190    var trocoPara = '';
191
192    if (document.getElementById('trocoPara' + idEndereco)) {
193        trocoPara = document.getElementById('trocoPara' + idEndereco).value;
194    }
195
196    if (document.getElementById('listaPontos' + idEndereco)) {
197        ponto = getSelecValor('listaPontos' + idEndereco);
198        if (ponto === '') {
199            validar = 'N';
200            document.getElementById(div).innerHTML = 'Favor selecionar o ponto que o profissional irá receber';
201        }
202
203    }
204
205    if (document.getElementById('nomeTelefone' + idEndereco)) {
206        nomeTel = document.getElementById('nomeTelefone' + idEndereco).value;
207        if (nomeTel === '') {
208            validar = 'N';
209            document.getElementById(div).innerHTML = 'Favor informar o nome e telefone da pessoa que o profissional irá receber';
210        }
211    }
212
213
214    if (validar === 'S') {
215
216        $.post("ouvirAceiteProfissional/ajaxPagarServicoEmDinheiro.php", {
217            idServico: idServico,
218            idEndereco: idEndereco,
219            ponto: ponto,
220            nomeTel: nomeTel,
221            trocoPara: trocoPara
222        },
223            function (retorno) {
224                $('#' + div).html(retorno);
225            }, 'html');
226    }
227}
228
229function pagarServicoEmDinheiroInformandoPonto2(div, idServico, idEndereco) {
230
231    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
232
233    var ponto = '';
234    var nomeTel = '';
235    var validar = 'S';
236    var trocoPara = '';
237
238    if (document.getElementById('trocoPara' + idEndereco)) {
239        trocoPara = document.getElementById('trocoPara' + idEndereco).value;
240    }
241
242    if (document.getElementById('listaPontos' + idEndereco)) {
243        ponto = getSelecValor('listaPontos' + idEndereco);
244
245
246    }
247
248    if (document.getElementById('nomeTelefone' + idEndereco)) {
249        nomeTel = document.getElementById('nomeTelefone' + idEndereco).value;
250
251    }
252
253
254    if (validar === 'S') {
255
256        $.post("ouvirAceiteProfissional/ajaxPagarServicoEmDinheiro.php", {
257            idServico: idServico,
258            idEndereco: idEndereco,
259            ponto: ponto,
260            nomeTel: nomeTel,
261            trocoPara: trocoPara
262        },
263            function (retorno) {
264                $('#' + div).html(retorno);
265            }, 'html');
266    }
267}
268
269function alterarDadosClienteSolicitante(div, aux, idSolicitante) {
270
271    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
272
273    var nome = "";
274    var empresa = "";
275    var email = "";
276    var cargo = "";
277    var telFixo = "";
278    var ramal;
279    var celular = "";
280    var emailFinanceiro = "";
281    var telFixo1 = "";
282    var inscricaoEstadual = "";
283    var ccm = "";
284    var idUsuarioLogado = '';
285
286    nome = document.getElementById("nomeS").value;
287
288    if (document.getElementById("empresa")) {
289        empresa = document.getElementById("empresa").value;
290    } else {
291        empresa = "N";
292    }
293
294    if (document.getElementById("idUsuarioLogado")) {
295        idUsuarioLogado = document.getElementById("idUsuarioLogado").value;
296    }
297
298    email = document.getElementById("emailS").value;
299
300    if (document.getElementById("cargo")) {
301        cargo = document.getElementById("cargo").value;
302    }
303    if (document.getElementById("inscricaoEstadual")) {
304        inscricaoEstadual = document.getElementById("inscricaoEstadual").value;
305    }
306    if (document.getElementById("ccm")) {
307        ccm = document.getElementById("ccm").value;
308    }
309
310    if (document.getElementById('ramal')) {
311        ramal = document.getElementById('ramal').value;
312    }
313
314    telFixo = document.getElementById("telFixoS").value;
315
316    telFixo1 = document.getElementById("telFixo1").value;
317    celular = document.getElementById("celularS").value;
318    telFixo = document.getElementById("telFixoS").value;
319    telFixo = document.getElementById("telFixoS").value;
320
321    var cnpjS = "";
322    if (document.getElementById("cnpjS")) {
323        cnpjS = document.getElementById("cnpjS").value;
324    }
325
326    var cpfS = "";
327    if (document.getElementById("cpfS")) {
328        cpfS = document.getElementById("cpfS").value;
329    }
330
331
332    $.post("usuarioLogado/ajaxAlterarDadosSolicitante.php", {
333        idSolicitante: idSolicitante,
334        nome: nome,
335        empresa: empresa,
336        email: email,
337        cargo: cargo,
338        telFixo: telFixo,
339        telFixo1: telFixo1,
340        ramal: ramal,
341        celular: celular,
342        inscricaoEstadual: inscricaoEstadual,
343        ccm: ccm,
344        idUsuarioLogado: idUsuarioLogado,
345        cnpjS: cnpjS,
346        cpfS: cpfS
347    },
348        function (retorno) {
349            $('#' + div).html(retorno);
350        }, 'html');
351
352}
353function alterarDadosUs(div, aux, idSolicitante) {
354
355    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
356
357    var dado = document.getElementById("dado").value;
358    var idUsuarioLogado = '';
359
360    if (document.getElementById("idUsuarioLogado")) {
361        idUsuarioLogado = document.getElementById("idUsuarioLogado").value;
362    }
363
364    $.post("usuarioLogado/ajaxAlterarDadosSolicitante2.php", {
365        idSolicitante: idSolicitante,
366        dado: dado,
367        idUsuarioLogado: idUsuarioLogado
368    },
369        function (retorno) {
370            $('#' + div).html(retorno);
371        }, 'html');
372
373}
374function salvarEnderecoUsarFuturo(div, identificador) {
375
376
377    document.getElementById(div).innerHTML = '<img src="imagens/carregando.gif" />';
378    var rua = document.getElementById("txtEnderecoE" + identificador).value;
379    var numero = '';
380    if (document.getElementById("n" + identificador)) {
381        numero = document.getElementById("n" + identificador).value;
382    }
383    var complemento = '';
384
385    if (document.getElementById("comp" + identificador)) {
386
387        complemento = document.getElementById("comp" + identificador).value;
388
389    }
390    var obs = '';
391    if (document.getElementById("obs" + identificador)) {
392        obs = document.getElementById("obs" + identificador).value;
393    }
394    var telefone = '';
395    var contato = '';
396    if (document.getElementById('telEnd' + identificador)) {
397        telefone = document.getElementById('telEnd' + identificador).value;
398    }
399    if (document.getElementById('contatoEnd' + identificador)) {
400        contato = document.getElementById('contatoEnd' + identificador).value;
401    }
402    var la = '';
403    if (document.getElementById("latitudeE" + identificador)) {
404        la = document.getElementById("latitudeE" + identificador).value;
405    }
406    var lo = '';
407    if (document.getElementById("longitudeE" + identificador)) {
408        lo = document.getElementById("longitudeE" + identificador).value;
409    }
410
411
412
413    $.post("enderecosServico/gravaPedidoGenerico/ajaxSalvaEnderecoUsarFuturo.php", {
414        rua: rua,
415        numero: numero,
416        complemento: complemento,
417        obs: obs,
418        la: la,
419        lo: lo,
420        identificador: identificador,
421        telefone: telefone,
422        contato: contato
423    },
424        function (retorno) {
425            $('#' + div).html(retorno);
426        }, 'html');
427
428}
429function salvarDadosFaturamentoCliente() {
430
431
432    document.getElementById('retorno').innerHTML = '<img src="imagens/carregando.gif" />';
433
434    var razaoSocial = document.getElementById("razaoSocial").value;
435    var cnpj = document.getElementById("cnpj").value;
436    var insc = document.getElementById("insc").value;
437    var cep = document.getElementById("cep").value;
438    var rua = document.getElementById("rua").value;
439    var numero = document.getElementById("numero").value;
440    var complemento = document.getElementById("complemento").value;
441    var bairro = document.getElementById("bairro").value;
442    var cidade = document.getElementById("cidade").value;
443    var estado = document.getElementById("estado").value;
444    var email = document.getElementById("email").value;
445    var telefone = document.getElementById("telefone").value;
446
447
448
449    $.post("dadosFaturamento/ajaxSalvarDadosFaturamento.php", {
450        razaoSocial: razaoSocial,
451        cnpj: cnpj,
452        insc: insc,
453        cep: cep,
454        rua: rua,
455        numero: numero,
456        complemento: complemento,
457        bairro: bairro,
458        cidade: cidade,
459        estado: estado,
460        email: email,
461        telefone: telefone
462    }, function (retorno) {
463        document.getElementById('retorno').innerHTML = '';
464        $('#retorno').html(retorno);
465    }, 'html');
466
467}
468
469function cadastrarCliente() {
470    document.getElementById('divRetorno').innerHTML = '<img src="imagens/carregando.gif" />';
471    var empresa = document.getElementById("empresa").value;
472    var nome = document.getElementById("nome").value;
473    var email = document.getElementById("email").value;
474    var cargo = document.getElementById("cargo").value;
475    var telefone = document.getElementById("telFixo").value;
476    var celular = document.getElementById("celular").value;
477    var senha1 = document.getElementById("senha1").value;
478    var senha2 = document.getElementById("senha2").value;
479
480    if (senha1 == senha2) {
481
482        let validacaocaptcha = $('#retornjoCaptcha').find('#validacaocaptcha').val();
483        let captcha_hf = '';
484        let captcha_idhf = '';
485        if (validacaocaptcha == 'S') {
486            captcha_hf = $('#retornjoCaptcha').find('[name="captcha-hf"]').val();
487            captcha_idhf = $('#retornjoCaptcha').find('[name="captcha-idhf"]').val();
488        }
489
490        $.post("cadastroUsuario/ajaxCadastroUsuario.php", {
491            empresa: empresa,
492            nome: nome,
493            email: email,
494            cargo: cargo,
495            telefone: telefone,
496            celular: celular,
497            senha1: senha1,
498            validacaocaptcha: validacaocaptcha,
499            'captcha-hf': captcha_hf,
500            'captcha-idhf': captcha_idhf
501        }, function (retorno) {
502            document.getElementById('divRetorno').innerHTML = '';
503            $('#divRetorno').html(retorno);
504        }, 'html');
505    } else {
506        document.getElementById('divRetorno').innerHTML = 'Precisa criar uma senha e cofirmar a mesma senha';
507    }
508}
509function dadosEndereco(idEndereco, idCliente, endereco) {
510
511    document.getElementById('divEndereco').innerHTML = '<img src="imagens/carregando.gif" />';
512
513
514
515    $.post("cadastroEndereco/dadosEndereco.php", {
516        endereco: endereco,
517        idCliente: idCliente,
518        idEndereco: idEndereco
519    },
520        function (retorno) {
521            document.getElementById('divEndereco').innerHTML = '';
522            $('#divEndereco').html(retorno);
523        }, 'html');
524
525
526}
527function informarEnderecoErrado(idEndereco, endereco) {
528
529    document.getElementById('divRetoInfoEndErrado').innerHTML = '<img src="imagens/carregando.gif" />';
530
531
532
533    $.post("cadastroEndereco/informarEnderecoNaoPegouLatitude.php", {
534        endereco: endereco,
535        idEndereco: idEndereco
536    },
537        function (retorno) {
538            document.getElementById('divRetoInfoEndErrado').innerHTML = '';
539            $('#divRetoInfoEndErrado').html(retorno);
540        }, 'html');
541
542
543}
544function iconesPedidoMotosinal(tipoVeiculo, aux) {
545    /**
546     * também é usado para urbano leva
547     */
548
549    if (tipoVeiculo === "A") {
550        abrirDivLentamente('divPedirMototaxi');
551        escondeDivLentamente('divPedirMotoboy');
552        funcaoAncoraLevementeScriptEE('ancoraIcones');
553        escondeDivLentamente('divEnderecosPedido');
554        escondeDivLentamente('mapas');
555
556    } else if (tipoVeiculo === "M") {
557        abrirDivLentamente('divPedirMotoboy');
558        escondeDivLentamente('divPedirMototaxi');
559        funcaoAncoraLevementeScriptEE('ancoraIcones');
560        escondeDivLentamente('divEnderecosPedido');
561        escondeDivLentamente('mapas');
562    }
563
564}
565
566function apareceDivCadastrar() {
567    apareceDiv('divCadastraEmp');
568    ocultaDiv('divInfoCad');
569}
570
571/**
572 * faz mover pagina lento
573 */
574//jQuery(document).ready(function ($) {
575//    $(".scroll").click(function (event) {
576//        event.preventDefault();
577//        $('html,body').animate({
578//           
579//            scrollTop: $(this.hash).offset().top
580//        }, 1600);
581//    });
582//});
583
584function funcaoAncoraLevementeScriptEE(ancora) {
585    //    this.location = "#" + ancora;
586    //    alert(ancora)
587    var aTag = $("a[name='" + ancora + "']");
588    $('html,body').animate({
589        scrollTop: aTag.offset().top
590    }, 'slow');
591}
592function radionSelecionado(name) {
593    var rads = document.getElementsByName(name);
594    for (var i = 0; i < rads.length; i++) {
595        if (rads[i].checked) {
596            return rads[i].value;
597        }
598
599    }
600
601    return null;
602}
603function alterarIconeTipoVeiculo() {
604
605    //        alert(' aqui')
606    var tipoVeiculo = getSelecValor('tipoVeiculo');
607    //alert(' aqui 2 ='+tipoVeiculo)
608    if (document.getElementById('divCadMoto')) {
609        if (tipoVeiculo === "U") {
610            escondeDivLentamente('divCadMoto')
611            abrirDivLentamente('divCadCarro');
612        } else if (tipoVeiculo === "M") {
613            escondeDivLentamente('divCadCarro');
614            abrirDivLentamente('divCadMoto');
615        }
616    }
617
618}
619function getSelecValor(name) {
620    var e = document.getElementById(name);
621    var itemSelecionado = e.options[e.selectedIndex].value;
622
623    return itemSelecionado;
624}
625function popEditarFormaPagto(idServico, idCliente, idMotoboy, tipo) {
626
627    var janelaPop = window.open('usuarioLogado/servicosFinalizados/editaFormaPagmento/popEditaPagmento.php?idServico=' + idServico + '&tipo=' + tipo + '&idCliente=' + idCliente + '&idMotoboy=' + idMotoboy, 'pagina', "titlebar=Editar Forma Pagamento, width=980, height=400, top=100, left=200, scrollbars=yes ");
628
629}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.