goto.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. $('.sec05-moblie-container').slick({
  2. arrows: false,
  3. slidesToShow: 1,
  4. slidesToScroll: 1,
  5. infinite: false,
  6. centerMode: true,
  7. });
  8. console.log(1);
  9. // $(document).ready(function () {
  10. // function get_data(){
  11. // $.ajax({
  12. // method: "GET",
  13. // // url:"https://api.ptt.cx:8228/collection/""+userid+",
  14. // url:"https://api.ptt.cx:8228/collection/U176663ce100ebb1f4c404d48749decb1_test_000_000_000",
  15. // dataType: "json",
  16. // })
  17. // .done(function (msg) {
  18. // console.log(msg);
  19. // });
  20. // }
  21. // get_data();
  22. // });
  23. // console.log(location.href);
  24. $(document).ready(function () {
  25. url = location.search;
  26. getSearch = url.split("?")
  27. console.log(getSearch[0]);
  28. console.log(getSearch[1]);
  29. var userid=getSearch[1];
  30. function get_data() {
  31. $.ajax({
  32. method: "GET",
  33. url: "https://api.ptt.cx:8228/receive/" + userid + "",
  34. dataType: "json",
  35. })
  36. .done(function (msg) {
  37. console.log(msg);
  38. console.log(msg.base)
  39. var Qrcodeimg = '';
  40. var useraddress = '';
  41. Qrcodeimg += '\
  42. <img src="data:image/png;base64,'+ msg.base + '" alt="">\
  43. ';
  44. useraddress += '\
  45. '+ msg.useraddress + '\
  46. ';
  47. $('#Qrcode').html(Qrcodeimg);
  48. $('#copy').html(useraddress);
  49. });
  50. }
  51. get_data();
  52. });
  53. function copyEvent(id) {
  54. var str = document.getElementById(id);
  55. window.getSelection().selectAllChildren(str);
  56. document.execCommand("Copy")
  57. toastr.options = {
  58. // 參數設定[註1]
  59. "closeButton": false, // 顯示關閉按鈕
  60. "debug": false, // 除錯
  61. "newestOnTop": false, // 最新一筆顯示在最上面
  62. "progressBar": false, // 顯示隱藏時間進度條
  63. "positionClass": "toast-top-center", // 位置的類別
  64. "preventDuplicates": false, // 隱藏重覆訊息
  65. "onclick": null, // 當點選提示訊息時,則執行此函式
  66. "showDuration": "300", // 顯示時間(單位: 毫秒)
  67. "hideDuration": "1000", // 隱藏時間(單位: 毫秒)
  68. "timeOut": "1000", // 當超過此設定時間時,則隱藏提示訊息(單位: 毫秒)
  69. "extendedTimeOut": "1000", // 當使用者觸碰到提示訊息時,離開後超過此設定時間則隱藏提示訊息(單位: 毫秒)
  70. "showEasing": "swing", // 顯示動畫時間曲線
  71. "hideEasing": "linear", // 隱藏動畫時間曲線
  72. "showMethod": "fadeIn", // 顯示動畫效果
  73. "hideMethod": "fadeOut" // 隱藏動畫效果
  74. }
  75. toastr.success("複製成功");
  76. }