|
|
@@ -36,11 +36,11 @@
|
|
|
<div class="example-wrapper">
|
|
|
<div class="example-header">
|
|
|
<div>示例照片</div>
|
|
|
- <div class="more">查看更多</div>
|
|
|
+ <div class="more" @click="openMorePopup(item.exampleImagesJson)">查看更多</div>
|
|
|
</div>
|
|
|
<div class="example-list" v-if="item.exampleImagesJson.length > 0">
|
|
|
- <div class="image-item-wrapper" v-for="example in item.exampleImagesJson" :key="example"
|
|
|
- @click="showExample(example)">
|
|
|
+ <div class="image-item-wrapper" v-for="(example, exIndex) in item.exampleImagesJson"
|
|
|
+ :key="example" @click="showExample(item.exampleImagesJson, exIndex)">
|
|
|
<img class="image-item" :src="example" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -93,15 +93,13 @@
|
|
|
<!-- 农场信息完善弹窗 -->
|
|
|
<farm-info-popup :expertMiniUserId="query.expertMiniUserId" v-model:show="showFarmInfoPopup" />
|
|
|
|
|
|
- <!-- 示例照片 -->
|
|
|
- <popup v-model:show="showExamplePopup" class="example-popup" :overlay-style="{ backdropFilter: 'blur(4px)' }">
|
|
|
- <div class="example-content">
|
|
|
- <img class="example-img" :src="exampleImgData" alt="" />
|
|
|
- <div class="example-tips">
|
|
|
- 拍摄要求:请采集代表农场作物物候期的照片,请采集代表农场作物物候期的照片。
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </popup>
|
|
|
+ <!-- 示例照片轮播组件 -->
|
|
|
+ <example-popup
|
|
|
+ v-model:show="showExamplePopup"
|
|
|
+ :images="exampleList"
|
|
|
+ :start-index="exampleStartIndex"
|
|
|
+ title="蒂蛀虫示例图"
|
|
|
+ />
|
|
|
<!-- 照片上传进度 -->
|
|
|
<popup v-model:show="showUploadProgressPopup" round class="upload-progress-popup">
|
|
|
<div class="upload-progress-title">
|
|
|
@@ -130,6 +128,9 @@
|
|
|
</div>
|
|
|
<div class="confirm-btn" @click="handleConfirmUpload">确认上传</div>
|
|
|
</popup>
|
|
|
+
|
|
|
+ <!-- 查看更多弹窗 -->
|
|
|
+ <more-popup ref="morePopupRef" />
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, onMounted, onActivated } from "vue";
|
|
|
@@ -138,11 +139,13 @@ import { Uploader, Popup } from "vant";
|
|
|
import customHeader from "@/components/customHeader.vue";
|
|
|
import upload from "@/components/upload.vue";
|
|
|
import FarmInfoPopup from "@/components/popup/farmInfoPopup.vue";
|
|
|
+import ExamplePopup from "./components/examplePopup.vue";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import { base_img_url2 } from "@/api/config";
|
|
|
import DrawRegionMap from "./map/drawRegionMap.js";
|
|
|
import UploadFile from "@/utils/upliadFile";
|
|
|
import { getFileExt } from "@/utils/util";
|
|
|
+import MorePopup from "./components/morePopup.vue";
|
|
|
|
|
|
|
|
|
const showFarmInfoPopup = ref(false);
|
|
|
@@ -150,7 +153,7 @@ const loading = ref(false);
|
|
|
const router = useRouter();
|
|
|
const listData = ref([]);
|
|
|
const query = ref(useRoute().query);
|
|
|
-
|
|
|
+const morePopupRef = ref(null);
|
|
|
//照片上传进度
|
|
|
const showUploadProgressPopup = ref(false);
|
|
|
const uploadFormData = ref({
|
|
|
@@ -216,11 +219,13 @@ const afterReadUpload = async (data) => {
|
|
|
}, 100);
|
|
|
}
|
|
|
};
|
|
|
-//示例照片
|
|
|
+// 示例照片轮播
|
|
|
const showExamplePopup = ref(false);
|
|
|
-const exampleImgData = ref(null);
|
|
|
-const showExample = (example) => {
|
|
|
- exampleImgData.value = example;
|
|
|
+const exampleList = ref([]);
|
|
|
+const exampleStartIndex = ref(0);
|
|
|
+const showExample = (list, index) => {
|
|
|
+ exampleList.value = list || [];
|
|
|
+ exampleStartIndex.value = index || 0;
|
|
|
showExamplePopup.value = true;
|
|
|
};
|
|
|
|
|
|
@@ -241,7 +246,6 @@ const loadData = async () => {
|
|
|
item.exampleImagesJson = [];
|
|
|
}
|
|
|
} catch (e) {
|
|
|
- console.error('解析 exampleImagesJson 失败:', e);
|
|
|
item.exampleImagesJson = [];
|
|
|
}
|
|
|
} else {
|
|
|
@@ -253,7 +257,7 @@ const loadData = async () => {
|
|
|
};
|
|
|
});
|
|
|
} catch (error) {
|
|
|
- console.error("加载数据失败", error);
|
|
|
+ // 加载数据失败时静默处理或在需要时提示
|
|
|
} finally {
|
|
|
loading.value = false;
|
|
|
}
|
|
|
@@ -345,6 +349,11 @@ const handleUploadSuccess = (data) => {
|
|
|
uploadData.value = data.imgArr;
|
|
|
};
|
|
|
|
|
|
+const openMorePopup = (images) => {
|
|
|
+ morePopupRef.value.setItems([...images, ...images, ...images, ...images, ...images, ...images, ...images, ...images, ...images, ...images, ...images, ...images, ...images]);
|
|
|
+ morePopupRef.value.openPopup();
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
// 初始化加载
|
|
|
getFarmList();
|
|
|
@@ -651,33 +660,6 @@ const getFarmList = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.example-popup {
|
|
|
- width: 100%;
|
|
|
- border-radius: 0;
|
|
|
- background: none;
|
|
|
- max-width: 100%;
|
|
|
-
|
|
|
- .example-content {
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- .example-img {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .example-tips {
|
|
|
- margin: 16px 12px 6px 12px;
|
|
|
- background: #3d3d3d;
|
|
|
- padding: 8px 10px;
|
|
|
- border-radius: 4px;
|
|
|
- backdrop-filter: blur(4px);
|
|
|
- color: #fff;
|
|
|
- font-size: 14px;
|
|
|
- line-height: 21px;
|
|
|
- text-align: left;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
.upload-progress-popup {
|
|
|
width: 100%;
|
|
|
padding: 20px 16px;
|