国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識(shí)百科 - 正文

微信小程序?qū)崿F(xiàn)彈出菜單功能

來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 22:12:59
文檔

微信小程序?qū)崿F(xiàn)彈出菜單功能

微信小程序?qū)崿F(xiàn)彈出菜單功能:需求 點(diǎn)擊標(biāo)簽欄按鈕,向下彈出菜單,再次點(diǎn)擊,收回菜單 要解決的問題 標(biāo)簽欄三欄樣式,標(biāo)簽欄固定不動(dòng); 點(diǎn)擊標(biāo)簽欄彈出菜單,并且出現(xiàn)透明遮罩; 遮罩優(yōu)先級(jí)在彈出框之下; 彈出框內(nèi)標(biāo)簽的設(shè)置; 滾動(dòng)欄滾動(dòng)條的隱藏 如何解決? 彈性布局,橫向,
推薦度:
導(dǎo)讀微信小程序?qū)崿F(xiàn)彈出菜單功能:需求 點(diǎn)擊標(biāo)簽欄按鈕,向下彈出菜單,再次點(diǎn)擊,收回菜單 要解決的問題 標(biāo)簽欄三欄樣式,標(biāo)簽欄固定不動(dòng); 點(diǎn)擊標(biāo)簽欄彈出菜單,并且出現(xiàn)透明遮罩; 遮罩優(yōu)先級(jí)在彈出框之下; 彈出框內(nèi)標(biāo)簽的設(shè)置; 滾動(dòng)欄滾動(dòng)條的隱藏 如何解決? 彈性布局,橫向,

需求

點(diǎn)擊標(biāo)簽欄按鈕,向下彈出菜單,再次點(diǎn)擊,收回菜單

要解決的問題

  1. 標(biāo)簽欄三欄樣式,標(biāo)簽欄固定不動(dòng);
  2. 點(diǎn)擊標(biāo)簽欄彈出菜單,并且出現(xiàn)透明遮罩;
  3. 遮罩優(yōu)先級(jí)在彈出框之下;
  4. 彈出框內(nèi)標(biāo)簽的設(shè)置;
  5. 滾動(dòng)欄滾動(dòng)條的隱藏

如何解決?

  1. 彈性布局,橫向,三者平分整欄;
  2. 狀態(tài)監(jiān)聽點(diǎn)擊事件,數(shù)據(jù)控制hide或者show,通過rgba設(shè)置透明度
  3. 彈出框設(shè)置z-index;
  4. 彈性布局flex 橫向排列 超出后wrap 然后space-around控制間距
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}

具體實(shí)現(xiàn)

wxml

<import src="../../templates/template" />
<view class="container {{isMask?'mask':''}}">
 <view class="header">
 <view class="filterCity {{status=='1' && isActive?'active':''}}" data-status='1' bindtap="changeStatus">
 <view class="city">城市篩選</view>
 <image src="{{status=='1' && isActive?'../../youzan-image/red-up.png':'../../youzan-image/down.png'}}" />
 </view>
 <view class="filterJob {{status=='2' && isActive?'active':''}}" data-status='2' bindtap="changeStatus">
 <view class="job">職位篩選</view>
 <image src="{{status=='2' && isActive?'../../youzan-image/red-up.png':'../../youzan-image/down.png'}}" />
 </view>
 <view class="filterOrder {{status=='3'&& isActive?'active':''}}" data-status='3' bindtap="changeStatus">
 <view class="order">排序方式</view>
 <image src="{{status=='3' && isActive?'../../youzan-image/red-up.png':'../../youzan-image/down.png'}}" />
 </view>
 </view>
 <block wx:if="{{isActive==true&&status=='1'}}">
 <view class="cityContainer">
 <block wx:for="{{city}}" wx:key="id" wx:for-index="index">
 <view class="city {{isSelect&&index==curIndex?'select':''}}" data-index="{{index}}" bindtap="select">{{item}}</view>
 </block>
 </view>
 </block>
 <block wx:if="{{isActive==true&&status=='2'}}">
 <scroll-view scroll-y="true" class="posContainer">
 <block wx:for="{{cur}}" data-index='index' wx:for-index='index' wx:key="index">
 <view class="title">{{item.title}}</view>
 <view class="poscontent">
 <view wx:for="{{item.types}}" wx:for-item="type" wx:key='id' wx:for-index="{{index}}" data-index="{{index}}">
 <view class="tag {{isSelect&&index==curIndex?'select':''}}" data-id="{{id}}" bindtap="multiSelect">{{type}}</view>
 </view>
 </view>
 </block>
 <view class="confirm">
 <button class="weui-btn" type="warn">確認(rèn)</button>
 </view>
 </scroll-view>
 </block>
 <block wx:if="{{isActive==true&&status=='3'}}">
 <view class="orderContainer">
 <view class="block">智能排序</view>
 <view class="block">時(shí)間排序</view>
 <view class="block">薪資排序</view>
 </view>
 </block>
 <view class="listContainer" >
 <view wx:for="{{jobList}}" wx:key="index" data-index="{{index}}">
 <template is="list-item" data="{{...item}}" />
 </view>
 </view>
 <view class="search " bindtap="search">
 <image src="../../youzan-image/search.png" />
 <text>搜索</text>
 </view>
</view>

wxss

page {
 position: relative;
 width: 100%;
 height: 100vh;
}

.header {
 width: 100%;
 height: 80rpx;
 position: fixed;
 top: 0;
 display: flex;
 flex-direction: row;
 justify-content: space-between;
 text-align: center;
 color: #313131;
 font-size: 16px;
 border-bottom: 1rpx solid #eeeeee;
 z-index: 9999;
 background-color: #fff;
}

.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

import category from '../../api/employ'
import jobList from '../../api/detail'
Page({
 data: {
 curIndex: '',
 isActive: false,
 jobList:[],
 cur: [],
 job: [],
 isShow: true,
 status: 0,
 isMask: false,
 isSelect: false,
 city: ['全國', '杭州', '北京', '深圳', '上海', '廣州', '武漢', '重慶']
 },
 changeStatus(e) {
 let status = e.currentTarget.dataset.status;
 let cur = category;
 this.setData({
 isActive: !this.data.isActive,
 status: status,
 isMask: !this.data.isMask,
 cur: cur,
 })
 },
 select(e) {
 let curIndex = e.currentTarget.dataset.index;
 this.setData({
 isSelect: " curIndex == this.data.curIndex ? '!this.data.isActive' : 'true' ",
 isActive: false,
 isMask:false,
 curIndex: curIndex,
 })
 },
 multiSelect(e){
 let multiIndex=e.currentTarget.dataset.index;
 this.setData({
 isSelect:!this.data.isSelect,
 curIndex:multiIndex
 })
 },
 search(e) {
 wx.navigateTo({
 url: '../search/search',
 })
 },
 onLoad: function (e) {
 this.setData({
 jobList:jobList
 })
 },
 click:function (e) {
 let id =e.currentTarget.dataset.id;
 wx.navigateTo({
 url: `../detail/detail?id=${id}`,
 })
 }
})

總結(jié)

以上所述是小編給大家介紹的微信小程序?qū)崿F(xiàn)彈出菜單功能,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

微信小程序?qū)崿F(xiàn)彈出菜單功能

微信小程序?qū)崿F(xiàn)彈出菜單功能:需求 點(diǎn)擊標(biāo)簽欄按鈕,向下彈出菜單,再次點(diǎn)擊,收回菜單 要解決的問題 標(biāo)簽欄三欄樣式,標(biāo)簽欄固定不動(dòng); 點(diǎn)擊標(biāo)簽欄彈出菜單,并且出現(xiàn)透明遮罩; 遮罩優(yōu)先級(jí)在彈出框之下; 彈出框內(nèi)標(biāo)簽的設(shè)置; 滾動(dòng)欄滾動(dòng)條的隱藏 如何解決? 彈性布局,橫向,
推薦度:
標(biāo)簽: 微信小程序 菜單 彈出
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 日韩欧美一区二区三区久久 | 亚洲欧美日韩高清中文在线 | 青青草原国产一区二区 | 欧美日韩高清在线 | 成人一a毛片免费视频 | 精品二区 | 欧美交性又色又爽又黄 | 美女视频黄全免费的 | 精品一区二区三区3d动漫 | 在线亚洲一区 | 国产3区| 久久91精品国产91久久户 | 看一级特黄a大片日本片 | 亚洲欧洲高清有无 | 久久免费看视频 | 欧美日韩精品 | 在线免费一区二区 | 国产黄色小视频在线观看 | 亚洲精品毛片久久久久久久 | 欧美极品欧美日韩 | 欧美高清免费 | 黄色毛片在线观看 | 午夜高清在线观看免费完整版 | 亚洲另类中文字幕 | 毛片资源 | 久久亚洲精品中文字幕60分钟 | 成人亚洲国产精品久久 | 欧美日韩色视频在线观看 | 国产精品亚洲四区在线观看 | 日韩欧美一二区 | 香港经典a毛片免费观看…伊人色综合久久 | 国产精品第 | 欧美精品亚洲精品日韩专区va | 2022国产精品福利在线观看 | 精品国产日韩亚洲一区二区 | 欧美日本中文字幕 | 成人中文字幕一区二区三区 | 欧美在线观看一区二区三 | 亚欧国产| 久久精品国产99久久99久久久 | 亚洲国产一区二区三区精品 |