Mike vor 3 Jahren
Ursprung
Commit
b4080dd4a4
2 geänderte Dateien mit 51 neuen und 50 gelöschten Zeilen
  1. 0 50
      ArkCard-web/event.html
  2. 51 0
      ArkCard-web/goto.js

+ 0 - 50
ArkCard-web/event.html

@@ -104,56 +104,6 @@ function nft_sent_message() {
     });
 }
 
-// 點擊「同意接收」按鈕
-$(".nft-event").submit(function (e) {
-    alert('.nft-event submit'); // test
-
-    var email = $('#email').val();
-
-    // Email欄位必填檢查
-    if (email == "") { // 未輸入Email
-        Swal.fire({
-            title: '注意!',
-            icon: 'error',
-            confirmButtonColor: '#3085d6',
-            html: '請先輸入Email<p><p>我們會發送合約地址至您指定的Email',
-        });
-        return false;
-    }
-    
-    var jsonInfo = $('.nft-event').serializeObject();
-    console.log(jsonInfo);
-    var jsonString = JSON.stringify(jsonInfo);
-    console.log(jsonString);
-
-    $.ajax({
-        type: 'POST',
-        url: 'https://ark.cards:8228/event',
-        data: jsonString,
-        dataType: 'json',
-        async: false,
-        success: function (data) {
-            console.log('送出成功: ' + JSON.stringify(data));
-            alert("送出成功");
-
-            // 呼叫fastAPI,贈送「風」通行證 + 「港記酥皇」
-            nft_sent_message();
-        },
-        beforeSend: function () {
-            console.log('beforeSend');
-        },
-        complete: function () {
-            console.log('complete');
-        },
-        error: function (jqXHR, textStatus, errorThrown) {
-            console.log(JSON.stringify(jqXHR));
-            console.log("AJAX errr: " + textStatus + ' : ' + errorThrown);
-            console.log('送出失敗: ' + jqXHR.responseText);
-        }
-    });
-    return false;
-});
-
 $(document).ready(function () {
     // 取得liff_id
     liff.init({

+ 51 - 0
ArkCard-web/goto.js

@@ -273,6 +273,57 @@ $(".nft-buy").submit(function (e) {
   return false;
 });
 
+// 點擊「同意接收」按鈕
+$(".nft-event").submit(function (e) {
+  alert('.nft-event submit'); // test
+
+  var email = $('#email').val();
+
+  // Email欄位必填檢查
+  if (email == "") { // 未輸入Email
+      Swal.fire({
+          title: '注意!',
+          icon: 'error',
+          confirmButtonColor: '#3085d6',
+          html: '請先輸入Email<p><p>我們會發送合約地址至您指定的Email',
+      });
+      return false;
+  }
+  
+  var jsonInfo = $('.nft-event').serializeObject();
+  console.log(jsonInfo);
+  var jsonString = JSON.stringify(jsonInfo);
+  console.log(jsonString);
+
+  $.ajax({
+      type: 'POST',
+      url: 'https://ark.cards:8228/event',
+      data: jsonString,
+      dataType: 'json',
+      async: false,
+      success: function (data) {
+          console.log('送出成功: ' + JSON.stringify(data));
+          alert("送出成功");
+
+          // 呼叫fastAPI,贈送「風」通行證 + 「港記酥皇」
+          nft_sent_message();
+      },
+      beforeSend: function () {
+          console.log('beforeSend');
+      },
+      complete: function () {
+          console.log('complete');
+      },
+      error: function (jqXHR, textStatus, errorThrown) {
+          console.log(JSON.stringify(jqXHR));
+          console.log("AJAX errr: " + textStatus + ' : ' + errorThrown);
+          console.log('送出失敗: ' + jqXHR.responseText);
+      }
+  });
+  return false;
+});
+
+
 function copyEvent(id) {
   var str = document.getElementById(id);
   window.getSelection().selectAllChildren(str);