ソースを参照

chore: 发布云飞智控v1.15.18版本并调整配置

1.  修改应用名称为云飞智控
2.  开启neutral模式并切换到生产环境API
3.  修复光照文案拼写错误
4.  优化可选链操作避免空指针
5.  调整害虫分析标签显示逻辑和图片标记缩放计算
allen 3 日 前
コミット
29704c386d

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "智控",
+    "name" : "云飞智控",
     "appid" : "__UNI__DBA6730",
     "description" : "",
     "versionName" : "1.15.18",

+ 1 - 1
pages/sy/components/deviceData.vue

@@ -37,7 +37,7 @@
           </view>
           <view class="data-item">
             <text class="data-value">{{ deviceStatic.lightDuration }}</text>
-            <text class="data-label">照</text>
+            <text class="data-label">照</text>
           </view>
         </view>
         <view class="data-column-left">

+ 5 - 4
pages/sy/components/pestEchart.vue

@@ -132,6 +132,7 @@ export default {
     pest_order:{
       handler(val){
         this.tabs = [];
+        this.activeTab = 0;
         for(let key in val){
           this.tabs.push({
             name: key,
@@ -200,14 +201,14 @@ export default {
         data: {
           model:'B',
           d_id: this.d_id,
-          year: this.endDate.split('-')[0],
+          year: this.endDate.split('-')?.[0],
           pest: this.currentPest,
         },
       });
       this.periodData = {
-        firstDate: res[0][0],
-        peakDate: res[1][0],
-        lastDate: res[2][0],
+        firstDate: res?.[0]?.[0],
+        peakDate: res?.[1]?.[0],
+        lastDate: res?.[2]?.[0],
       }
     },
     initChart() {

+ 11 - 11
pages/sy/detail.vue

@@ -40,7 +40,7 @@
       />
       <view class="tabs">
         <view class="tab-container" v-if="isShowTab">
-          <view class="tab-item" :class="activeTab === 'pestAnalysis'?'active':''" @click="handleTabClick('pestAnalysis')" v-if="disableShow">
+          <view class="tab-item" :class="activeTab === 'pestAnalysis'?'active':''" @click="handleTabClick('pestAnalysis')">
             害虫分析
           </view>
           <view class="tab-item" :class="activeTab === 'viewImage'?'active':''" @click="handleTabClick('viewImage')">
@@ -69,7 +69,7 @@
           </view>
         </view>
       </view>
-      <view v-if="activeTab === 'pestAnalysis'" class="tab-content">
+      <view v-show="activeTab === 'pestAnalysis'" class="tab-content">
         <PestDiscern
           :total="total"
           :pest_order="pest_order"
@@ -293,15 +293,15 @@ export default {
       }
       this.initAction();
       this.isShowTab = showStatus;
-      if(this.deviceInfo.disable == 0){
-        this.disableShow = false;
-        if(showStatus){
-          this.activeTab = 'viewImage';
-          this.handleTabClick('viewImage');
-        }
-      }else{
-        this.disableShow = true;
-      }
+      // if(this.deviceInfo.disable == 0){
+      //   this.disableShow = false;
+      //   if(showStatus){
+      //     this.activeTab = 'viewImage';
+      //     this.handleTabClick('viewImage');
+      //   }
+      // }else{
+      //   this.disableShow = true;
+      // }
     },
     prevPage(e){
       if(e == 1){

+ 16 - 9
pages/sy/devicePhoto.vue

@@ -511,14 +511,21 @@ export default {
         // this.pestList = [];
         const markers = [];
         // 根据原图宽度计算缩放比例
+      //   if (this.originalW >= 5000) {
+      //   this.baseScale = 0.25;
+      // } else if (this.originalW >= 4000) {
+      //   this.baseScale = 0.31;
+      // } else {
+      //   this.baseScale = 0.4;
+      // }
         let scaleRatio = 3.07;
-        // if (this.imageWidth >= 5000) {
-        //   scaleRatio = 4;
-        // } else if (this.imageWidth >= 4000) {
-        //   scaleRatio = 1;
-        // } else {
-        //   scaleRatio = 2.5;
-        // }
+        if (this.imageWidth >= 5000) {
+          scaleRatio = 4;
+        } else if (this.imageWidth >= 4000) {
+          scaleRatio = 100/31;
+        } else {
+          scaleRatio = 2.5;
+        }
         // const pestArr = new Map()
         this.currentImg.mark.map((item, index) => {
           // if(pestArr.has(item.text)){
@@ -540,8 +547,8 @@ export default {
           this.is_mark = 1
           const { startX, startY,text } = item;
           // 使用缩放比例计算标记位置和尺寸
-          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 x = item.width > 0 ? (startX * scaleRatio / this.imageWidth) * 100 : ((startX + item.width) * scaleRatio / this.imageWidth) * 100;
+          const y = item.height > 0 ? (startY * scaleRatio / this.imageHeight) * 100 : ((startY + item.height) * scaleRatio / this.imageHeight) * 100;
           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;
 

+ 2 - 2
util/api.js

@@ -9,10 +9,10 @@ export const myRequest = (options) => {
     //      ? 'https://uat.hnyfwlw.com'
     //      : 'https://web.hnyfwlw.com';
     // BASE_URL = 'http://192.168.1.107:8000'
-    BASE_URL = 'http://218.28.198.186:10508';
+    // BASE_URL = 'http://218.28.198.186:10508';
     // BASE_URL = 'http://8.136.98.49:8002';
   }
-  // BASE_URL = config.productAPI;
+  BASE_URL = config.productAPI;
   // BASE_URL = config.developAPI;
   var session_key = '';
   session_key = uni.getStorageSync('session_key');

+ 2 - 2
util/neutral.js

@@ -1,6 +1,6 @@
 export default {
-  // isneutral:true,//云飞智控
-  isneutral: false, //智控
+  isneutral:true,//云飞智控
+  // isneutral: false, //智控
   developAPI:'https://uat.hnyfwlw.com',//测试环境访问地址
   // productAPI:'http://8.136.98.49:8002',//生产环境
   productAPI:'https://web.hnyfwlw.com',//生产环境