更新记录
1.0.1(2025-03-06)
下载此版本
修改成免费
1.0(2025-02-27)
下载此版本
新版发布
支持Android和IOS
斜体水印
斜体自定义水印
底部点
底部图标
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
Android:4.4,iOS:9,HarmonyNext:不确定 |
× |
× |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
鸿蒙元服务 |
× |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
× |
× |
× |
× |
× |
× |
× |
× |
× |
使用方法
引用插件
复制代码import {
addWaterForPath,
addWaterForBase64
} from '../../uni_modules/whb-picturewater'
方法说明
复制代码let param = {
'photos': photos,
'RotateCustomText': 'uts图片加水印插件',
'rotateWater': true,
'outputPath': true,
'compressSize': 1,
'configStyle': {
'textColor': "#000000",
'fontSize': 15
}
};
addWaterForPath(param, (ret) => {
this.pictures.push(ret.path)
});
addWaterForBase64(param, (ret) => {
this.pictures.push(ret.path)
});
参数说明
复制代码export type WaterOptions = {
photos ?: UTSJSONObject[],
rotateWater ?: boolean,
outputPath ?: boolean,
compressSize ?: number,
RotateCustomText ?: string,
waterType ?: string,
configStyle ?: any
}
photos参数说明
参数 |
值类型 |
是否必传 |
说明 |
path |
String |
是 |
图片路径(addWaterForBase64传图片转换的base64) |
contents |
Arr([{'text':"",'icon':''}]) |
否 |
水印信息 |
参数 |
值类型 |
说明 |
text |
String |
水印文案 |
icon |
String |
icon(decorate == 'icon'有效) |
configStyle 说明
参数 |
值类型 |
说明 |
textColor |
String |
字体颜色HEX值(默认"#ffffff") |
fontSize |
int |
字体大小 |
decorate |
String |
point:点 icon:图标 none:纯文字。默认point |
topY |
int |
水印上方内边距(waterType== leftTop waterType== rightTop有效) |
bottomY |
int |
水印下方内边距(waterType== rightBottom waterType== leftBottom有效) |