From 0a23b1aa90404be282b630959e5784f3974a6acd Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 10 十月 2025 16:45:31 +0800
Subject: [PATCH] 解决扫码频率快导致播放成功错误音乐-99错误
---
utils/common.js | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/utils/common.js b/utils/common.js
index 71805ba..47488ec 100644
--- a/utils/common.js
+++ b/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) {
--
Gitblit v1.9.1