Browse Source

Merge branch 'farmer' of http://www.sysuimars.cn:3000/feiniao/feiniao-farm-h5 into farmer

lxf 2 days ago
parent
commit
5a4caa367e

+ 58 - 12
src/components/pageComponents/ArchivesFarmTimeLine.vue

@@ -59,9 +59,9 @@
                                                 </el-icon>
                                             </div>
                                         </div>
-                                        <div class="title-wrap van-ellipsis" v-show="shouldShowBlue(p)">
-                                            <div class="title-text" v-if="fw.flowStatus != null">{{ fw.flowStatus ==
-                                                3 ? '待认证' : '已过期' }}</div>
+                                        <div class="title-wrap van-ellipsis">
+                                            <div class="title-text" v-if="fw.flowStatus != null && fw.flowStatus != 0">{{ flowStatusStr[fw.flowStatus] }}</div>
+                                            <div class="title-text blue-tag" v-if="fw.flowStatus != null && fw.flowStatus != 0">限时溯源</div>
                                         </div>
                                     </div>
                                     <div class="card-right"
@@ -566,7 +566,7 @@ const getArrangeStatusClass = (fw) => {
     const t = props.pageType === 'agri_record' ? fw?.flowStatus : fw?.sourceType;
     if (props.pageType === 'agri_record') {
         if (t == null || t == 0) return "status-default";
-        if (t == 3) return "status-complete";
+        if (t == 3) return "status-warning-bg";
         return "status-act";
     } else {
         if (t == 10) return "status-complete";
@@ -826,14 +826,17 @@ const handleStatusDetail = (fw) => {
     // 跳转前记录当前滚动位置
     saveTimelineScrollTop();
     if (props.pageType === 'agri_plan') {
-        router.push({
-            path: "/agricultural_detail",
-            query: {
-                farmId: props.farmId,
-                regionId: props.regionId,
-                date: fw?.createTime?.slice(0, 10)
-            },
-        });
+        if (fw?.sourceData && fw?.id) {
+            router.push({
+                path: "/agricultural_detail",
+                query: {
+                    farmId: props.farmId,
+                    regionId: props.regionId,
+                    date: fw?.createTime?.slice(0, 10),
+                    content: fw?.content
+                },
+            });
+        }
     } else {
         router.push({
             path: "/work_detail",
@@ -925,8 +928,24 @@ const getPhenologyTermProgress = (phenologyProgress) => {
     return matchedTermProgress;
 };
 
+const flowStatusStr = {
+    '3': '待认证',
+    '-1': '已过期',
+    '2': '已认证',
+}
+
 // 判断物候期是否应该显示蓝色(已过或当前节气的物候期)
 const shouldShowBlue = (phenology) => {
+    // 农事记录页兼容:只要该物候期下存在待认证农事,左侧生育期/物候期均高亮为蓝色
+    if (props.pageType === "agri_record") {
+        const hasPendingAuth = (Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : []).some((reproductive) =>
+            (Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : []).some((fw) => Number(fw?.flowStatus) === 3)
+        );
+        if (hasPendingAuth) {
+            return true;
+        }
+    }
+
     // 优先使用物候期真实日期判断:未来日期不应显示蓝色
     const phenologyTimeMs =
         Number(phenology?.startTimeMs) ||
@@ -1243,6 +1262,11 @@ watch(
                                         font-size: 12px;
                                         color: #B7B7B7;
                                     }
+
+                                    .blue-tag{
+                                        color: #2199F8;
+                                        background: rgba(33, 153, 248, 0.1);
+                                    }
                                 }
                             }
                         }
@@ -1347,6 +1371,28 @@ watch(
                     }
                 }
 
+                .arrange-card.status-warning-bg {
+                    border-color: #FF943D;
+
+                    .card-left {
+                        .left-info {
+                            .left-date {
+                                color: #FF943D;
+                                border-color: #FF943D;
+                            }
+                        }
+
+                        .title-text {
+                            color: #fff;
+                            background: #FF943D;;
+                        }
+                    }
+
+                    &::before {
+                        border-right-color: #FF943D;
+                    }
+                }
+
                 .arrange-card.status-act {
                     border-color: #FF953D;
 

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

@@ -1,6 +1,6 @@
 <template>
-    <custom-header :isClose="showClose" name="农情互动" bgColor="#f2f4f5"></custom-header>
-    <div class="interaction-list-wrapper">
+    <custom-header v-if="!showClose" name="农情互动" bgColor="#f2f4f5"></custom-header>
+    <div class="interaction-list-wrapper" :class="{ 'show-close': !showClose }">
         <div class="interaction-card" v-if="showClose">
             <img v-if="listData[0]?.coverUrl" :src="listData[0]?.coverUrl" alt="">
             <div class="card-content">
@@ -756,6 +756,9 @@ const handleSubmitAll = () => {
     padding: 12px;
     box-sizing: border-box;
     overflow-y: auto;
+    &.show-close{
+        height: 100vh;
+    }
     .interaction-card{
         background: #ffffff;
         border-radius: 6px;

+ 2 - 2
src/views/old_mini/monitor/subPages/agriculturalDetail.vue

@@ -7,7 +7,7 @@
             <div class="card-wrap">
                 <div class="card-box sampling-card">
                     <div class="sampling-title">采样时间: {{ imgInfo.samplingTime }}</div>
-                    <div class="sampling-desc">本次飞巡采样了1区、2区和5区,拍摄了 120棵树</div>
+                    <div class="sampling-desc">本次飞巡采样{{ imgInfo.regions }},拍摄了 {{ imgInfo.total }} 棵树</div>
                 </div>
             </div>
 
@@ -15,7 +15,7 @@
             <div class="card-wrap">
                 <div class="card-box photo-card">
                     <div class="card-title">农情照片</div>
-                    <div class="ratio-tip">出现新梢的果树占比为5%</div>
+                    <div class="ratio-tip">{{ route.query.content }}</div>
                     <div class="photo-grid">
                         <div
                             v-for="photo in imgInfo.imageList"