flx:优化水印遮挡

This commit is contained in:
Rain_ 2025-09-03 10:48:09 +08:00
parent c4f91645a7
commit fbff1bbab1
2 changed files with 32 additions and 25 deletions

View File

@ -54,6 +54,7 @@
</view>
<view class="type flex" v-if="title == '整改'">
<view class="name">
<text class="star">*</text>
违章人员:
</view>
<!-- <picker mode="selector" :range="personList" range-key="workerName" @change="handleChangeRegion"
@ -79,7 +80,7 @@
input-align="left" @confirm="handleChangeCharger"></g-picker> -->
</view>
<view class="type flex3">
<view class="name"><text v-if="type != 3" class="star">*</text>补充说明</view>
<view class="name"><text class="star">*</text>补充说明</view>
<textarea class="textarea" maxlength="-1" placeholder-class="cl" name="inspectContent"
@input='changeTextarea' :value="content" placeholder="请输入"></textarea>
</view>
@ -115,7 +116,7 @@
<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 style="opacity: 0;" v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
<canversCom @imgUrl="imgUrl" :imgList="imgList"></canversCom>
</view>
</template>
@ -392,7 +393,7 @@
},
//
formSubmit() {
if (this.content == '' && this.type != 3) {
if (this.content == '') {
uni.showToast({
title: "请输入回复内容",
icon: "none"
@ -415,10 +416,10 @@
return
}
// if (this.violatorId.length == 0 && this.type == 1) {
// this.$message.error("");
// return;
// }
if (this.violatorId.length == 0 && this.type == 1) {
this.$message.error("请选择违章人员");
return;
}
let time = this.getNewDate()
let data = {

View File

@ -39,8 +39,8 @@
uni.getLocation({
type: 'gcj02',
geocode: true,
isHighAccuracy: "true",
accuracy: "best", // 20m
isHighAccuracy: "true",
accuracy: "best", // 20m
success: function(res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
@ -58,7 +58,8 @@
console.log("地址", res)
if (res.data.status == "1") {
//
var one = res.data.regeocode.formatted_address
var one = res.data.regeocode.formatted_address;
that.locationInfo = one;
if (one) {
that.adressDetail = one.substr(3, 3) + one.substr(9, 4) + one
.substr(20, 7)
@ -92,12 +93,18 @@
}
});
},
drawMultilineText(ctx, text, x, y, lineHeight) {
const lines = text.split('\n');
lines.forEach((line, index) => {
ctx.fillText(line, x, y + index * lineHeight);
});
},
canversImg() {
uni.showLoading({
title: '正在合成中'
})
let that = this
console.log('我开始画啦 '+JSON.stringify(that.imgList))
console.log('我开始画啦 ' + JSON.stringify(that.imgList))
const ctx = uni.createCanvasContext('myCanvas', that); //
ctx.drawImage(that.imgList.imgUrl, 0, 0, that.imgList.imgWidth, that.imgList
.imgHeight); //
@ -106,23 +113,22 @@
0.72, that.imgList.imgWidth * 0.50, that.imgList.imgHeight * 0.22); //
ctx.setFillStyle('#FFFFFF'); //
ctx.setFontSize(25); //
ctx.fillText('详情', that.imgList.imgWidth * 0.73, that.imgList.imgHeight * 0.755); //
ctx.setFillStyle('#000000'); //
// ctx.fillText('' + (that.imgList.name ? that.imgList.name : ''), that.imgList.imgWidth *
// 0.56, that
// .imgList.imgHeight * 0.8); //
// ctx.fillText(' ' + (that.imgList.team ? that.imgList.team : ''), that.imgList.imgWidth *
// 0.56, that
// .imgList.imgHeight * 0.825); //
ctx.fillText('天 气:' + that.weatherInfo, that.imgList.imgWidth * 0.56, that.imgList
.imgHeight *
0.8); //
ctx.fillText('拍摄时间:' + that.date, that.imgList.imgWidth * 0.56, that.imgList.imgHeight *
0.84); //
ctx.fillText('地 点:' + that.adressDetail, that.imgList.imgWidth * 0.56, that.imgList
.imgHeight *
0.88); //
console.log('canvs画布返回的地址---',that.adressDetail);
0.83); //
// ctx.fillText('' + that.adressDetail, that.imgList.imgWidth * 0.56, that.imgList
// .imgHeight *
// 0.88); //
const insertIntervalString = (originStr, disNum = 10, insertStr = "\n") => originStr.replace(new RegExp("(.{" + disNum + "})", "g"), "$1" + insertStr);
that.drawMultilineText(ctx, insertIntervalString('地点:' + that.locationInfo, 18), that.imgList.imgWidth * 0.56, that.imgList.imgHeight *
0.86, 40);
// ctx.fillText('' + that.imgList.shooter, that.imgList.imgWidth * 0.56, that.imgList
// .imgHeight *
// 0.92); //
console.log('canvs画布返回的地址---', that.locationInfo);
ctx.draw(false, () => {
// canvas
uni.canvasToTempFilePath({
@ -142,7 +148,7 @@
title: '绘制成功'
});
uni.hideLoading()
},
fail: err => {
uni.showToast({
@ -153,7 +159,7 @@
uni.hideLoading();
uni.hideToast();
uni.hideLoading()
}
}, );
});