flx:优化水印遮挡
This commit is contained in:
parent
c4f91645a7
commit
fbff1bbab1
@ -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 = {
|
||||
|
||||
@ -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()
|
||||
|
||||
|
||||
}
|
||||
}, );
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user