|
|
@@ -5,7 +5,8 @@
|
|
|
<!-- 组件:天气 -->
|
|
|
<div class="weather-info-wrap">
|
|
|
<weather-info ref="weatherInfoRef" from="growth_report" class="weather-info"
|
|
|
- @weatherExpanded="weatherExpanded" @changeGarden="changeGarden" @changeGardenTab="changeGardenTab">
|
|
|
+ :showTabMask="showTabMask" @weatherExpanded="weatherExpanded" @changeGarden="changeGarden"
|
|
|
+ @changeGardenTab="changeGardenTab">
|
|
|
</weather-info>
|
|
|
|
|
|
<!-- 邀请关注 -->
|
|
|
@@ -53,12 +54,12 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 左滑查看更多 -->
|
|
|
- <div class="swipe-more-tag" v-show="currentIndex < regionsData.length - 1">
|
|
|
+ <div class="swipe-more-tag" v-show="regionsData.length > 1 && currentIndex < regionsData.length - 1">
|
|
|
<div>更多分区</div>
|
|
|
左滑查看
|
|
|
</div>
|
|
|
<!-- 右滑查看更多 -->
|
|
|
- <div class="swipe-more-tag" v-show="currentIndex === regionsData.length - 1">
|
|
|
+ <div class="swipe-more-tag" v-show="regionsData.length > 1 && currentIndex === regionsData.length - 1">
|
|
|
<div>更多分区</div>
|
|
|
右滑查看
|
|
|
</div>
|
|
|
@@ -183,6 +184,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- 农场列表引导 -->
|
|
|
+ <div class="mask-wrap" @click="closeTabMask" v-if="showTabMask"></div>
|
|
|
+
|
|
|
<tip-popup v-model:show="showBindSuccess" type="success" text="您的农场已绑定成功" hideBtn />
|
|
|
|
|
|
<start-interact-popup ref="startInteractPopupRef" />
|
|
|
@@ -223,7 +227,10 @@ const weatherInfoRef = ref(null);
|
|
|
|
|
|
// 首次进入页面的左滑提示遮罩
|
|
|
const showSwipeGuide = ref(false);
|
|
|
-
|
|
|
+const showTabMask = ref(false);
|
|
|
+const pendingSwipeGuide = ref(false);
|
|
|
+const TAB_GUIDE_SHOWN_KEY = "GROWTH_REPORT_TAB_GUIDE_SHOWN";
|
|
|
+const SWIPE_GUIDE_KEY = "GROWTH_REPORT_SWIPE_GUIDE_SHOWN";
|
|
|
const weatherExpanded = (isExpandedValue) => {
|
|
|
isExpanded.value = isExpandedValue;
|
|
|
};
|
|
|
@@ -273,6 +280,9 @@ const changeGarden = async ({ id, name }) => {
|
|
|
|
|
|
onActivated(() => {
|
|
|
window.scrollTo(0, 0);
|
|
|
+ // 从新增农场页返回时,优先用缓存中的最新选中农场
|
|
|
+ const savedFarmId = localStorage.getItem("selectedFarmId");
|
|
|
+ selectedGardenId.value = savedFarmId ? Number(savedFarmId) : null;
|
|
|
gardenListRef.value?.refreshFarmList?.();
|
|
|
|
|
|
// 如果路由中带有 miniJson,并且其中有 showBind,则展示绑定成功弹窗
|
|
|
@@ -299,6 +309,15 @@ const closeSwipeGuide = () => {
|
|
|
showSwipeGuide.value = false;
|
|
|
};
|
|
|
|
|
|
+const closeTabMask = () => {
|
|
|
+ showTabMask.value = false;
|
|
|
+ if (pendingSwipeGuide.value) {
|
|
|
+ showSwipeGuide.value = true;
|
|
|
+ pendingSwipeGuide.value = false;
|
|
|
+ localStorage.setItem(SWIPE_GUIDE_KEY, "1");
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const userInfo = localStorage.getItem("localUserInfo");
|
|
|
const userInfoObj = userInfo ? JSON.parse(userInfo) : {};
|
|
|
|
|
|
@@ -394,12 +413,26 @@ const getRegions = async () => {
|
|
|
}).then(({ data }) => {
|
|
|
regionsData.value = data || [];
|
|
|
if (regionsData.value.length > 0) {
|
|
|
- const guideKey = "GROWTH_REPORT_SWIPE_GUIDE_SHOWN";
|
|
|
- if (!localStorage.getItem(guideKey) && regionsData.value.length > 1) {
|
|
|
- showSwipeGuide.value = true;
|
|
|
- localStorage.setItem(guideKey, "1");
|
|
|
- }
|
|
|
hasReport.value = true;
|
|
|
+ const hasShownTabGuide = localStorage.getItem(TAB_GUIDE_SHOWN_KEY) === "1";
|
|
|
+ const needSwipeGuide = !localStorage.getItem(SWIPE_GUIDE_KEY) && regionsData.value.length > 1;
|
|
|
+
|
|
|
+ // 首次进入且有分区数据:先显示农场列表引导;左滑引导在其关闭后再显示
|
|
|
+ if (!hasShownTabGuide) {
|
|
|
+ showTabMask.value = true;
|
|
|
+ localStorage.setItem(TAB_GUIDE_SHOWN_KEY, "1");
|
|
|
+ pendingSwipeGuide.value = needSwipeGuide;
|
|
|
+ } else {
|
|
|
+ showTabMask.value = false;
|
|
|
+ pendingSwipeGuide.value = false;
|
|
|
+ if (needSwipeGuide) {
|
|
|
+ showSwipeGuide.value = true;
|
|
|
+ localStorage.setItem(SWIPE_GUIDE_KEY, "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 切换农场tab回到当前农场tab
|
|
|
+ weatherInfoRef.value && weatherInfoRef.value.handleGardenClick('current');
|
|
|
|
|
|
// 如果不是点击农情报告已生成弹窗过来的,则显示农情互动弹窗
|
|
|
if (!route.query.hideInteraction) {
|
|
|
@@ -436,6 +469,10 @@ const getRegions = async () => {
|
|
|
sessionStorage.removeItem('activeSwipeIndex');
|
|
|
}
|
|
|
} else {
|
|
|
+ // 切换农场tab回到当前农场tab
|
|
|
+ // weatherInfoRef.value && weatherInfoRef.value.handleGardenClick('current');
|
|
|
+ showTabMask.value = false;
|
|
|
+ pendingSwipeGuide.value = false;
|
|
|
hasReport.value = false;
|
|
|
}
|
|
|
});
|
|
|
@@ -459,6 +496,15 @@ onUnmounted(() => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.mask-wrap {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 300px;
|
|
|
+ background-color: rgba(0, 0, 0, 0.52);
|
|
|
+ z-index: 99999;
|
|
|
+}
|
|
|
.achievement-report-page {
|
|
|
width: 100%;
|
|
|
height: 100vh;
|
|
|
@@ -480,7 +526,7 @@ onUnmounted(() => {
|
|
|
position: absolute;
|
|
|
z-index: 12;
|
|
|
left: 10px;
|
|
|
- top: 12px;
|
|
|
+ top: 10px;
|
|
|
|
|
|
.weather-info {
|
|
|
width: 100%;
|
|
|
@@ -512,7 +558,6 @@ onUnmounted(() => {
|
|
|
right: 0;
|
|
|
width: 0px;
|
|
|
height: 0px;
|
|
|
- content: " ";
|
|
|
border-right: 3px solid transparent;
|
|
|
border-top: 3px solid #75a8cd;
|
|
|
border-left: 3px solid #75a8cd;
|