<view v-show="showView">
<tnWaterMater @pBackImage="backImage" ref="childWaterMater"></tnWaterMater>
<scroll-view
uni.chooseImage({
count: 1, // 最多可以选择的图片张数
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera', 'album'], // camera调用相机拍照,album是打开手机相册
success: (res) => {
let photoData = [plus.io.convertLocalFileSystemURL(res.tempFilePaths[0])]
this.addWaterBase64(photoData)
// this.imgToBase64(res)
}
addWaterBase64(photoData) {
let _this = this;
let model = {};
console.log("0")
model.url = photoData[0];
console.log("1")
model.watermark = [{
type: 'text',
fillStyle: 'rgba(255, 0, 0, 1)',
content: _this.item.hphm,
font: '6px',
x: -500,
y: -500,
shadowColor: 'rgba(0, 0, 0, 1)',
shadowOffsetX: 2,
shadowOffsetY: 2,
rotate: 0,
repeatWidth: 1500,
repeatHeight: 2000,
isRepeat: true
}];
this.$refs.childWaterMater.addWaterMark(model);
console.log("3")
},
backImage(data) {
console.log("A")
console.log(data)
},
1 个回复
DCloud_UNI_yuhe
使用插件问题,你可以去插件市场@一下插件作者