|
|
@@ -15,14 +15,19 @@
|
|
|
<div class="card-wrap">
|
|
|
<div class="card-box photo-card">
|
|
|
<div class="card-title">农情照片</div>
|
|
|
- <div class="area-btns">
|
|
|
- <div v-for="(area, idx) in areaList" :key="idx" class="area-btn"
|
|
|
- :class="{ active: activeAreaIndex === idx }" @click="activeAreaIndex = idx">
|
|
|
- {{ area }}区
|
|
|
+ <div class="ratio-tip">出现新梢的果树占比为5%</div>
|
|
|
+ <div class="photo-grid">
|
|
|
+ <div
|
|
|
+ v-for="photo in photoList"
|
|
|
+ :key="photo.id"
|
|
|
+ class="photo-item"
|
|
|
+ @click="handlePhotoClick(photo)"
|
|
|
+ >
|
|
|
+ <img :src="photo.url" alt="农情照片" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="ratio-tip">出现新梢的果树占比为{{ currentRatio }}%</div>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -30,9 +35,13 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
-import { ref, computed } from "vue";
|
|
|
+import { ref } from "vue";
|
|
|
import customHeader from "@/components/customHeader.vue";
|
|
|
|
|
|
+import { Popup } from "vant";
|
|
|
+import AlbumCarousel from "@/components/album_compoents/albumCarousel";
|
|
|
+import { base_img_url2 } from "@/api/config";
|
|
|
+
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
|
|
|
@@ -51,13 +60,34 @@ if (route.query.miniJson) {
|
|
|
const samplingTime = ref("2025.05.06");
|
|
|
const samplingDesc = ref("本次飞巡采样了1区、2区和5区,拍摄了120棵树");
|
|
|
|
|
|
-// 区域列表与当前选中
|
|
|
-const areaList = ref(["1", "2", "3", "3"]);
|
|
|
-const activeAreaIndex = ref(0);
|
|
|
-
|
|
|
-// 当前选中区的占比(示例数据,可按区区分)
|
|
|
-const ratioByArea = ["5", "8", "12", "12"];
|
|
|
-const currentRatio = computed(() => ratioByArea[activeAreaIndex.value] ?? "5");
|
|
|
+// 农情照片示例列表(后续可替换为接口数据)
|
|
|
+const photoList = ref(
|
|
|
+ Array.from({ length: 25 }).map((_, index) => ({
|
|
|
+ id: index + 1,
|
|
|
+ url: "https://picsum.photos/200/200?random=10",
|
|
|
+ }))
|
|
|
+);
|
|
|
+
|
|
|
+// 图片弹窗相关
|
|
|
+const showImagePopup = ref(false);
|
|
|
+const imgType = ref("");
|
|
|
+const imageList = ref([]);
|
|
|
+const currentImageData = ref({});
|
|
|
+
|
|
|
+const handlePhotoClick = (photo) => {
|
|
|
+ // 暂时使用当前页面的假数据 URL,直接传给轮播组件
|
|
|
+ // imageList.value = photoList.value.map((p) => p.url);
|
|
|
+ // imgType.value = "";
|
|
|
+ // currentImageData.value = {
|
|
|
+ // executeName: "",
|
|
|
+ // executeDate: samplingTime.value,
|
|
|
+ // farmName: "",
|
|
|
+ // prescriptionList: [],
|
|
|
+ // farmWorkName: "农情照片",
|
|
|
+ // droneDate: "",
|
|
|
+ // };
|
|
|
+ // showImagePopup.value = true;
|
|
|
+};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@@ -71,79 +101,82 @@ const currentRatio = computed(() => ratioByArea[activeAreaIndex.value] ?? "5");
|
|
|
padding: 12px;
|
|
|
padding-bottom: 24px;
|
|
|
box-sizing: border-box;
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-.card-wrap {
|
|
|
- margin-bottom: 12px;
|
|
|
-}
|
|
|
-
|
|
|
-.card-box {
|
|
|
- background: #fff;
|
|
|
- border-radius: 8px;
|
|
|
- padding: 12px 16px;
|
|
|
- box-sizing: border-box;
|
|
|
-}
|
|
|
-
|
|
|
-.sampling-card {
|
|
|
- .sampling-title {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: 500;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 6px;
|
|
|
- }
|
|
|
+ .card-wrap {
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
|
- .sampling-desc {
|
|
|
- font-size: 14px;
|
|
|
- color: #767676;
|
|
|
- line-height: 1.5;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.photo-card {
|
|
|
- .card-title {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 12px;
|
|
|
- }
|
|
|
+ .card-box {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 8px;
|
|
|
+ padding: 12px 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
|
|
|
- .area-btns {
|
|
|
- display: flex;
|
|
|
- flex-wrap: nowrap;
|
|
|
- gap: 8px;
|
|
|
- margin-bottom: 12px;
|
|
|
- overflow-x: auto;
|
|
|
- padding-bottom: 4px;
|
|
|
- -webkit-overflow-scrolling: touch;
|
|
|
-
|
|
|
- &::-webkit-scrollbar {
|
|
|
- display: none;
|
|
|
- }
|
|
|
+ .sampling-card {
|
|
|
+ .sampling-title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sampling-desc {
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgba(0, 0, 0, 0.5);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- .area-btn {
|
|
|
- padding: 0 14px;
|
|
|
- height: 32px;
|
|
|
- line-height: 32px;
|
|
|
- font-size: 14px;
|
|
|
- color: #333;
|
|
|
- background: #f2f3f5;
|
|
|
- border-radius: 16px;
|
|
|
- white-space: nowrap;
|
|
|
-
|
|
|
- &.active {
|
|
|
- background: #2199f8;
|
|
|
- color: #fff;
|
|
|
+ .photo-card {
|
|
|
+ .card-title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ratio-tip {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #2199f8;
|
|
|
+ padding: 10px 12px;
|
|
|
+ background: rgba(33, 153, 248, 0.08);
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .photo-grid {
|
|
|
+ margin-top: 12px;
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(4, 1fr);
|
|
|
+ grid-gap: 6px;
|
|
|
+
|
|
|
+ .photo-item {
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ padding-bottom: 100%;
|
|
|
+ border-radius: 8px;
|
|
|
+ overflow: hidden;
|
|
|
+ background: #e5f5e5;
|
|
|
+
|
|
|
+ img {
|
|
|
+ position: absolute;
|
|
|
+ inset: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ object-fit: cover;
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+.image-popup {
|
|
|
+ width: 327px;
|
|
|
+ border-radius: 8px;
|
|
|
|
|
|
- .ratio-tip {
|
|
|
- font-size: 14px;
|
|
|
- color: #2199f8;
|
|
|
- padding: 10px 12px;
|
|
|
- background: rgba(33, 153, 248, 0.08);
|
|
|
- border-radius: 8px;
|
|
|
+ .popup-content {
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|