wxml
<view class='shareBtn'>
<image src="{{imgUrl}}weixin.png"></image>
<text>转发微信分享</text>
<button open-type='share'></button>
</view>
wxss
.shareBtn{
display: flex;
flex-direction: column;
align-items: center;
font-size: 14px;
position: relative;
}
.shareBtn image{
width: 45px;
height: 45px;
margin-bottom:10px;
}
.shareBtn button{
position:absolute ;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 99;
}
//js 页面右上角和自定义按钮都走这个方法
onShareAppMessage: res=>{
console.log(res.from)
let meetId=11;
let UId=wx.getStorageSync('UId')
return {
title: '会议名称',
path: `pages/meet/index?meetId=${meetId}&UId=${UId}&type=1` // 分享后打开的页面
}
}
})
网友评论