|
|
@@ -297,22 +297,42 @@ export const callUp = (mobile) =>{
|
|
|
|
|
|
//没有库存时的语音播放 shish
|
|
|
export const noStockRemind = () =>{
|
|
|
- // const innerAudioContext = uni.createInnerAudioContext()
|
|
|
- // innerAudioContext.autoplay = false
|
|
|
- // innerAudioContext.volume = 1
|
|
|
- // innerAudioContext.src = "/static/noStock.mp3"
|
|
|
- // innerAudioContext.onError()
|
|
|
- // innerAudioContext.onPause(function() {
|
|
|
- // innerAudioContext.destroy()
|
|
|
- // })
|
|
|
- // innerAudioContext.play()
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext()
|
|
|
+ innerAudioContext.autoplay = false
|
|
|
+ innerAudioContext.volume = 1
|
|
|
+ innerAudioContext.src = "/static/noStock.mp3"
|
|
|
+ innerAudioContext.play()
|
|
|
+ innerAudioContext.onError(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ innerAudioContext.onPause(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ innerAudioContext.onStop(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ innerAudioContext.onEnded(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
export const hitVoice = () =>{
|
|
|
- // const innerAudioContext = uni.createInnerAudioContext()
|
|
|
- // innerAudioContext.autoplay = false
|
|
|
- // innerAudioContext.src = "/static/hit.mp3"
|
|
|
- // innerAudioContext.play()
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext()
|
|
|
+ innerAudioContext.autoplay = false
|
|
|
+ innerAudioContext.src = "/static/hit.mp3"
|
|
|
+ innerAudioContext.play()
|
|
|
+ innerAudioContext.onError(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ innerAudioContext.onPause(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ innerAudioContext.onStop(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
+ innerAudioContext.onEnded(function() {
|
|
|
+ innerAudioContext.destroy()
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//去重 姜枫 2021.05.05
|