From 0ab6cdbb96d1efc00cbca105917aa021ad2491ef Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期二, 06 五月 2025 09:55:36 +0800
Subject: [PATCH] 1.新增扫描成功和失败音效。
---
Scripts/config.js | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Scripts/config.js b/Scripts/config.js
index 924a764..8a3f5c1 100644
--- a/Scripts/config.js
+++ b/Scripts/config.js
@@ -161,3 +161,20 @@
return;
window.history.back();
}
+
+// 鏂板闊抽鎾斁鏂规硶
+Vue.prototype.$playSound = function(type = 'success') {
+ try {
+ const audioMap = {
+ success: '/audio/OK.wav',
+ error: '/audio/NG.wav'
+ };
+ const audio = new Audio(audioMap[type]);
+ audio.play().catch(error => {
+ console.error('闊抽鎾斁澶辫触:', error);
+ this.$toast.fail('鎻愮ず闊冲姞杞藉け璐�');
+ });
+ } catch (e) {
+ console.error('闊抽鍒濆鍖栭敊璇�:', e);
+ }
+};
--
Gitblit v1.9.3