需求
要解决的问题
如何解决?
- 弹性布局,横向,三者平分整栏;
- 状态监听点击事件,数据控制hide或者show,通过rgba设置透明度
- 弹出框设置z-index;
- 弹性布局flex 横向排列 超出后wrap 然后space-around控制间距
具体实现
wxml
wxml
wxss
.filterCity {
flex: 1;
position: relative;
height: 80rpx;
line-height: 80rpx;
}
.filterJob {
position: relative;
flex: 1;
height: 80rpx;
line-height: 80rpx;
}
.filterOrder {
position: relative;
flex: 1;
height: 80rpx;
line-height: 80rpx;
}
.header image {
position: absolute;
right: 15rpx;
top: 26rpx;
width: 30rpx;
height: 30rpx;
}
.active {
color: #ef0001;
}
.mask {
width: 100%;
height: 100%;
position: fixed;
top: 80rpx;
background-color: rgba(15,15,26,0.3);
}
.cityContainer {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: space-between;
flex-wrap: wrap;
width: 100%;
height: 300rpx;
z-index: 999;
background-color: #fff;
border-bottom: 1rpx solid #e9e9e9;
padding-bottom: 130rpx;
}
.cityContainer .city {
display: block;
font-size: 15px;
margin-top: 100rpx;
width: 150rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
border: 1rpx solid #e9e9e9;
overflow: hidden;
}
.select {
color: #ffffff;
background-color: #ed0000;
}
.posContainer {
height: 980rpx;
width: 100%;
background-color: #fff;
/ overflow:auto; /
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.title {
margin-top: 55rpx;
font-size: 15px;
margin-left: 28rpx;
}
.poscontent {
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: wrap;
margin-top: -15rpx;
}
.tag {
margin-left: 28rpx;
margin-top: 23rpx;
font-size: 13px;
width: 150rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
border: 1rpx solid #e9e9e9;
}
.confirm {
width: 100%;
height: 150rpx;
border: 1rpx solid transparent;
background-color: #fff;
}
.weui-btn {
position: fixed;
width: 95%;
bottom: 52rpx;
left: 50%;
transform: translateX(-50%);
}
.orderContainer {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
background-color: #fff;
width: 100%;
height: 125rpx;
}
.block {
font-size: 13px;
width: 200rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
border: 1rpx solid #e9e9e9;
}
.search {
position: fixed;
bottom: 80rpx;
background-color: #fff;
right: 25rpx;
width: 150rpx;
height: 75rpx;
line-height: 75rpx;
text-align: center;
border-radius: 35rpx;
Box-shadow: 1rpx 1rpx 7rpx 7rpx #f5f5f5;
}
.search image {
width: 30rpx;
height: 30rpx;
}
.search text {
font-size: 15px;
padding-left: 9rpx;
color: #666666;
}
.listContainer {
width: 100%;
height: 100%;
margin-top: 80rpx;
}
js
以上所述是小编给大家介绍的微信小程序实现弹出菜单功能。编程之家 jb51.cc 收集整理的教程希望能对你有所帮助,如果觉得编程之家不错,可分享给好友!感谢支持。
原文链接:https://www.f2er.com/weapp/31928.html