Forráskód Böngészése

feat:对接农情采集弹窗接口

wangsisi 2 napja
szülő
commit
dfac66eaa4

+ 2 - 2
src/components/popup/agriExecutePopup.vue

@@ -8,13 +8,13 @@
     >
         <div class="popup-content">
             <!-- 头部区域 -->
-            <div class="popup-header">
+            <!-- <div class="popup-header">
                 <img class="expert-logo" src="@/assets/img/mine/expert-icon.png" alt="" />
                 <div class="expert-info">
                     <span>{{ popupData.expertName || "韦帮稳" }}专家</span>
                     <span class="invite-text">邀请您</span>
                 </div>
-            </div>
+            </div> -->
 
             <!-- 标题 -->
             <div class="popup-title">{{ popupData.title }}</div>

+ 0 - 16
src/views/old_mini/home/index.vue

@@ -238,7 +238,6 @@ onActivated(() => {
             query: { reload: route.query.reload },
         });
     }
-    checkHasUnrepliedTriggeredInteraction();
 });
 
 const userType = ref(localStorage.getItem("USER_TYPE"));
@@ -252,21 +251,6 @@ onMounted(() => {
     }
 });
 
-const checkHasUnrepliedTriggeredInteraction = async () => {
-    const { data } = await VE_API.home.hasUnrepliedTriggeredInteraction({ farmId: localStorage.getItem("selectedFarmId") });
-    if (data && data.interactionTypeName?.length) {
-        agriExecuteData.value = {
-            expertName: data.expertName || "韦帮稳",
-            title: data.interactionTypeName || "新梢长势评估",
-            abnormalText: data.reason || '秋梢健壮是来年成花的关键,及时记录新梢萌动时间,可精准预测嫩叶旺长期,便于提前补充营养,防治病虫。',
-            exampleImg: JSON.parse(data.exampleImagesJson)[0],
-            executedButtonText: '开始采集',
-        };
-        showAgriExecutePopup.value = true;
-    }
-};
-
-
 // 查询当前农资店的成员列表(只保留有"任务接单"权限的成员)
 const getManagerList = async () => {
     const { data } = await VE_API.mine.listManagerList({ onlyExecutor: true });

+ 123 - 8
src/views/old_mini/home/subPages/prescriptionPage.vue

@@ -2,7 +2,7 @@
     <div class="prescription-page">
         <div class="prescription-title">
             <img @click="goBack" src="@/assets/img/home/back.png" alt="" />
-            <div class="title-name">农事处方维护单</div>
+            <div class="title-name">农场基本信息</div>
             <div class="title-desc">请认真核对一下内容</div>
         </div>
         <div class="prescription-box">
@@ -28,8 +28,63 @@
                         </el-radio-group>
                     </div>
                 </div>
+                <!-- 农场规模 -->
+                <div class="farm-scale-header">
+                    <div class="farm-scale-title">请填写您的农场规模</div>
+                    <div class="farm-scale-desc">农闲时可以提供农事服务,获取额外收益</div>
+                </div>
+                <div class="farm-scale-form">
+                    <div class="farm-scale-item">
+                        <label class="farm-scale-label">一般长工人数</label>
+                        <el-input
+                            v-model="farmScale.longTermWorker"
+                            placeholder="请输入人数"
+                            class="farm-scale-input"
+                        >
+                            <template #append>人</template>
+                        </el-input>
+                    </div>
+                    <div class="farm-scale-item">
+                        <label class="farm-scale-label">植保技能人数</label>
+                        <el-input
+                            v-model="farmScale.plantProtection"
+                            placeholder="请输入人数"
+                            class="farm-scale-input"
+                        >
+                            <template #append>人</template>
+                        </el-input>
+                    </div>
+                    <div class="farm-scale-item">
+                        <label class="farm-scale-label">剪枝技能人数</label>
+                        <el-input
+                            v-model="farmScale.pruning"
+                            placeholder="请输入人数"
+                            class="farm-scale-input"
+                        >
+                            <template #append>人</template>
+                        </el-input>
+                    </div>
+                </div>
+                <div class="box-item" v-for="(group, i) in farmScaleList" :key="i">
+                    <div class="item-name">
+                        <span class="required-icon">*</span>
+                        <span>{{ group.name }}</span>
+                    </div>
+                    <div class="tips">{{ group.subName }}</div>
+                    <div class="item-checkbox">
+                        <el-radio-group v-model="group.checked">
+                            <el-radio-button
+                                v-for="(item, index) in group.items"
+                                :key="index"
+                                :label="item.name"
+                                :value="item.name"
+                            />
+                        </el-radio-group>
+                    </div>
+                </div>
             </div>
         </div>
+        
         <!-- <div class="prescription-box">
             <div class="box-title">
                 <img src="@/assets/img/home/label-icon.png" />
@@ -74,6 +129,8 @@ const productList = ref([
     { name: "请选择您的果园土壤类型", subName:'土壤类型确认最佳施肥策略',items: [{ name: "砂质土" }, { name: "黏质土" }, { name: "壤土" }] },
     { name: "请选择您的灌溉方式",subName:'处方执行方式,根据您的灌溉设施确定', items: [{ name: "人工浇灌" }, { name: "人工喷灌" }, { name: "微喷灌" },{name:'滴灌'}] },
     { name: "请选择您的农机设备",subName:'农机可以加入农机租赁库,在农闲时获取额外收益', items: [{ name: "植保无人机" }, { name: "骑乘式割草机" },{name:'乘坐式喷药机'},{name:'果园运输车'},{name:'果园碎枝机'},{name:'农用吊运无人机'}] },
+]);
+const farmScaleList = ref([
     { name: "您最想改善的方向",items: [{ name: "病虫防治" }, { name: "树势不良" }, { name: "土壤板结" },{name:'保花保果'},{name:'品种改良'},{name:'树体剪枝'},{name:'果园规划'}] },
 ]);
 const outputList = ref([
@@ -86,6 +143,12 @@ const outputList = ref([
 // 默认选中前两项
 const outputVal = ref([]);
 const disasterDesc = ref("");
+// 农场规模
+const farmScale = ref({
+    longTermWorker: "",
+    plantProtection: "",
+    pruning: "",
+});
 // 初始化默认选中第一项
 onActivated(() => {
     // outputVal.value = outputList.value.length >= 2
@@ -198,6 +261,7 @@ const handlePage = () => {
                     align-items: center;
                     font-size: 15px;
                     color: rgba(0, 0, 0, 0.9);
+                    font-weight: 500;
                     .required-icon {
                         color: #ff0000;
                         font-size: 16px;
@@ -213,16 +277,20 @@ const handlePage = () => {
                     ::v-deep {
                         .el-radio-button,
                         .el-checkbox-button {
-                            margin: 10px 7px 0 0;
+                            margin: 10px 0 0 7px;
                             .el-radio-button__inner,
                             .el-checkbox-button__inner {
                                 border: none;
-                                background: #f1f1f1;
-                                border-radius: 8px;
-                                padding: 13px 21px;
-                                border: 1px solid rgba(255, 255, 255, 0);
+                                border-radius: 6px;
+                                // padding: 13px 21px;
+                                height: 43px;
+                                width: 107px;
+                                display: flex;
+                                align-items: center;
+                                justify-content: center;
+                                border: 1px solid #EBEBEB;
                                 color: #000000;
-                                font-size: 15px;
+                                background: rgba(241, 241, 241, 0.12);
                                 font-weight: 400;
                             }
                             &.is-active,
@@ -244,7 +312,6 @@ const handlePage = () => {
                                     color: #2199f8 !important;
                                     border: 1px solid #2199f8 !important;
                                     box-shadow: none;
-                                    font-weight: 500;
                                 }
                             }
                             &.is-active {
@@ -266,6 +333,54 @@ const handlePage = () => {
                                 }
                             }
                         }
+
+                        .el-radio-button:nth-child(3n-2){
+                            margin-left: 0;
+                        }
+                    }
+                }
+            }
+        }
+        /* 农场规模(与农场情况同一卡片内) */
+        .farm-scale-header {
+            margin-top: 16px;
+            .farm-scale-title {
+                font-size: 15px;
+                font-weight: 500;
+                color: rgba(0, 0, 0, 0.9);
+            }
+            .farm-scale-desc {
+                font-size: 13px;
+                color: rgba(0, 0, 0, 0.4);
+            }
+        }
+        .farm-scale-form {
+            margin-top: 10px;
+            .farm-scale-item {
+                display: flex;
+                align-items: center;
+                margin-bottom: 14px;
+                &:last-child {
+                    margin-bottom: 0;
+                }
+                .farm-scale-label {
+                    flex-shrink: 0;
+                    width: 110px;
+                    font-size: 14px;
+                    color: rgba(0, 0, 0, 0.9);
+                    margin-right: 12px;
+                }
+                .farm-scale-input {
+                    flex: 1;
+                    ::v-deep .el-input-group__append {
+                        padding: 0 12px;
+                        background: #f5f7fa;
+                        color: rgba(0, 0, 0, 0.65);
+                        border-color: #dcdfe6;
+                        border-radius: 0 4px 4px 0;
+                    }
+                    ::v-deep .el-input__inner {
+                        border-radius: 4px 0 0 4px;
                     }
                 }
             }

+ 48 - 19
src/views/old_mini/monitor/index.vue

@@ -4,14 +4,8 @@
         <!-- 天气遮罩 -->
         <div class="weather-mask" v-show="isExpanded" @click="handleMaskClick"></div>
         <!-- 天气 -->
-        <weather-info
-            ref="weatherInfoRef"
-            class="weather-info"
-            @weatherExpanded="weatherExpanded"
-            @changeGarden="changeGarden"
-            :isGarden="true"
-            :gardenId="defaultGardenId"
-        ></weather-info>
+        <weather-info ref="weatherInfoRef" class="weather-info" @weatherExpanded="weatherExpanded"
+            @changeGarden="changeGarden" :isGarden="true" :gardenId="defaultGardenId"></weather-info>
         <!-- 作物档案 -->
         <div class="archives-time-line">
             <div class="archives-time-line-header">
@@ -23,7 +17,9 @@
                     <div class="box-content">
                         <div class="box-title">
                             <span>农情互动报告</span>
-                            <el-icon><CaretRight /></el-icon>
+                            <el-icon>
+                                <CaretRight />
+                            </el-icon>
                         </div>
                         <span class="box-text">当前处于蒂蛀虫高发期,请及时采集</span>
                     </div>
@@ -36,14 +32,12 @@
         </div>
     </div>
 
-    <tip-popup
-        v-model:show="showFarmPopup"
-        type="success"
-        text="农场领取成功"
-        :overlay-style="{ 'backdrop-filter': 'blur(4px)' }"
-        :closeOnClickOverlay="false"
-        :zIndex="9999"
-    />
+    <tip-popup v-model:show="showFarmPopup" type="success" text="农场领取成功"
+        :overlay-style="{ 'backdrop-filter': 'blur(4px)' }" :closeOnClickOverlay="false" :zIndex="9999" />
+
+    <!-- 农事执行弹窗 -->
+    <agri-execute-popup v-model:show="showAgriExecutePopup" :popupData="agriExecuteData"
+        @executed="handleAgriExecuted" />
 </template>
 
 <script setup>
@@ -57,6 +51,28 @@ import farmInfoPopup from "../home/components/farmInfoPopup.vue";
 import tipPopup from "@/components/popup/tipPopup.vue";
 import { ElMessage, ElMessageBox } from "element-plus";
 import ArchivesFarmTimeLine from "@/components/pageComponents/ArchivesFarmTimeLine.vue";
+import agriExecutePopup from "@/components/popup/agriExecutePopup.vue";
+
+const showAgriExecutePopup = ref(false); // 农事执行弹窗
+const agriExecuteData = ref({});
+const handleAgriExecuted = () => {
+    showAgriExecutePopup.value = false;
+    // router.push("/interaction_list?expertMiniUserId=81881&oldUser=true");
+    router.push("/interaction_list?expertMiniUserId=81881");
+};
+
+const checkHasUnrepliedTriggeredInteraction = async () => {
+    const { data } = await VE_API.home.hasUnrepliedTriggeredInteraction({ farmId: localStorage.getItem("selectedFarmId") });
+    if (data && data.id != null) {
+        agriExecuteData.value = {
+            title: data.interactionTypeName,
+            abnormalText: data.reason,
+            exampleImg: JSON.parse(data.exampleImagesJson)[0],
+            executedButtonText: '开始采集',
+        };
+        showAgriExecutePopup.value = true;
+    }
+};
 
 const showFarmPopup = ref(false); // 农场领取成功弹窗
 const date = ref(new Date());
@@ -74,6 +90,7 @@ onActivated(() => {
         // 统一转换为布尔值
         isDefaultFarm.value = route.query.defaultFarm === "true" || route.query.defaultFarm === true;
     }
+    checkHasUnrepliedTriggeredInteraction();
 });
 
 const receiveFarm = (json) => {
@@ -300,7 +317,6 @@ onMounted(() => {
         finished.value = false;
         broadcastList.value = [];
         getStayCount();
-        // 不在这里手动加载,让 List 组件的 immediate-check 自动触发首次加载
     }
 });
 
@@ -314,6 +330,7 @@ const changeGarden = ({ id }) => {
     broadcastList.value = [];
     getStayCount();
     getBroadcastList(1, false);
+    checkHasUnrepliedTriggeredInteraction();
 };
 
 function handlePage(url) {
@@ -337,6 +354,7 @@ function handlePage(url) {
     padding: 13px 10px;
     box-sizing: border-box;
     background: linear-gradient(180deg, #f9f9f9 0%, #f0f8ff 31.47%, #f9f9f9 46.81%, #f9f9f9 69.38%, #f9f9f9 100%);
+
     .weather-mask {
         position: fixed;
         top: 0;
@@ -346,23 +364,28 @@ function handlePage(url) {
         background-color: rgba(0, 0, 0, 0.52);
         z-index: 2;
     }
+
     .weather-info {
         width: calc(100% - 20px);
         position: absolute;
         z-index: 3;
     }
+
     .archives-time-line {
         position: relative;
         margin-top: 96px;
         height: calc(100% - 90px);
+
         .archives-time-line-header {
             display: flex;
             align-items: center;
             justify-content: space-between;
+
             .line-title {
                 position: relative;
                 padding-left: 14px;
                 font-size: 16px;
+
                 &::before {
                     content: "";
                     position: absolute;
@@ -376,6 +399,7 @@ function handlePage(url) {
                 }
             }
         }
+
         .archives-time-line-content {
             margin-top: 10px;
             height: calc(100% - 35px);
@@ -383,6 +407,7 @@ function handlePage(url) {
             border-radius: 8px;
             padding: 10px;
             box-sizing: border-box;
+
             .report-box {
                 background: linear-gradient(120deg, #eef8ff, #bbe3ff);
                 border-radius: 4px;
@@ -391,6 +416,7 @@ function handlePage(url) {
                 align-items: center;
                 justify-content: space-between;
                 margin-bottom: 12px;
+
                 .box-content {
                     .box-title {
                         font-size: 16px;
@@ -400,16 +426,19 @@ function handlePage(url) {
                         display: flex;
                         align-items: center;
                     }
+
                     .box-text {
                         color: #4e5969;
                     }
                 }
+
                 .report-icon {
                     width: 120px;
                     height: 85px;
                 }
             }
-            .time-line{
+
+            .time-line {
                 height: calc(100% - 100px);
             }
         }