From 22a23b05b25e4b5c616f65989ac0ca16324f4c29 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:23:41 +0800
Subject: [PATCH] Merge branch 'dev' into test

---
 src/components/CommonWeather.vue |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/components/CommonWeather.vue b/src/components/CommonWeather.vue
index abec0ec..9e260c7 100644
--- a/src/components/CommonWeather.vue
+++ b/src/components/CommonWeather.vue
@@ -6,8 +6,8 @@
 			<img src="@/assets/images/home/homeLeft/tq.png" alt="" />
 			<span class="tq">{{ weather }}</span>
 			<span class="tq">风速:{{ windVelocity }} </span>
-			<span v-if="flylevel >= 5" :class="[isFly === '适合飞行' ? 'qk' : isFly === '禁止飞行' ? 'redqk' : 'yellowqk']">{{
-				isFly
+			<span v-if="flightAdvice" :class="[flightAdvice === '适合飞行' ? 'qk' : flightAdvice === '禁止飞行' ? 'redqk' : 'yellowqk']">{{
+					flightAdvice
 			}}</span>
 		</div>
 	</div>
@@ -16,6 +16,11 @@
 <script setup>
 import dayjs from 'dayjs'
 import { getDroneSuggest } from '@/api/home/common'
+import { useStore } from 'vuex'
+import { ElMessage } from 'element-plus'
+
+const store = useStore()
+const flySuggest = computed(() => store.state.home.flySuggest)
 
 const time = ref('')
 const updateTime = () => {
@@ -24,26 +29,21 @@
 
 // 天气
 const weather = ref('')
-// 是否适合飞行
-const isFly = ref('')
+
 // 风速
 const windVelocity = ref('')
 // 区县级
-const flylevel = ref('')
+const flightAdvice = computed(() => flySuggest.value?.flightAdvice)
+
 // 获取天气建议
 const getWeatherSuggest = () => {
+	// ElMessage.success('wobeichonghzil')
 	getDroneSuggest().then(res => {
 		if (res.data.code !== 0) return
 		weather.value = res.data.data.weather
-		isFly.value = res.data.data.flightAdvice
 		windVelocity.value = res.data.data.windPower
-		flylevel.value = res.data.data.adcode.replace(/0+$/, "").length
 	})
 }
-
-
-
-
 
 let intervalTime
 onMounted(() => {

--
Gitblit v1.9.3