From 4a33335da6f6ccbb13427d317d23b0c74d019fbb Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期一, 14 四月 2025 17:56:16 +0800
Subject: [PATCH] 新增测试数据功能,允许在首页和取水口页面使用模拟数据进行测试,优化用户体验。

---
 pages/feedback/feedback.js |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/pages/feedback/feedback.js b/pages/feedback/feedback.js
index 2872086..273540c 100644
--- a/pages/feedback/feedback.js
+++ b/pages/feedback/feedback.js
@@ -27,7 +27,6 @@
       height: 160,
     },
     originFiles: [],
-
     contentValue: '', //鍙嶉璇︽儏
     accSavePath: [], //涓婁紶鐨勯煶棰戞枃浠舵帴鍙h繑鍥炵殑鍦板潃
     photoSavePath: [], //涓婁紶鐨勭収鐗囨枃浠惰繑鍥炵殑鍦板潃
@@ -362,10 +361,15 @@
     }, 1000)
 
   },
+
   //寮�鍚畾鏃跺櫒
   startRecordingCountdown() {
     console.log("startRecordingCountdown");
     const that = this;
+    if (this.recordingInterval) {
+      // 濡傛灉瀹氭椂鍣ㄥ凡缁忓湪杩愯锛岄伩鍏嶉噸澶嶅惎鍔�
+      return;
+    }
     this.recordingInterval = setInterval(() => {
       const newVoiceTime = that.data.voiceTime + 1;
       const newContDownTime = that.data.contDownTime - 1;
@@ -379,7 +383,12 @@
       }
     }, 1000);
   },
-
+  onUnload() {
+    if (this.recordingInterval) {
+      clearInterval(this.recordingInterval);
+      this.recordingInterval = null;
+    }
+  },
   stopRecordingCountdown() {
     console.log("stopRecordingCountdown");
     if (this.recordingInterval) {
@@ -503,7 +512,7 @@
       this.setData({
         isRefreshing: false,
         pageCurr: 1,
-        listData:[]
+        listData: []
       });
     }
     const app = getApp();

--
Gitblit v1.8.0