|
|
@@ -14,6 +14,7 @@ function jumpMap() {
|
|
|
route.navigate("map")
|
|
|
}
|
|
|
const companyInfo = ref<Array<any>>([])
|
|
|
+let timer: any = 0
|
|
|
function getCompany() {
|
|
|
apis.mobileApi.getCompanyDevice(user.value.companyId).then((res) => {
|
|
|
if (res.data.monitor1 && res.data.monitor1.length) {
|
|
|
@@ -38,6 +39,8 @@ function getCompany() {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ clearTimeout(timer)
|
|
|
+ timer = setTimeout(getCompany, 60 * 1000)
|
|
|
}
|
|
|
|
|
|
function init() {
|
|
|
@@ -53,13 +56,16 @@ function init() {
|
|
|
} else if (user.value.userType == 2) {
|
|
|
showLogo.value = false
|
|
|
showCompany.value = true
|
|
|
- getCompany()
|
|
|
}
|
|
|
uni.showTabBar()
|
|
|
}, 1000)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+onShow(() => {
|
|
|
+ if (user.value.userType == 2) {
|
|
|
+ getCompany()
|
|
|
+ }
|
|
|
+})
|
|
|
onLoad(init)
|
|
|
</script>
|
|
|
|