Procházet zdrojové kódy

feat(shuHai): 完成项目版本升级与功能迭代

1.  切换项目为云飞智控模式,更新应用名称与版本号
2.  添加用户隐私协议页面与登录校验
3.  重构水害模块接口与页面逻辑,适配新的业务接口
4.  优化图片视频预览组件,支持多类型媒体展示
5.  修复页面跳转路径错误问题
allen před 1 týdnem
rodič
revize
9557baae35

+ 3 - 3
manifest.json

@@ -1,9 +1,9 @@
 {
-    "name" : "智控",
+    "name" : "云飞智控",
     "appid" : "__UNI__DBA6730",
     "description" : "",
-    "versionName" : "1.15.26",
-    "versionCode" : 11526,
+    "versionName" : "1.15.27",
+    "versionCode" : 11527,
     "transformPx" : false,
     "sassImplementationName" : "node-sass",
     /* 5+App特有相关 */

+ 8 - 0
pages.json

@@ -12,6 +12,14 @@
       }
     },
     {
+      "path": "pages/login/agreement",
+      "style": {
+        "navigationBarTitleText": "用户隐私协议",
+        "enablePullDownRefresh": false,
+        "navigationStyle": "custom"
+      }
+    },
+    {
       "path": "pages/index/index",
       "style": {
         "navigationBarTitleText": "首页",

+ 245 - 0
pages/login/agreement.vue

@@ -0,0 +1,245 @@
+<template>
+  <view class="agreement-page">
+    <view class="back-btn" @click="goBack">
+      <u-icon name="arrow-left" size="36" color="#333"></u-icon>
+    </view>
+    <view class="agreement-title">用户服务与隐私协议</view>
+    <view class="agreement-date">更新日期:2026-09-01</view>
+    <view class="agreement-intro">
+      欢迎使用本服务!您在使用前需同意本协议。我们致力于为您提供优质服务,同时保障您的合法权益。您应妥善保管账号信息,并对账号下的一切行为负责。
+    </view>
+
+    <view class="agreement-summary">
+      <view class="summary-content">
+        我们深知个人信息对您的重要性,并承诺依法保护您的隐私。我们仅收集实现服务所必要的信息,包括但不限于:
+      </view>
+      <view class="summary-item" v-for="(item, i) in summary" :key="i">
+        <text class="item-name">{{ item.name }}</text>
+        <text class="item-desc">—— {{ item.desc }}</text>
+      </view>
+      <view class="summary-footer">
+        我们不会主动向第三方共享您的个人信息,除非获得您的明确同意或法律法规要求。
+      </view>
+    </view>
+
+    <view
+      class="agreement-section"
+      v-for="(item, index) in sections"
+      :key="index"
+    >
+      <view class="section-title">{{ item.title }}</view>
+      <view class="section-content">
+        <template v-if="Array.isArray(item.content)">
+          <view
+            class="content-line"
+            v-for="(line, i) in item.content"
+            :key="i"
+            >{{ line }}</view
+          >
+        </template>
+        <text v-else>{{ item.content }}</text>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      summary: [
+        {
+          name: '微信昵称、头像',
+          desc: '用于展示您的身份',
+        },
+        {
+          name: '手机号',
+          desc: '用于售后联系与账号安全',
+        },
+        {
+          name: '位置信息',
+          desc: '用于推荐附近服务(需您授权)',
+        },
+        {
+          name: '设备信息',
+          desc: '用于保障服务稳定运行',
+        },
+      ],
+      sections: [
+        {
+          title: '一、协议的确认与账号安全',
+          content:
+            '本协议是您与本应用运营者之间关于使用本应用服务的约定。您在开始使用本应用服务前,请务必仔细阅读并充分理解本协议全部内容,点击"同意"或实际使用本应用服务即表示您已阅读并同意本协议。您应妥善保管账号信息,不得将账号出借、转让或授权他人使用,并对账号下的一切行为负责。如发现账号被他人盗用或存在其他安全问题,请立即与我们联系。',
+        },
+        {
+          title: '二、我们收集的信息',
+          content: [
+            '我们遵循"最小必要"原则,仅收集实现服务所必需的信息:',
+            '1. 微信昵称、头像:在您授权后获取,用于在应用内展示您的身份;',
+            '2. 手机号:在您绑定或授权后获取,用于售后服务联系与账号安全验证;',
+            '3. 位置信息:在您授权后获取,用于为您推荐附近的服务,拒绝授权仅会影响该功能,不影响其他功能的正常使用;',
+            '4. 设备信息:如设备型号、操作系统版本、网络状态等,用于保障服务的稳定运行和问题排查。',
+            '除上述信息外,我们不会收集与服务无关的个人信息。',
+          ],
+        },
+        {
+          title: '三、我们如何使用信息',
+          content: [
+            '我们收集的信息将用于:',
+            '1. 验证您的身份,保障账号与数据安全;',
+            '2. 为您提供设备管理、监测数据展示、预警通知等核心服务;',
+            '3. 与您取得联系,处理售后、报修及咨询等事项;',
+            '4. 分析与改进服务性能,优化您的使用体验。',
+            '我们不会将您的个人信息用于上述目的之外的任何用途。',
+          ],
+        },
+        {
+          title: '四、信息的共享与披露',
+          content: [
+            '我们不会主动向第三方共享、转让或公开披露您的个人信息,但以下情形除外:',
+            '1. 事先获得您的明确同意;',
+            '2. 根据法律法规、司法机关或行政机关的强制性要求;',
+            '3. 为提供核心服务所必需,且仅共享实现服务所必需的最少信息(例如委托技术合作方进行数据存储或消息推送),我们将要求其遵守保密义务并采取足够的安全措施。',
+          ],
+        },
+        {
+          title: '五、信息的存储与保护',
+          content:
+            '您的个人信息存储于中华人民共和国境内。我们采用加密传输、访问控制、安全审计等技术手段和管理措施,防止您的信息被未经授权地访问、篡改、泄露或丢失。我们仅在实现本协议所述目的所必需的期限内保留您的个人信息,超出期限后将对您的个人信息进行删除或匿名化处理。',
+        },
+        {
+          title: '六、您的权利',
+          content: [
+            '按照相关法律法规,您有权:',
+            '1. 随时查阅您的个人信息;',
+            '2. 更正不准确或不完整的信息;',
+            '3. 删除您的部分或全部个人信息;',
+            '4. 撤回此前作出的授权同意,撤回授权不影响此前基于授权已进行的信息处理的合法性;',
+            '5. 注销账号。',
+            '您可以通过应用内的相关功能或联系我们行使上述权利,我们将在核实您的身份后及时处理。',
+          ],
+        },
+        {
+          title: '七、未成年人保护',
+          content:
+            '我们主要面向成年人提供服务。若您未满18周岁,请在监护人的陪同下阅读本协议,并在征得监护人同意后使用本应用服务。',
+        },
+        {
+          title: '八、协议的更新',
+          content:
+            '我们可能根据法律法规变化或服务调整适时修订本协议,修订后的协议将在本页面发布。当协议发生重大变更时,我们会以显著方式提示您,请您定期查阅本协议以了解最新内容。若您在协议更新后继续使用本应用服务,即视为您已接受修订后的协议。',
+        },
+      ],
+    };
+  },
+  methods: {
+    goBack() {
+      uni.navigateBack({
+        delta: 1,
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.agreement-page {
+  min-height: 100vh;
+  background-color: #ffffff;
+  padding: 40rpx 40rpx 60rpx;
+  box-sizing: border-box;
+}
+
+.back-btn {
+  width: 88rpx;
+  height: 48rpx;
+  margin-top: 64rpx;
+  margin-bottom: 20rpx;
+  display: flex;
+  align-items: center;
+}
+
+.agreement-title {
+  font-size: 36rpx;
+  font-weight: bold;
+  color: #333;
+  text-align: center;
+  margin-bottom: 16rpx;
+}
+
+.agreement-date {
+  font-size: 24rpx;
+  color: #999;
+  text-align: center;
+  margin-bottom: 40rpx;
+}
+
+.agreement-intro {
+  font-size: 28rpx;
+  color: #666;
+  line-height: 1.8;
+  text-align: justify;
+  margin-bottom: 30rpx;
+}
+
+.agreement-summary {
+  padding: 24rpx 24rpx;
+  margin-bottom: 40rpx;
+
+  .summary-title {
+    font-size: 30rpx;
+    font-weight: bold;
+    color: #333;
+    margin-bottom: 16rpx;
+  }
+
+  .summary-content {
+    font-size: 26rpx;
+    color: #666;
+    line-height: 1.8;
+    text-align: justify;
+    margin-bottom: 16rpx;
+  }
+
+  .summary-item {
+    font-size: 26rpx;
+    color: #666;
+    line-height: 1.9;
+
+    .item-name {
+      color: #333;
+      font-weight: bold;
+    }
+  }
+
+  .summary-footer {
+    font-size: 26rpx;
+    color: #666;
+    line-height: 1.8;
+    text-align: justify;
+    margin-top: 16rpx;
+  }
+}
+
+.agreement-section {
+  margin-bottom: 30rpx;
+
+  .section-title {
+    font-size: 30rpx;
+    font-weight: bold;
+    color: #333;
+    margin-bottom: 12rpx;
+  }
+
+  .section-content {
+    font-size: 28rpx;
+    color: #666;
+    line-height: 1.8;
+    text-align: justify;
+
+    .content-line {
+      margin-bottom: 6rpx;
+    }
+  }
+}
+</style>

+ 50 - 0
pages/login/login.vue

@@ -61,6 +61,22 @@
           <view class="uni-btn-v">
             <button form-type="submit" @click="denglu">登 录</button>
           </view>
+          <!--用户隐私协议-->
+          <view class="agreement">
+            <u-checkbox-group>
+              <u-checkbox
+                v-model="agree"
+                shape="circle"
+                size="28"
+                active-color="#2979ff"
+                :label-disabled="false"
+                >我已阅读并同意
+              </u-checkbox>
+            </u-checkbox-group>
+            <text class="agree-link" @click="goAgreement"
+              >《用户隐私协议》</text
+            >
+          </view>
         </view>
       </form>
     </view>
@@ -140,6 +156,7 @@ export default {
       percentNum: 0, //在线下载进度
       passvalue: false,
       turnover: true,
+      agree: false,
     };
   },
   onLoad() {},
@@ -300,6 +317,13 @@ export default {
       });
     },
     async formSubmit() {
+      if (!this.agree) {
+        uni.showToast({
+          title: '请先阅读并同意用户隐私协议',
+          icon: 'none',
+        });
+        return;
+      }
       const res = await this.$myRequest({
         url: '/api/api_gateway?method=user.login.login_user',
         data: {
@@ -394,6 +418,11 @@ export default {
         });
       }
     },
+    goAgreement() {
+      uni.navigateTo({
+        url: './agreement',
+      });
+    },
   },
 };
 </script>
@@ -612,4 +641,25 @@ export default {
 .upgradeBox {
   padding: 15rpx;
 }
+.agreement {
+  width: 80%;
+  margin: 40rpx auto 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+
+  /deep/.u-checkbox__label {
+    font-size: 24rpx;
+    color: #fff;
+    margin-right: 0;
+  }
+  /deep/.u-checkbox__icon-wrap {
+    border-color: rgba(255, 255, 255, 0.8);
+  }
+  .agree-link {
+    font-size: 24rpx;
+    color: #fff;
+    text-decoration: underline;
+  }
+}
 </style>

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

@@ -542,7 +542,7 @@ export default {
     },
     openSettings(){
       uni.navigateTo({
-        url: '/pages/cbd/deviceControl?deviceId=' + this.deviceInfo.id + '&d_id=' + this.deviceInfo.d_id,
+        url: '/pages/shuHai/deviceControl?deviceId=' + this.deviceInfo.id + '&d_id=' + this.deviceInfo.d_id,
       });
     },
     initChart() {

+ 36 - 17
pages/shuHai/components/photoImage.vue

@@ -26,16 +26,25 @@
           <view class="photo-image__item-img-container">
             <image
               class="photo-image__item-img"
-              :src="item.addr"
-            />
-            <image
-              class="photo-image__item-icon"
-              src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/img/ai.png"
-            />
-            <image
-              class="photo-image__item-icon-video"
-              src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/img/video.png"
+              :src="getSrc(item)"
             />
+            <view class="photo-image__item-icon-container">
+              <image
+                v-if="item.has_mark == 1 || item.has_identify == 1"
+                class="photo-image__item-icon"
+                src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/img/ai.png"
+              />
+              <image
+                v-if="item.has_photo == 1"
+                class="photo-image__item-icon-video"
+                src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/img/video.png"
+              />
+              <image
+                v-if="item.has_video == 1"
+                class="photo-image__item-icon-img"
+                src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/img/img.png"
+              />
+            </view>
           </view>
           <view class="photo-image__item-title">
             相机1
@@ -85,6 +94,9 @@ export default {
     };
   },
   methods: {
+    getSrc(item){
+      return item.photo_list[0]?.addr;
+    },
     changeTab(index) {
       if(this.activeIndexList.includes(index)){
         this.activePest = this.activePest.filter(item => item !== this.pestList[index])
@@ -111,8 +123,9 @@ export default {
       return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
     },
     handleClick(item) {
+      console.log(item,'itemimtiemtiemtiemi')
       uni.navigateTo({
-        url: '/pages/cbd/devicePhoto?device_id=' + item?.device_id + '&addtime=' + item?.addtime + '&img_id=' + item?.ids + '&id=' + this.deviceInfo.id + '&currentYear=' + this.currentYear
+        url: '/pages/shuHai/devicePhoto?device_id=' + item?.device_id + '&addtime=' + item?.addtime + '&id=' + this.deviceInfo.id + '&currentYear=' + this.currentYear + '&event_id=' + item?.event_id
       })
     }
   },
@@ -231,7 +244,15 @@ export default {
       overflow: hidden;
       background-color: #f5f5f5;
     }
-
+    .photo-image__item-icon-container{
+      position: absolute;
+      display: flex;
+      gap: 4rpx;
+      top: 8rpx;
+      left: 8rpx;
+      width: 100%;
+      height: 100%;
+    }
     &-img {
       position: absolute;
       top: 0;
@@ -240,16 +261,14 @@ export default {
       height: 100%;
     }
     &-icon {
-      position: absolute;
-      top: 8rpx;
-      left: 8rpx;
       width: 40rpx;
       height: 40rpx;
     }
     &-icon-video {
-      position: absolute;
-      top: 8rpx;
-      left: 52rpx;
+      width: 40rpx;
+      height: 40rpx;
+    }
+    &-icon-img {
       width: 40rpx;
       height: 40rpx;
     }

+ 4 - 5
pages/shuHai/detail.vue

@@ -184,6 +184,7 @@ export default {
       time: '',
       activeTab: 'pestAnalysis',
       deviceType: '',
+      camera_id: '',
       location: '',
       total: 0,
       imgTotal: 0,
@@ -277,7 +278,7 @@ export default {
     },
     handleSettingClick(){
       uni.navigateTo({
-        url: '/pages/cbd/deviceControl?deviceId=' + this.deviceInfo.id + '&d_id=' + this.deviceInfo.d_id,
+        url: '/pages/shuHai/deviceControl?deviceId=' + this.deviceInfo.id + '&d_id=' + this.deviceInfo.d_id,
       });
     },
     closeOperationHandler(){
@@ -414,15 +415,13 @@ export default {
         title: '加载中',
       })
       const res = await this.$myRequest({
-        url: '/api/api_gateway?method=forecast.new_cbd.photo_list',
+        url: '/api/api_gateway?method=forecast.shuhai.shuhai_two_camera_event_list',
         method: 'POST',
         data: {
           page:this.page,
+          camera_id: this.camera_id,
           page_size:this.page_size,
           device_id: this.deviceInfo.id,
-          is_pest: this.is_pest,
-          identify_model: 'B',
-          pest_names: this.pest_names,
           time_begin: this.formatDate(new Date(this.startDate)) + ' 00:00:00',// 格式化开始时间YYYY-MM-DD HH:MM:SS
           time_end: this.formatDate(new Date(this.endDate)) + ' 23:59:59',// 格式化结束时间YYYY-MM-DD HH:MM:SS
         },

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 712 - 215
pages/shuHai/deviceControl.vue


+ 194 - 60
pages/shuHai/devicePhoto.vue

@@ -30,6 +30,19 @@
           <u-icon name="calendar" class="calendar"></u-icon>
         </view>
     </view>
+    <view class="fileList-preview">
+      <view  class="fileList-scroll">
+        <view 
+          class="file-item" 
+          v-for="(item, index) in fileList" 
+          :key="index"
+          :class="{ fileActive: fileIndex == index }"
+          @click="selectFile(index)"
+        >
+          {{ item.event_id }}
+        </view>
+      </view>
+    </view>
     <!-- 主图片区域 -->
     <view class="main-photo" v-if="currentImg.addr">
       <movable-area class="movable-area" :style="{ height: containerHeight }">
@@ -43,11 +56,26 @@
           <view class="image-container">
             <!-- 原图 -->
             <image
+              v-if="is_jpg == 1"
               :src="currentImg.addr"
               class="main-photo-image"
               mode="widthFix"
               @load="onImageLoad"
             />
+            <!-- 视频 -->
+            <video
+              v-if="is_jpg == 0"
+              :src="currentImg.addr"
+              class="main-photo-image"
+              mode="widthFix"
+              @load="onImageLoad"
+              controls
+            />
+
+            <view class="tags-swiper">
+              <image :src="is_jpg == 1 ? imageActiveIcon : imageIcon" class="tag-icon" @click="changeVideo(1)"/>
+              <image :src="is_jpg == 0 ? videoActiveIcon : videoIcon" class="tag-icon" @click="changeVideo(2)"/>
+            </view>
             <!-- 虫子标记层 -->
             <view class="bug-markers" v-if="bugMarkers.length > 0">
               <view
@@ -80,13 +108,22 @@
           class="thumbnail-item" 
           v-for="(item, index) in thumbnails" 
           :key="index"
-          :class="{ active: img_id == item.ids }"
+          :class="{ active: img_id == item.id }"
           @click="selectThumbnail(item)"
         >
           <image 
+            v-if="is_jpg == 1"
             :src="item.addr" 
             class="thumbnail-image"
           />
+          <!-- 视频 -->
+          <video
+            v-if="is_jpg == 0"
+            :src="item.addr"
+            class="thumbnail-image"
+            mode="widthFix"
+            controls
+          />
         </view>
       </view>
     </view>
@@ -97,16 +134,16 @@
       <!-- 一类害虫 -->
       <view>
         <view class="pest-category" v-for="(pest,index) in pestList" :key="index">
-          <view class="category-header">
+          <!-- <view class="category-header">
             <text class="category-title">{{ pest[0] }}</text>
             <text class="category-count">数量</text>
-          </view>
-          <view class="pest-item" v-for="(p, i) in pest[1]" :key="i">
+          </view> -->
+          <view class="pest-item">
             <view class="pest-info">
-              <view class="pest-color" :style="{ backgroundColor: getPestColor(p.pest_name) }"></view>
-              <text class="pest-name">{{ p.pest_name }}</text>
+              <view class="pest-color" :style="{ backgroundColor: getPestColor(pest.pest_name) }"></view>
+              <text class="pest-name">{{ pest.pest_name }}</text>
             </view>
-            <text class="pest-count">{{ p.pest_num }}</text>
+            <text class="pest-count">{{ pest.pest_num }}</text>
           </view>
         </view>
       </view>
@@ -150,7 +187,14 @@ export default {
       selectorRange: [],
       title: '查看图片',
       currentThumbnail: 2,
+      videoActiveIcon: 'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/svg/videoIconActive.svg',
+      imageActiveIcon: 'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/svg/imageIconActive.svg',
+      imageIcon: 'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/svg/imageIcon.svg',
+      videoIcon: 'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/svg/videoIcon.svg',
       pestYype:{},
+      fileList:[],
+      fileTotle:0,
+      fileIndex:0,
       is_mark:0,
       device_id: '',
       time_begin: this.formatTime(new Date(new Date().getFullYear(), 0, 1)),
@@ -171,6 +215,9 @@ export default {
         '#FA73F5'
       ],
       currentYear:'',
+      event_id:'',
+      event_page:1,
+      event_page_size:100,
       pest_list_arr:[],
       thumbnails: [],
       addtime:'',
@@ -178,6 +225,8 @@ export default {
       bugMarkers: [],
       imageWidth: 0,
       imageHeight: 0,
+      camera_id:'',
+      is_jpg:1,
       imgOld_id:'',
       containerHeight: '300px',
       pestDict: {}, // 虫子字典 {id: name}
@@ -193,6 +242,8 @@ export default {
     this.time_begin = this.addtime;
     this.defaultDate = this.addtime;
     this.time_end = this.addtime;
+    this.camera_id = '';
+    this.is_jpg = 1;
     this.selectorRange = [];
     const nowYear = new Date().getFullYear();
     for(let i = 0;i<50;i++){
@@ -203,12 +254,25 @@ export default {
       this.selectorRange.push(item);
     }
     this.pestList = [];
+    await this.getEventList();
     await this.getPestDict();
     await this.getPestLevelMap();
     await this.getPestList();
     // this.getDevicePhotoDetails();
   },
   methods: {
+    selectFile(index){
+      this.fileIndex = index;
+      const file = this.fileList[index];
+      this.event_id = file.event_id;
+      this.camera_id = file.device_id;
+      this.thumbnails = [];
+      this.getPestList();
+    },
+    changeVideo(type){
+      this.is_jpg = type == 1 ? 1 : 0;
+      this.getPestList();
+    },
     getPestName(id){
       if(this.is_mark == 0){
         return this.pestDict[id] || id;
@@ -276,35 +340,43 @@ export default {
       };
       return levelMap[String(level)] || `${level}`;
     },
+    async getEventList(){
+      const res = await this.$myRequest({
+        url: '/api/api_gateway?method=forecast.shuhai.shuhai_two_camera_event_list',
+        method: 'POST',
+        data: {
+          page:this.event_page,
+          page_size:this.event_page_size,
+          device_id: this.device_id,
+          time_begin: new Date(this.time_begin + ' 00:00:00').getTime()/1000,//换成秒级时间戳
+          time_end: new Date(this.time_end + ' 23:59:59').getTime()/1000,//换成秒级时间戳
+        },
+      });
+      const resList = res?.data || [];
+      this.fileList = resList;
+      this.fileTotle = res?.total || 0;
+      console.log(resList,'resresresres')
+    },
     async getPestList() {
       const res = await this.$myRequest({
-        url: '/api/api_gateway?method=forecast.new_cbd.photo_list',
+        url: '/api/api_gateway?method=forecast.shuhai.shuhai_two_camera_photo_list',
         method: 'POST',
         data: {
-          identify_model:'B',
-          cmd:'cbd',
+          camera_id: this.camera_id,
+          is_jpg:this.is_jpg,
           page:1,
+          event_id: this.event_id,
           page_size:500,
-          time_begin: this.time_begin + ' 00:00:00',
-          time_end: this.time_end + ' 23:59:59',
-          identify_model:'B',
+          time_begin: new Date(this.time_begin + ' 00:00:00').getTime()/1000,
+          time_end: new Date(this.time_end + ' 23:59:59').getTime()/1000,
           device_id: this.device_id,
         },
       });
       this.thumbnails = res?.data || [];
       this.currentImg = {};
       //如果和旧的id相同,就用旧的id不然就用第一个
-      if(this.thumbnails.find(item => item.ids == this.imgOld_id)){
-        this.img_id = this.imgOld_id
-      }else{
-        this.img_id = this.thumbnails[0].ids
-      }
+      this.img_id = this.thumbnails[0]?.id
       this.getDevicePhotoDetails();
-      // if(this.img_id){
-      //   this.currentImg = this.thumbnails.find(item => item.ids == this.img_id) ||  this.thumbnails[0] || {}
-      // }else{
-      //   this.currentImg = this.thumbnails[0] || {}
-      // }
     },
     formatTime(dateString) {
       const date = new Date(dateString);
@@ -352,51 +424,69 @@ export default {
     },
     async getDevicePhotoDetails() {
       const res = await this.$myRequest({
-        url: '/api/api_gateway?method=forecast.forecast_system.device_photo_details',
+        url: '/api/api_gateway?method=forecast.shuhai.shuhai_two_camera_photo_details',
         method: 'POST',
         data: {
-          identify_model:'B',
-          cmd:'cbd',
           img_id: this.img_id,
         },
       });
-      this.currentImg = res;
+      this.currentImg = res?.photo || {};
       // 处理label参数生成bugMarkers
       this.processBugMarkers();
-      const pest_list = res.pest_list
+      // const pest_list = res.pest_list
       const pestArr = new Map()
-      const pesAlltList = []
-      for(let key in this.pestYype){
-        for(let j in this.pestYype[key]){
-          const pestName = this.pestYype[key][j]
-          pesAlltList.push(pestName)
-          pest_list.forEach(item => {
-            if(item.pest_name == pestName){
-              if(pestArr.has(key)){
-                pestArr.get(key).push(item)
-              }else{
-                pestArr.set(key, [item])
-              }
-            }
-          })
-        }
-      }
-      pest_list.forEach(item => {
-        if(!pesAlltList.includes(item.pest_name)){
-          if(pestArr.has('其他害虫')){
-            pestArr.get('其他害虫').push(item)
-          }else{
-            pestArr.set('其他害虫', [item])
-          }
-        }
-      })
+      // const pesAlltList = []
+      // for(let key in this.pestYype){
+      //   for(let j in this.pestYype[key]){
+      //     const pestName = this.pestYype[key][j]
+      //     pesAlltList?.push(pestName)
+      //     pest_list?.forEach(item => {
+      //       if(item.pest_name == pestName){
+      //         if(pestArr.has(key)){
+      //           pestArr.get(key).push(item)
+      //         }else{
+      //           pestArr.set(key, [item])
+      //         }
+      //       }
+      //     })
+      //   }
+      // }
+      // pest_list?.forEach(item => {
+      //   if(!pesAlltList.includes(item.pest_name)){
+      //     if(pestArr.has('其他害虫')){
+      //       pestArr.get('其他害虫').push(item)
+      //     }else{
+      //       pestArr.set('其他害虫', [item])
+      //     }
+      //   }
+      // })
       const pestList = []
-      for(let key of pestArr){
-        pestList.push(key)
-      }
+      // for(let key of pestArr){
+      //   pestList.push(key)
+      // }
+      console.log(this.currentImg,'currentImgimgigmi')
       if (this.currentImg.is_mark != 0) {
         this.processBugMarkers();
+        for(let i = 0;i< this.currentImg.mark.length;i++){
+          console.log(this.currentImg.mark[i],'markmarkmarkmark')
+          const key = this.currentImg.mark[i].text
+          if(pestArr.has(key)){
+            pestArr.get(key).pest_num++
+            pestArr.set(key, pestArr.get(key))
+          }else{
+            pestArr.set(key, {
+              pest_num: 1,
+            })
+          }
+        }
+        for(let key of pestArr){
+          pestList.push({
+            pest_name: key[0],
+            pest_num: key[1].pest_num,
+          })
+        }
       }
+      console.log(pestList,'pestListpestList')
       this.pestList = pestList
     },
     onImageLoad(e) {
@@ -482,7 +572,7 @@ export default {
         // this.pestList = [];
         const markers = [];
         // 根据原图宽度计算缩放比例
-        let scaleRatio = 3.1;
+        let scaleRatio = 2.4;
         // if (this.imageWidth >= 5000) {
         //   scaleRatio = 4;
         // } else if (this.imageWidth >= 4000) {
@@ -491,7 +581,7 @@ export default {
         //   scaleRatio = 2.5;
         // }
         // const pestArr = new Map()
-        this.currentImg.mark.map((item, index) => {
+        this.currentImg?.mark?.map((item, index) => {
           // if(pestArr.has(item.text)){
           //   pestArr.set(item.text,{
           //     value: pestArr.get(item.text).value+=1,
@@ -541,7 +631,7 @@ export default {
       uni.navigateBack();
     },
     selectThumbnail(item) {
-      this.img_id = item.ids;
+      this.img_id = item.id;
       this.getDevicePhotoDetails();
     }
   }
@@ -707,7 +797,20 @@ export default {
       position: relative;
       width: 100%;
     }
-
+    .tags-swiper{
+      position: absolute;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      z-index:10000;
+      top:10rpx;
+      right: 20rpx;
+      .tag-icon{
+        width: 60rpx;
+        height: 60rpx;
+        margin-left: 10rpx;
+      }
+    }
     .main-photo-image {
       width: 100%;
       display: block;
@@ -783,6 +886,37 @@ export default {
       font-size: 24rpx;
     }
   }
+  .fileList-preview{
+    margin: 0 24rpx 24rpx;
+    .fileList-scroll{
+      gap: 16rpx;
+      box-sizing: border-box;
+      white-space: nowrap;
+      overflow-x: auto;
+      overflow-y: hidden;
+      width: 100%;
+      // 隐藏滚动条
+      -ms-overflow-style: none;
+      scrollbar-width: none;
+      .file-item {
+        width: 240rpx;
+        height: 40rpx;
+        line-height: 40rpx;
+        text-align: center;
+        font-size: 24rpx;
+        color: #042118;
+        font-weight: 500;
+        border: 2rpx solid transparent;
+        display: inline-block;
+        box-sizing: border-box;
+        margin-right: 10rpx;
+        border-radius: 8rpx;
+        &.fileActive {
+          border-color: #0BBC58;
+        }
+      }
+    }
+  }
 
   /* 缩略图预览 */
   .thumbnail-preview {

+ 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',//生产环境