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