devicePhoto.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  1. <template>
  2. <view class="device-photo-page">
  3. <!-- 顶部导航栏 -->
  4. <view class="device-detail__header">
  5. <u-icon
  6. size="36"
  7. class="arrow-left"
  8. name="arrow-left"
  9. @click="handleBack"
  10. ></u-icon>
  11. {{ title }}
  12. </view>
  13. <!-- 日期选择器 -->
  14. <view class="date-container">
  15. <view class="select-year">
  16. <view class="select-year-item" @click="showPicker = true">
  17. {{ currentYear }}
  18. <u-icon name="arrow-down" size="18" class="arrow-down"></u-icon>
  19. </view>
  20. </view>
  21. <view class="date-picker" @click="show = true">
  22. <view class="date-input">
  23. <text class="date-label">{{ time_begin || '-' }}</text>
  24. </view>
  25. <view class="date-separator">-</view>
  26. <view class="date-input">
  27. <text class="date-label">{{ time_end || '-' }}</text>
  28. </view>
  29. <u-icon name="calendar" class="calendar"></u-icon>
  30. </view>
  31. </view>
  32. <!-- 主图片区域 -->
  33. <view class="main-photo" v-if="currentImg.addr">
  34. <movable-area class="movable-area" :style="{ height: containerHeight }">
  35. <movable-view
  36. class="movable-view"
  37. direction="all"
  38. scale="true"
  39. scale-min="1"
  40. scale-max="5"
  41. >
  42. <view class="image-container">
  43. <!-- 原图 -->
  44. <image
  45. :src="currentImg.addr"
  46. class="main-photo-image"
  47. mode="widthFix"
  48. @load="onImageLoad"
  49. />
  50. <!-- 虫子标记层 -->
  51. <view class="bug-markers" v-if="bugMarkers.length > 0">
  52. <view
  53. v-for="(marker, index) in bugMarkers"
  54. :key="index"
  55. class="bug-marker"
  56. :style="{
  57. left: marker.x + '%',
  58. top: marker.y + '%',
  59. width: marker.width + '%',
  60. height: marker.height + '%',
  61. borderColor: marker.color
  62. }"
  63. >
  64. <view class="bug-label" :style="{ color: marker.color }">
  65. {{ getPestName(marker.id) }}
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </movable-view>
  71. </movable-area>
  72. <view class="photo-timestamp">{{ formatDate(currentImg.addtime) }}</view>
  73. </view>
  74. <!-- 缩略图预览 -->
  75. <view class="thumbnail-preview">
  76. <view class="thumbnail-scroll">
  77. <view
  78. class="thumbnail-item"
  79. v-for="(item, index) in thumbnails"
  80. :key="index"
  81. :class="{ active: img_id == item.ids }"
  82. @click="selectThumbnail(item)"
  83. >
  84. <image
  85. :src="item.addr"
  86. class="thumbnail-image"
  87. />
  88. </view>
  89. </view>
  90. </view>
  91. <!-- 识别结果 -->
  92. <view class="recognition-result">
  93. <view class="result-title">当前图片识别结果</view>
  94. <!-- 一类害虫 -->
  95. <view class="pest-category" v-for="(pest,index) in pestList" :key="index">
  96. <view class="category-header">
  97. <text class="category-title">{{ pest[0] }}</text>
  98. <text class="category-count">数量</text>
  99. </view>
  100. <view class="pest-item" v-for="(p, i) in pest[1]" :key="i">
  101. <view class="pest-info">
  102. <view class="pest-color" :style="{ backgroundColor: getPestColor(p.pest_name) }"></view>
  103. <text class="pest-name">{{ p.pest_name }}</text>
  104. </view>
  105. <text class="pest-count">{{ p.pest_num }}</text>
  106. </view>
  107. </view>
  108. </view>
  109. <u-calendar v-model="show" :mode="mode" @change="handleChange" :max-date="maxDate" :min-date="minDate" :defaultDate="defaultDate"></u-calendar>
  110. <u-picker v-model="showPicker" mode="selector" :range="selectorRange" range-key="id" :default-selector="[0]" @confirm="confirmHandler"></u-picker>
  111. </view>
  112. </template>
  113. <script>
  114. export default {
  115. data() {
  116. return {
  117. show: false,
  118. mode: 'range',
  119. maxDate: this.formatTime(new Date()),
  120. minDate: this.formatTime(new Date(new Date().getFullYear(), 0, 1)),
  121. defaultDate: this.formatTime(new Date(new Date().getFullYear(), 0, 1)),
  122. showPicker: false,
  123. selectorRange: [],
  124. title: '查看图片',
  125. currentThumbnail: 2,
  126. pestYype:{},
  127. device_id: '',
  128. time_begin: this.formatTime(new Date(new Date().getFullYear(), 0, 1)),
  129. time_end: this.formatTime(new Date()),
  130. img_id: '',
  131. pest_list:[],
  132. pestList:[],
  133. colors:[
  134. '#FF5951',
  135. '#66EDED',
  136. '#E67B3E',
  137. '#6DE28B',
  138. '#FFC97A',
  139. '#E7EB4B',
  140. '#1561F3',
  141. '#FA73F5',
  142. '#159AFF',
  143. '#FA73F5'
  144. ],
  145. currentYear:'',
  146. pest_list_arr:[],
  147. thumbnails: [],
  148. currentImg:{},
  149. bugMarkers: [],
  150. imageWidth: 0,
  151. imageHeight: 0,
  152. imgOld_id:'',
  153. containerHeight: '300px',
  154. pestDict: {}, // 虫子字典 {id: name}
  155. pestColorMap: {}, // 害虫颜色映射 {pestName: color}
  156. };
  157. },
  158. async onLoad(options) {
  159. const {id,img_id,currentYear} = options
  160. this.device_id = id
  161. this.imgOld_id = img_id
  162. this.currentYear = currentYear
  163. this.time_begin = this.currentYear + '-01-01'
  164. this.time_end = this.currentYear + '-12-31'
  165. this.maxDate = this.formatTime(this.time_end)
  166. this.minDate = this.formatTime(this.time_begin)
  167. this.selectorRange = [];
  168. const nowYear = new Date().getFullYear();
  169. for(let i = 0;i<50;i++){
  170. const item = {
  171. label: nowYear - i,
  172. id: nowYear - i
  173. }
  174. this.selectorRange.push(item);
  175. }
  176. this.pestList = [];
  177. await this.getPestDict();
  178. this.getPestLevelMap();
  179. this.getPestList();
  180. // this.getDevicePhotoDetails();
  181. },
  182. methods: {
  183. getPestName(id){
  184. return this.pestDict[id] || id;
  185. },
  186. async confirmHandler(e){
  187. this.currentYear = this.selectorRange[e].id;
  188. if(this.currentYear == new Date().getFullYear()){
  189. this.time_begin = this.formatTime(new Date(new Date().getFullYear(), 0, 1));
  190. this.time_end = this.formatTime(new Date());
  191. this.maxDate = this.formatTime(new Date());
  192. this.minDate = this.formatTime(new Date(new Date().getFullYear(), 0, 1));
  193. }else{
  194. this.time_begin = this.formatTime(new Date(this.currentYear, 0, 1));
  195. this.time_end = this.formatTime(new Date(this.currentYear, 11, 31));
  196. this.maxDate = this.formatTime(new Date(this.currentYear, 11, 31));
  197. this.minDate = this.formatTime(new Date(this.currentYear, 0, 1));
  198. this.defaultDate = this.minDate;
  199. }
  200. this.showPicker = false;
  201. this.pestList = [];
  202. this.thumbnails = [];
  203. await this.getPestList();
  204. },
  205. async handleChange(e){
  206. console.log(e,'e')
  207. this.time_begin = e.startDate;
  208. this.time_begin = e.endDate;
  209. this.pestList = [];
  210. await this.getPestList()
  211. this.currentImg = {};
  212. },
  213. getPestColor(pestName) {
  214. // 如果该害虫已有颜色,直接返回
  215. if (this.pestColorMap[pestName]) {
  216. return this.pestColorMap[pestName];
  217. }
  218. // 为新害虫分配颜色
  219. const usedColors = Object.values(this.pestColorMap);
  220. // 找一个未使用的颜色
  221. let color;
  222. for (const c of this.colors) {
  223. if (!usedColors.includes(c)) {
  224. color = c;
  225. break;
  226. }
  227. }
  228. // 如果所有颜色都用完了,使用哈希值确定颜色
  229. if (!color) {
  230. const hash = pestName.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
  231. color = this.colors[hash % this.colors.length];
  232. }
  233. this.pestColorMap[pestName] = color;
  234. return color;
  235. },
  236. getLevelDisplayName(level) {
  237. const levelMap = {
  238. '-1': '其他害虫',
  239. 1: '一类害虫',
  240. 2: '二类害虫',
  241. 3: '三类害虫',
  242. 4: '四类害虫',
  243. 5: '五类害虫'
  244. };
  245. return levelMap[String(level)] || `${level}`;
  246. },
  247. async getPestList() {
  248. const res = await this.$myRequest({
  249. url: '/api/api_gateway?method=forecast.new_cbd.photo_list',
  250. method: 'POST',
  251. data: {
  252. identify_model:'B',
  253. cmd:'cbd',
  254. time_begin: this.time_begin + ' 00:00:00',
  255. time_end: this.time_end + ' 23:59:59',
  256. identify_model:'B',
  257. device_id: this.device_id,
  258. },
  259. });
  260. this.thumbnails = res?.data || [];
  261. //如果和旧的id相同,就用旧的id不然就用第一个
  262. if(this.thumbnails.find(item => item.ids == this.imgOld_id)){
  263. this.img_id = this.imgOld_id
  264. }else{
  265. this.img_id = this.thumbnails[0].ids
  266. }
  267. this.getDevicePhotoDetails();
  268. // if(this.img_id){
  269. // this.currentImg = this.thumbnails.find(item => item.ids == this.img_id) || this.thumbnails[0] || {}
  270. // }else{
  271. // this.currentImg = this.thumbnails[0] || {}
  272. // }
  273. },
  274. formatTime(dateString) {
  275. const date = new Date(dateString);
  276. const year = date.getFullYear();
  277. const month = String(date.getMonth() + 1).padStart(2, '0');
  278. const day = String(date.getDate()).padStart(2, '0');
  279. return `${year}-${month}-${day}`;
  280. },
  281. async getPestLevelMap() {
  282. const res = await this.$myRequest({
  283. url: '/api/api_gateway?method=forecast.new_cbd.pest_level_map',
  284. method: 'POST',
  285. });
  286. const pestYype = {}
  287. for(let key in res){
  288. pestYype[this.getLevelDisplayName(key)] = res[key]
  289. }
  290. this.pestYype = pestYype
  291. },
  292. // 获取虫子字典
  293. async getPestDict() {
  294. try {
  295. const res = await this.$myRequest({
  296. url: '/api/api_gateway?method=forecast.pest_info.pest_dict',
  297. method: 'POST',
  298. data:{
  299. type_name: '1'
  300. }
  301. });
  302. this.pestDict = res || {};
  303. } catch (error) {
  304. console.error('获取虫子字典失败:', error);
  305. this.pestDict = {};
  306. }
  307. },
  308. formatDate(dateString) {
  309. const date = new Date(dateString*1000);
  310. const year = date.getFullYear();
  311. const month = String(date.getMonth() + 1).padStart(2, '0');
  312. const day = String(date.getDate()).padStart(2, '0');
  313. const hour = String(date.getHours()).padStart(2, '0');
  314. const minute = String(date.getMinutes()).padStart(2, '0');
  315. const second = String(date.getSeconds()).padStart(2, '0');
  316. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  317. },
  318. async getDevicePhotoDetails() {
  319. const res = await this.$myRequest({
  320. url: '/api/api_gateway?method=forecast.forecast_system.device_photo_details',
  321. method: 'POST',
  322. data: {
  323. identify_model:'B',
  324. cmd:'cbd',
  325. img_id: this.img_id,
  326. },
  327. });
  328. console.log('获取图片详情成功:', res);
  329. this.currentImg = res;
  330. // 处理label参数生成bugMarkers
  331. this.processBugMarkers();
  332. const pest_list = res.pest_list
  333. const pestArr = new Map()
  334. for(let key in this.pestYype){
  335. for(let j in this.pestYype[key]){
  336. const pestName = this.pestYype[key][j]
  337. pest_list.forEach(item => {
  338. if(item.pest_name == pestName){
  339. if(pestArr.has(item.level)){
  340. pestArr.get(key).push(item)
  341. }else{
  342. pestArr.set(key, [item])
  343. }
  344. }
  345. })
  346. }
  347. }
  348. const pestList = []
  349. for(let key of pestArr){
  350. pestList.push(key)
  351. }
  352. this.pestList = pestList
  353. },
  354. onImageLoad(e) {
  355. this.imageWidth = e.detail.width;
  356. this.imageHeight = e.detail.height;
  357. // 计算容器显示高度(根据屏幕宽度和图片宽高比)
  358. const systemInfo = uni.getSystemInfoSync();
  359. const screenWidth = systemInfo.windowWidth;
  360. const containerWidth = screenWidth - 24; // 减去左右margin (24rpx ≈ 12px)
  361. const displayHeight = (containerWidth / this.imageWidth) * this.imageHeight;
  362. this.containerHeight = displayHeight + 'px';
  363. console.log('图片尺寸:', this.imageWidth, this.imageHeight, '容器高度:', this.containerHeight);
  364. // 图片加载完成后处理bugMarkers
  365. this.processBugMarkers();
  366. },
  367. processBugMarkers() {
  368. console.log('开始处理label参数:', this.currentImg.label);
  369. if (!this.currentImg.label) {
  370. console.log('没有label参数');
  371. this.bugMarkers = [];
  372. return;
  373. }
  374. // 如果没有图片尺寸,先设置默认值
  375. if (!this.imageWidth || !this.imageHeight) {
  376. console.log('没有图片尺寸,使用默认值');
  377. this.imageWidth = 1000;
  378. this.imageHeight = 1000;
  379. }
  380. try {
  381. // 处理label参数,将单引号替换为双引号
  382. let labelStr = this.currentImg.label;
  383. labelStr = labelStr.replace(/'/g, '"');
  384. const label = JSON.parse(labelStr);
  385. const markers = [];
  386. // 根据原图宽度计算缩放比例
  387. let scaleRatio;
  388. if (this.imageWidth >= 5000) {
  389. scaleRatio = 1;
  390. } else if (this.imageWidth >= 4000) {
  391. scaleRatio = 1;
  392. } else {
  393. scaleRatio = 1;
  394. }
  395. console.log('原图宽度:', this.imageWidth, '缩放比例:', scaleRatio);
  396. label.forEach(item => {
  397. for (let key in item) {
  398. const [x1, y1, x2, y2] = item[key];
  399. // 使用缩放比例计算标记位置和尺寸
  400. const x = (x1 * scaleRatio / this.imageWidth) * 100;
  401. const y = (y1 * scaleRatio / this.imageHeight) * 100;
  402. const width = ((x2 - x1) * scaleRatio / this.imageWidth) * 100;
  403. const height = ((y2 - y1) * scaleRatio / this.imageHeight) * 100;
  404. // 从字典中获取虫子名字(尝试字符串和数字两种类型)
  405. const pestName = this.pestDict[key] || this.pestDict[String(key)] || key;
  406. const color = this.getPestColor(pestName);
  407. markers.push({
  408. id: pestName, // 显示虫子名字
  409. x,
  410. y,
  411. width,
  412. height,
  413. color
  414. });
  415. }
  416. });
  417. this.bugMarkers = markers;
  418. } catch (error) {
  419. console.error('处理label参数失败:', error);
  420. this.bugMarkers = [];
  421. }
  422. },
  423. handleBack() {
  424. uni.navigateBack({
  425. delta: 1
  426. });
  427. },
  428. goBack() {
  429. uni.navigateBack();
  430. },
  431. selectThumbnail(item) {
  432. this.img_id = item.ids;
  433. this.getDevicePhotoDetails();
  434. }
  435. }
  436. };
  437. </script>
  438. <style lang="scss" scoped>
  439. ::v-deep .u-calendar__action{
  440. display:flex;
  441. justify-content: space-between;
  442. }
  443. ::v-deep .u-hover-class{
  444. .u-calendar__content__item__inner{
  445. color:#aaa !important;
  446. }
  447. }
  448. .device-photo-page {
  449. background-color: #F5F5F5;
  450. min-height: 100vh;
  451. width: 100%;
  452. padding-top: 112rpx;
  453. background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  454. .device-detail__header {
  455. width: 100%;
  456. font-size: 28rpx;
  457. color: #999;
  458. color: #042118;
  459. font-family: 'Source Han Sans CN VF';
  460. font-weight: 700;
  461. position: relative;
  462. text-align: center;
  463. .arrow-left {
  464. position: absolute;
  465. left: 32rpx;
  466. margin-right: 12rpx;
  467. }
  468. }
  469. /* 顶部导航栏 */
  470. .nav-bar {
  471. display: flex;
  472. align-items: center;
  473. justify-content: space-between;
  474. padding: 24rpx;
  475. background-color: #E6F7EF;
  476. .nav-left {
  477. .back-icon {
  478. font-size: 36rpx;
  479. color: #042118;
  480. }
  481. }
  482. .nav-title {
  483. font-size: 32rpx;
  484. font-weight: 700;
  485. color: #042118;
  486. }
  487. .nav-right {
  488. display: flex;
  489. align-items: center;
  490. .more-icon {
  491. font-size: 32rpx;
  492. color: #042118;
  493. margin-right: 24rpx;
  494. }
  495. .eye-icon {
  496. font-size: 32rpx;
  497. }
  498. }
  499. }
  500. .date-container{
  501. padding: 0 20rpx;
  502. display: flex;
  503. align-items: center;
  504. justify-content: center;
  505. .select-year{
  506. width: 150rpx;
  507. height: 80rpx;
  508. display: flex;
  509. align-items: center;
  510. justify-content: space-around;
  511. color: #656565;
  512. font-size: 26rpx;
  513. line-height: 80rpx;
  514. text-align: center;
  515. border-radius: 48rpx;
  516. background-color: #FFFFFF;
  517. margin-right: 10rpx;
  518. padding: 0 26rpx;
  519. .select-year-item{
  520. width: 100%;
  521. display: flex;
  522. align-items: center;
  523. justify-content: space-around;
  524. }
  525. }
  526. }
  527. /* 日期选择器 */
  528. .date-picker {
  529. display: flex;
  530. align-items: center;
  531. padding: 20rpx 24rpx;
  532. background-color: #FFFFFF;
  533. margin-bottom: 24rpx;
  534. width: 90%;
  535. margin:20rpx auto;
  536. border-radius: 48rpx;
  537. position: relative;
  538. .date-input {
  539. display: flex;
  540. flex-direction: column;
  541. width: 35%;
  542. .date-label {
  543. font-size: 24rpx;
  544. color: #999999;
  545. margin-bottom: 8rpx;
  546. }
  547. .date-value {
  548. font-size: 28rpx;
  549. color: #042118;
  550. font-weight: 500;
  551. }
  552. }
  553. .calendar {
  554. position: absolute;
  555. right: 24rpx;
  556. top: 50%;
  557. transform: translateY(-50%);
  558. font-size: 32rpx;
  559. color: #999999;
  560. }
  561. .date-separator {
  562. margin: 0 24rpx;
  563. font-size: 28rpx;
  564. color: #999999;
  565. }
  566. }
  567. /* 主图片区域 */
  568. .main-photo {
  569. position: relative;
  570. margin: 0 24rpx 24rpx;
  571. background-color: #FFFFFF;
  572. border-radius: 16rpx;
  573. padding: 0;
  574. overflow: hidden;
  575. .movable-area {
  576. width: 100%;
  577. overflow: hidden;
  578. }
  579. .movable-view {
  580. width: 100%;
  581. }
  582. .image-container {
  583. position: relative;
  584. width: 100%;
  585. }
  586. .main-photo-image {
  587. width: 100%;
  588. display: block;
  589. }
  590. /* 虫子标记层 */
  591. .bug-markers {
  592. position: absolute;
  593. top: 0;
  594. left: 0;
  595. width: 100%;
  596. height: 100%;
  597. pointer-events: none;
  598. }
  599. /* 虫子标记 */
  600. .bug-marker {
  601. position: absolute;
  602. border: 2rpx solid;
  603. border-radius: 4rpx;
  604. }
  605. /* 虫子标记标签 */
  606. .bug-label {
  607. position: absolute;
  608. top: -24rpx;
  609. left: 0;
  610. padding: 2rpx 6rpx;
  611. border-radius: 4rpx;
  612. font-size: 20rpx;
  613. color: white;
  614. white-space: nowrap;
  615. }
  616. /* 虫子标记层 */
  617. .bug-markers {
  618. position: absolute;
  619. top: 0;
  620. left: 0;
  621. width: 100%;
  622. height: 100%;
  623. pointer-events: none;
  624. }
  625. /* 虫子标记 */
  626. .bug-marker {
  627. position: absolute;
  628. border: 2rpx solid;
  629. border-radius: 4rpx;
  630. pointer-events: auto;
  631. }
  632. /* 虫子标记标签 */
  633. .bug-label {
  634. position: absolute;
  635. top: -30rpx;
  636. left: 0;
  637. padding: 4rpx 8rpx;
  638. border-radius: 4rpx;
  639. font-size: 20rpx;
  640. font-weight: bold;
  641. }
  642. .photo-timestamp {
  643. position: absolute;
  644. bottom: 0rpx;
  645. left: 0rpx;
  646. width:100%;
  647. background-color: rgba(0, 0, 0, 0.6);
  648. color: #FFFFFF;
  649. padding: 8rpx 16rpx;
  650. border-radius: 8rpx;
  651. font-size: 24rpx;
  652. }
  653. }
  654. /* 缩略图预览 */
  655. .thumbnail-preview {
  656. margin: 0 24rpx 24rpx;
  657. .thumbnail-scroll {
  658. gap: 16rpx;
  659. padding-bottom: 16rpx;
  660. box-sizing: border-box;
  661. white-space: nowrap;
  662. overflow-x: auto;
  663. overflow-y: hidden;
  664. width: 100%;
  665. // 隐藏滚动条
  666. -ms-overflow-style: none;
  667. scrollbar-width: none;
  668. .thumbnail-item {
  669. width: 120rpx;
  670. height: 120rpx;
  671. border-radius: 8rpx;
  672. overflow: hidden;
  673. border: 2rpx solid transparent;
  674. display: inline-block;
  675. box-sizing: border-box;
  676. margin-right: 10rpx;
  677. &.active {
  678. border-color: #0BBC58;
  679. }
  680. .thumbnail-image {
  681. width: 100%;
  682. height: 100%;
  683. object-fit: cover;
  684. }
  685. }
  686. }
  687. }
  688. /* 识别结果 */
  689. .recognition-result {
  690. margin: 0 24rpx 24rpx;
  691. background-color: #FFFFFF;
  692. border-radius: 16rpx;
  693. padding: 24rpx;
  694. .result-title {
  695. font-size: 28rpx;
  696. font-weight: 700;
  697. color: #042118;
  698. margin-bottom: 24rpx;
  699. }
  700. /* 害虫类别 */
  701. .pest-category {
  702. margin-bottom: 32rpx;
  703. border: 1px solid #E4E7ED;
  704. border-radius: 16rpx;
  705. &:last-child {
  706. margin-bottom: 0;
  707. }
  708. .category-header {
  709. display: flex;
  710. justify-content: space-between;
  711. margin-bottom: 16rpx;
  712. background: #F6F8FC;
  713. padding: 18rpx 24rpx;
  714. .category-title {
  715. font-size: 24rpx;
  716. font-weight: 500;
  717. color: #042118;
  718. }
  719. .category-count {
  720. font-size: 24rpx;
  721. color: #999999;
  722. }
  723. }
  724. .pest-item {
  725. display: flex;
  726. justify-content: space-between;
  727. align-items: center;
  728. margin-bottom: 12rpx;
  729. padding: 6rpx 24rpx;
  730. &:last-child {
  731. margin-bottom: 0;
  732. }
  733. .pest-info {
  734. display: flex;
  735. align-items: center;
  736. .pest-color {
  737. width: 16rpx;
  738. height: 16rpx;
  739. border-radius: 50%;
  740. margin-right: 12rpx;
  741. }
  742. .pest-name {
  743. font-size: 24rpx;
  744. color: #042118;
  745. }
  746. }
  747. .pest-count {
  748. font-size: 24rpx;
  749. color: #042118;
  750. }
  751. }
  752. }
  753. }
  754. }
  755. </style>