Bladeren bron

feat:添加弹窗和勾画页面

wangsisi 4 dagen geleden
bovenliggende
commit
85b3cdd02e

+ 9 - 2
src/components/popup/tipPopup.vue

@@ -18,7 +18,7 @@
         </template>
         <template v-else-if="type === 'success'">
             <img class="tip-icon success-icon" src="@/assets/img/home/right.png" alt="" />
-            <div class="tip-text success-text">{{ text }} <span class="highlight-text">{{ highlightText }}</span></div>
+            <div class="tip-text success-text" :class="{pmzd:font}">{{ text }} <span class="highlight-text">{{ highlightText }}</span></div>
         </template>
         <template v-else>
             <img class="tip-icon success-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
@@ -85,6 +85,10 @@ const props = defineProps({
         type: Number,
         default: 2003,
     },
+    font: {
+        type:Boolean,
+        default:false
+    }
 });
 
 const emit = defineEmits(["update:show", "confirm", "handleClickOverlay"]);
@@ -147,12 +151,15 @@ const handleClickOverlay = () => {
         margin-bottom: 32px;
         text-align: center;
         &.success-text {
-            font-size: 22px;
+            font-size: 20px;
             font-weight: 400;
         }
         .highlight-text {
             color: #2199f8;
         }
+        &.pmzd{
+            font-family: 'PangMenZhengDao';
+        }
     }
     .tip-btn {
         width: 100%;

+ 7 - 0
src/router/globalRoutes.js

@@ -453,4 +453,11 @@ export default [
         meta: { keepAlive: true },
         component: () => import("@/views/old_mini/interactionList/drawRegion.vue"),
     },
+    //确认区域
+    {
+        path: "/confirm_area",
+        name: "ConfirmArea",
+        meta: { keepAlive: true },
+        component: () => import("@/views/old_mini/interactionList/confirmArea.vue"),
+    },
 ];

+ 22 - 3
src/views/old_mini/home/index.vue

@@ -57,6 +57,9 @@
     <tip-popup v-model:show="showTipPopup" type="warning" text="请设置" highlightText="种植方案" buttonText="去设置"
         @confirm="handleBtn" :closeOnClickOverlay="false" :zIndex="9999" />
 
+    <tip-popup v-model:show="showDronePhotoPopup" font type="success" text="无人机照片已上传完毕请您确认" buttonText="去确认"
+        @confirm="hanldeDrone" :zIndex="9999" />
+
     <!-- 农事执行弹窗 -->
     <agri-execute-popup v-model:show="showAgriExecutePopup" :popupData="agriExecuteData" @later="handleAgriLater"
         @executed="handleAgriExecuted" />
@@ -86,6 +89,11 @@ const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 const router = useRouter();
 const route = useRoute();
 
+const showDronePhotoPopup = ref(false)
+const hanldeDrone = () => {
+    console.log('111')
+}
+
 const showTipPopup = ref(false);
 const handleBtn = () => {
     router.push("/plan?pageType=plant&headerTitle=请设置您的种植方案");
@@ -112,10 +120,10 @@ const handleAgriLater = () => {
 };
 
 const handleAgriExecuted = () => {
-    console.log("我已执行111",agriExecuteData.value);
-    if(agriExecuteData.value.executedButtonText === '开始采集'){
+    console.log("我已执行111", agriExecuteData.value);
+    if (agriExecuteData.value.executedButtonText === '开始采集') {
         router.push("/interaction_list?expertMiniUserId=81881&oldUser=true");
-    }else{
+    } else {
         // 显示执行轨迹弹窗
         showExecuteTracePopup.value = true;
     }
@@ -409,6 +417,7 @@ const handleBannerClick = () => {
 
     .task-list {
         padding: 0 10px 10px;
+
         .task-title {
             color: #000;
             margin: 6px 0 14px 0;
@@ -417,6 +426,7 @@ const handleBannerClick = () => {
             line-height: 22px;
             position: relative;
             padding-left: 9px;
+
             &::after {
                 content: "";
                 position: absolute;
@@ -429,9 +439,11 @@ const handleBannerClick = () => {
                 border-radius: 20px;
             }
         }
+
         .bottom-tag {
             display: flex;
             gap: 4px;
+
             .tag-card {
                 flex: 1;
                 border-radius: 6px;
@@ -439,6 +451,7 @@ const handleBannerClick = () => {
                 box-sizing: border-box;
                 background: rgba(201, 201, 201, 0.1);
                 border: 0.5px solid transparent;
+
                 .card-content {
                     display: flex;
                     flex-direction: column;
@@ -446,6 +459,7 @@ const handleBannerClick = () => {
                     justify-content: center;
                     text-align: center;
                     height: 100%;
+
                     .card-main-text {
                         font-size: 18px;
                         line-height: 28px;
@@ -453,6 +467,7 @@ const handleBannerClick = () => {
                         color: #1D2129;
                         margin-bottom: 2px;
                     }
+
                     .card-sub-text {
                         font-size: 14px;
                         line-height: 22px;
@@ -460,6 +475,7 @@ const handleBannerClick = () => {
                         display: flex;
                         align-items: center;
                         gap: 4px;
+
                         .card-icon {
                             display: inline-flex;
                             align-items: center;
@@ -470,13 +486,16 @@ const handleBannerClick = () => {
                         }
                     }
                 }
+
                 &.active {
                     background: rgba(33, 153, 248, 0.1);
                     border-color: #2199f8;
+
                     .card-content {
                         .card-main-text {
                             color: #2199f8;
                         }
+
                         .card-sub-text {
                             color: #2199f8;
                         }

+ 207 - 0
src/views/old_mini/interactionList/confirmArea.vue

@@ -0,0 +1,207 @@
+<template>
+    <div class="edit-map">
+        <custom-header name="确认农场区域"></custom-header>
+        <div class="edit-map-content">
+            <div class="edit-map-tip">操作提示:拖动圆点,即可调整地块边界</div>
+            <div class="map-container" ref="mapContainer"></div>
+            <div class="edit-map-footer">
+                <div class="footer-back" @click="goBack">
+                    <img class="back-icon" src="@/assets/img/home/go-back.png" alt="" />
+                </div>
+                <div class="footer-address-box">
+                    <div class="footer-address">
+                        <div class="address-title">111</div>
+                        <div class="address-detail">2222</div>
+                    </div>
+                    <div class="address-btn" @click="goBack">修改地址</div>
+                </div>
+                <div class="edit-map-footer-btn">
+                    <div class="btn-cancel" @click="goBack">取消</div>
+                    <div class="btn-confirm" @click="confirm">确认</div>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <!-- 地形/建模航线提示弹窗(复用 droneConsultPopup:terrainRoute 立即获取 → terrainRouteSuccess 航线已生成) -->
+    <drone-consult-popup v-model:show="showTerrainRoutePopup" :type="terrainPopupType"
+        @confirm="onTerrainRouteConfirm" />
+</template>
+
+<script setup>
+import customHeader from "@/components/customHeader.vue";
+import DroneConsultPopup from "@/components/popup/droneConsultPopup.vue";
+import { ref, onMounted, onActivated, onDeactivated } from "vue";
+import DrawRegionMap from "./map/drawRegionMap.js";
+import { useRouter, useRoute } from "vue-router";
+import { convertPointToArray } from "@/utils/index";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const router = useRouter();
+const route = useRoute();
+const mapContainer = ref(null);
+const drawRegionMap = new DrawRegionMap();
+
+const type = ref('droneConsult');
+const gardenName = ref('荔博园')
+const showTerrainRoutePopup = ref(false);
+/** 弹窗类型:terrainRoute 立即获取 | terrainRouteSuccess 航线已生成 */
+const terrainPopupType = ref("terrainRoute");
+
+onMounted(() => {
+    const point = route.query.mapCenter || "POINT (113.6142086995688 23.585836479509055)";
+    drawRegionMap.initMap(point, mapContainer.value);
+});
+
+onActivated(() => {
+    const point = route.query.mapCenter || "POINT (113.6142086995688 23.585836479509055)";
+
+    // 先绘制地块
+    const polygonData = route.query.polygonData;
+
+    if (polygonData) {
+        drawRegionMap.setAreaGeometry(JSON.parse(polygonData)?.geometryArr);
+    }
+
+    // 再设置地图中心位置,确保视图在 mapCenter
+    drawRegionMap.setMapPosition(convertPointToArray(point));
+});
+
+onDeactivated(() => {
+    drawRegionMap.clearLayer()
+})
+const goBack = () => {
+    // drawRegionMap.clearLayer()
+    router.back()
+};
+
+const onTerrainRouteConfirm = () => {
+    if (terrainPopupType.value === "terrainRoute") {
+        setTimeout(() => {
+            terrainPopupType.value = "terrainRouteSuccess";
+            showTerrainRoutePopup.value = true;
+        }, 1000);
+    } else {
+        showTerrainRoutePopup.value = false;
+        router.back();
+    }
+};
+
+const confirm = () => {
+    if (type.value === "droneConsult") {
+        terrainPopupType.value = "terrainRoute";
+        showTerrainRoutePopup.value = true;
+    }
+    // const polygonData = drawRegionMap.getAreaGeometry();
+    // sessionStorage.setItem("drawRegionPolygonData", JSON.stringify(polygonData));
+    // router.back();
+};
+</script>
+
+<style lang="scss" scoped>
+.edit-map {
+    width: 100%;
+    height: 100vh;
+    overflow: hidden;
+
+    .edit-map-content {
+        width: 100%;
+        height: 100%;
+        position: relative;
+
+        .edit-map-tip {
+            position: absolute;
+            top: 23px;
+            left: calc(50% - 256px / 2);
+            z-index: 1;
+            font-size: 12px;
+            color: #fff;
+            padding: 9px 20px;
+            background: rgba(0, 0, 0, 0.5);
+            border-radius: 20px;
+        }
+
+        .map-container {
+            width: 100%;
+            height: 100%;
+        }
+
+        .edit-map-footer {
+            position: absolute;
+            bottom: 80px;
+            left: 12px;
+            width: calc(100% - 24px);
+            display: flex;
+            flex-direction: column;
+            align-items: flex-end;
+
+            .footer-back {
+                padding: 6px 7px 9px;
+                background: #fff;
+                border-radius: 8px;
+
+                .back-icon {
+                    width: 20px;
+                    height: 18px;
+                }
+            }
+
+            .footer-address-box {
+                width: 100%;
+                box-sizing: border-box;
+                margin: 19px 0 14px 0;
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+                background: #fff;
+                border-radius: 14px;
+                padding: 14px 12px;
+
+                .footer-address {
+                    font-size: 12px;
+                    color: rgba(0, 0, 0, 0.6);
+
+                    .address-title {
+                        font-weight: 500;
+                        font-size: 16px;
+                        color: #000;
+                    }
+                }
+
+                .address-btn {
+                    color: #2199f8;
+                    border: 1px solid #2199f8;
+                    border-radius: 25px;
+                    padding: 6px 10px;
+                    flex: none;
+                }
+            }
+
+            .edit-map-footer-btn {
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                width: 100%;
+                gap: 8px;
+
+                div {
+                    flex: 1;
+                    max-width: 100px;
+                    text-align: center;
+                    color: #666666;
+                    font-size: 14px;
+                    padding: 8px 0;
+                    border-radius: 25px;
+                    background: #fff;
+                }
+
+                .btn-confirm {
+                    background: #000;
+                    background-image: linear-gradient(180deg, #76c3ff 0%, #2199f8 100%);
+                    color: #fff;
+                }
+            }
+        }
+    }
+}
+</style>

+ 0 - 32
src/views/old_mini/interactionList/drawRegion.vue

@@ -16,15 +16,10 @@
             </div>
         </div>
     </div>
-
-    <!-- 地形/建模航线提示弹窗(复用 droneConsultPopup:terrainRoute 立即获取 → terrainRouteSuccess 航线已生成) -->
-    <drone-consult-popup v-model:show="showTerrainRoutePopup" :type="terrainPopupType"
-        @confirm="onTerrainRouteConfirm" />
 </template>
 
 <script setup>
 import customHeader from "@/components/customHeader.vue";
-import DroneConsultPopup from "@/components/popup/droneConsultPopup.vue";
 import { ref, onMounted, onActivated, onDeactivated } from "vue";
 import DrawRegionMap from "./map/drawRegionMap.js";
 import { useRouter, useRoute } from "vue-router";
@@ -37,17 +32,11 @@ const mapContainer = ref(null);
 const drawRegionMap = new DrawRegionMap();
 
 const type = ref(null);
-const showTerrainRoutePopup = ref(false);
-/** 弹窗类型:terrainRoute 立即获取 | terrainRouteSuccess 航线已生成 */
-const terrainPopupType = ref("terrainRoute");
 
 onMounted(() => {
     type.value = route.query.type;
     const point = route.query.mapCenter || "POINT (113.6142086995688 23.585836479509055)";
     drawRegionMap.initMap(point, mapContainer.value);
-    if (route.query.showTerrainPopup === "1") {
-        showTerrainRoutePopup.value = true;
-    }
 
     // 地图初始化之后(比如 initPreviewMap 里)
     const regions = [
@@ -78,10 +67,6 @@ onActivated(() => {
 
     // 再设置地图中心位置,确保视图在 mapCenter
     drawRegionMap.setMapPosition(convertPointToArray(point));
-
-    if (route.query.showTerrainPopup === "1") {
-        showTerrainRoutePopup.value = true;
-    }
 });
 
 onDeactivated(() => {
@@ -109,24 +94,7 @@ const deletePolygon = () => {
     });
 };
 
-const onTerrainRouteConfirm = () => {
-    if (terrainPopupType.value === "terrainRoute") {
-        setTimeout(() => {
-            terrainPopupType.value = "terrainRouteSuccess";
-            showTerrainRoutePopup.value = true;
-        }, 1000);
-    } else {
-        showTerrainRoutePopup.value = false;
-        router.back();
-    }
-};
-
 const confirm = () => {
-    if (type.value === "droneConsult") {
-        terrainPopupType.value = "terrainRoute";
-        showTerrainRoutePopup.value = true;
-        return;
-    }
     const polygonData = drawRegionMap.getAreaGeometry();
     sessionStorage.setItem("drawRegionPolygonData", JSON.stringify(polygonData));
     router.back();

+ 18 - 7
src/views/old_mini/interactionList/index.vue

@@ -112,10 +112,10 @@
         <div class="empty-data" v-if="!loading && listData.length === 0">暂无数据</div>
     </div>
 
-    <div class="custom-bottom-fixed-btns" :class="{ 'center-btn': true}">
-        <!-- <div class="bottom-btn secondary-btn" @click="handleShowDroneConsultPopup">获取自动飞行航线</div>
-        <div class="bottom-btn secondary-btn">邀请农情互动</div> -->
-        <div class="bottom-btn primary-btn" @click="handleSubmitAll">一键提交</div>
+    <div class="custom-bottom-fixed-btns" :class="{ 'center-btn': false }">
+        <div class="bottom-btn secondary-btn" @click="handleShowDroneConsultPopup">获取自动飞行航线</div>
+        <div class="bottom-btn secondary-btn">邀请农情互动</div>
+        <!-- <div class="bottom-btn primary-btn" @click="handleSubmitAll">一键提交</div> -->
     </div>
 
     <!-- 农场信息完善弹窗 -->
@@ -157,6 +157,9 @@
 
     <!-- 查看更多弹窗 -->
     <more-popup ref="morePopupRef" />
+
+    <tip-popup v-model:show="showTipPopup" type="success" text="2025.02.05农情报告已生成
+请点击查看" buttonText="查看报告" @confirm="handleBtn" :zIndex="9999" />
 </template>
 <script setup>
 import { ref, onMounted, onActivated } from "vue";
@@ -173,13 +176,20 @@ import DrawRegionMap from "./map/drawRegionMap.js";
 import UploadFile from "@/utils/upliadFile";
 import { getFileExt } from "@/utils/util";
 import MorePopup from "./components/morePopup.vue";
+import tipPopup from "@/components/popup/tipPopup.vue";
+
+
+const showTipPopup = ref(false)
+const handleBtn = () => {
+    console.log('00')
+}
 
 
 const showDroneConsultPopup = ref(false);
 const handleShowDroneConsultPopup = () => {
     // showDroneConsultPopup.value = true;
     router.push(
-        `/draw_region?type=droneConsult`
+        `/confirm_area`
     );
 }
 
@@ -723,9 +733,10 @@ const handleSubmitAll = () => {
     }
 }
 
-.center-btn{
+.center-btn {
     justify-content: center;
-    .primary-btn{
+
+    .primary-btn {
         padding: 10px 32px;
         background: #2199F8;
     }