Commit 7e746ed440c16641d546171c642a21692192fff2

Authored by xp.Huang
2 parents 69253a01 847ee68d

Merge branch 'fix/indexofdevice-add-first-get' into 'main_dev'

fix: 修复首页和设备tabs切换得时候没有请求数据

See merge request yunteng/thingskit-app!152
... ... @@ -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()
... ...
... ... @@ -82,6 +82,8 @@
82 82 onLoad() {
83 83 // 隐藏原生的tabbar
84 84 uni.hideTabBar();
  85 + },
  86 + onShow(){
85 87 if (getApp().getBindNot()) {
86 88 this.basicStatistics.map(item=>{
87 89 const { key, value } = item
... ...