ソースを参照

fix(developing, devicePhoto): 修复页面和标记计算相关问题

1. 注释掉开发页面的返回按钮
2. 修复设备照片页面的标记坐标和尺寸计算逻辑,处理宽高为负值的情况
allen 2 日 前
コミット
aadab63e84
2 ファイル変更6 行追加6 行削除
  1. 4 4
      pages/cbd/devicePhoto.vue
  2. 2 2
      pages/index/developing.vue

+ 4 - 4
pages/cbd/devicePhoto.vue

@@ -509,10 +509,10 @@ export default {
           this.is_mark = 1
           const { startX, startY,text } = item;
           // 使用缩放比例计算标记位置和尺寸
-          const x = (startX * scaleRatio / this.imageWidth) * 105;
-          const y = (startY * scaleRatio / this.imageHeight) * 105;
-          const width = (item.width * scaleRatio / this.imageWidth) * 100;
-          const height = (item.height * scaleRatio / this.imageHeight) * 100;
+          const x = item.width > 0 ? (startX * scaleRatio / this.imageWidth) * 105 : ((startX + item.width) * scaleRatio / this.imageWidth) * 105;
+          const y = item.height > 0 ? (startY * scaleRatio / this.imageHeight) * 105 : ((startY + item.height) * scaleRatio / this.imageHeight) * 105;
+          const width = (item.width > 0 ? item.width : -item.width) * scaleRatio / this.imageWidth * 100;
+          const height = (item.height > 0 ? item.height : -item.height) * scaleRatio / this.imageHeight * 100;
 
           // 从字典中获取虫子名字(尝试字符串和数字两种类型)
           const pestName = text;

+ 2 - 2
pages/index/developing.vue

@@ -1,9 +1,9 @@
 <template>
   <view class="developing-page">
-    <view class="back-btn" @click="goBack">
+    <!-- <view class="back-btn" @click="goBack">
       <text class="back-icon">←</text>
       <text class="back-text">返回</text>
-    </view>
+    </view> -->
     <view class="content-wrapper" v-if="!webUrl">
       <view class="icon-wrapper">
         <text class="icon">🚧</text>