想要的效果
而我总是在底部有导航栏
可以通过调用wx.hideTabBar和wx.showTabBar隐藏或展示底部的tabbar。
例
index.js
Page({
data: {
show: false
},
showPopup() {
wx.hideTabBar({ animation: true })
setTimeout(() => { this.setData({ show: true }); }, 200);
},
onClose() {
this.setData({ show: false });
setTimeout(() => { wx.showTabBar({ animation: true }) }, 300);
},
})
index.wxml
<van-cell title="展示弹出层" is-link bind:click="showPopup" />
<van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-style="height: 20%;" closeable close-icon-position="top-right">
</van-popup>
index.json
{
"usingComponents": {
"van-popup": "/miniprogram_npm/@vant/weapp/popup/index",
"van-cell": "/miniprogram_npm/@vant/weapp/cell/index"
}
}
{
"navigationStyle":"custom",
}
1、弹窗出来要么就隐藏tabbar,等弹窗关闭后再显示出来(弊端是有点延迟,显示&&隐藏的时候不流畅)。
2、自己手写tabbar