|
|
@@ -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();
|
|
|
});
|
|
|
|