自定义分享朋友圈wxml代码
<van-action-sheet bind:close="onClose" bind:cancel="onClose" cancel-text="取消" title="分享页面"
show="{{ showShare }}">
<view class="shareBox">
<button open-type="share" class="share_box">
<!-- <van-icon name="friends" size="30" color="#07c160" /> -->
<text class="iconfont icon-weixin"></text>
<view class="share-title">
微信好友
</view>
</button>
<button bind:tap="shareToPoster" class="share_box">
<!-- <van-icon name="photo" size="30" color="#c79f5d" /> -->
<text class="iconfont icon-pengyouquan"></text>
<view class="share-title">
朋友圈
</view>
</button>
</view>
</van-action-sheet>
<van-dialog closeOnClickOverlay use-slot bind:confirm="saveImage" theme="round-button" confirmButtonText="保存图片到相册"
show="{{ isShowShareDialog }}">
<image src="/static/images/share_img.jpg" class="share-image"></image>
<canvasdrawer painting="{{painting}}" class="canvasdrawer" bind:getImage="eventGetImage"/>
</van-dialog>
分享海报
shareToPoster(){
// this.loadShare()
var that=this
that.setData({
isShowShareDialog:true
})
},
saveImage(e){
console.log("保存图片")
wx.saveImageToPhotosAlbum({
filePath: "/static/images/share_img.jpg",
success(res) {
wx.showToast({
title: '保存图片成功',
icon: 'success',
duration: 2000
})
}
})
},