欧洲变态另类zozo,欧美xxxx做受欧美gaybdsm,欧洲熟妇色xxxx欧美老妇软件,免费人成视频xvideos入口 ,欧美.日韩.国产.中文字幕

歡迎光臨本站
我們一直在努力

小程序開(kāi)發(fā)做出彈出菜單功能(附代碼)

這次給大家?guī)?lái)小程序開(kāi)發(fā)做出彈出菜單功能(附代碼),小程序開(kāi)發(fā)做出彈出菜單功能(的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來(lái)看一下。

需求

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

要解決的問(wè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)聽(tīng)點(diǎn)擊事件,數(shù)據(jù)控制hide或者show,通過(guò)rgba設(shè)置透明度

  3. 彈出框設(shè)置z-index;

  4. 彈性布局flex 橫向排列 超出后wrap 然后space-around控制間距

::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
登錄后復(fù)制

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

wxml

<import></import><view>
  <view>
    <view>
      <view>城市篩選</view>
      <image></image>
    </view>
    <view>
      <view>職位篩選</view>
      <image></image>
    </view>
    <view>
      <view>排序方式</view>
      <image></image>
    </view>
  </view>
  <block>
    <view>
      <block>
        <view>{{item}}</view>
      </block>
    </view>
  </block>
  <block>
    <scroll-view>
      <block>
        <view>{{item.title}}</view>
        <view>
          <view>
            <view>{{type}}</view>
          </view>
        </view>
      </block>
      <view>
        <button>確認(rèn)</button>
      </view>
    </scroll-view>
  </block>
  <block>
    <view>
      <view>智能排序</view>
      <view>時(shí)間排序</view>
      <view>薪資排序</view>
    </view>
  </block>
  <view>
    <view>
      <template></template>
    </view>
  </view>
  <view>
    <image></image>
    <text>搜索</text>
  </view></view>
登錄后復(fù)制

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;
}
登錄后復(fù)制

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: ['全國(guó)', '杭州', '北京', '深圳', '上海', '廣州', '武漢', '重慶']
 },
 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}`,
  })
 }
})
登錄后復(fù)制

相信看了本文案例你已經(jīng)掌握了方法,更多精彩請(qǐng)關(guān)注有卡有網(wǎng)。

版權(quán)聲明:本文采用知識(shí)共享 署名4.0國(guó)際許可協(xié)議 [BY-NC-SA] 進(jìn)行授權(quán)
文章名稱(chēng):《小程序開(kāi)發(fā)做出彈出菜單功能(附代碼)》
文章鏈接:http://www.ljxxtl.cn/kaquan-baike/xcx/154412.html
本站資源僅供個(gè)人學(xué)習(xí)交流,請(qǐng)于下載后24小時(shí)內(nèi)刪除,不允許用于商業(yè)用途,否則法律問(wèn)題自行承擔(dān)。