|
|
@@ -45,12 +45,15 @@
|
|
|
</div>
|
|
|
<AgriculturalDynamics />
|
|
|
</div>
|
|
|
- <!-- 创建农场弹窗 -->
|
|
|
<tip-popup
|
|
|
- v-model:show="showFarmPopup"
|
|
|
- :type="farmPopupType"
|
|
|
- :text="farmPopupType === 'create' ? ['您当前还没有农场', '请先创建农场'] : '农场创建成功'"
|
|
|
+ v-model:show="showTipPopup"
|
|
|
+ type="warning"
|
|
|
+ text="请设置"
|
|
|
+ highlightText="种植方案"
|
|
|
+ buttonText="去设置"
|
|
|
@confirm="handleBtn"
|
|
|
+ :closeOnClickOverlay="false"
|
|
|
+ :zIndex="9999"
|
|
|
/>
|
|
|
</template>
|
|
|
|
|
|
@@ -68,11 +71,18 @@ const tabBarHeight = computed(() => store.state.home.tabBarHeight);
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
|
|
|
-const showFarmPopup = ref(false);
|
|
|
-const farmPopupType = ref("create");
|
|
|
+const showTipPopup = ref(false);
|
|
|
+const handleBtn = () => {
|
|
|
+ router.push("/plan?pageType=plant&headerTitle=请设置您的种植方案");
|
|
|
+};
|
|
|
|
|
|
-const gardenId = ref(null);
|
|
|
+//判断是否存在可用方案
|
|
|
+async function checkExistsEnabledScheme() {
|
|
|
+ const { data } = await VE_API.home.existsEnabledScheme({containerId:null});
|
|
|
+ console.log(data);
|
|
|
+}
|
|
|
|
|
|
+const gardenId = ref(null);
|
|
|
const isGarden = ref(false);
|
|
|
const changeGarden = ({ id }) => {
|
|
|
gardenId.value = id;
|
|
|
@@ -130,20 +140,12 @@ const handleCardClick = (card) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const handleBtn = () => {
|
|
|
- if (farmPopupType.value === "create") {
|
|
|
- router.push("/create_farm?isReload=true&from=home");
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
onActivated(() => {
|
|
|
+ checkExistsEnabledScheme()
|
|
|
getBannerList();
|
|
|
isGarden.value = Boolean(localStorage.getItem("isGarden"));
|
|
|
// 检测是否从创建农场页面成功返回
|
|
|
if (route.query.showSuccess === "true") {
|
|
|
- farmPopupType.value = "success";
|
|
|
- showFarmPopup.value = true;
|
|
|
-
|
|
|
// 清除URL参数,避免刷新页面时再次显示弹窗
|
|
|
router.replace({
|
|
|
path: "/home",
|