index.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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">我用云练习智能评测获得了<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">云练习见证你的成长!</div>
  65. </div>
  66. <div class="img">
  67. <img id="qrcode" src="./icons/qrcode.png"/>
  68. </div>
  69. </div>
  70. </div>
  71. <script>
  72. document.getElementById('avatar').src = (decodeURIComponent(parseSearch.avatar) || './icons/avatar.png') + '?v=' + parseInt(Math.random() * 10000000)
  73. document.getElementById('name').innerText = parseSearch.name || ''
  74. document.getElementById('subjectName').innerText = parseSearch.subjectName || ''
  75. document.getElementById('examSongName').innerText = parseSearch.examSongName || ''
  76. document.getElementById('score').innerText = parseSearch.score || ''
  77. if (parseSearch.intonation) {
  78. document.getElementById('intonation').parentElement.style.display = 'flex'
  79. document.getElementById('intonation-val').innerText = parseSearch.intonation || ''
  80. document.getElementById('intonation-view').style.width = parseSearch.intonation + '%' || ''
  81. }
  82. if (parseSearch.cadence) {
  83. document.getElementById('cadence').parentElement.style.display = 'flex'
  84. document.getElementById('cadence-val').innerText = parseSearch.cadence || ''
  85. document.getElementById('cadence-view').style.width = parseSearch.cadence + '%' || ''
  86. }
  87. if (parseSearch.integrity) {
  88. document.getElementById('integrity').parentElement.style.display = 'flex'
  89. document.getElementById('integrity-val').innerText = parseSearch.integrity || ''
  90. document.getElementById('integrity-view').style.width = parseSearch.integrity + '%' || ''
  91. }
  92. window.addEventListener('load', function () {
  93. // QRCode.toDataURL(location.origin + '/accompany/colexiu-report-share.html?id=' + (parseSearch.id || '') + '&musicId=' + (parseSearch.musicId || '') + '&client=web', { errorCorrectionLevel: 'H', width: 192 }, function (err, val) {
  94. // console.log(val)
  95. // document.getElementById('qrcode').setAttribute('src', val)
  96. html2canvas(document.body, {allowTaint: true, useCORS: true,})
  97. .then((canvas) => canvas.toDataURL())
  98. .then(res => {
  99. // console.log(res)
  100. if (window.setPng) {
  101. window.setPng(res)
  102. }
  103. })
  104. // })
  105. })
  106. </script>
  107. <!-- <script src="./index.js"></script> -->
  108. </body>
  109. </html>