细节调整
This commit is contained in:
@@ -140,8 +140,8 @@ button::after {
|
||||
}
|
||||
|
||||
.share-canvas {
|
||||
width: 302px;
|
||||
height: 534px;
|
||||
width: 300px;
|
||||
height: 530px;
|
||||
position: absolute;
|
||||
top: -1000px;
|
||||
left: 0;
|
||||
|
||||
@@ -43,7 +43,7 @@ const saveImage = () => {
|
||||
<view class="content">
|
||||
<view :style="{ overflow: 'hidden', borderRadius: '10px' }">
|
||||
<canvas
|
||||
:style="{ width: '302px', height: '534px' }"
|
||||
:style="{ width: '300px', height: '530px' }"
|
||||
canvas-id="shareCanvas"
|
||||
></canvas>
|
||||
</view>
|
||||
|
||||
@@ -135,7 +135,7 @@ export function generateCanvasImage(canvasId, type, user, data) {
|
||||
var ctx = uni.createCanvasContext(canvasId);
|
||||
const width = 303;
|
||||
const height = 535;
|
||||
ctx.drawImage("../static/share-bg.png", 0, 0, 302, 534);
|
||||
ctx.drawImage("../static/share-bg.png", 0, 0, 300, 530);
|
||||
drawRoundImage(ctx, user.avatar, 17, 20, 37, 37, 20);
|
||||
ctx.drawImage("../static/avatar-frame.png", 12, 15, 47, 47);
|
||||
renderText(ctx, user.nickName, 14, "#fff", 80, 32, "center");
|
||||
@@ -153,14 +153,14 @@ export function generateCanvasImage(canvasId, type, user, data) {
|
||||
} else if (type == 3) {
|
||||
titleImage = "../static/practise-two-title.png";
|
||||
}
|
||||
ctx.drawImage(titleImage, (width - 160) / 2, 160, 160, 40);
|
||||
ctx.drawImage(titleImage, (width - 160) / 2 - 5, 160, 160, 40);
|
||||
const subTitleWidth = ctx.measureText(subTitle).width;
|
||||
renderText(
|
||||
ctx,
|
||||
subTitle,
|
||||
18,
|
||||
"#fff",
|
||||
width / 2 - subTitleWidth - (type > 1 ? 15 : 8),
|
||||
width / 2 - subTitleWidth - (type > 1 ? 15 : 13),
|
||||
220
|
||||
);
|
||||
renderText(ctx, "共", 16, "#fff", 124, 300);
|
||||
|
||||
Reference in New Issue
Block a user