版權說明:本文檔由用戶提供并上傳,收益歸屬內(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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 機器人公司安全生產(chǎn)制度
- 村安全生產(chǎn)工作報告制度
- 2026年現(xiàn)代物流管理與供應鏈優(yōu)化試題
- 2026年一級建造師執(zhí)業(yè)資格考試綜合復習資料與模擬題
- 2026年中級導游知識文化測試題集
- 2026年營養(yǎng)師食品營養(yǎng)與健康搭配考試題
- 公司解散清算專項法律服務全程顧問方案
- 小學數(shù)學畢業(yè)考試題及答案
- 2026年用戶體驗提升對房地產(chǎn)市場的影響
- 2026年動力學基本概念與應用
- 2026年江蘇經(jīng)貿(mào)職業(yè)技術學院單招職業(yè)傾向性測試模擬測試卷必考題
- 2026年中藥材生產(chǎn)質(zhì)量管理規(guī)范理論考試題含答案
- 北京市東城區(qū)2025-2026年高三上期末地理試卷(含答案)
- 肥胖患者麻醉管理
- 小鯉魚跳龍門電子版
- 2019年急性腦梗死出血轉(zhuǎn)化專家共識解讀
- 《混凝土結構工程施工規(guī)范》
- 土地證延期申請書
- 硫乙醇酸鹽流體培養(yǎng)基適用性檢查記錄
- 進階切分技法advanced funk studies rick latham-藍色加粗字
- GB 19079.12-2013體育場所開放條件與技術要求第12部分:傘翼滑翔場所
評論
0/150
提交評論