| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 |
- <template>
- <view class="device-photo-page">
- <!-- 顶部导航栏 -->
- <view class="device-detail__header">
- <u-icon
- size="36"
- class="arrow-left"
- name="arrow-left"
- @click="handleBack"
- ></u-icon>
- {{ title }}
- </view>
- <!-- 日期选择器 -->
- <view class="date-picker">
- <view class="date-input">
- <text class="date-label">开始日期</text>
- </view>
- <view class="date-separator">-</view>
- <view class="date-input">
- <text class="date-label">结束日期</text>
- </view>
- <u-icon name="calendar" class="calendar"></u-icon>
- </view>
- <!-- 主图片区域 -->
- <view class="main-photo">
- <image
- src="https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20a%20white%20surface%20with%20markers&image_size=portrait_4_3"
- class="main-photo-image"
- />
- <view class="photo-timestamp">2025-12-28 08:00:00</view>
- </view>
- <!-- 缩略图预览 -->
- <view class="thumbnail-preview">
- <view class="thumbnail-scroll">
- <view
- class="thumbnail-item"
- v-for="(item, index) in thumbnails"
- :key="index"
- :class="{ active: index === currentThumbnail }"
- @click="selectThumbnail(index)"
- >
- <image
- :src="item.src"
- class="thumbnail-image"
- />
- </view>
- </view>
- </view>
- <!-- 识别结果 -->
- <view class="recognition-result">
- <view class="result-title">当前图片识别结果</view>
-
- <!-- 一类害虫 -->
- <view class="pest-category">
- <view class="category-header">
- <text class="category-title">一类害虫</text>
- <text class="category-count">数量</text>
- </view>
- <view class="pest-item" v-for="(pest, index) in category1Pests" :key="index">
- <view class="pest-info">
- <view class="pest-color" :style="{ backgroundColor: pest.color }"></view>
- <text class="pest-name">{{ pest.name }}</text>
- </view>
- <text class="pest-count">{{ pest.count }}</text>
- </view>
- </view>
- <!-- 二类害虫 -->
- <view class="pest-category">
- <view class="category-header">
- <text class="category-title">二类害虫</text>
- <text class="category-count">数量</text>
- </view>
- <view class="pest-item" v-for="(pest, index) in category2Pests" :key="index">
- <view class="pest-info">
- <view class="pest-color" :style="{ backgroundColor: pest.color }"></view>
- <text class="pest-name">{{ pest.name }}</text>
- </view>
- <text class="pest-count">{{ pest.count }}</text>
- </view>
- </view>
- <!-- 三类害虫 -->
- <view class="pest-category">
- <view class="category-header">
- <text class="category-title">三类害虫</text>
- <text class="category-count">数量</text>
- </view>
- <view class="pest-item" v-for="(pest, index) in category3Pests" :key="index">
- <view class="pest-info">
- <view class="pest-color" :style="{ backgroundColor: pest.color }"></view>
- <text class="pest-name">{{ pest.name }}</text>
- </view>
- <text class="pest-count">{{ pest.count }}</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- title: '查看图片',
- currentThumbnail: 2,
- thumbnails: [
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" },
- { src: "https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=insects%20on%20white%20surface&image_size=square" }
- ],
- category1Pests: [
- { name: '蚜虫', color: '#FF9933', count: 3 },
- { name: '松墨天牛', color: '#FF3333', count: 3 },
- { name: '夜蛾', color: '#3366FF', count: 3 }
- ],
- category2Pests: [
- { name: '蚜虫', color: '#FF9933', count: 3 },
- { name: '松墨天牛', color: '#FF3333', count: 3 },
- { name: '夜蛾', color: '#3366FF', count: 3 }
- ],
- category3Pests: [
- { name: '蚜虫', color: '#FF9933', count: 3 },
- { name: '松墨天牛', color: '#FF3333', count: 3 },
- { name: '夜蛾', color: '#3366FF', count: 3 }
- ]
- };
- },
- methods: {
- goBack() {
- uni.navigateBack();
- },
- selectThumbnail(index) {
- this.currentThumbnail = index;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .device-photo-page {
- background-color: #F5F5F5;
- min-height: 100vh;
- width: 100%;
- padding-top: 112rpx;
- background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
- .device-detail__header {
- width: 100%;
- font-size: 28rpx;
- color: #999;
- color: #042118;
- font-family: 'Source Han Sans CN VF';
- font-weight: 700;
- position: relative;
- text-align: center;
- .arrow-left {
- position: absolute;
- left: 32rpx;
- margin-right: 12rpx;
- }
- }
- /* 顶部导航栏 */
- .nav-bar {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 24rpx;
- background-color: #E6F7EF;
- .nav-left {
- .back-icon {
- font-size: 36rpx;
- color: #042118;
- }
- }
- .nav-title {
- font-size: 32rpx;
- font-weight: 700;
- color: #042118;
- }
- .nav-right {
- display: flex;
- align-items: center;
- .more-icon {
- font-size: 32rpx;
- color: #042118;
- margin-right: 24rpx;
- }
- .eye-icon {
- font-size: 32rpx;
- }
- }
- }
- /* 日期选择器 */
- .date-picker {
- display: flex;
- align-items: center;
- padding: 20rpx 24rpx;
- background-color: #FFFFFF;
- margin-bottom: 24rpx;
- width: 90%;
- margin:20rpx auto;
- border-radius: 48rpx;
- position: relative;
- .date-input {
- display: flex;
- flex-direction: column;
- width: 35%;
- .date-label {
- font-size: 24rpx;
- color: #999999;
- margin-bottom: 8rpx;
- }
- .date-value {
- font-size: 28rpx;
- color: #042118;
- font-weight: 500;
- }
- }
- .calendar {
- position: absolute;
- right: 24rpx;
- top: 50%;
- transform: translateY(-50%);
- font-size: 32rpx;
- color: #999999;
- }
- .date-separator {
- margin: 0 24rpx;
- font-size: 28rpx;
- color: #999999;
- }
- }
- /* 主图片区域 */
- .main-photo {
- position: relative;
- margin: 0 24rpx 24rpx;
- background-color: #FFFFFF;
- border-radius: 16rpx;
- padding: 0;
- overflow: hidden;
- .main-photo-image {
- width: 100%;
- height: 400rpx;
- object-fit: cover;
- border-radius: 8rpx;
- }
- .photo-timestamp {
- position: absolute;
- bottom: 0rpx;
- left: 0rpx;
- width:100%;
- background-color: rgba(0, 0, 0, 0.6);
- color: #FFFFFF;
- padding: 8rpx 16rpx;
- border-radius: 8rpx;
- font-size: 24rpx;
- }
- }
- /* 缩略图预览 */
- .thumbnail-preview {
- margin: 0 24rpx 24rpx;
- .thumbnail-scroll {
- gap: 16rpx;
- padding-bottom: 16rpx;
- box-sizing: border-box;
- white-space: nowrap;
- overflow-x: auto;
- overflow-y: hidden;
- width: 100%;
- // 隐藏滚动条
- -ms-overflow-style: none;
- scrollbar-width: none;
- .thumbnail-item {
- width: 120rpx;
- height: 120rpx;
- border-radius: 8rpx;
- overflow: hidden;
- border: 2rpx solid transparent;
- display: inline-block;
- box-sizing: border-box;
- margin-right: 10rpx;
- &.active {
- border-color: #0BBC58;
- }
- .thumbnail-image {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- }
- }
- /* 识别结果 */
- .recognition-result {
- margin: 0 24rpx 24rpx;
- background-color: #FFFFFF;
- border-radius: 16rpx;
- padding: 24rpx;
- .result-title {
- font-size: 28rpx;
- font-weight: 700;
- color: #042118;
- margin-bottom: 24rpx;
- }
- /* 害虫类别 */
- .pest-category {
- margin-bottom: 32rpx;
- border: 1px solid #E4E7ED;
- border-radius: 16rpx;
- &:last-child {
- margin-bottom: 0;
- }
- .category-header {
- display: flex;
- justify-content: space-between;
- margin-bottom: 16rpx;
- background: #F6F8FC;
- padding: 18rpx 24rpx;
- .category-title {
- font-size: 24rpx;
- font-weight: 500;
- color: #042118;
- }
- .category-count {
- font-size: 24rpx;
- color: #999999;
- }
- }
- .pest-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 12rpx;
- padding: 6rpx 24rpx;
- &:last-child {
- margin-bottom: 0;
- }
- .pest-info {
- display: flex;
- align-items: center;
- .pest-color {
- width: 16rpx;
- height: 16rpx;
- border-radius: 50%;
- margin-right: 12rpx;
- }
- .pest-name {
- font-size: 24rpx;
- color: #042118;
- }
- }
- .pest-count {
- font-size: 24rpx;
- color: #042118;
- }
- }
- }
- }
- }
- </style>
|