浏览代码

發送按鈕處理

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

+ 1 - 1
ArkCard-web/collect.html

@@ -338,7 +338,7 @@
             <div class="p-2">
                 <input id="address" style="border-radius: 10px; border:none;" class="p-2 w-100 mb-3" type="text" name="address" placeholder="請輸入您要發送的地址" required>
                 <div class="text-end px-2">
-                    <p class="text-start text-white mb-2">※一次只能發送一則NFT收藏品</p>
+                    <p class="text-start text-white mb-2">※ 一次只能發送一則NFT收藏品</p>
                     <button id="qrcodeButton"type="button" style="border:1px solid #fff; border-radius: 30px;" class="qrcode btn text-white px-3">掃描QRCode</button>
                     <button type="button" style="border:1px solid #fff; border-radius: 30px;" class="close btn text-white px-3">取消</button>
                     <input style="border-radius: 30px; background:#fff; border: none;" class="send-btn p-2 ms-1" type="submit" value="確定發送">

+ 26 - 1
ArkCard-web/goto.js

@@ -248,6 +248,25 @@ $(".collect-send").submit(function (e) {
   var jsonString = JSON.stringify(jsonInfo);
   console.log(jsonString);
 
+  Swal.fire({
+    title: '您是否確認要發送?',
+    text: "發送後,NFT將從您的錢包轉移至接收者的錢包!",
+    icon: 'warning',
+    showCancelButton: true,
+    confirmButtonColor: '#3085d6',
+    cancelButtonColor: '#d33',
+    confirmButtonText: '立即發送',
+    cancelButtonText: '取消'
+  }).then((result) => {
+    if (result.isConfirmed) {
+      Swal.fire({
+          icon: 'success',
+          confirmButtonColor: '#3085d6',
+          html: '發送成功'
+      });
+    }
+  })
+
   $.ajax({
     type: 'POST',
     url: 'https://ark.cards:8228/send',
@@ -256,7 +275,13 @@ $(".collect-send").submit(function (e) {
     async: false,
     success: function (data) {
       console.log('發送成功: ' + JSON.stringify(data));
-      alert("發送成功");
+      
+      Swal.fire({
+        icon: 'success',
+        confirmButtonColor: '#3085d6',
+        html: '發送成功'
+      });
+
       location.reload();
     },
     beforeSend: function () {