|
@@ -301,12 +301,12 @@
|
|
|
</a>
|
|
|
</li>
|
|
|
|
|
|
- <li class="nav-item">
|
|
|
+ <!-- <li class="nav-item">
|
|
|
<a class="nav-link collapsed" href="mint.html">
|
|
|
<i class="bi bi-grid"></i>
|
|
|
<span>Mint管理</span>
|
|
|
</a>
|
|
|
- </li>
|
|
|
+ </li> -->
|
|
|
|
|
|
<!-- <li class="nav-item">
|
|
|
<a class="nav-link collapsed" href="index.html">
|
|
@@ -562,15 +562,15 @@
|
|
|
|
|
|
<form id="nft_add_form" method="post" enctype="multipart/form-data">
|
|
|
<div class="row mb-3">
|
|
|
- <label for="inputText" class="col-sm-2 col-form-label">名稱</label>
|
|
|
+ <label for="title" class="col-sm-2 col-form-label">名稱</label>
|
|
|
<div class="col-sm-10">
|
|
|
- <input id="title" name="title" type="text" class="form-control">
|
|
|
+ <input id="title" name="title" type="text" class="form-control" required>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row mb-3">
|
|
|
- <label for="inputNumber" class="col-sm-2 col-form-label">圖片</label>
|
|
|
+ <label for="image" class="col-sm-2 col-form-label">圖片</label>
|
|
|
<div class="col-sm-10">
|
|
|
- <input id="image" name="image" class="form-control" type="file">
|
|
|
+ <input id="image" name="image" class="form-control" type="file" required>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row mb-3">
|
|
@@ -578,7 +578,25 @@
|
|
|
<div class="col-sm-10">
|
|
|
<input id="content" name="content" class="form-control" type="text">
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="row mb-3">
|
|
|
+ <label for="uid" class="col-sm-2 col-form-label">識別號</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input id="uid" name="uid" class="form-control" type="number" placeholder="4 - 9位數字" required>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row mb-3">
|
|
|
+ <label for="toaddress" class="col-sm-2 col-form-label">目標地址</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="text" class="form-control" id="toaddress" name="toaddress" required>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row mb-3">
|
|
|
+ <label for="amount" class="col-sm-2 col-form-label">數量</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="number" class="form-control" id="amount" name="amount" required>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="row mb-3">
|
|
|
<legend class="col-form-label col-sm-2 pt-0">顯示</legend>
|
|
|
<div class="col-sm-10">
|
|
@@ -932,21 +950,26 @@ function handleFileSelect(evt) {
|
|
|
|
|
|
$("#nft_add_form").submit(function(e) {
|
|
|
e.preventDefault();
|
|
|
- var bodyFormData = new FormData($('#nft_add_form')[0]);
|
|
|
+ const form = document.querySelector('#nft_add_form');
|
|
|
+ var bodyFormData = new FormData(form);
|
|
|
|
|
|
var title = $('#title').val();
|
|
|
- var image = $('#image').val();
|
|
|
var desc = $('#content').val();
|
|
|
+ var uid = $('#uid').val();
|
|
|
+ var amount = $('#amount').val();
|
|
|
+ var toaddress = $('#toaddress').val();
|
|
|
+ console.log(title, desc, uid, amount, toaddress, imageFile);
|
|
|
|
|
|
bodyFormData.append('title', title);
|
|
|
- bodyFormData.append('context', title);
|
|
|
- bodyFormData.append('category', '');
|
|
|
+ bodyFormData.append('context', desc);
|
|
|
+ bodyFormData.append('catagory', '');
|
|
|
bodyFormData.append('hash', '');
|
|
|
- bodyFormData.append('userid', '');
|
|
|
+ bodyFormData.append('uid', uid);
|
|
|
+ bodyFormData.append('amount', amount);
|
|
|
+ bodyFormData.append('address', toaddress);
|
|
|
bodyFormData.append('image', imageFile);
|
|
|
bodyFormData.append('is_active', $("#is_active_checkbox").is(':checked'));
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
if (!title) {
|
|
|
Swal.fire({
|
|
|
title: '注意',
|
|
@@ -975,7 +998,7 @@ $("#nft_add_form").submit(function(e) {
|
|
|
} else {
|
|
|
$('#is_active').val(0);
|
|
|
}
|
|
|
-
|
|
|
+ console.log(bodyFormData);
|
|
|
// var formData = new FormData($("#nft_add_form")[0]);
|
|
|
axios({
|
|
|
method: 'post',
|
|
@@ -989,30 +1012,6 @@ $("#nft_add_form").submit(function(e) {
|
|
|
}).catch(err => {
|
|
|
console.log(err);
|
|
|
})
|
|
|
- /* $.ajax({
|
|
|
- url: url,
|
|
|
- headers: headers,
|
|
|
- type: 'POST',
|
|
|
- data: bodyFormData,
|
|
|
- cache: false,
|
|
|
- contentType: false,
|
|
|
- processData: false,
|
|
|
- success: function (res, status) {
|
|
|
- console.log(res); // test
|
|
|
- Swal.fire({
|
|
|
- title: '新增NFT',
|
|
|
- icon: 'success',
|
|
|
- text: 'NFT新增成功',
|
|
|
- confirmButtonColor: '#3085d6'
|
|
|
- });
|
|
|
- window.setTimeout(() => {
|
|
|
- window.location.href = 'nft.html';
|
|
|
- }, 2000);
|
|
|
- }, error: function(xhr, status, error) {
|
|
|
- console.log(xhr.responseText); // test
|
|
|
- }
|
|
|
- });
|
|
|
- */
|
|
|
return false;
|
|
|
});
|
|
|
</script>
|