فهرست منبع

fix: 长势报告

lxf 1 روز پیش
والد
کامیت
a2860c03dc

+ 2 - 2
src/App.vue

@@ -66,8 +66,8 @@
                     <img
                         :src="
                             props.active
-                                ? require('@/assets/img/tab_bar/task-active.png')
-                                : require('@/assets/img/tab_bar/task.png')
+                                ? require('@/assets/img/tab_bar/farm-active.png')
+                                : require('@/assets/img/tab_bar/farm.png')
                         "
                     />
                 </template>

BIN
src/assets/img/tab_bar/farm-active.png


BIN
src/assets/img/tab_bar/farm.png


BIN
src/assets/img/tab_bar/home-active.png


BIN
src/assets/img/tab_bar/home.png


BIN
src/assets/img/tab_bar/task-active.png


BIN
src/assets/img/tab_bar/task.png


BIN
src/assets/img/tab_bar/tree-active.png


BIN
src/assets/img/tab_bar/tree.png


+ 7 - 5
src/views/old_mini/create_farm/index.vue

@@ -750,11 +750,13 @@ function backgToHome() {
                 url: `/pages/subPages/new_recognize/index?gardenData=${JSON.stringify(dropdownGardenItem.value)}`,
             });
         }
-        const paramsPage = JSON.parse(json.paramsPage);
-        if (paramsPage.isFarmer) {
-            router.replace('/home');
-            return;
-        }
+        
+        json?.from && router.replace(`/${json.from}`);
+        // const paramsPage = JSON.parse(json.paramsPage);
+        // if (paramsPage.isFarmer) {
+        //     router.replace('/home');
+        //     return;
+        // }
     } else {
         if (fromPage && fromPage !== "details") {
             if (route.query.type === "farmer") {

+ 27 - 7
src/views/old_mini/growth_report/index.vue

@@ -167,6 +167,8 @@
                 <div class="swipe-guide-text">左滑查看其它品种报告</div>
             </div>
         </div>
+
+        <tip-popup v-model:show="showBindSuccess" type="success" text="您的农场已绑定成功" />
     </div>
 </template>
 
@@ -174,14 +176,16 @@
 import wx from "weixin-js-sdk";
 import weatherInfo from "@/components/weatherInfo.vue";
 import { ref, onActivated, onDeactivated, onUnmounted, computed } from "vue";
-import { useRoute } from "vue-router";
+import { useRoute, useRouter } from "vue-router";
 import { useStore } from "vuex";
 import { Swipe, SwipeItem, Badge } from 'vant';
+import tipPopup from "@/components/popup/tipPopup.vue";
 
 const store = useStore();
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 
 const route = useRoute();
+const router = useRouter();
 const loading = ref(false);
 const hasReport = ref(false);
 const workItem = ref({
@@ -262,6 +266,7 @@ const todoRows = ref([
 
 
 const paramsPage = ref({});
+const showBindSuccess = ref(false);
 // 天气组件相关
 const isExpanded = ref(false);
 const weatherInfoRef = ref(null);
@@ -288,17 +293,32 @@ const changeGarden = ({ id }) => {
         farmId: id,
     };
     getDetail();
-};
-
-onActivated(() => {
-    window.scrollTo(0, 0);
-    // paramsPage.value = route.query || {};
-    // 首次进入时显示左滑提示(本地仅展示一次)
     const guideKey = "GROWTH_REPORT_SWIPE_GUIDE_SHOWN";
     if (!localStorage.getItem(guideKey)) {
         showSwipeGuide.value = true;
         localStorage.setItem(guideKey, "1");
     }
+};
+
+onActivated(() => {
+    window.scrollTo(0, 0);
+
+    // 如果路由中带有 miniJson,并且其中有 showBind,则展示绑定成功弹窗
+    const { miniJson } = route.query || {};
+    if (miniJson) {
+        try {
+            const parsed = typeof miniJson === "string" ? JSON.parse(miniJson) : miniJson;
+            if (parsed && parsed.showBind) {
+                showBindSuccess.value = true;
+                // 处理完后清空路由中的 miniJson 参数,避免重复弹出
+                const newQuery = { ...(route.query || {}) };
+                delete newQuery.miniJson;
+                router.replace({ path: route.path, query: newQuery });
+            }
+        } catch (e) {
+            // miniJson 解析失败时忽略,不影响正常流程
+        }
+    }
     // getResultReport();
 });