Mike пре 3 година
родитељ
комит
ca90588978
2 измењених фајлова са 51 додато и 51 уклоњено
  1. 50 0
      ArkCard-web/event.html
  2. 1 51
      ArkCard-web/goto.js

+ 50 - 0
ArkCard-web/event.html

@@ -104,6 +104,56 @@ 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({

+ 1 - 51
ArkCard-web/goto.js

@@ -189,6 +189,7 @@ $(document).on("click", ".close", function (event) {
 });
 
 $.fn.serializeObject = function () {
+  alert('serializeObject()'); // test
   var o = {};
   var a = this.serializeArray();
   // o["id"] = 0;
@@ -273,57 +274,6 @@ $(".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);