微信小程序?qū)崿F(xiàn)吸頂盒效果_第1頁
微信小程序?qū)崿F(xiàn)吸頂盒效果_第2頁
微信小程序?qū)崿F(xiàn)吸頂盒效果_第3頁
微信小程序?qū)崿F(xiàn)吸頂盒效果_第4頁
微信小程序?qū)崿F(xiàn)吸頂盒效果_第5頁
已閱讀5頁,還剩1頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

第微信小程序?qū)崿F(xiàn)吸頂盒效果本文實例為大家分享了微信小程序?qū)崿F(xiàn)吸頂盒效果的具體代碼,供大家參考,具體內(nèi)容如下

html部分

!--列表--

view

!--吸頂盒--

viewclass="partner-list-header{{isFixedTop'tab-fixed':''}}"id='operation-bar'

view合伙人/view

view

text操作/text

imagesrc="../../../../static/imges/right_arrow.png"mode="widthFix"/image

/view

/view

!--用于吸頂后占位用的--

viewwx:if="{{isFixedTop}}"/view

!--列表--

viewwx:for='{{memLs}}'wx:key='index'

view{{item.agent_name}}/view

view

view

scroll-viewscroll-x="true"

textbindtap="toMember"data-g="{{item.agent_id}}"data-storename='{{item.agent_name}}'成員管理/text

textbindtap="toMachineList"data-g="{{item.agent_id}}"data-storename='{{item.agent_name}}'設備管理/text

textbindtap="toPoint"data-g="{{item.agent_id}}"data-storename='{{item.agent_name}}'門店管理/text

/scroll-view

/view

view

scroll-viewscroll-x="true"

textbindtap="toReplnishApply"data-g="{{item.agent_id}}"data-storename='{{item.agent_name}}'補貨申請/text

textbindtap="toReplnishApplyList"data-g="{{item.agent_id}}"data-storename='{{item.agent_name}}'補貨申請記錄/text

/scroll-view

/view

/view

/view

/view

css部分

.partner-content-container{

width:100%;

background:#fff;

.partner-list-header{

display:flex;

justify-content:space-around;

height:80rpx;

line-height:80rpx;

border-bottom:3rpxdashed#b2b3b2;

margin:020rpx;

font-weight:bold;

background:#fff;

width:100%;

.tab-fixed{

position:fixed;

top:0;

left:0;

z-index:1;

.partner-list-title{

width:40%;

text-align:center;

.icon-container{

display:flex;

justify-content:center;

align-items:center;

.right-arrow{

width:50rpx;

margin-right:20rpx;

.partner-list-content{

display:flex;

justify-content:space-around;

align-items:center;

background:#fff;

line-height:100rpx;

margin:020rpx;

.co-wrapper{

width:55%;

box-sizing:border-box;

.item-desc{

width:45%;

overflow:hidden;

white-space:nowrap;

text-overflow:ellipsis;

text-align:center;

.co-btn{

background:rgb(1437199);

font-size:24rpx;

margin-top:10rpx;

border-radius:10rpx;

color:#fff;

padding:18rpx22rpx;

margin:010rpx00;

}

js部分

data:{

navbarInitTop:0,//導航欄初始化距頂部的距離

isFixedTop:false,//是否固定頂部

/*監(jiān)聽頁面滑動事件*/

onPageScroll:function(e){

letthat=this;

letscrollTop=parseInt(e.scrollTop);//滾動條距離頂部高度

letisSatisfy=scrollTop=that.data.navbarInitToptrue:false;

//為了防止不停的setData,這兒做了一個等式判斷。只有處于吸頂?shù)呐R界值才會不相等

if(that.data.isFixedTop===isSatisfy){

returnfalse;

}

that.setData({

isFixedTop:isSatisfy

})

},

onShow:function(){

letthat=this;

wx.createSelectorQuery().select('#operation-bar').boundingClientRect(function(rect){

if(rectrect.top0){

varnavbarInitTop=parseInt(rect.top);

that.setData({

navbarInitTop:navbarInitTop

});

console.log(that.data.navbarInitTop)

}

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論