From d8743368ffda9bc0fb2c6818f695a9a6b1079e57 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 19 九月 2025 18:22:15 +0800
Subject: [PATCH] laster

---
 pages/task/list.vue |   42 +++++++++++++++++++++++-------------------
 1 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/pages/task/list.vue b/pages/task/list.vue
index afa7af0..4d85b88 100644
--- a/pages/task/list.vue
+++ b/pages/task/list.vue
@@ -33,7 +33,7 @@
 			<uni-icons color="#ccc" type="info" size="128"></uni-icons>
 			<view class="space">娌℃湁鎵惧埌绗﹀悎鏉′欢鐨勪换鍔�/view>
 		</view>
-		<view class="position-add" @click="clickAddTask()" @touchstart='btnAddTouchStart' @touchmove='btnAddTouchMove'
+		<view class="position-add" @click="clickAddTask"  @touchstart='btnAddTouchStart' @touchmove='btnAddTouchMove'
 			:style="{transform:`translate(${btnAddInfo.x}px,${btnAddInfo.y}px) scale(1)`}">
 			<uni-icons class="img" type="plus-filled" size="80" color="#1890FF"></uni-icons>
 		</view>
@@ -45,6 +45,8 @@
 		showToast,
 		showModal,
 		session,
+		showError,
+		showInfo
 	} from "@/comm/utils.js"
 	import TaskItemView from "./infos/task-item.vue"
 	import {
@@ -68,6 +70,7 @@
 		},
 		data() {
 			return {
+				loading:false,
 				ip: "",
 				sceneId: "",
 				list: [],
@@ -104,8 +107,10 @@
 			this.ip = option.ip || ""
 			this.sceneId = option.sceneId || ""
 			this.isPageVisible = true
-
-			this.loadData()
+			this.$nextTick(()=>{
+				this.loadData()
+			})
+			
 		},
 		onShow() {
 			this.isPageVisible = true
@@ -159,7 +164,7 @@
 
 				} catch (ex) {
 
-					this.showError(ex)
+					showError(ex)
 				}
 			},
 			async loadTaskList() {
@@ -167,20 +172,25 @@
 					const res = await tasks(this.ip)
 					const list = res?.data || []
 					this.list = list
+					showToast(`瑁呰浇浜�{list.length}浠诲姟`)
 				} catch (ex) {
 
-					this.showError(ex)
+					showError(ex)
 				}
+				
 			},
 
 			async timerCheckTaskGroupStatus() {
 				try {
 					if (this.isPageVisible)
 						await this.checkTaskGroupStatus()
+						setTimeout(this.timerCheckTaskGroupStatus, 1000);
 				} catch (ex) {
-					this.showError(ex)
+					showError(ex).then((res)=>{
+						setTimeout(this.timerCheckTaskGroupStatus, 1000);
+					})
 				} finally {
-					setTimeout(this.timerCheckTaskGroupStatus, 1000);
+					
 				}
 			},
 			async checkTaskGroupStatus() {
@@ -210,7 +220,7 @@
 				} catch (ex) {
 
 					this.taskStatus = {}
-					this.showError(ex)
+					showError(ex)
 				}
 			},
 			setTaskGroupStatus(cmdID) {
@@ -220,6 +230,7 @@
 			},
 			clickAddTask() {
 				const _this = this
+				
 				uni.navigateTo({
 					url: `/pages/task/add?ip=${this.ip}&title=鏂板浠诲姟`,
 					events: {
@@ -305,7 +316,7 @@
 					this.setTaskGroupStatus(cmdID)
 
 				} catch (ex) {
-					this.showError(ex)
+					showError(ex)
 				}
 			},
 
@@ -314,7 +325,7 @@
 					await addTaskGroupCmd(this.ip, item.taskGroupID, this.taskStatus.taskGroupCmdID, 2)
 					showToast("缁堟浠诲姟鎴愬姛")
 				} catch (ex) {
-					this.showError(ex)
+					showError(ex)
 				}
 			},
 
@@ -345,7 +356,7 @@
 						showToast("鏈壘鍒版湭寮�鎴栨鍦ㄦ墽琛岀殑瀛愪换鍔�)
 					}
 				} catch (ex) {
-					this.showError(ex)
+					showError(ex)
 				}
 			},
 
@@ -379,19 +390,12 @@
 					this.list = [...list]
 
 				} catch (ex) {
-					this.showError(ex)
+					showError(ex)
 				}
 
 			},
 
 
-			showError(ex) {
-				let exStr = JSON.stringify(ex)
-				if (exStr == "{}")
-					exStr = ex
-				let tip = typeof ex.msg == "string" ? ex.msg : typeof ex.errMsg == "string" ? ex.errMsg : exStr
-				showModal(tip, "閿欒", false, "纭畾")
-			},
 		}
 	}
 </script>

--
Gitblit v1.9.1