|
@@ -3,13 +3,18 @@
|
|
|
class="carousel-item"
|
|
class="carousel-item"
|
|
|
:src="watermark || base_img_url2 + (photo.resFilename ? photo.resFilename : photo.filename) + resize"
|
|
:src="watermark || base_img_url2 + (photo.resFilename ? photo.resFilename : photo.filename) + resize"
|
|
|
>
|
|
>
|
|
|
- <img v-if="Math.abs(current - index) < 3" crossorigin="anonymous" @load="drawWatermark($event)" loading="lazy" :src="watermark || (base_img_url2 + (photo.resFilename ? photo.resFilename : photo.filename) + resize)"
|
|
|
|
|
- style="width: 100%;height:25vh;object-fit: cover;" />
|
|
|
|
|
- <canvas ref="canvasRef" style="position: absolute;"></canvas>
|
|
|
|
|
- <div class="tag-text" v-if="photo.growText && showTagBox" >
|
|
|
|
|
- <span v-html="photo.growText"></span>
|
|
|
|
|
- <button class="close-button" @click="hideTagBox">✖</button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <img
|
|
|
|
|
+ v-if="Math.abs(current - index) < 3"
|
|
|
|
|
+ crossorigin="anonymous"
|
|
|
|
|
+ @load="drawWatermark($event)"
|
|
|
|
|
+ loading="lazy"
|
|
|
|
|
+ :src="watermark || (base_img_url2 + (photo.resFilename ? photo.resFilename : photo.filename) + resize)"
|
|
|
|
|
+ style="width: 100%; height: auto; display: block;"
|
|
|
|
|
+ />
|
|
|
|
|
+ <canvas
|
|
|
|
|
+ ref="canvasRef"
|
|
|
|
|
+ style="position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none;"
|
|
|
|
|
+ ></canvas>
|
|
|
<div class="tag-box right" v-if="isShowNum" :class="{'leftTop': 'leftTop'}">{{ index+1 }}/{{ length }}</div>
|
|
<div class="tag-box right" v-if="isShowNum" :class="{'leftTop': 'leftTop'}">{{ index+1 }}/{{ length }}</div>
|
|
|
<!-- <div class="center-mark">mark</div>-->
|
|
<!-- <div class="center-mark">mark</div>-->
|
|
|
</photo-consumer>
|
|
</photo-consumer>
|
|
@@ -75,20 +80,28 @@ let data = {year:props.photo.uploadDate.substring(0,4),
|
|
|
|
|
|
|
|
async function drawWatermark(event) {
|
|
async function drawWatermark(event) {
|
|
|
img = event.target
|
|
img = event.target
|
|
|
- await loadImage(props.photo.baseMap,"base_map_"+props.photo.treeId)
|
|
|
|
|
- data.baseMap = imageCache.get("base_map_"+props.photo.treeId)
|
|
|
|
|
- if(!watermark.value){
|
|
|
|
|
- let param = {farmId:props.farmId, date: props.photo.uploadDate}
|
|
|
|
|
- let weather = null
|
|
|
|
|
- VE_API.weather7d.findSuitabilityByPoint(param).then((res)=>{
|
|
|
|
|
- if(res.code === 0){
|
|
|
|
|
- weather = res.data
|
|
|
|
|
- drawWatermark2(img,weather)
|
|
|
|
|
- }else{
|
|
|
|
|
- drawWatermark2(img,null)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const weather = {
|
|
|
|
|
+ "tempMax": 17,
|
|
|
|
|
+ "tempMin": 10,
|
|
|
|
|
+ "tempSuitability": "适宜",
|
|
|
|
|
+ "humiditySuitability": "适宜",
|
|
|
|
|
+ "vindexSuitability": "寡照"
|
|
|
|
|
+}
|
|
|
|
|
+ drawWatermark2(img,null)
|
|
|
|
|
+ // await loadImage(props.photo.baseMap,"base_map_"+props.photo.treeId)
|
|
|
|
|
+ // data.baseMap = imageCache.get("base_map_"+props.photo.treeId)
|
|
|
|
|
+ // if(!watermark.value){
|
|
|
|
|
+ // let param = {farmId:props.farmId, date: props.photo.uploadDate}
|
|
|
|
|
+ // let weather = null
|
|
|
|
|
+ // VE_API.weather7d.findSuitabilityByPoint(param).then((res)=>{
|
|
|
|
|
+ // if(res.code === 0){
|
|
|
|
|
+ // weather = res.data
|
|
|
|
|
+ // drawWatermark2(img,weather)
|
|
|
|
|
+ // }else{
|
|
|
|
|
+ // drawWatermark2(img,null)
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function drawWatermark2(img,weather) {
|
|
function drawWatermark2(img,weather) {
|
|
@@ -127,13 +140,13 @@ const drawBottom = (imgWidth, imgHeight, weather) => {
|
|
|
ctx.fillStyle = "white"; // 文本颜色为白色
|
|
ctx.fillStyle = "white"; // 文本颜色为白色
|
|
|
// 绘制温度
|
|
// 绘制温度
|
|
|
let startXPercent = 1;
|
|
let startXPercent = 1;
|
|
|
- drawImageInRect(ctx, bottomRect, data.tempImg, startXPercent, 5+10, 5, 30)
|
|
|
|
|
|
|
+ // drawImageInRect(ctx, bottomRect, data.tempImg, startXPercent, 5+10, 5, 30)
|
|
|
drawTextInRect(ctx, bottomRect,`${data.temp}`,startXPercent + 4, 28+10, 20)
|
|
drawTextInRect(ctx, bottomRect,`${data.temp}`,startXPercent + 4, 28+10, 20)
|
|
|
// 绘制湿度
|
|
// 绘制湿度
|
|
|
- drawImageInRect(ctx, bottomRect, data.shiduImg, startXPercent+26, 7 + 10, 4, 30)
|
|
|
|
|
|
|
+ // drawImageInRect(ctx, bottomRect, data.shiduImg, startXPercent+26, 7 + 10, 4, 30)
|
|
|
drawTextInRect(ctx, bottomRect,`${data.shidu}`,startXPercent + 31, 28 + 10, 20)
|
|
drawTextInRect(ctx, bottomRect,`${data.shidu}`,startXPercent + 31, 28 + 10, 20)
|
|
|
// 绘制辐射
|
|
// 绘制辐射
|
|
|
- drawImageInRect(ctx, bottomRect, data.fusheImg, startXPercent+26 + 18, 7 + 10, 5, 30)
|
|
|
|
|
|
|
+ // drawImageInRect(ctx, bottomRect, data.fusheImg, startXPercent+26 + 18, 7 + 10, 5, 30)
|
|
|
drawTextInRect(ctx, bottomRect,`${data.fushe}`,startXPercent+31 + 18, 28 + 10, 20)
|
|
drawTextInRect(ctx, bottomRect,`${data.fushe}`,startXPercent+31 + 18, 28 + 10, 20)
|
|
|
//绘制日期信息
|
|
//绘制日期信息
|
|
|
ctx.fillStyle = "#FFFFFF";
|
|
ctx.fillStyle = "#FFFFFF";
|
|
@@ -142,10 +155,10 @@ const drawBottom = (imgWidth, imgHeight, weather) => {
|
|
|
ctx.fillStyle = "#FFFFFF90";
|
|
ctx.fillStyle = "#FFFFFF90";
|
|
|
drawTextInRect(ctx, bottomRect,`${data.treeCode}_S3_SCS3-3_D0P0G1`,startXPercent +13, 75, 18)
|
|
drawTextInRect(ctx, bottomRect,`${data.treeCode}_S3_SCS3-3_D0P0G1`,startXPercent +13, 75, 18)
|
|
|
|
|
|
|
|
- if(data.baseMap){
|
|
|
|
|
- drawBorderImageInRect(ctx, imgRect, data.baseMap, 2/3*100, 2/3*100,
|
|
|
|
|
- 1/3*100, 1/3*100, 5, 5)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if(data.baseMap){
|
|
|
|
|
+ // drawBorderImageInRect(ctx, imgRect, data.baseMap, 2/3*100, 2/3*100,
|
|
|
|
|
+ // 1/3*100, 1/3*100, 5, 5)
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|