flx:修改水印问题

This commit is contained in:
Rain_ 2025-09-05 09:32:30 +08:00
parent 47014f251e
commit 8908a84e41
5 changed files with 267 additions and 111 deletions

View File

@ -409,7 +409,7 @@
<script>
import tkiTree from "@/components/tki-tree/tki-tree.vue"
import canversCom from "@/pages/videoManage/component/canversCom.vue"
import canversCom from "@/pages/projectEnd/safeSame/hiddenTroubleComponents/canversCom/canversCom.vue"
import dateTimePiccker from '@/components/dateTimePicker/index.vue'
import {
dateformat
@ -595,7 +595,7 @@
success(res) {
that.mobileTopHeight = res.statusBarHeight ? res.statusBarHeight : 0;
uni.setStorageSync('systemInfo', res)
console.log(res)
console.log(111222, res)
}
})
console.log('this.mobileTopHeight', this.mobileTopHeight)
@ -827,22 +827,61 @@
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
imgUrl(val) {
this.openImg = false
this.imgUpload(val)
this.openImg = true
canversList(tempFilePath) {
//
uni.getImageInfo({
src: tempFilePath,
success: (imageRes) => {
console.log(88888, imageRes)
const {
width,
height
} = imageRes;
this.imgList = {
imgUrl: tempFilePath,
imgWidth: width,
imgHeight: height,
shooter: this.userInfo.realName,
}
this.openImg = true
console.log('传过去啦', this.imgList)
},
fail: (err) => {
console.error('获取图片信息失败:', err);
reject(err);
}
});
},
imgUrl(val) {
// this.imgUpload(val)
this.uploadFileFn(val.imgUrl);
this.openImg = false;
},
uploadFileFn(filePath) {
let that = this;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: filePath,
name: 'files',
success: (uploadFileRes) => {
console.log(uploadFileRes);
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.imgFileList.push(data)
}
});
},
//
imgUpload(baseImg) {
console.log('进入----------图片上传请求的接口');
console.log('进入----------图片上传请求的接口', baseImg);
let that = this
let cuDate = new Date().getTime();
let arr = []
that.base64Image = baseImg
// that.base64Image = baseImg
let parmars = {
base64Image: that.base64Image
base64Image: baseImg
}
this.sendRequest({
@ -1481,34 +1520,35 @@
count: 5 - that.imgFileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: tempFilePaths[0],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.imgFileList.push(data)
uni.getImageInfo({
src: tempFilePaths[0],
success: (resInfo) => {
console.log('传过去啦 resInfo', resInfo)
that.imgList = {
imgUrl: tempFilePaths[0],
imgWidth: resInfo.width,
imgHeight: resInfo.height,
// team:'',
// name: ''
}
that.openImg = true
}
})
that.openImg = false
that.canversList(tempFilePaths[0]);
// uni.uploadFile({
// url: that.url_config + 'upload/image', //
// filePath: tempFilePaths[0],
// name: 'files',
// success: (uploadFileRes) => {
// let data = {
// name: JSON.parse(uploadFileRes.data).data[0].filename,
// url: JSON.parse(uploadFileRes.data).data[0].imageUrl
// };
// that.imgFileList.push(data)
// uni.getImageInfo({
// src: tempFilePaths[0],
// success: (resInfo) => {
// console.log(' resInfo', resInfo)
// that.imgList = {
// imgUrl: tempFilePaths[0],
// imgWidth: resInfo.width,
// imgHeight: resInfo.height,
// // team:'',
// // name: ''
// }
// that.openImg = true
// }
// })
// that.openImg = false
}
});
// }
// });
}
})
} else if (type == 2) {
@ -1731,7 +1771,7 @@
this.pointList[i].y
pointArr.push(obj)
}
data.measurePoints = pointArr.join(',')
data.notifyPerson = pointArr.join(',')
console.log('data.measurePoints=============', data.measurePoints);

View File

@ -409,7 +409,7 @@
import tkiTree from "@/components/tki-tree/tki-tree.vue"
import searchTree from "@/components/search-tree/search-tree.vue"
import canversCom from "@/pages/videoManage/component/canversCom.vue"
import canversCom from "@/pages/projectEnd/safeSame/hiddenTroubleComponents/canversCom/canversCom.vue"
import dateTimePiccker from '@/components/dateTimePicker/index.vue'
import {
dateformat
@ -921,11 +921,51 @@
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
canversList(tempFilePath) {
//
uni.getImageInfo({
src: tempFilePath,
success: (imageRes) => {
console.log(88888, imageRes)
const {
width,
height
} = imageRes;
this.imgList = {
imgUrl: tempFilePath,
imgWidth: width,
imgHeight: height,
shooter: this.userInfo.realName,
}
this.openImg = true
console.log('传过去啦', this.imgList)
},
fail: (err) => {
console.error('获取图片信息失败:', err);
reject(err);
}
});
},
imgUrl(val) {
this.openImg = false
this.imgUpload(val)
this.openImg = true
// this.imgUpload(val)
this.uploadFileFn(val.imgUrl);
this.openImg = false;
},
uploadFileFn(filePath) {
let that = this;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: filePath,
name: 'files',
success: (uploadFileRes) => {
console.log(uploadFileRes);
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.imgFileList.push(data)
}
});
},
//
@ -1573,34 +1613,35 @@
count: 5 - that.imgFileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: tempFilePaths[0],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.imgFileList.push(data)
uni.getImageInfo({
src: tempFilePaths[0],
success: (resInfo) => {
console.log('传过去啦 resInfo', resInfo)
that.imgList = {
imgUrl: tempFilePaths[0],
imgWidth: resInfo.width,
imgHeight: resInfo.height,
// team:'',
// name: ''
}
that.openImg = true
}
})
that.openImg = false
that.canversList(tempFilePaths[0]);
// uni.uploadFile({
// url: that.url_config + 'upload/image', //
// filePath: tempFilePaths[0],
// name: 'files',
// success: (uploadFileRes) => {
// let data = {
// name: JSON.parse(uploadFileRes.data).data[0].filename,
// url: JSON.parse(uploadFileRes.data).data[0].imageUrl
// };
// that.imgFileList.push(data)
// uni.getImageInfo({
// src: tempFilePaths[0],
// success: (resInfo) => {
// console.log(' resInfo', resInfo)
// that.imgList = {
// imgUrl: tempFilePaths[0],
// imgWidth: resInfo.width,
// imgHeight: resInfo.height,
// // team:'',
// // name: ''
// }
// that.openImg = true
// }
// })
// that.openImg = false
}
});
// }
// });
}
})
} else if (type == 2) {

View File

@ -21,7 +21,8 @@
locationInfo: '--',
weatherInfo: '--', //
adressDetail: '--', //
url: ''
url: '',
systemInfo: {},
}
},
props: ['imgList'],
@ -30,10 +31,16 @@
},
mounted() {
console.log("啦啦啦啦啦", this.imgList)
let that = this;
var that = this;
uni.getSystemInfo({
success(res) {
that.systemInfo = res;
console.log(111222, res)
}
})
this.date = this.dateFormat(new Date().toISOString())
this.loadWeather();
},
methods: {
//
@ -106,16 +113,34 @@
uni.showLoading({
title: '正在合成中'
})
let that = this
let that = this;
console.log('我开始画啦 ' + JSON.stringify(that.imgList))
console.log(that.systemInfo)
const ctx = uni.createCanvasContext('myCanvas', that); //
ctx.drawImage(that.imgList.imgUrl, 0, 0, that.imgList.imgWidth, that.imgList
.imgHeight); //
ctx.drawImage(require('@/static/CanvarsImg.png'), that.imgList.imgWidth * 0.52, that.imgList
.imgHeight *
0.72, that.imgList.imgWidth * 0.50, that.imgList.imgHeight * 0.22); //
if(that.imgList.imgWidth > that.imgList.imgHeight){
ctx.drawImage(require('@/static/CanvarsImg.png'), that.imgList.imgWidth * 0.52, that.imgList
.imgHeight *
0.72, that.imgList.imgWidth * 0.5, that.imgList.imgHeight * 0.22); //
ctx.setFontSize(25); //
} else if(that.imgList.imgHeight / that.imgList.imgWidth < 2) {
ctx.drawImage(require('@/static/CanvarsImg.png'), that.imgList.imgWidth * 0.52, that.imgList
.imgHeight *
0.72, that.imgList.imgWidth * 0.5, that.imgList.imgHeight * 0.2); //
ctx.setFontSize(25); //
} else if(that.imgList.imgHeight / that.imgList.imgWidth < 2.2) {
ctx.drawImage(require('@/static/CanvarsImg.png'), that.imgList.imgWidth * 0.52, that.imgList
.imgHeight *
0.74, that.imgList.imgWidth * 0.5, that.imgList.imgHeight * 0.16); //
ctx.setFontSize(25); //
} else {
ctx.drawImage(require('@/static/CanvarsImg.png'), that.imgList.imgWidth * 0.52, that.imgList
.imgHeight *
0.74, that.imgList.imgWidth * 0.5, that.imgList.imgHeight * 0.16); //
ctx.setFontSize(17); //
}
ctx.setFillStyle('#FFFFFF'); //
ctx.setFontSize(25); //
ctx.setFillStyle('#000000'); //
ctx.fillText('天 气:' + that.weatherInfo, that.imgList.imgWidth * 0.56, that.imgList
.imgHeight *

View File

@ -89,7 +89,7 @@
</view>
<view class="uni-form-input imgBox_wrap">
<view class="imgBox" v-show="fileList.length>0" v-for="(item,index) in fileList" :key="index">
<image :src="url_config+'image/'+item.url" class="img"></image>
<image @click="previewImage(url_config+'image/'+item.url)" :src="url_config+'image/'+item.url" class="img"></image>
<view @click="deleteImg(item)" class="deleteImg">×</view>
</view>
<view class="addImgBox" @click="selectImg" v-if="fileList.length<5">
@ -115,12 +115,12 @@
<tki-tree ref="changeIdTree" :search="true" :defaultList='violatorId' :multiple="false"
@confirm="(val)=>checkPointBtn(val,1)" idKey='id' :range="personList" rangeKey="workerName"
confirmColor="#4e8af7" :selectParent="true" />
<canversCom @imgUrl="imgUrl" :imgList="imgList"></canversCom>
<canversCom style="opacity: 0;" v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
</view>
</template>
<script>
import canversCom from "@/pages/videoManage/component/canversCom.vue"
import canversCom from "@/pages/projectEnd/safeSame/hiddenTroubleComponents/canversCom/canversCom.vue"
import dateTimePiccker from '@/components/dateTimePicker/index.vue'
export default {
components: {
@ -255,9 +255,51 @@
this.workerName = val.map(item => item.workerName).join('、');
}
},
canversList(tempFilePath) {
//
uni.getImageInfo({
src: tempFilePath,
success: (imageRes) => {
console.log(88888, imageRes)
const {
width,
height
} = imageRes;
this.imgList = {
imgUrl: tempFilePath,
imgWidth: width,
imgHeight: height,
shooter: this.userInfo.realName,
}
this.openImg = true
console.log('传过去啦', this.imgList)
},
fail: (err) => {
console.error('获取图片信息失败:', err);
reject(err);
}
});
},
imgUrl(val) {
this.openImg = false
this.imgUpload(val)
// this.imgUpload(val)
this.uploadFileFn(val.imgUrl);
this.openImg = false;
},
uploadFileFn(filePath) {
let that = this;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: filePath,
name: 'files',
success: (uploadFileRes) => {
console.log(uploadFileRes);
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.fileList.push(data)
}
});
},
//
imgUpload(baseImg) {
@ -338,33 +380,34 @@
count: 5 - that.fileList.length,
success(res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: that.url_config + 'upload/image', //
filePath: tempFilePaths[0],
name: 'files',
success: (uploadFileRes) => {
let data = {
name: JSON.parse(uploadFileRes.data).data[0].filename,
url: JSON.parse(uploadFileRes.data).data[0].imageUrl
};
that.fileList.push(data)
uni.getImageInfo({
src: tempFilePaths[0],
success: (resInfo) => {
console.log('传过去啦 resInfo', resInfo)
that.imgList = {
imgUrl: tempFilePaths[0],
imgWidth: resInfo.width,
imgHeight: resInfo.height,
// team:'',
// name: ''
}
that.openImg = true
}
})
that.openImg = false
}
});
that.canversList(tempFilePaths[0]);
// uni.uploadFile({
// url: that.url_config + 'upload/image', //
// filePath: tempFilePaths[0],
// name: 'files',
// success: (uploadFileRes) => {
// let data = {
// name: JSON.parse(uploadFileRes.data).data[0].filename,
// url: JSON.parse(uploadFileRes.data).data[0].imageUrl
// };
// that.fileList.push(data)
// uni.getImageInfo({
// src: tempFilePaths[0],
// success: (resInfo) => {
// console.log(' resInfo', resInfo)
// that.imgList = {
// imgUrl: tempFilePaths[0],
// imgWidth: resInfo.width,
// imgHeight: resInfo.height,
// // team:'',
// // name: ''
// }
// that.openImg = true
// }
// })
// that.openImg = false
// }
// });
}
})
},
@ -526,6 +569,12 @@
})
},
//
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
}
}
</script>

View File

@ -107,6 +107,7 @@
this.videoInfo = uni.getStorageSync('videoInfo');
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.opSize = Number(uni.getStorageSync('videoOpSize') || 20);
this.streamType = this.videoInfo.defaultStreamType;
if (this.videoInfo.videoType == 2) {
this.url = this.videoInfo.liveRadioUrl
} else {