Browse Source

feat:对接农情互动关闭弹窗

wangsisi 6 days ago
parent
commit
dabb644d6b

+ 5 - 0
src/api/modules/monitor.js

@@ -103,4 +103,9 @@ module.exports = {
         url: config.base_dev_url + "container_phenology_interaction/farmWorkPlan",
         type: "get",
     },
+    //关闭当天弹窗:记录该互动在当天已展示过弹窗
+    closeTodayPopup: {
+        url: config.base_dev_url + "container_phenology_interaction/closeTodayUnrepliedInteraction",
+        type: "get",
+    },
 };

+ 23 - 3
src/components/pageComponents/ArchivesFarmTimeLine.vue

@@ -35,7 +35,7 @@
                                         <div class="left-info">
                                             <div class="left-date">{{ formatDate(fw.createTime) }}</div>
                                             <div class="text" @click.stop="handleStatusDetail(fw)">
-                                                <span class="van-ellipsis">{{ shouldShowBlue(p) ? '物候进程' : fw.title }}</span>
+                                                <span class="van-ellipsis">{{ fw.title}}</span>
                                                 <el-icon v-if="shouldShowBlue(p)"><ArrowRight /></el-icon>
                                             </div>
                                             <!-- <div class="text green van-ellipsis" v-if="fw?.sourceType === 7">
@@ -53,7 +53,7 @@
                                             </div>
                                         </div>
                                         <div class="title-wrap van-ellipsis" v-show="shouldShowBlue(p)">
-                                            <div class="title-text">{{ fw.flowStatus == null ? '未激活' : '已激活' }}</div>
+                                            <div class="title-text" v-if="fw.flowStatus != null">{{ fw.flowStatus == null ? '未激活' : '已激活' }}</div>
                                             <!-- <div class="expert-info">
                                                 <el-avatar :size="14" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
                                                 <span>专家下发</span>
@@ -490,7 +490,7 @@ const getArrangeStatusClass = (fw) => {
     const t = props.pageType === 'agri_record' ? fw?.flowStatus : fw?.sourceType;
     if(props.pageType === 'agri_record'){
         if (t == null) return "status-default";
-        return "status-complete";
+        return "status-act";
     }else{
         if (t == 9) return "status-complete";
         if (t == 8 ) return "status-warning";
@@ -1243,6 +1243,26 @@ watch(
                     }
                 }
 
+                .arrange-card.status-act {
+                    border-color: #FF953D;
+
+                    .card-left {
+                        .left-info {
+                            .left-date {
+                                color: #FF953D;
+                                border-color: #FF953D;
+                            }
+                        }
+                        .title-text{
+                            color: #fff;
+                            background: #FF953D;
+                        }
+                    }
+                    &::before {
+                        border-right-color: #FF953D;
+                    }
+                }
+
                 .arrange-card.status-default {
                     border-color: #BBBBBB;
 

+ 13 - 6
src/components/popup/agriExecutePopup.vue

@@ -7,14 +7,15 @@
         teleport="body"
     >
         <div class="popup-content">
+            <div class="popup-tips">为了处方体系更加适应您当前的果园管理</div>
             <!-- 头部区域 -->
-            <!-- <div class="popup-header">
-                <img class="expert-logo" src="@/assets/img/mine/expert-icon.png" alt="" />
+            <div class="popup-header">
+                <img class="expert-logo" :src="popupData?.expertAvatar" alt="" />
                 <div class="expert-info">
-                    <span>{{ popupData.expertName || "韦帮稳" }}专家</span>
-                    <span class="invite-text">邀请您</span>
+                    <span>{{ popupData?.expertName || "韦帮稳" }}专家</span>
+                    <span class="invite-text">邀请您进行农情互动</span>
                 </div>
-            </div> -->
+            </div>
 
             <!-- 标题 -->
             <div class="popup-title">{{ popupData.title }}</div>
@@ -99,6 +100,11 @@ const handleExecuted = () => {
         flex-direction: column;
     }
 
+    .popup-tips{
+        color: rgba(93, 93, 93, 0.8);
+        margin-bottom: 5px;
+    }
+
     .popup-header {
         margin-bottom: 5px;
         display: flex;
@@ -107,12 +113,13 @@ const handleExecuted = () => {
         .expert-logo {
             width: 26px;
             height: 26px;
+            border-radius: 50%;
+            object-fit: cover;
         }
 
         .expert-info {
             font-size: 16px;
             .invite-text {
-                color: #999999;
                 margin-left: 6px;
             }
         }

+ 1 - 1
src/views/old_mini/agri_record/index.vue

@@ -16,7 +16,7 @@
         <div class="archives-time-line">
             <div class="archives-time-line-header">
                 <div class="line-title">农事记录</div>
-                <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" />
+                <!-- <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" /> -->
             </div>
             <div class="archives-time-line-content">
                 <archives-farm-time-line :farmId="gardenId" pageType="agri_record"></archives-farm-time-line>

+ 2 - 2
src/views/old_mini/interactionList/index.vue

@@ -119,9 +119,9 @@
                 :style="{ justifyContent: item.expanded ? 'center' : 'space-between' }">
                 <template v-if="!item.expanded">
                     <span class="proportion-text">{{(item.questionList && item.questionList.length
-                        ? item.questionList.map((q, i) => q + (item.answerValues[i] ?? '') + (item.indicators[i]?.unit
+                        ? item.questionList.map((q, i) => q + ':' + (item.answerValues[i] ?? '') + (item.indicators[i]?.unit
                             ?? item.indicators[0]?.unit ?? '%')).join('')
-                        : item.question + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%')) }}</span>
+                        : item.question + ':' + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%')) }}</span>
                 </template>
                 <div class="toggle-btn" @click="toggleExpand(item)">
                     <span>{{ item.expanded ? "收起" : "展开" }}</span>

+ 13 - 4
src/views/old_mini/monitor/index.vue

@@ -10,7 +10,7 @@
         <div class="archives-time-line">
             <div class="archives-time-line-header" @click="handleJump">
                 <div class="line-title">作物档案</div>
-                <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" />
+                <!-- <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" /> -->
             </div>
             <div class="archives-time-line-content">
                 <div class="report-box">
@@ -37,7 +37,7 @@
 
     <!-- 农事执行弹窗 -->
     <agri-execute-popup v-model:show="showAgriExecutePopup" :popupData="agriExecuteData"
-        @executed="handleAgriExecuted" />
+        @executed="handleAgriExecuted" @close="handleClosePopup" />
 </template>
 
 <script setup>
@@ -62,13 +62,18 @@ const agriExecuteData = ref({});
 const handleAgriExecuted = () => {
     showAgriExecutePopup.value = false;
     // router.push("/interaction_list?expertMiniUserId=81881&oldUser=true");
+    handleClosePopup();
     router.push("/interaction_list?expertMiniUserId=81881");
 };
 
+const expertInfo = ref({});
 const checkHasUnrepliedTriggeredInteraction = async () => {
     const { data } = await VE_API.home.hasUnrepliedTriggeredInteraction({ farmId: localStorage.getItem("selectedFarmId") });
     if (data && data.id != null) {
+        expertInfo.value = data;
         agriExecuteData.value = {
+            expertAvatar: data.expertAvatar,
+            expertName: data.expertName,
             title: data.interactionTypeName,
             abnormalText: data.reason,
             exampleImg: JSON.parse(data.exampleImagesJson)[0],
@@ -319,8 +324,6 @@ onMounted(() => {
         currentPage.value = 1;
         finished.value = false;
         broadcastList.value = [];
-        getStayCount();
-        checkHasUnrepliedTriggeredInteraction();
     }
 });
 
@@ -356,6 +359,12 @@ function handleReportClick() {
         query: { miniJson: JSON.stringify({ id: gardenId.value }) },
     });
 }
+
+const handleClosePopup = () => {
+    VE_API.monitor.closeTodayPopup({
+        interactionId: expertInfo.value.id,
+    });
+}
 </script>
 
 <style scoped lang="scss">