小程序页面之 悬浮标样式

阅读: 评论:0

小程序页面之 悬浮标样式

小程序页面之 悬浮标样式

效果图

wxml 中

// 第一种,使用 navigator  跳转页面<view class="round-click"><navigator url='/pages/addimages/addimages' >发布</navigator >
</view>// 第2种,使用 bindtap 跳转<view class="round-click"><view data-type="{{currentIndex}}" class="fabuimg" bindtap='tofabu'>发布</view>
</view>

wxss

/* 悬浮框样式 */.round-click{height: 120rpx;width: 120rpx;/* background-color: #d92a2a; */background-color: #2ad9c2;border-radius: 100%;position: fixed;bottom: 150rpx;right: 20rpx;display: flex;align-items: center;justify-content: center;z-index: 9;
}
.round-click navigator{font-size: 32rpx;max-width: 80rpx;color: #fff;text-align: center;
}
.round-click view{font-size: 32rpx;max-width: 80rpx;color: #fff;text-align: center;
}

js 实例

//跳转到  发布页tofabu: (event) => {let type = event.pe;var id = event.currentTarget.dataset.id;let url;if (type == "0") {url = "/pages/xiangmu/fabu/fabu?type="+ type;} else if (type == "1") {url = "/pages/xiangmu/fabu/fabu?type=" + type;} else if (type == "2"){url = "/pages/xiangmu/fabu/jsfabu/jsfabu?type=" + type;}console.log(url);wx.navigateTo({url: url,})
},

本文发布于:2024-02-04 13:10:08,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170708000055865.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:样式   页面   程序
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23