|
|
@@ -302,22 +302,15 @@ export const unique = (arr) => {
|
|
|
|
|
|
//点击声效 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()
|
|
|
}
|
|
|
|
|
|
//#ifdef APP-PLUS
|
|
|
@@ -420,21 +413,15 @@ export const isScanEnv = () =>{
|
|
|
|
|
|
//没有库存时的语音播放 shish
|
|
|
export const noStockRemind = () =>{
|
|
|
- //没有库存声音提醒
|
|
|
- const innerAudioContext = uni.createInnerAudioContext();
|
|
|
- innerAudioContext.autoplay = true;
|
|
|
- innerAudioContext.src = `${CONSTANT.imgUrl}/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.src = "/static/noStock.mp3"
|
|
|
+ innerAudioContext.onPlay()
|
|
|
+ innerAudioContext.onError()
|
|
|
innerAudioContext.onPause(function() {
|
|
|
- //console.log('end');
|
|
|
- innerAudioContext.destroy();
|
|
|
+ innerAudioContext.destroy()
|
|
|
})
|
|
|
+ innerAudioContext.play()
|
|
|
}
|
|
|
|
|
|
export const callUp = (mobile) =>{
|