index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="酷乐秀APP,器乐学习的不二选择">
  8. <title>酷乐秀</title>
  9. <link rel="stylesheet" href="index.css">
  10. <script src="../helpers/rem-fit.min.js"></script>
  11. <script src="../helpers/qs.min.js"></script>
  12. <script src="../helpers/html2canvas.js"></script>
  13. <script src="../helpers/qrcode.js"></script>
  14. <script>
  15. var remFit = new RemFit(3.75,true)
  16. remFit.init()
  17. window.addEventListener('resize', function () {
  18. remFit.init()
  19. })
  20. var parseSearch = Qs.parse(window.location.search, { ignoreQueryPrefix: true })
  21. </script>
  22. <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/plyr@3.6.8/dist/plyr.css"> -->
  23. </head>
  24. <body>
  25. <div class="content">
  26. <div class="tag"></div>
  27. <div class="userinfo">
  28. <img id="avatar" crossOrigin="anonymous"/>
  29. <div class="cont">
  30. <p class="name" id="name"></p>
  31. <p class="sub" id="subjectName"></p>
  32. </div>
  33. </div>
  34. <div class="desc">
  35. <div class="tit">我用小酷Ai智能评测获得了<span id="score"></span>分!</div>
  36. <div class="info" id="examSongName"></div>
  37. </div>
  38. <div class="fraction" style="display: none;">
  39. <div class="item" id="intonation">
  40. <div class="decs">音准</div>
  41. <div class="view"><span id="intonation-view"></span></div>
  42. <div class="val" id="intonation-val"></div>
  43. </div>
  44. </div>
  45. <div class="fraction" style="display: none;">
  46. <div class="item" id="cadence">
  47. <div class="decs">节奏</div>
  48. <div class="view"><span id="cadence-view"></span></div>
  49. <div class="val" id="cadence-val"></div>
  50. </div>
  51. </div>
  52. <div class="fraction" style="display: none;">
  53. <div class="item" id="integrity">
  54. <div class="decs">节奏</div>
  55. <div class="view"><span id="integrity-view"></span></div>
  56. <div class="val" id="integrity-val"></div>
  57. </div>
  58. </div>
  59. <div class="line"></div>
  60. <div class="app">
  61. <div class="app-info">
  62. <div class="app-title">酷乐秀</div>
  63. <div class="app-desc">器乐学习的<span>不二选择</span></div>
  64. <div class="app-subtitle">小酷Ai见证你的成长!</div>
  65. </div>
  66. <div class="img">
  67. <img id="qrcode" src="./icons/qrcode.png"/>
  68. <img class="logo" src="./icons/logo.png"/>
  69. </div>
  70. </div>
  71. </div>
  72. <script>
  73. document.getElementById('avatar').src = (decodeURIComponent(parseSearch.avatar) || './icons/avatar.png') + '?v=' + parseInt(Math.random() * 10000000)
  74. document.getElementById('name').innerText = parseSearch.name || ''
  75. document.getElementById('subjectName').innerText = parseSearch.subjectName || ''
  76. document.getElementById('examSongName').innerText = parseSearch.examSongName || ''
  77. document.getElementById('score').innerText = parseSearch.score || ''
  78. if (parseSearch.intonation) {
  79. document.getElementById('intonation').parentElement.style.display = 'flex'
  80. document.getElementById('intonation-val').innerText = parseSearch.intonation || ''
  81. document.getElementById('intonation-view').style.width = parseSearch.intonation + '%' || ''
  82. }
  83. if (parseSearch.cadence) {
  84. document.getElementById('cadence').parentElement.style.display = 'flex'
  85. document.getElementById('cadence-val').innerText = parseSearch.cadence || ''
  86. document.getElementById('cadence-view').style.width = parseSearch.cadence + '%' || ''
  87. }
  88. if (parseSearch.integrity) {
  89. document.getElementById('integrity').parentElement.style.display = 'flex'
  90. document.getElementById('integrity-val').innerText = parseSearch.integrity || ''
  91. document.getElementById('integrity-view').style.width = parseSearch.integrity + '%' || ''
  92. }
  93. window.addEventListener('load', function () {
  94. QRCode.toDataURL(location.origin + '/accompany/colexiu-report-share.html?id=' + (parseSearch.id || '') + '&musicId=' + (parseSearch.musicId || '') + '&client=web', { errorCorrectionLevel: 'H', width: 192 }, function (err, val) {
  95. console.log(val)
  96. document.getElementById('qrcode').setAttribute('src', val)
  97. html2canvas(document.body)
  98. .then((canvas) => canvas.toDataURL())
  99. .then(res => {
  100. // console.log(res)
  101. if (window.setPng) {
  102. window.setPng(res)
  103. }
  104. })
  105. })
  106. })
  107. </script>
  108. <!-- <script src="./index.js"></script> -->
  109. </body>
  110. </html>