使用canvas生成海报
wxml
<view>
<canvas class="canvas" style="width: {
{canvas_width}}px;height:{
{canvas_height}}px;" canvas-id="mycanvas"></canvas>
<view class="pop">
<view class="popbg" bindtap="getclose"></view>
<view class="popup">
<view class="poster">
<image src="{
{canvas}}"></image>
</view>
<view class="save">
<view class="down">
<image mode="widthFix" src="https://sucai.suoluomei.cn/sucai_zs/images/20200110105821-1.png">
</image>
</view>
<view bindtap="getsave">保存图片</view>
</view>
</view>
</view>
</view>
wxss
.popbg {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 10;
}
.popup {
position: fixed;
top: 10%;
left: 50%;
transform: translate(-50%);
z-index: 100;
}
.poster {
width: 700rpx;
height: 900rpx;
background: #fff;
border-radius: 30rpx;
overflow: hidden;