效果图
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 条评论) |