goto.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. var url = location.search;
  26. var rid;
  27. if (url.indexOf("?") != -1) {
  28. var str = url.substr(1);
  29. // str.split("=")[0] 為 userID
  30. rid = str.split("=")[1];
  31. }
  32. if (rid == undefined) {
  33. rid = '';
  34. }
  35. console.log(rid)
  36. function get_data() {
  37. $.ajax({
  38. method: "GET",
  39. url: "https://api.ptt.cx:8228/receive/" + rid + "",
  40. dataType: "json",
  41. })
  42. .done(function (msg) {
  43. console.log(msg);
  44. console.log(msg.base)
  45. var Qrcodeimg = '';
  46. var useraddress = '';
  47. Qrcodeimg += '\
  48. <img src="data:image/png;base64,'+ msg.base + '" alt="">\
  49. ';
  50. useraddress += '\
  51. '+ msg.useraddress + '\
  52. ';
  53. $('#Qrcode').html(Qrcodeimg);
  54. $('#copy').html(useraddress);
  55. });
  56. }
  57. get_data();
  58. });
  59. function copyEvent(id) {
  60. var str = document.getElementById(id);
  61. window.getSelection().selectAllChildren(str);
  62. document.execCommand("Copy")
  63. toastr.options = {
  64. // 參數設定[註1]
  65. "closeButton": false, // 顯示關閉按鈕
  66. "debug": false, // 除錯
  67. "newestOnTop": false, // 最新一筆顯示在最上面
  68. "progressBar": false, // 顯示隱藏時間進度條
  69. "positionClass": "toast-top-center", // 位置的類別
  70. "preventDuplicates": false, // 隱藏重覆訊息
  71. "onclick": null, // 當點選提示訊息時,則執行此函式
  72. "showDuration": "300", // 顯示時間(單位: 毫秒)
  73. "hideDuration": "1000", // 隱藏時間(單位: 毫秒)
  74. "timeOut": "1000", // 當超過此設定時間時,則隱藏提示訊息(單位: 毫秒)
  75. "extendedTimeOut": "1000", // 當使用者觸碰到提示訊息時,離開後超過此設定時間則隱藏提示訊息(單位: 毫秒)
  76. "showEasing": "swing", // 顯示動畫時間曲線
  77. "hideEasing": "linear", // 隱藏動畫時間曲線
  78. "showMethod": "fadeIn", // 顯示動畫效果
  79. "hideMethod": "fadeOut" // 隱藏動畫效果
  80. }
  81. toastr.success("複製成功");
  82. }