goto.js 2.5 KB

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