This commit is contained in:
zoujiandong
2025-08-03 17:46:42 +08:00
parent 6e320c3944
commit e5979f605e
24 changed files with 162 additions and 101 deletions
@@ -55,6 +55,11 @@ const useImg=ref('')
const goBack = () => {
uni.navigateBack({
delta: 1,
fail(){
uni.redirectTo({
url:'/pages/index/index'
})
}
});
};
+12 -1
View File
@@ -42,6 +42,11 @@ const props = defineProps({
const goBack = () => {
uni.navigateBack({
delta: 1,
fail(){
uni.redirectTo({
url:'/pages/index/index'
})
}
});
};
</script>
@@ -71,7 +76,13 @@ const goBack = () => {
);
}
.namebox {
padding-top: 102rpx;
/* #ifdef H5 */
padding-top: 51rpx;
/* #endif */
/* #ifdef MP-WEIXIN */
padding-top: 102rpx;
/* #endif */
margin: 0rpx 30rpx 0rpx;
display: flex;
align-items: center;
+5
View File
@@ -25,6 +25,11 @@ const props = defineProps({
const goBack = () => {
uni.navigateBack({
delta: 1,
fail(){
uni.redirectTo({
url:'/pages/index/index'
})
}
});
};
</script>
+1 -1
View File
@@ -141,7 +141,7 @@ onLoad(()=>{
/* #ifdef H5 */
padding-top: 51rpx;
/* #endif */
/* #ifdef MP_WEIXIN */
/* #ifdef MP-WEIXIN */
padding-top: 102rpx;
/* #endif */
+5
View File
@@ -99,6 +99,11 @@ const goMy=()=>{
const goBack = () => {
uni.navigateBack({
delta: 1,
fail(){
uni.redirectTo({
url:'/pages/index/index'
})
}
});
};
onLoad(()=>{
+22 -18
View File
@@ -321,7 +321,7 @@
const fillTextToImgWx = (base64) => {
let maskText = "@肝胆相照临床病例库";
return new Promise((resolve, reject) => {
wx.createSelectorQuery().in(instace.proxy)
wx.createSelectorQuery().in(instace.proxy)
.select("#pwatermarkCanvas")
.fields({
node: true,
@@ -347,15 +347,15 @@
let font = ""; //fontsize"px Arial";
let fontColor = "#fff";
let strokeWidth = 3;
let strokeWidth =10;
uni.getImageInfo({
src: base64,
success: (imageRes) => {
// 设置canvas宽高
let scale =28;
// (imageRes.width / 800) * 30 > 12
// ? (imageRes.width / 800) * 30
// : 12;
//28;
let scale =(imageRes.width / 800) * 30 > 12
? (imageRes.width / 800) * 30
: 12;
font = scale + "px Arial";
console.log(imageRes);
canvas.width = imageRes.width;
@@ -372,8 +372,8 @@
// 将图片绘制到canvas上
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
let posXmargin = 10; //this.data.posXmargin // 自定义离左/右边的距离
let posYmargin = 10; // this.data.posYmargin // 自定义离上/下边的距离
let posXmargin =20; //this.data.posXmargin // 自定义离左/右边的距离
let posYmargin = 20; // this.data.posYmargin // 自定义离上/下边的距离
let randomNumber = 3; //Math.floor(Math.random() * (3 + 1));
console.log("randomNumber:" + randomNumber);
switch (randomNumber) {
@@ -381,8 +381,7 @@
let lt_x = posXmargin;
let lt_y = posYmargin + textHeight;
ctx.font = font;
ctx.fillStyle = fontColor;
ctx.storkStyle = "black";
ctx.storkStyle = "#000";
ctx.strokeWidth = strokeWidth;
ctx.fillStyle = "#fff";
ctx.fillText(maskText, lt_x, lt_y);
@@ -399,6 +398,7 @@
ctx.strokeWidth = strokeWidth;
ctx.fillStyle = "#fff";
ctx.fillText(maskText, lb_x, lb_y);
//ctx.restore()
//ctx.save()
break;
@@ -411,7 +411,7 @@
let rt_y = posYmargin + textHeight * 2;
ctx.font = font;
ctx.fillStyle = fontColor;
ctx.strokeStyle = "black";
ctx.strokeStyle = "#000";
ctx.strokeWidth = strokeWidth;
ctx.fillStyle = "#fff";
ctx.fillText(maskText, rt_x, rt_y);
@@ -420,17 +420,21 @@
break;
case 3: //右下角
let rb_x =
imgWidth - textWidth * 6 - posXmargin <= 0
imgWidth - scale*10 - posXmargin <= 0
? 10
: imgWidth - 276- posXmargin;
: imgWidth - scale*10 - posXmargin;
console.log(rb_x)
let rb_y = imgHeight - posYmargin;
ctx.font = font;
ctx.fillStyle = fontColor;
ctx.strokeStyle = "black";
ctx.strokeWidth = strokeWidth;
ctx.strokeStyle = "#000";
//ctx.strokeWidth = strokeWidth;
ctx.fillStyle = "#fff";
ctx.fillText(maskText, rb_x, rb_y);
console.log('rb_x')
console.log(rb_x)
ctx.strokeText(maskText,rb_x, rb_y);
ctx.fillText(maskText, rb_x, rb_y);
//ctx.restore()
//ctx.save()
break;
@@ -460,6 +464,7 @@
});
});
};
const fillTextToImg = (base64) => {
const img = new Image();
img.src = base64;
@@ -610,8 +615,7 @@
};
Promise.all(promiseFun).then((res) => {
uni.showToast({
duration: 1000,
message: "上传成功",
title: "上传成功",
icon:"none"
});
});