From 6cc0130bd7667a57d669f51ec6ad68b970265f33 Mon Sep 17 00:00:00 2001 From: chaiyapeng <3535863041@qq.com> Date: Wed, 4 Sep 2024 20:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E6=B0=94=E9=A2=84=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/port/port/index.js | 7 ++++ src/views/port/port/employee.vue | 58 +++++++++++++++++++++++++++++--- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/src/api/port/port/index.js b/src/api/port/port/index.js index d16530e..07190c7 100644 --- a/src/api/port/port/index.js +++ b/src/api/port/port/index.js @@ -77,6 +77,13 @@ export function getWeather() { method: 'GET' }) } +//天气预报 +export function getWeatherForecast(cityName) { + return request({ + url: '/port/list/getWeatherForecast?cityName='+cityName, + method: 'GET' + }) +} //购买 export function doBuyInterface(data) { diff --git a/src/views/port/port/employee.vue b/src/views/port/port/employee.vue index 6e80399..a7f3bdd 100644 --- a/src/views/port/port/employee.vue +++ b/src/views/port/port/employee.vue @@ -45,6 +45,7 @@ 测试API 测试API 测试API + 测试API @@ -168,6 +169,26 @@ + + + + + + + + 城市:{{this.formWeatherForecast.city}}
+ 天气:{{this.formWeatherForecast.info}}
+ 温度:{{this.formWeatherForecast.temperature}}
+ 湿度:{{this.formWeatherForecast.humidity}}
+ 风向:{{this.formWeatherForecast.direct}}
+ 风力:{{this.formWeatherForecast.power}}
+ 空气质量:{{this.formWeatherForecast.aqi}}
+
+
+ +
@@ -236,6 +257,7 @@ import {getWeather} from "@/api/port/port"; import {doBuyInterface} from "@/api/port/port"; import {userBalance} from "@/api/system/user"; import {findConnectSort} from "@/api/port/port"; +import {getWeatherForecast} from "@/api/port/port"; export default { //import引入的组件需要注入到对象中才能使用" components: {}, @@ -247,6 +269,17 @@ export default { userBalanceData: { userBalance: '加载中...' }, + formWeatherForecast:{ + cityName:"", + city:"", + info:"", + temperature:"", + humidity:"", + direct:"", + power:"", + aqi:"", + reason:"", + }, formWeather:{}, data:[], defaultProps: { @@ -327,6 +360,7 @@ export default { dialogFormVisible3:false, dialogFormVisible4:false, dialogFormVisible5:false, + dialogFormVisible6:false, dialogTableVisible:false, }; }, @@ -409,6 +443,24 @@ export default { this.formPostCode.reason=true; }) }, + //天气预报 + getWeatherForecast(){ + getWeatherForecast(this.formWeatherForecast.cityName).then((res)=>{ + console.log(res.data); + this.formWeatherForecast.city=res.data.city; + this.formWeatherForecast.info=res.data.info; + this.formWeatherForecast.temperature=res.data.temperature; + this.formWeatherForecast.humidity=res.data.humidity; + this.formWeatherForecast.direct=res.data.direct; + this.formWeatherForecast.power=res.data.power; + this.formWeatherForecast.aqi=res.data.aqi; + this.formWeatherForecast.reason=true; + }) + }, + //天气预报 + testWeatherForecast(){ + this.dialogFormVisible6=true; + }, testMailbox(){ this.dialogFormVisible3=true; }, @@ -459,12 +511,10 @@ export default { } }) }, - testIP(ip){ - this.formIp.ip=ip; + testIP(){ this.dialogFormVisible1=true; }, - testPhone(tel){ - this.formInline.tel=tel; + testPhone(){ this.dialogFormVisible=true; }, phonePlace(){