|
|
@@ -5,15 +5,16 @@
|
|
|
<!-- 组件:天气 -->
|
|
|
<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)">
|
|
|
- <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">
|
|
|
+ <div class="report-content-wrap" v-if="hasReport" v-loading="loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.1)">
|
|
|
+ <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" /> -->
|
|
|
@@ -21,7 +22,7 @@
|
|
|
<div class="report-header">
|
|
|
<!-- <img class="header-book" src="@/assets/img/home/book.png" alt="" /> -->
|
|
|
<div class="time-tag">{{ workItems?.[0]?.reportDate }}</div>
|
|
|
- <div class="report-title">{{regionsData[currentIndex]?.regionName}}长势报告</div>
|
|
|
+ <div class="report-title">{{ regionsData[currentIndex]?.regionName }}长势报告</div>
|
|
|
<div class="report-info">
|
|
|
<div class="info-item">
|
|
|
<img class="info-icon" src="@/assets/img/home/farm.png" alt="" />
|
|
|
@@ -39,17 +40,13 @@
|
|
|
<div class="box-title warning">今日巡园重点</div>
|
|
|
<div class="box-text w-100">
|
|
|
<div class="row">
|
|
|
- <div
|
|
|
- v-for="(card, cardI) in todayPatrolFocus"
|
|
|
- :key="cardI"
|
|
|
- class="status-card"
|
|
|
- :class="'today-'+card.color"
|
|
|
- @click="handleTodayPatrolFocusClick(card)"
|
|
|
- >
|
|
|
+ <div v-for="(card, cardI) in todayPatrolFocus" :key="cardI" class="status-card"
|
|
|
+ :class="'today-' + card.color" @click="handleTodayPatrolFocusClick(card)">
|
|
|
<!-- <badge class="status-badge" dot
|
|
|
:offset="[80, -10]">
|
|
|
</badge> -->
|
|
|
- <div class="status-title" :class="{ 'status-title-small': (card.title || '').length > 6 }">
|
|
|
+ <div class="status-title"
|
|
|
+ :class="{ 'status-title-small': (card.title || '').length > 6 }">
|
|
|
{{ card.title }}
|
|
|
</div>
|
|
|
<div class="status-sub">
|
|
|
@@ -64,22 +61,23 @@
|
|
|
<div class="box-title warning">待执行农事</div>
|
|
|
<div class="box-text w-100">
|
|
|
<div class="row">
|
|
|
- <div
|
|
|
- v-for="(card, cardI) in pendingFarmWork"
|
|
|
- :key="cardI"
|
|
|
+ <div v-for="(card, cardI) in pendingFarmWork" :key="cardI"
|
|
|
class="status-card pending-card"
|
|
|
:style="{ background: card.purposeColor, color: card.purposeColor === '#FFFFFF' ? '#000' : '#fff' }"
|
|
|
- :class="card.type"
|
|
|
- @click="handlePendingFarmWorkClick(card)"
|
|
|
- >
|
|
|
+ :class="card.type" @click="handlePendingFarmWorkClick(card)">
|
|
|
<!-- <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>
|
|
|
- <div class="status-title" :class="{ 'status-title-small': (card.name || '').length > 6 }">
|
|
|
+ <div v-if="card.executionLimitDays || card.executionLimitDays === 0"
|
|
|
+ class="tag-name"
|
|
|
+ :style="{ borderColor: card.purposeColor, color: card.purposeColor }">限时 {{
|
|
|
+ card.executionLimitDays }} 天</div>
|
|
|
+ <div class="status-title"
|
|
|
+ :class="{ 'status-title-small': (card.name || '').length > 6 }">
|
|
|
{{ card.name }}
|
|
|
</div>
|
|
|
- <div class="status-sub pending-sub" :style="{ color: card.purposeColor === '#FFFFFF' ? '#000' : '#fff' }">
|
|
|
+ <div class="status-sub pending-sub"
|
|
|
+ :style="{ color: card.purposeColor === '#FFFFFF' ? '#000' : '#fff' }">
|
|
|
{{ card.purposeName }}
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -135,7 +133,8 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="lock-img">
|
|
|
- <img @click="handleLockClick" src="@/assets/img/home/lock-blue.png" alt="" class="has-click lock-img-item" />
|
|
|
+ <img @click="handleLockClick" src="@/assets/img/home/lock-blue.png" alt=""
|
|
|
+ class="has-click lock-img-item" />
|
|
|
<div class="lock-text">
|
|
|
专属数字农场,种好卖好
|
|
|
<div>点击解锁一键溯源增产</div>
|
|
|
@@ -212,8 +211,12 @@ const currentFarmName = ref('');
|
|
|
const changeGarden = async ({ id, name }) => {
|
|
|
if (!id) return;
|
|
|
currentFarmName.value = name;
|
|
|
- swipeRef.value && swipeRef.value.swipeTo(0, {immediate:true});
|
|
|
- currentIndex.value = 0;
|
|
|
+ if (sessionStorage.getItem('activeSwipeIndex')) {
|
|
|
+ currentIndex.value = Number(sessionStorage.getItem('activeSwipeIndex'));
|
|
|
+ } else {
|
|
|
+ currentIndex.value = 0;
|
|
|
+ swipeRef.value && swipeRef.value.swipeTo(0, { immediate: true });
|
|
|
+ }
|
|
|
paramsPage.value = {
|
|
|
...(paramsPage.value || {}),
|
|
|
subjectId: id,
|
|
|
@@ -299,7 +302,7 @@ const handleTodayPatrolFocusClick = (card) => {
|
|
|
}
|
|
|
|
|
|
const getTodayPatrolFocus = () => {
|
|
|
- VE_API.report.todayPatrolFocus({ farmId: paramsPage.value.farmId, regionId:paramsPage.value.regionId }).then(({ data }) => {
|
|
|
+ VE_API.report.todayPatrolFocus({ farmId: paramsPage.value.farmId, regionId: paramsPage.value.regionId }).then(({ data }) => {
|
|
|
todayPatrolFocus.value = data || [];
|
|
|
});
|
|
|
}
|
|
|
@@ -344,7 +347,7 @@ const getRegions = async () => {
|
|
|
subjectId: paramsPage.value.subjectId,
|
|
|
}).then(({ data }) => {
|
|
|
regionsData.value = data || [];
|
|
|
- if(regionsData.value.length > 0) {
|
|
|
+ if (regionsData.value.length > 0) {
|
|
|
const guideKey = "GROWTH_REPORT_SWIPE_GUIDE_SHOWN";
|
|
|
if (!localStorage.getItem(guideKey) && regionsData.value.length > 1) {
|
|
|
showSwipeGuide.value = true;
|
|
|
@@ -353,7 +356,7 @@ const getRegions = async () => {
|
|
|
hasReport.value = true;
|
|
|
|
|
|
// 如果不是点击农情报告已生成弹窗过来的,则显示农情互动弹窗
|
|
|
- if(!route.query.hideInteraction) {
|
|
|
+ if (!route.query.hideInteraction) {
|
|
|
agriExecutePopupRef.value.showPopup(regionsData.value[currentIndex.value].farmId);
|
|
|
}
|
|
|
|
|
|
@@ -379,6 +382,13 @@ const getRegions = async () => {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (sessionStorage.getItem('activeSwipeIndex')) {
|
|
|
+ nextTick(() => {
|
|
|
+ swipeRef.value?.swipeTo?.(currentIndex.value, { immediate: true });
|
|
|
+ });
|
|
|
+ sessionStorage.removeItem('activeSwipeIndex');
|
|
|
+ }
|
|
|
} else {
|
|
|
hasReport.value = false;
|
|
|
}
|
|
|
@@ -393,6 +403,7 @@ const clearData = () => {
|
|
|
};
|
|
|
|
|
|
onDeactivated(() => {
|
|
|
+ sessionStorage.setItem('activeSwipeIndex', currentIndex.value);
|
|
|
clearData();
|
|
|
});
|
|
|
|
|
|
@@ -594,7 +605,7 @@ onUnmounted(() => {
|
|
|
width: 100%;
|
|
|
height: calc(100% - 230px);
|
|
|
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.38) 50%, rgba(255, 255, 255, 0) 100%),
|
|
|
-linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
|
|
|
+ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
|
|
|
}
|
|
|
|
|
|
.lock-img {
|
|
|
@@ -610,12 +621,15 @@ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
|
|
|
justify-content: center;
|
|
|
flex-direction: column;
|
|
|
gap: 16px;
|
|
|
+
|
|
|
.lock-img-item {
|
|
|
width: 57px;
|
|
|
}
|
|
|
+
|
|
|
.has-click {
|
|
|
pointer-events: auto;
|
|
|
}
|
|
|
+
|
|
|
.lock-text {
|
|
|
font-size: 14px;
|
|
|
color: #000;
|
|
|
@@ -623,6 +637,7 @@ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
|
|
|
line-height: 21px;
|
|
|
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 50%, rgba(255, 255, 255, 0) 100%);
|
|
|
}
|
|
|
+
|
|
|
.lock-btn {
|
|
|
width: 140px;
|
|
|
height: 40px;
|
|
|
@@ -846,6 +861,7 @@ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
|
|
|
&.today-red {
|
|
|
background: #FF6A6A;
|
|
|
color: #fff;
|
|
|
+
|
|
|
.status-sub {
|
|
|
color: #fff;
|
|
|
}
|
|
|
@@ -855,6 +871,7 @@ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
|
|
|
color: #fff;
|
|
|
position: relative;
|
|
|
padding: 9px 0 7px 0;
|
|
|
+
|
|
|
.tag-name {
|
|
|
position: absolute;
|
|
|
top: -8px;
|