shuhao 7 часов назад
Родитель
Сommit
ea05d421de

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

@@ -27,4 +27,9 @@ module.exports = {
         url: config.base_dev_url + "chat/sessionListByFarm",
         type: "get",
     },
+    //获取帖子详情
+    postDetail: {
+        url: config.base_dev_url + "bbs_post/detail",
+        type: "get",
+    }
 }

+ 6 - 0
src/router/globalRoutes.js

@@ -427,6 +427,12 @@ export default [
         meta: { showTabbar: true, keepAlive: true },
         component: () => import("@/views/old_mini/growth_report/index.vue"),
     },
+    // 历史风险报告
+    {
+        path: "/history_risk_report",
+        name: "HistoryRiskReport",
+        component: () => import("@/views/old_mini/growth_report/historyRiskReport.vue"),
+    },
     // 咨询专家
     {
         path: "/consult",

+ 86 - 0
src/views/old_mini/growth_report/historyRiskReport.vue

@@ -0,0 +1,86 @@
+<template>
+    <div class="history-risk-report-page">
+        <custom-header name="历史风险报告" isGoBack @goback="handleGoBack"></custom-header>
+        <div v-loading="loading" class="history-risk-report-content">
+            <div v-if="reportContent" class="rich-text" v-html="reportContent"></div>
+            <div v-else-if="!loading" class="empty-text">暂无内容</div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { onActivated, onMounted, ref } from "vue";
+import { useRouter } from "vue-router";
+import customHeader from "@/components/customHeader.vue";
+
+const router = useRouter();
+const loading = ref(false);
+const reportContent = ref("");
+
+const getReportDetail = () => {
+    loading.value = true;
+    VE_API.bbs
+        .postDetail({ id: "829511846204542976" })
+        .then((res) => {
+            reportContent.value = res?.data?.content || "";
+        })
+        .finally(() => {
+            loading.value = false;
+        });
+};
+
+const handleGoBack = () => {
+    if (window.history.length > 1) {
+        router.back();
+        return;
+    }
+    router.replace("/growth_report");
+};
+
+onMounted(() => {
+    getReportDetail();
+});
+
+onActivated(() => {
+    getReportDetail();
+});
+</script>
+
+<style scoped lang="scss">
+.history-risk-report-page {
+    width: 100%;
+    min-height: 100vh;
+    background: #ffffff;
+
+    .history-risk-report-content {
+        min-height: calc(100vh - 40px);
+        padding: 12px 16px 20px;
+        box-sizing: border-box;
+    }
+
+    .rich-text {
+        font-size: 14px;
+        line-height: 1.75;
+        color: #333333;
+        word-break: break-word;
+
+        ::v-deep(img) {
+            max-width: 100%;
+            height: auto;
+            border-radius: 6px;
+        }
+
+        ::v-deep(table) {
+            width: 100% !important;
+            table-layout: fixed;
+        }
+    }
+
+    .empty-text {
+        padding-top: 40px;
+        text-align: center;
+        color: #999999;
+        font-size: 14px;
+    }
+}
+</style>

+ 58 - 4
src/views/old_mini/growth_report/index.vue

@@ -6,7 +6,14 @@
         <weather-info ref="weatherInfoRef" from="growth_report" class="weather-info" @weatherExpanded="weatherExpanded"
             @changeGarden="changeGarden" :isGarden="true"></weather-info>
         <div class="report-content-wrap" v-if="hasReport" v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.1)">
-            <swipe ref="swipeRef" class="my-swipe" :loop="false" indicator-color="white" @change="handleSwipeChange">
+          <div class="history-risk-report-btn" @click="handleHistoryRiskReportClick">
+            <span class="risk-report-icon">
+              <i></i>
+            </span>
+            <span class="risk-report-text">历史风险报告</span>
+          </div>
+
+          <swipe ref="swipeRef" class="my-swipe" :loop="false" indicator-color="white" @change="handleSwipeChange">
                 <swipe-item v-for="(item, index) in regionsData" :key="index">
                     <div class="report-content has-report" :style="{ minHeight: `calc(100vh - ${tabBarHeight}px)` }">
                         <!-- <img src="@/assets/img/home/qrcode.png" alt="" class="code-icon" /> -->
@@ -39,7 +46,7 @@
                                         :class="'today-'+card.color"
                                         @click="handleTodayPatrolFocusClick(card)"
                                         >
-                                        <!-- <badge class="status-badge" dot 
+                                        <!-- <badge class="status-badge" dot
                                             :offset="[80, -10]">
                                         </badge> -->
                                         <div class="status-title">
@@ -65,7 +72,7 @@
                                         :class="card.type"
                                         @click="handlePendingFarmWorkClick(card)"
                                         >
-                                        <!-- <badge class="status-badge" dot 
+                                        <!-- <badge class="status-badge" dot
                                             :offset="[80, -10]">
                                         </badge> -->
                                         <div v-if="card.executionLimitDays || card.executionLimitDays === 0" class="tag-name" :style="{ borderColor: card.purposeColor, color: card.purposeColor }">限时 {{ card.executionLimitDays }} 天</div>
@@ -264,6 +271,10 @@ const handleAddFarm = () => {
     router.push(`/create_farm?from=growth_report&isReload=true`);
 }
 
+const handleHistoryRiskReportClick = () => {
+    router.push("/history_risk_report");
+}
+
 const todayPatrolFocus = ref([]);
 const pendingFarmWork = ref([]);
 const handlePendingFarmWorkClick = (card) => {
@@ -438,6 +449,49 @@ onUnmounted(() => {
         box-sizing: border-box;
         position: relative;
 
+        .history-risk-report-btn {
+            position: absolute;
+            right: 0px;
+            top: 110px;
+            z-index: 13;
+            height: 26px;
+            padding: 0 10px 0 8px;
+            display: inline-flex;
+            align-items: center;
+            gap: 4px;
+            color: #ffffff;
+            font-size: 14px;
+            border-radius: 13px 0 0 13px;
+            background: linear-gradient(180deg, #60c2ff 0%, #2199f8 100%);
+            box-shadow: 0 2px 6px rgba(33, 153, 248, 0.3);
+            cursor: pointer;
+
+            .risk-report-icon {
+                width: 14px;
+                height: 14px;
+                border-radius: 2px;
+                background: #ffffff;
+                position: relative;
+                display: inline-flex;
+                align-items: center;
+                justify-content: center;
+                transform: rotate(-12deg);
+
+                i {
+                    width: 8px;
+                    height: 2px;
+                    border-radius: 2px;
+                    background: #42a7ff;
+                    box-shadow: 0 3px 0 #42a7ff;
+                }
+            }
+
+            .risk-report-text {
+                line-height: 1;
+                white-space: nowrap;
+            }
+        }
+
         .bottom-btn {
             z-index: 2;
             position: fixed;
@@ -776,7 +830,7 @@ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
                 grid-template-columns: repeat(3, 1fr);
                 gap: 6px;
 
-                
+
 
                 .status-card {
                     border-radius: 2px;

+ 31 - 1
src/views/old_mini/youwei_trace/index.vue

@@ -1,4 +1,5 @@
 <template>
+    <!--
     <div class="youwei-trace-page" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
         <empty
             image="https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png"
@@ -6,18 +7,32 @@
             description="该页面正在升级,敬请期待..."
         />
     </div>
+    -->
+    <div class="youwei-trace-page" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
+        <img
+            class="trace-long-img"
+            src="https://birdseye-img.sysuimars.com/birdseye-look-vue/zj/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20260407220906_3750_42.png"
+            alt="有味溯源"
+        />
+    </div>
 </template>
 
 <script setup>
+// import { computed } from "vue";
+// import { useStore } from "vuex";
+// import { Empty } from "vant";
+//
+// const store = useStore();
+// const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 import { computed } from "vue";
 import { useStore } from "vuex";
-import { Empty } from "vant";
 
 const store = useStore();
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 </script>
 
 <style scoped lang="scss">
+/*
 .youwei-trace-page {
     width: 100%;
     height: 100%;
@@ -26,4 +41,19 @@ const tabBarHeight = computed(() => store.state.home.tabBarHeight);
     justify-content: center;
     box-sizing: border-box;
 }
+*/
+
+.youwei-trace-page {
+    width: 100%;
+    height: 100%;
+    overflow-y: auto;
+    -webkit-overflow-scrolling: touch;
+    background: #ffffff;
+}
+
+.trace-long-img {
+    width: 100%;
+    height: auto;
+    display: block;
+}
 </style>