Commit 847ee68ddce933219d09909f5e1aadba45bc2e14
Committed by
xp.Huang
1 parent
69253a01
fix: 修复首页和设备tabs切换得时候没有请求数据
Showing
3 changed files
with
9 additions
and
3 deletions
| ... | ... | @@ -64,9 +64,7 @@ |
| 64 | 64 | if (getApp().getBindNot()) { |
| 65 | 65 | return |
| 66 | 66 | } |
| 67 | - if (!e.deviceState) { | |
| 68 | - this.loadData(1); | |
| 69 | - } else { | |
| 67 | + if (e.deviceState) { | |
| 70 | 68 | let params = JSON.parse(e.deviceState); |
| 71 | 69 | this.conditions = { |
| 72 | 70 | deviceState: params |
| ... | ... | @@ -87,7 +85,9 @@ |
| 87 | 85 | this.conditions = { |
| 88 | 86 | organizationId: this.ordId |
| 89 | 87 | } |
| 88 | + return | |
| 90 | 89 | } |
| 90 | + this.loadData(1); | |
| 91 | 91 | }, |
| 92 | 92 | methods: { |
| 93 | 93 | inputChanged(e) { | ... | ... |
| ... | ... | @@ -45,6 +45,7 @@ import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/me |
| 45 | 45 | import api from '@/api/index.js' |
| 46 | 46 | import { useNavigateTo } from '@/plugins/utils.js' |
| 47 | 47 | import headerOrg from '@/components/common/header-org.vue' |
| 48 | +import store from '@/store' | |
| 48 | 49 | |
| 49 | 50 | export default { |
| 50 | 51 | mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) |
| ... | ... | @@ -78,6 +79,9 @@ export default { |
| 78 | 79 | onHide() { |
| 79 | 80 | this.ordId = '' |
| 80 | 81 | }, |
| 82 | + onUnload(){ | |
| 83 | + store.commit('setLoadingShow', false) | |
| 84 | + }, | |
| 81 | 85 | onLoad() { |
| 82 | 86 | // 隐藏原生的tabbar |
| 83 | 87 | uni.hideTabBar() | ... | ... |