浏览代码

修改提供視窗

Mike 3 年之前
父节点
当前提交
cec516a87c
共有 1 个文件被更改,包括 36 次插入36 次删除
  1. 36 36
      ArkCard-web/goto.js

+ 36 - 36
ArkCard-web/goto.js

@@ -259,44 +259,38 @@ $(".collect-send").submit(function (e) {
     cancelButtonText: '取消'
   }).then((result) => {
     if (result.isConfirmed) {
-      Swal.fire({
-          icon: 'success',
-          confirmButtonColor: '#3085d6',
-          html: '發送成功'
+      $.ajax({
+        type: 'POST',
+        url: 'https://ark.cards:8228/send',
+        data: jsonString,
+        dataType: 'json',
+        async: false,
+        success: function (data) {
+          console.log('發送成功: ' + JSON.stringify(data));
+          
+          Swal.fire({
+            icon: 'success',
+            confirmButtonColor: '#3085d6',
+            html: '發送成功'
+          });
+    
+          location.reload();
+        },
+        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;
     }
   })
-
-  $.ajax({
-    type: 'POST',
-    url: 'https://ark.cards:8228/send',
-    data: jsonString,
-    dataType: 'json',
-    async: false,
-    success: function (data) {
-      console.log('發送成功: ' + JSON.stringify(data));
-      
-      Swal.fire({
-        icon: 'success',
-        confirmButtonColor: '#3085d6',
-        html: '發送成功'
-      });
-
-      location.reload();
-    },
-    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;
 });
 
 $(".nft-buy").submit(function (e) {
@@ -313,7 +307,13 @@ $(".nft-buy").submit(function (e) {
       dataType: 'json',
       success: function (data) {
         console.log('購買成功: ' + data);
-        alert("購買成功");
+        
+        Swal.fire({
+          icon: 'success',
+          confirmButtonColor: '#3085d6',
+          html: '購買成功'
+        });
+
         location.reload();
       },
       beforeSend: function () {