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 ++++++++++++-
manifest.json | 4 ++--
pages/shengchanlingliao/form.vue | 3 +++
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/manifest.json b/manifest.json
index 8cbdab0..d279f43 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name" : "鏅轰簯LMES",
"appid" : "__UNI__B002F49",
"description" : "",
- "versionName" : "1.0.94",
- "versionCode" : 194,
+ "versionName" : "1.0.96",
+ "versionCode" : 196,
"transformPx" : false,
/* 5+App鐗规湁鐩稿叧 */
"app-plus" : {
diff --git a/pages/shengchanlingliao/form.vue b/pages/shengchanlingliao/form.vue
index 6f2e753..34f2d26 100644
--- a/pages/shengchanlingliao/form.vue
+++ b/pages/shengchanlingliao/form.vue
@@ -616,6 +616,7 @@
console.log('鎵爜杩斿洖', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
+ CommonUtils.playSound(1);
var data = res.data.data
if (data.hBarTypeField == '浠撳簱鏉$爜') {
this.hform.HWHName = data.hWhNameField
@@ -702,6 +703,7 @@
//娓呯┖鏁伴噺
this.hform.HQty = ''
} else {
+ CommonUtils.playSound(0);
uni.showToast({
title: res.data.Message,
icon: 'none'
@@ -711,6 +713,7 @@
this.refreshHBarCodeFocus()
},
fail: (res) => {
+ CommonUtils.playSound(0);
console.log(res);
uni.showToast({
title: '鎺ュ彛璇锋眰澶辫触',
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