Commit a34fc10a authored by hewenhao's avatar hewenhao

feat: update

parent 8343537b
......@@ -5,8 +5,8 @@
display: flex;
align-items: center;
box-sizing: border-box;
z-index: 1;
box-shadow: 0 1px 14px rgba(0, 81, 231, 0.1);
z-index: 20;
box-shadow: 0 1px 14px rgba(0, 81, 231, .5);
position: relative;
overflow: hidden;
......
......@@ -5,11 +5,22 @@ import { useFocus } from '@/hooks'
import {
usePageScroll, createIntersectionObserver, getCurrentInstance,
getMenuButtonBoundingClientRect, IntersectionObserver, nextTick,
createInnerAudioContext
createInnerAudioContext, onAppHide, onAppShow
} from '@tarojs/taro'
import audio from '@/assets/oss/assets-audio'
let isHide = false
onAppHide(() => {
isHide = true
})
onAppShow(() => {
isHide = false
})
function palyAudio (src: string) {
if (isHide) return
// @ts-ignore
const innerAudioContext = createInnerAudioContext({ useWebAudioImplement: true })
innerAudioContext.src = src
......
import { createInnerAudioContext } from '@tarojs/taro'
import { createInnerAudioContext, onAppHide, onAppShow } from '@tarojs/taro'
const innerAudioContext = createInnerAudioContext()
let isHide = false
onAppHide(() => {
isHide = true
innerAudioContext.pause()
})
onAppShow(() => {
isHide = false
})
export function palyAudio (src: string) {
innerAudioContext.src = src
if (!isHide) {
innerAudioContext.play()
}
return innerAudioContext
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment