|
@@ -1,4 +1,4 @@
|
|
|
-32<template>
|
|
|
|
|
|
|
+<template>
|
|
|
<div class="growth-track-page">
|
|
<div class="growth-track-page">
|
|
|
<custom-header
|
|
<custom-header
|
|
|
:name="pageTitle"
|
|
:name="pageTitle"
|
|
@@ -38,19 +38,24 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="interact-card__qa">
|
|
<div class="interact-card__qa">
|
|
|
- <div class="interact-card__question">{{ interactQuestion }}</div>
|
|
|
|
|
- <div class="interact-card__options">
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="item in interactOptions"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- class="interact-option"
|
|
|
|
|
- :class="{ selected: selectedOptionId === item.id }"
|
|
|
|
|
- @click="selectedOptionId = item.id"
|
|
|
|
|
- >
|
|
|
|
|
- <span class="interact-option__text">{{ item.name }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div v-if="phenophaseName" class="interact-card__phenology">
|
|
|
|
|
+ {{ t("agriFile.currentPhenologyTip", { name: phenophaseName }) }}
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="interact-card__submit" @click="handleSubmit">{{ t("agriFile.submit") }}</div>
|
|
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <div class="interact-card__question">{{ interactQuestion }}</div>
|
|
|
|
|
+ <div class="interact-card__options">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="item in interactOptions"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ class="interact-option"
|
|
|
|
|
+ :class="{ selected: selectedOptionId === item.id }"
|
|
|
|
|
+ @click="selectedOptionId = item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="interact-option__text">{{ item.name }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="interact-card__submit" @click="handleSubmit">{{ t("agriFile.submit") }}</div>
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- <div class="interact-card__ref">
|
|
<!-- <div class="interact-card__ref">
|
|
|
<span class="interact-card__ref-label">{{ t("agriFile.referenceImage") }}</span>
|
|
<span class="interact-card__ref-label">{{ t("agriFile.referenceImage") }}</span>
|
|
@@ -89,6 +94,13 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="guide-card__upload" @click="handleUploadClick">
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <Plus />
|
|
|
|
|
+ </el-icon>
|
|
|
|
|
+ <span>{{ t("agriFile.uploadPhoto") }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<album-upload-popup v-model:show="showUploadPopup" @confirm="handleUploadConfirm" />
|
|
<album-upload-popup v-model:show="showUploadPopup" @confirm="handleUploadConfirm" />
|
|
|
<tip-popup v-model:show="showSuccessPopup" type="executeSuccess" text="您已上传成功" text2="请等待诊断报告生成" hideBtn>
|
|
<tip-popup v-model:show="showSuccessPopup" type="executeSuccess" text="您已上传成功" text2="请等待诊断报告生成" hideBtn>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
@@ -157,6 +169,8 @@ const interactQuestion = ref("");
|
|
|
/** 互动选项,由 parse_interact 赋值 */
|
|
/** 互动选项,由 parse_interact 赋值 */
|
|
|
const interactOptions = ref([]);
|
|
const interactOptions = ref([]);
|
|
|
const selectedOptionId = ref(null);
|
|
const selectedOptionId = ref(null);
|
|
|
|
|
+/** 当前物候期名称:get_phenophase */
|
|
|
|
|
+const phenophaseName = ref("");
|
|
|
const showUploadPopup = ref(false);
|
|
const showUploadPopup = ref(false);
|
|
|
const showSuccessPopup = ref(false);
|
|
const showSuccessPopup = ref(false);
|
|
|
const showLeavePopup = ref(false);
|
|
const showLeavePopup = ref(false);
|
|
@@ -241,6 +255,27 @@ async function fetchGrowthInteract() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/** 查询当前物候期:有名称则展示提示条,不再展示互动问答 */
|
|
|
|
|
+async function fetchPhenology() {
|
|
|
|
|
+ if (isAbnormal.value) return;
|
|
|
|
|
+ const entry = readEntryFarmData();
|
|
|
|
|
+ const tel = entry?.phone;
|
|
|
|
|
+ if (!tel) {
|
|
|
|
|
+ phenophaseName.value = "";
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await VE_API.questionnaire.getPhenology({ tel });
|
|
|
|
|
+ if (res?.code === 200 && res.data?.phenophase_name) {
|
|
|
|
|
+ phenophaseName.value = String(res.data.phenophase_name);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ phenophaseName.value = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ phenophaseName.value = "";
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/** 异常态势详情:parse_anormal */
|
|
/** 异常态势详情:parse_anormal */
|
|
|
async function fetchAbnormalInteract() {
|
|
async function fetchAbnormalInteract() {
|
|
|
if (!isAbnormal.value) return;
|
|
if (!isAbnormal.value) return;
|
|
@@ -327,6 +362,10 @@ const handleBack = () => {
|
|
|
router.back();
|
|
router.back();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleUploadClick = () => {
|
|
|
|
|
+ showUploadPopup.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const confirmLeave = () => {
|
|
const confirmLeave = () => {
|
|
|
router.back();
|
|
router.back();
|
|
|
};
|
|
};
|
|
@@ -335,6 +374,7 @@ onMounted(() => {
|
|
|
if (isAbnormal.value) {
|
|
if (isAbnormal.value) {
|
|
|
fetchAbnormalInteract();
|
|
fetchAbnormalInteract();
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ fetchPhenology();
|
|
|
fetchGrowthInteract();
|
|
fetchGrowthInteract();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -343,6 +383,7 @@ onActivated(() => {
|
|
|
if (isAbnormal.value) {
|
|
if (isAbnormal.value) {
|
|
|
fetchAbnormalInteract();
|
|
fetchAbnormalInteract();
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ fetchPhenology();
|
|
|
fetchGrowthInteract();
|
|
fetchGrowthInteract();
|
|
|
}
|
|
}
|
|
|
if (route.query.showUpload !== "1") return;
|
|
if (route.query.showUpload !== "1") return;
|
|
@@ -488,6 +529,12 @@ onActivated(() => {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ &__phenology {
|
|
|
|
|
+ color: #2199f8;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ line-height: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
&__question {
|
|
&__question {
|
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
@@ -679,6 +726,31 @@ onActivated(() => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+.guide-card__upload {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ right: 7px;
|
|
|
|
|
+ bottom: 94px;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ width: 58px;
|
|
|
|
|
+ height: 58px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ background: #2199f8;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.1);
|
|
|
|
|
+ font-size: 15px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .guide-card__upload span {
|
|
|
|
|
+ margin-top: 3px;
|
|
|
|
|
+ font-size: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
.bottom-btn-container {
|
|
.bottom-btn-container {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|