|
@@ -38,54 +38,33 @@
|
|
|
document.getElementById('loading').className = ''
|
|
|
}
|
|
|
})
|
|
|
- function _postMessage(data, callback) {
|
|
|
- const instance = window.ORCHESTRA || (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.ORCHESTRA)
|
|
|
- if (instance) {
|
|
|
- const uuid = '' + Date.now() + Math.floor(Math.random() * 1000000)
|
|
|
- data.content = data.content ? { ...data.content, uuid } : { uuid }
|
|
|
- console.log('h5发送:', JSON.stringify(data))
|
|
|
- instance.postMessage(JSON.stringify(data))
|
|
|
- }
|
|
|
- }
|
|
|
- // 横屏
|
|
|
- _postMessage({
|
|
|
- api: 'setRequestedOrientation',
|
|
|
- content: {
|
|
|
- orientation: 0
|
|
|
- }
|
|
|
- })
|
|
|
- // 安卓的状态栏
|
|
|
- _postMessage({
|
|
|
- api: 'setStatusBarVisibility',
|
|
|
- content: {
|
|
|
- isVisibility: 0
|
|
|
- }
|
|
|
- })
|
|
|
- _postMessage({
|
|
|
- api: 'setTitleBarVisibility',
|
|
|
- content: {
|
|
|
- status: 0
|
|
|
- }
|
|
|
- })
|
|
|
</script>
|
|
|
<style>
|
|
|
- #lottieWeb {
|
|
|
+ #lottieWebWrap{
|
|
|
position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
z-index: 100;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- width: 100Px;
|
|
|
- height: 100Px;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
pointer-events: none;
|
|
|
transition: opacity .3s;
|
|
|
}
|
|
|
+ #lottieWeb {
|
|
|
+ width: 100Px;
|
|
|
+ height: 100Px;
|
|
|
+ }
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
<div id="app"></div>
|
|
|
- <div id="lottieWeb"></div>
|
|
|
+ <div id="lottieWebWrap">
|
|
|
+ <div id="lottieWeb"></div>
|
|
|
+ </div>
|
|
|
<script>
|
|
|
lottie.loadAnimation({
|
|
|
container: document.getElementById('lottieWeb'),
|
|
@@ -97,7 +76,7 @@
|
|
|
path: '/orchestra-music-score/loading.json'
|
|
|
});
|
|
|
window.addEventListener('load', function () {
|
|
|
- const loadingEle = document.getElementById('lottieWeb')
|
|
|
+ const loadingEle = document.getElementById('lottieWebWrap')
|
|
|
loadingEle.style.opacity = '0'
|
|
|
setTimeout(() => {
|
|
|
loadingEle.style.display = 'none'
|