Browse Source

自定义tabbar数量和数据库同步

h5_css
蟑螂恶霸 3 years ago
parent
commit
073430973d
  1. 19
      pages/index/index.vue

19
pages/index/index.vue

@ -37,6 +37,22 @@
};
},
onLoad() {
uni.setTabBarItem({
index: 1,
"visible": false
});
uni.setTabBarItem({
index: 2,
"visible": false
});
uni.setTabBarItem({
index: 3,
"visible": false
});
uni.setTabBarItem({
index: 4,
"visible": false
});
this.listTabbar();
this.getSwiperList()
},
@ -44,7 +60,9 @@
listTabbar() {
this.$api.listTabbar({})
.then(res => {
console.log(res)
for (var i = 0; i < res.data.length; i++) {
if (res.data[i].hide == 1) {
if (res.data[i].type == "home") {
uni.setTabBarItem({
index: 0,
@ -74,6 +92,7 @@
});
}
}
}
}).catch((e) => console.log(e)); //捕获异常
},

Loading…
Cancel
Save