<view class='title_icon'>
<image src='p/index/icons/l.png' mode='aspectFit' class='back' bindtap='navBack'></image>
<view></view>
<image src='p/index/icons/home.png' mode='aspectFit' class='home' bindtap='navHome'></image> </view>
<view class='title_text'>
猎码⼠
</view>
</view>
<!--Page-->
<view >
js导航栏下拉菜单
Page Content
</view>
wxss:
/* ⾃定义导航 */
.nav {
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 10;
background: #fff;
}
.title_text {
width: 100%;
height: 45px;
line-height: 45px;
text-align: center;
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
font-size: 34rpx;
}
.title_icon {
position: absolute;
bottom: 10rpx;
left: 10rpx;
border-radius: 70rpx;
box-sizing: border-box;
border: 0.5px solid #eaeaea; display: flex;
z-index: 20;
}
.title_icon image {
display: inline-block;
overflow: hidden;
width: 32rpx;
height: 36rpx;
padding: 16rpx 32rpx;
text-align: center;
}
.title_icon view {
height: 18px;
border-left: 1px solid #eaeaea; margin-top: 6px;
}
js:
Page({
data: {
navH: 0
},
onLoad: function (options) {
this.navHeight()
},
navHeight: function () {
var that = this;
// 获取⼿机系统信息
success: res => {
//导航⾼度
that.data.navH = res.statusBarHeight + 46;
that.setData({ navH: res.statusBarHeight + 46 }) }, fail(err) {
console.log(err);
}
})
},
// 返回上⼀页
navBack: function () {
wx.navigateBack({
delta: 1
})
},
navHome: function () {
url: '../index/index'
})
}
})
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论