|
|
@@ -298,41 +298,29 @@ export const callUp = (mobile) =>{
|
|
|
|
|
|
//没有库存时的语音播放 shish
|
|
|
export const noStockRemind = () =>{
|
|
|
- //没有库存声音提醒
|
|
|
- const innerAudioContext = uni.createInnerAudioContext();
|
|
|
- innerAudioContext.autoplay = true;
|
|
|
- innerAudioContext.src = `${CONSTANT.imgUrl}/voice/noStock.mp3`;
|
|
|
- innerAudioContext.onPlay(() => {
|
|
|
- //console.log('开始播放');
|
|
|
- });
|
|
|
- innerAudioContext.onError((res) => {
|
|
|
- //console.log(res.errMsg);
|
|
|
- //console.log(res.errCode);
|
|
|
- });
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext()
|
|
|
+ innerAudioContext.autoplay = false
|
|
|
+ innerAudioContext.volume = 1
|
|
|
+ innerAudioContext.src = "/static/noStock.mp3"
|
|
|
+ innerAudioContext.onPlay()
|
|
|
+ innerAudioContext.onError()
|
|
|
innerAudioContext.onPause(function() {
|
|
|
- //console.log('end');
|
|
|
- innerAudioContext.destroy();
|
|
|
+ innerAudioContext.destroy()
|
|
|
})
|
|
|
+ innerAudioContext.play()
|
|
|
}
|
|
|
|
|
|
//点击声效 shish
|
|
|
export const hitRemind = () =>{
|
|
|
- //没有库存声音提醒
|
|
|
- const innerAudioContext = uni.createInnerAudioContext();
|
|
|
- innerAudioContext.autoplay = true;
|
|
|
- innerAudioContext.src = `${CONSTANT.imgUrl}/hit.mp3`;
|
|
|
- innerAudioContext.volume = 0.5
|
|
|
- innerAudioContext.onPlay(() => {
|
|
|
- //console.log('开始播放');
|
|
|
- });
|
|
|
- innerAudioContext.onError((res) => {
|
|
|
- //console.log(res.errMsg);
|
|
|
- //console.log(res.errCode);
|
|
|
- });
|
|
|
+ const innerAudioContext = uni.createInnerAudioContext()
|
|
|
+ innerAudioContext.autoplay = false
|
|
|
+ innerAudioContext.src = "/static/hit.mp3"
|
|
|
+ innerAudioContext.onPlay()
|
|
|
+ innerAudioContext.onError()
|
|
|
innerAudioContext.onPause(function() {
|
|
|
- //console.log('end');
|
|
|
- innerAudioContext.destroy();
|
|
|
+ innerAudioContext.destroy()
|
|
|
})
|
|
|
+ innerAudioContext.play()
|
|
|
}
|
|
|
|
|
|
//去重 姜枫 2021.05.05
|