colexiu-report.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html lang="ZH-cn">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="icon" href="/favicon.ico" />
  6. <meta name="description" content="酷乐秀APP,器乐学习的不二选择">
  7. <title>评测记录</title>
  8. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  9. <script src="/helpers/lottie.min.js"></script>
  10. <link href="/vant.css" rel="stylesheet">
  11. <script>
  12. function getBroswer() {
  13. var Sys = {};
  14. var ua = navigator.userAgent.toLowerCase();
  15. var s;
  16. (s = ua.match(/edge\/([\d.]+)/)) ? Sys.edge = s[1] :
  17. (s = ua.match(/rv:([\d.]+)\) like gecko/)) ? Sys.ie = s[1] :
  18. (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
  19. (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
  20. (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
  21. (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
  22. (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
  23. if (Sys.edge) return { broswer: "Edge", version: Sys.edge };
  24. if (Sys.ie) return { broswer: "IE", version: Sys.ie };
  25. if (Sys.firefox) return { broswer: "Firefox", version: Sys.firefox };
  26. if (Sys.chrome) return { broswer: "Chrome", version: Sys.chrome };
  27. if (Sys.opera) return { broswer: "Opera", version: Sys.opera };
  28. if (Sys.safari) return { broswer: "Safari", version: Sys.safari };
  29. return { broswer: "", version: "0" };
  30. }
  31. var broswer = getBroswer();
  32. window.addEventListener('DOMContentLoaded', function () {
  33. if (broswer.broswer === 'Chrome' && parseFloat(broswer.version) <= 50) {
  34. document.getElementById('update').className = 'show'
  35. document.getElementById('loading').className = ''
  36. }
  37. })
  38. function _postMessage(data, callback) {
  39. const instance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA)
  40. if (instance) {
  41. const uuid = '' + Date.now() + Math.floor(Math.random() * 1000000)
  42. data.content = data.content ? { ...data.content, uuid } : { uuid }
  43. console.log('h5发送:', JSON.stringify(data))
  44. instance.postMessage(JSON.stringify(data))
  45. }
  46. }
  47. // 横屏
  48. _postMessage({
  49. api: 'setRequestedOrientation',
  50. content: {
  51. orientation: 0
  52. }
  53. })
  54. // 安卓的状态栏
  55. _postMessage({
  56. api: 'setStatusBarVisibility',
  57. content: {
  58. isVisibility: 0
  59. }
  60. })
  61. _postMessage({
  62. api: 'setTitleBarVisibility',
  63. content: {
  64. status: 0
  65. }
  66. })
  67. </script>
  68. <style>
  69. #lottieWeb {
  70. position: fixed;
  71. z-index: 100;
  72. top: 50%;
  73. left: 50%;
  74. width: 100Px;
  75. height: 100Px;
  76. transform: translate(-50%, -50%);
  77. pointer-events: none;
  78. transition: opacity .3s;
  79. }
  80. </style>
  81. </head>
  82. <body>
  83. <div id="app"></div>
  84. <div id="lottieWeb"></div>
  85. <script>
  86. lottie.loadAnimation({
  87. container: document.getElementById('lottieWeb'),
  88. renderer: 'svg',
  89. width: '30px',
  90. height: '30px',
  91. loop: true,
  92. autoplay: true,
  93. path: '/orchestra-music-score/loading.json'
  94. });
  95. window.addEventListener('load', function () {
  96. const loadingEle = document.getElementById('lottieWeb')
  97. loadingEle.style.opacity = '0'
  98. setTimeout(() => {
  99. loadingEle.style.display = 'none'
  100. }, 1000)
  101. })
  102. </script>
  103. <script type="module" src="/src/subpages/colexiu-report/main.ts"></script>
  104. </body>
  105. </html>