wtt
2025-10-11 d669eb89c39aba5b980e52b8032e96a0d0ea9271
utils/common.js
@@ -302,7 +302,6 @@
    // uni-app 播放音频封装
    playSound(e) {
      console.log(e);
        const innerAudioContext = uni.createInnerAudioContext();
        if (e == 1) {
            innerAudioContext.src = '/static/success.wav';
@@ -310,6 +309,18 @@
            innerAudioContext.src = '/static/jingbao.wav';
        }
        innerAudioContext.play(); // 播放音频
      innerAudioContext.onPlay(() => {
         console.log('开始播放');
      });
      innerAudioContext.onError((res) => {
         console.log(res.errMsg);
         console.log(res.errCode);
      });
      innerAudioContext.onPause(function(){
         console.log('播放出现错误,销毁');
         innerAudioContext.destroy();
      })
    }
    
    replaceWithFunction(str, handler) {