Selaa lähdekoodia

onshow更新首页数据

xiaohaizhao 1 vuosi sitten
vanhempi
commit
f44013b855

+ 3 - 0
pages/index/index.vue

@@ -50,6 +50,9 @@ export default {
 		})
 		this.loadElement()
 	},
+	onShow() {
+		this.$refs.Home.renderData();
+	},
 	methods: {
 		opentabControl(active) {
 			if (this.$refs.tabControl.active !== active) this.$nextTick(() => this.$refs.tabControl.active = active);

+ 9 - 4
pages/index/modules/home.vue

@@ -20,13 +20,13 @@
 		</cu-custom>
 
 		<!-- 滚动通知 -->
-		<notice />
+		<notice ref="notice" />
 		<!-- 工作台 -->
 		<workbench />
 		<!-- 数据看板 -->
-		<spectaculars />
+		<spectaculars ref="spectaculars" />
 		<!-- 巡检计划 -->
-		<patrolScheme />
+		<patrolScheme ref="patrolScheme" />
 
 		<workorder v-if="showWorkrder" :isHome="true" />
 		<view style="height: calc(16.533vw + env(safe-area-inset-bottom) / 2);" />
@@ -76,6 +76,11 @@ export default {
 		this.getWeather();
 	},
 	methods: {
+		renderData() {
+			this.$refs.notice.getList();
+			this.$refs.spectaculars.getDetail();
+			this.$refs.patrolScheme.getDetail();
+		},
 		getWeather() {
 			this.$Http.basic({
 				id: "20231012093701",
@@ -142,7 +147,7 @@ export default {
 			Dustom.CustomBar = Dustom.CustomBar + num;
 			this.headHeight = Dustom.getHeight()
 		}
-	},
+	}
 }
 </script>
 

+ 0 - 1
pages/index/modules/notice.vue

@@ -13,7 +13,6 @@ export default {
         };
     },
     created() {
-        this.getList();
         this.$Http.updateMessage = this.getList.bind(this);
     },
     methods: {

+ 0 - 1
pages/index/modules/patrolScheme.vue

@@ -32,7 +32,6 @@ export default {
         };
     },
     created() {
-        this.getDetail()
     },
     methods: {
         getDetail() {

+ 0 - 1
pages/index/modules/spectaculars.vue

@@ -39,7 +39,6 @@ export default {
         }
     },
     created() {
-        this.getDetail()
         let auth = uni.getStorageSync('authList'),
             showList = [];
         typeof auth.设备中心 == 'object' && showList.push("在线设备");