DmitrMakeev commited on
Commit
cffd19f
·
verified ·
1 Parent(s): 4c09778

Update js/senler_form_v1.js

Browse files
Files changed (1) hide show
  1. js/senler_form_v1.js +1 -1
js/senler_form_v1.js CHANGED
@@ -1 +1 @@
1
- !function(e){var n={};function o(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=e,o.c=n,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,n){if(1&n&&(e=o(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)o.d(r,t,function(n){return e[n]}.bind(null,t));return r},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="",o(o.s=0)}([function(e,n){var o,r=window.w_url,t=Number(window.vk_grup),u=window.vk_grup,s=window.s_grup,d=window.on_url,c=window.off_url;vkBridge.send("VKWebAppInit"),document.getElementById("contactForm").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:t,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{o=e.id,function(){const e=document.getElementById("name").value,n=document.getElementById("email").value,t=document.getElementById("phone").value,c="https://"+r+"?vk_user_id="+o+"&vk_group_id="+u+"&sub_id="+s+"&name="+encodeURIComponent(e)+"&email="+encodeURIComponent(n)+"&phone="+encodeURIComponent(t);console.log("secondServerURL:",c),fetch(c,{method:"GET"}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{console.log("Данные от сервера:",e),e&&e.add_response&&e.add_response.success&&e.add_response.subscribers&&e.add_response.subscribers[0]&&e.add_response.subscribers[0].success?window.open(d,"_blank"):console.error("Ошибка при добавлении пользователя")}).catch(e=>{console.error("Error:",e)})}()}).catch(e=>{console.error("Error fetching user info:",e),window.location.href=c}):window.location.href=c}).catch(e=>{console.error("Error allowing messages from group:",e),window.location.href=c})}))}]);
 
1
+ !function(e){var n={};function o(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=e,o.c=n,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,n){if(1&n&&(e=o(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)o.d(r,t,function(n){return e[n]}.bind(null,t));return r},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="",o(o.s=0)}([function(e,n){var o,r=window.w_url,t=Number(window.vk_grup),u=window.vk_grup,s=window.s_grup,d=window.on_url,c=window.off_url;function i(){const e=document.getElementById("name").value,n=document.getElementById("email").value,t=document.getElementById("phone").value,c="https://"+r+"?vk_user_id="+o+"&vk_group_id="+u+"&sub_id="+s+"&name="+encodeURIComponent(e)+"&email="+encodeURIComponent(n)+"&phone="+encodeURIComponent(t);console.log("secondServerURL:",c),fetch(c,{method:"GET"}).then(e=>{if(!e.ok)throw new Error("Ошибка HTTP: "+e.status);return e.json()}).then(e=>{console.log("Данные от сервера:",e),e&&e.add_response&&e.add_response.success&&e.add_response.subscribers&&e.add_response.subscribers[0]&&e.add_response.subscribers[0].success?window.open(d,"_blank"):console.error("Ошибка при добавлении пользователя")}).catch(e=>{console.error("Error:",e)})}vkBridge.send("VKWebAppInit"),document.getElementById("contactForm").addEventListener("submit",(function(e){e.preventDefault(),vkBridge.send("VKWebAppAllowMessagesFromGroup",{group_id:t,key:"cc964fabb0e1d70924a92e4e8b513dbff7cc10a9"}).then(e=>{e.result?vkBridge.send("VKWebAppGetUserInfo").then(e=>{o=e.id,setTimeout(i,1e3)}).catch(e=>{console.error("Error fetching user info:",e),window.location.href=c}):window.location.href=c}).catch(e=>{console.error("Error allowing messages from group:",e),window.location.href=c})}))}]);