{{terminalErrorHeading}}

An error has occurred

{{terminalError}}

$(function () { setTimeout(function(){ // if (window.variavelminificada === undefined) { // console.log("cenas e coisinhas", window.variavelminificada); // window.variavelminificada = true; var alreadyFilled = false; var paymentData = {}; var $options = null; var $name = null; var $nif = null; var $address = null; var $city = null; var $postalCode = null; function validateNIF(nif) { if (nif === '') { return false; } var re = /^\d{9}$/g; if (re.test(nif)) { var firstDigit = nif[0]; if (firstDigit !== '0' && firstDigit !== '3' && firstDigit !== '4' && firstDigit !== '7') { return true; } } return false; } $("#invoice-save-data").click(function (e) { $name = $(".invoice-name"); $nif = $(".invoice-nif"); $address = $(".invoice-morada"); $city = $(".city"); $postalCode = $(".invoice-postal-code"); if ($name.val() == "") { $(".error-message").html("Tem que preencher o nome."); $(".error-message").addClass("error"); $name.focus(); return; } if ($nif.val() == "" || !validateNIF($nif.val())) { $(".error-message").html("NIF inválido."); $(".error-message").addClass("error"); $nif.focus(); return; } if ($address.val() == "") { $(".error-message").html("É necessário preencher a morada."); $(".error-message").addClass("error"); $address.focus(); return; } if (!$postalCode.val().match(/\d{4}\-\d{3}/)) { $(".error-message").html("Código postal inválido. Formato: 0000-000"); $(".error-message").addClass("error"); $postalCode.focus(); return; } if ($city.val() == "") { $(".error-message").html("É necessário preencher a localidade"); $(".error-message").addClass("error"); $city.focus(); return; } var data = { real_name: $name.val(), nif: $nif.val(), address: { address: $address.val(), city: $city.val(), postal_code: $postalCode.val() } }; window.parent.postMessage({command: "setUserPaymentData", payload: data}, "*"); }); $(".invoice-checkbox").change(function () { $options = $(".payment-options-wrapper"); $otherBlock = $(".selected-payment-method"); if (this.checked) { $(".error-message").html(""); $name = $(".invoice-name"); $nif = $(".invoice-nif"); $address = $(".invoice-morada"); $city = $(".city"); $postalCode = $(".invoice-postal-code"); if (!alreadyFilled) { $name.val(paymentData.real_name); $nif.val(paymentData.nif); if (paymentData.address) { $address.val(paymentData.address.address ? paymentData.address.address : ""); $city.val(paymentData.address.city ? paymentData.address.city : ""); $postalCode.val(paymentData.address.postal_code ? paymentData.address.postal_code : ""); } alreadyFilled = true; } $otherBlock.addClass("disabled"); $options.addClass("disabled"); } else { $otherBlock.removeClass("disabled"); $options.removeClass("disabled"); } }); window.addEventListener("message", function (e) { if (e.origin.indexOf("observador.pt", e.origin.length - "observador.pt".length) === -1) { return; } if (e.data.command) { switch (e.data.command) { case"getUserPaymentDataRtn": console.log("getUserPaymentDataRtn", e.data); paymentData = e.data.payload; break; case"setUserPaymentDataRtn": $(".error-message").removeClass("error"); if (e.data.payload) { $(".error-message").html("Alterações guardadas."); $options.removeClass("disabled"); $otherBlock.removeClass("disabled"); } else { $(".error-message").html("Ocurreu um erro ao guardar as alterações."); $(".error-message").addClass("error"); } break; } } }, false); window.parent.postMessage({command: "getUserPaymentData"}, "*"); // } }); },1);
window.onmessage = function(e){ if (e.data == 'closeMessage') { console.log("clicked close button"); document.getElementById('close').click(); } }; setTimeout(function(){ var diaMes = new Date().toISOString().split("T")[0]; var d = DaysBetween(new Date(diaMes), new Date("2019-10-15")); var markup = ""; if(d <= 3) { if (d == 1) { markup = "Aproveite. Último dia."; } else if (d > 1 ) { markup = "Aproveite. Últimos " + d + " dias."; } else if (d == 0) { markup = "Aproveite. Últimas horas."; } document.getElementById("campaign-period").remove(); document.getElementById("days").innerHTML = markup; } }, 1); function DaysBetween( date1, date2 ) { //Get 1 day in milliseconds var one_day=1000*60*60*24; // Convert both dates to milliseconds var date1_ms = date1.getTime(); var date2_ms = date2.getTime(); // Calculate the difference in milliseconds var difference_ms = (date2_ms + (1000*60*60*9)) - date1_ms; // Convert back to days and return return Math.round(difference_ms/one_day); }
Informação para que ninguém decida por si. Seja /premium
{{term.billingPlanTable[0].priceValue}}€
/SEMANA
/1º ANO
/1º MÊS *
/3º MÊS
{{term.billingPlanTable[0].priceValue}}€
/ANO
/MÊS
/SEMANA
Promoção legislativas