<script>
$(document).ready(function () {
let linkStart = 'a[href^="https://api.pro.photoever.ru/api"]';
$('.uc-sendform').on('click','.t-submit', function(){
let name = $('.uc-sendform .t-input-group_nm input').val();
let mail = $('.uc-sendform .t-input-group_em input').val();
let phone = $('.uc-sendform .t-input-group_ph input:last').val();
let formData={};
formData['name'] = name;
formData['mail'] = mail;
formData['phone'] = phone;
localStorage.setItem ("formData", JSON.stringify(formData));
});
if (localStorage.getItem('formData') !== null) {
let loadInfo = JSON.parse(localStorage.getItem("formData"));
if($(linkStart).length){
let nM = loadInfo['name'];
let eM = loadInfo['mail'];
let pH = loadInfo['phone'];
let linkEnd = `https://api.pro.photoever.ru/api/122770/get-link?name={{${nM}}}&phone={{${pH}}}&email={{${eM}}`;
$(linkStart).attr('href', linkEnd);
};
};
});
</script>