flx:优化水印遮挡
This commit is contained in:
parent
c4f91645a7
commit
fbff1bbab1
@ -54,6 +54,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="type flex" v-if="title == '整改'">
|
<view class="type flex" v-if="title == '整改'">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
|
<text class="star">*</text>
|
||||||
违章人员:
|
违章人员:
|
||||||
</view>
|
</view>
|
||||||
<!-- <picker mode="selector" :range="personList" range-key="workerName" @change="handleChangeRegion"
|
<!-- <picker mode="selector" :range="personList" range-key="workerName" @change="handleChangeRegion"
|
||||||
@ -79,7 +80,7 @@
|
|||||||
input-align="left" @confirm="handleChangeCharger"></g-picker> -->
|
input-align="left" @confirm="handleChangeCharger"></g-picker> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="type flex3">
|
<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"
|
<textarea class="textarea" maxlength="-1" placeholder-class="cl" name="inspectContent"
|
||||||
@input='changeTextarea' :value="content" placeholder="请输入"></textarea>
|
@input='changeTextarea' :value="content" placeholder="请输入"></textarea>
|
||||||
</view>
|
</view>
|
||||||
@ -115,7 +116,7 @@
|
|||||||
<tki-tree ref="changeIdTree" :search="true" :defaultList='violatorId' :multiple="false"
|
<tki-tree ref="changeIdTree" :search="true" :defaultList='violatorId' :multiple="false"
|
||||||
@confirm="(val)=>checkPointBtn(val,1)" idKey='id' :range="personList" rangeKey="workerName"
|
@confirm="(val)=>checkPointBtn(val,1)" idKey='id' :range="personList" rangeKey="workerName"
|
||||||
confirmColor="#4e8af7" :selectParent="true" />
|
confirmColor="#4e8af7" :selectParent="true" />
|
||||||
<canversCom style="opacity: 0;" v-if="openImg" @imgUrl="imgUrl" :imgList="imgList"></canversCom>
|
<canversCom @imgUrl="imgUrl" :imgList="imgList"></canversCom>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -392,7 +393,7 @@
|
|||||||
},
|
},
|
||||||
//提交表单
|
//提交表单
|
||||||
formSubmit() {
|
formSubmit() {
|
||||||
if (this.content == '' && this.type != 3) {
|
if (this.content == '') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请输入回复内容",
|
title: "请输入回复内容",
|
||||||
icon: "none"
|
icon: "none"
|
||||||
@ -415,10 +416,10 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (this.violatorId.length == 0 && this.type == 1) {
|
if (this.violatorId.length == 0 && this.type == 1) {
|
||||||
// this.$message.error("请选择违章人员");
|
this.$message.error("请选择违章人员");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
let time = this.getNewDate()
|
let time = this.getNewDate()
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
|
|||||||
@ -58,7 +58,8 @@
|
|||||||
console.log("地址", res)
|
console.log("地址", res)
|
||||||
if (res.data.status == "1") {
|
if (res.data.status == "1") {
|
||||||
//总地址
|
//总地址
|
||||||
var one = res.data.regeocode.formatted_address
|
var one = res.data.regeocode.formatted_address;
|
||||||
|
that.locationInfo = one;
|
||||||
if (one) {
|
if (one) {
|
||||||
that.adressDetail = one.substr(3, 3) + one.substr(9, 4) + one
|
that.adressDetail = one.substr(3, 3) + one.substr(9, 4) + one
|
||||||
.substr(20, 7)
|
.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() {
|
canversImg() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在合成中'
|
title: '正在合成中'
|
||||||
})
|
})
|
||||||
let that = this
|
let that = this
|
||||||
console.log('我开始画啦 :'+JSON.stringify(that.imgList))
|
console.log('我开始画啦 :' + JSON.stringify(that.imgList))
|
||||||
const ctx = uni.createCanvasContext('myCanvas', that); //获取一个画布对象
|
const ctx = uni.createCanvasContext('myCanvas', that); //获取一个画布对象
|
||||||
ctx.drawImage(that.imgList.imgUrl, 0, 0, that.imgList.imgWidth, that.imgList
|
ctx.drawImage(that.imgList.imgUrl, 0, 0, that.imgList.imgWidth, that.imgList
|
||||||
.imgHeight); //画一个图片底图(路径,位置,大小)
|
.imgHeight); //画一个图片底图(路径,位置,大小)
|
||||||
@ -106,23 +113,22 @@
|
|||||||
0.72, that.imgList.imgWidth * 0.50, that.imgList.imgHeight * 0.22); //画一个图片底图(路径,位置,大小)
|
0.72, that.imgList.imgWidth * 0.50, that.imgList.imgHeight * 0.22); //画一个图片底图(路径,位置,大小)
|
||||||
ctx.setFillStyle('#FFFFFF'); // 文字颜色
|
ctx.setFillStyle('#FFFFFF'); // 文字颜色
|
||||||
ctx.setFontSize(25); // 文字字号
|
ctx.setFontSize(25); // 文字字号
|
||||||
ctx.fillText('详情', that.imgList.imgWidth * 0.73, that.imgList.imgHeight * 0.755); // 绘制文字
|
|
||||||
ctx.setFillStyle('#000000'); // 文字颜色
|
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
|
ctx.fillText('天 气:' + that.weatherInfo, that.imgList.imgWidth * 0.56, that.imgList
|
||||||
.imgHeight *
|
.imgHeight *
|
||||||
0.8); // 绘制文字
|
0.8); // 绘制文字
|
||||||
ctx.fillText('拍摄时间:' + that.date, that.imgList.imgWidth * 0.56, that.imgList.imgHeight *
|
ctx.fillText('拍摄时间:' + that.date, that.imgList.imgWidth * 0.56, that.imgList.imgHeight *
|
||||||
0.84); // 绘制文字
|
0.83); // 绘制文字
|
||||||
ctx.fillText('地 点:' + that.adressDetail, that.imgList.imgWidth * 0.56, that.imgList
|
// ctx.fillText('地点:' + that.adressDetail, that.imgList.imgWidth * 0.56, that.imgList
|
||||||
.imgHeight *
|
// .imgHeight *
|
||||||
0.88); // 绘制文字
|
// 0.88); // 绘制文字
|
||||||
console.log('canvs画布返回的地址:---',that.adressDetail);
|
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, () => {
|
ctx.draw(false, () => {
|
||||||
// canvas画布转成图片并返回图片地址
|
// canvas画布转成图片并返回图片地址
|
||||||
uni.canvasToTempFilePath({
|
uni.canvasToTempFilePath({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user