先写两个按钮,再绑定对应事件
wxml:
<view class='container'>
<button class='back-btn' bindtap='goBack'>
<view class='text-back'>
<text>返回</text>
</view>
</button>
<button class='share-btn' open-type='share' >
<view class='text-share'><text>分享</text></view>
</button>
</view>
wxss:
.share-btn{
line-height: 30rpx;
text-align: center;
flex-direction: row;
background-color: rgba(15, 107, 228, 0.966);
position: fixed;
font-size: 20rpx;
height: 100rpx;
width: 100rpx;
right: 20rpx;
bottom: 50rpx;
border-radius: 50%;
}
.back-btn text{
vertical-align: middle;
color: white;
}
.text-share{
margin: 80% auto;
color: white;
}
.share-btn::after{
border: 0;
}
.back-btn::after{
border: 0;
}
js:
goBack(e){
console.log('点击了返回==>',e)
wx.redirecTo({url:'/pages/index/index',})
},