| | |
| | | <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> |
| | |
| | | <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 = () => { |
| | |
| | | |
| | | // 天气 |
| | | 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(() => { |