123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- $(".sendbox").hide();
- $(document).on("click", ".collectcard", function (event) {
-
- $(".sendbox").show(500);
- $(this).toggleClass("select");
- });
- $(document).on("click", ".close", function (event) {
-
- $(".sendbox").hide(500);
- $(".collectcard").removeClass("select");
- });
- $(document).ready(function () {
- collecturl = location.search;
- getcollect = collecturl.split("?")
- console.log(getcollect[0]);
- console.log(getcollect[1]);
- var collectuserid = getcollect[1];
- $.ajax({
- method: "GET",
- url: "https://api.ptt.cx:8228/collection/" + collectuserid + "",
-
- dataType: "json",
- })
- .done(function (msg) {
- console.log(msg);
-
- let msgLen =Object.keys(msg).length;
- console.log(msgLen)
- var collectcontent = '';
- for(var i = 0; i < msgLen; i++){
- collectcontent+='\
- <div class="collectcontent col">\
- <input style="display: none;" type="checkbox" value="'+msg[i].id+'" name="nftid" id="'+msg[i].id+'">\
- <label for="'+msg[i].id+'">\
- <div class="collectcard card h-100">\
- <a target="_blank">\
- <img src="'+msg[i].imgurl+'"class="card-img-top" alt="...">\
- </a>\
- <div class="card-body p-2">\
- <a target="_blank">\
- <h5 class="card-title pt-3">'+msg[i].title+'</h5>\
- </a>\
- <p class="card-text">\
- '+msg[i].context+' \
- </p>\
- <p class="card-text row">\
- <small class="text-muted col-6 px-1">\
- <img class="mb-1 mx-1 d-inline" style="width: 10px; object-fit: cover; "\
- src="./img/sec05/Icon awesome-ethereum.png" alt=""><span>'+msg[i].cost+'</span>\
- </small>\
- <small class="price col-6 px-0 text-center">\
- <img class="mb-1 mx-1 d-inline" style="width: 12px; object-fit: cover; " src="./img/sec05/like.png" alt=""><span>'+msg[i].likes+'</span></small>\
- </p>\
- </div>\
- </div>\
- </label>\
- </div>';
- }
- $('.sec05-moblie-container').html(collectcontent);
-
- });
-
- });
- $.fn.serializeObject = function () {
- var o = {};
- var a = this.serializeArray();
-
-
- $.each(a, function () {
- if (o[this.name]) {
- if (!o[this.name].push) {
- o[this.name] = [o[this.name]];
- }
- o[this.name].push(this.value || '');
- } else {
- o[this.name] = this.value || '';
- }
- });
- return o;
- };
- $(".collect-send").submit(function (e) {
-
- var jsonInfo = $('.collect-send').serializeObject();
- var jsonString = JSON.stringify(jsonInfo);
- console.log(jsonString),
- $.ajax({
- type: 'POST',
- url: 'https://api.ptt.cx:8228/send',
- data: jsonString,
- dataType: 'json',
- success: function (data) {
- console.log('送出成功: ' + data);
- alert("送出成功");
-
- },
- 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;
- });
- console.log(1);
- $(document).ready(function () {
- url = location.search;
- getSearch = url.split("?")
- console.log(getSearch[0]);
- console.log(getSearch[1]);
- var userid = getSearch[1];
- function get_data() {
- $.ajax({
- method: "GET",
- url: "https://api.ptt.cx:8228/receive/" + userid + "",
-
- dataType: "json",
- })
- .done(function (msg) {
- console.log(msg);
- console.log(msg.base)
- var Qrcodeimg = '';
- var useraddress = '';
- Qrcodeimg += '\
- <img src="'+ msg.base + '" alt="">\
- ';
- useraddress += '\
- '+ msg.useraddress + '\
- ';
- $('#Qrcode').html(Qrcodeimg);
- $('#copy').html(useraddress);
- });
- }
- get_data();
- });
- function copyEvent(id) {
- var str = document.getElementById(id);
- window.getSelection().selectAllChildren(str);
- document.execCommand("Copy")
- toastr.options = {
-
- "closeButton": false,
- "debug": false,
- "newestOnTop": false,
- "progressBar": false,
- "positionClass": "toast-top-center",
- "preventDuplicates": false,
- "onclick": null,
- "showDuration": "300",
- "hideDuration": "1000",
- "timeOut": "1000",
- "extendedTimeOut": "1000",
- "showEasing": "swing",
- "hideEasing": "linear",
- "showMethod": "fadeIn",
- "hideMethod": "fadeOut"
- }
- toastr.success("複製成功");
- }
|