天气预报
parent
07dbfd2b53
commit
6cc0130bd7
|
@ -77,6 +77,13 @@ export function getWeather() {
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//天气预报
|
||||||
|
export function getWeatherForecast(cityName) {
|
||||||
|
return request({
|
||||||
|
url: '/port/list/getWeatherForecast?cityName='+cityName,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
//购买
|
//购买
|
||||||
export function doBuyInterface(data) {
|
export function doBuyInterface(data) {
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeather()" v-if="connector.connectorName=='气象预警'">测试API</el-button>
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeather()" v-if="connector.connectorName=='气象预警'">测试API</el-button>
|
||||||
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testBirthdate()" v-if="connector.connectorName=='生辰助手'">测试API</el-button>
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testBirthdate()" v-if="connector.connectorName=='生辰助手'">测试API</el-button>
|
||||||
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testMailbox()" v-if="connector.connectorName=='邮编查询'">测试API</el-button>
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testMailbox()" v-if="connector.connectorName=='邮编查询'">测试API</el-button>
|
||||||
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeatherForecast()" v-if="connector.connectorName=='天气预报'">测试API</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -168,6 +169,26 @@
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!--天气预报-->
|
||||||
|
<el-dialog title="天气预报" :visible.sync="dialogFormVisible6">
|
||||||
|
<el-form :model="formWeatherForecast">
|
||||||
|
<el-form-item label="城市名" >
|
||||||
|
<el-input v-model="formWeatherForecast.cityName" autocomplete="off" placeholder="请输入城市名"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<span style="font-weight: bold;font-size: 20px" v-if="formWeatherForecast.reason==true">
|
||||||
|
城市:{{this.formWeatherForecast.city}}<br>
|
||||||
|
天气:{{this.formWeatherForecast.info}}<br>
|
||||||
|
温度:{{this.formWeatherForecast.temperature}}<br>
|
||||||
|
湿度:{{this.formWeatherForecast.humidity}}<br>
|
||||||
|
风向:{{this.formWeatherForecast.direct}}<br>
|
||||||
|
风力:{{this.formWeatherForecast.power}}<br>
|
||||||
|
空气质量:{{this.formWeatherForecast.aqi}}<br>
|
||||||
|
</span>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="getWeatherForecast(cityName)">发起请求</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
<!-- 购买-->
|
<!-- 购买-->
|
||||||
<el-dialog title="购买API" :visible.sync="dialogFormVisible5">
|
<el-dialog title="购买API" :visible.sync="dialogFormVisible5">
|
||||||
<el-form :model="buyForm">
|
<el-form :model="buyForm">
|
||||||
|
@ -236,6 +257,7 @@ import {getWeather} from "@/api/port/port";
|
||||||
import {doBuyInterface} from "@/api/port/port";
|
import {doBuyInterface} from "@/api/port/port";
|
||||||
import {userBalance} from "@/api/system/user";
|
import {userBalance} from "@/api/system/user";
|
||||||
import {findConnectSort} from "@/api/port/port";
|
import {findConnectSort} from "@/api/port/port";
|
||||||
|
import {getWeatherForecast} from "@/api/port/port";
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
components: {},
|
components: {},
|
||||||
|
@ -247,6 +269,17 @@ export default {
|
||||||
userBalanceData: {
|
userBalanceData: {
|
||||||
userBalance: '加载中...'
|
userBalance: '加载中...'
|
||||||
},
|
},
|
||||||
|
formWeatherForecast:{
|
||||||
|
cityName:"",
|
||||||
|
city:"",
|
||||||
|
info:"",
|
||||||
|
temperature:"",
|
||||||
|
humidity:"",
|
||||||
|
direct:"",
|
||||||
|
power:"",
|
||||||
|
aqi:"",
|
||||||
|
reason:"",
|
||||||
|
},
|
||||||
formWeather:{},
|
formWeather:{},
|
||||||
data:[],
|
data:[],
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
|
@ -327,6 +360,7 @@ export default {
|
||||||
dialogFormVisible3:false,
|
dialogFormVisible3:false,
|
||||||
dialogFormVisible4:false,
|
dialogFormVisible4:false,
|
||||||
dialogFormVisible5:false,
|
dialogFormVisible5:false,
|
||||||
|
dialogFormVisible6:false,
|
||||||
dialogTableVisible:false,
|
dialogTableVisible:false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -409,6 +443,24 @@ export default {
|
||||||
this.formPostCode.reason=true;
|
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(){
|
testMailbox(){
|
||||||
this.dialogFormVisible3=true;
|
this.dialogFormVisible3=true;
|
||||||
},
|
},
|
||||||
|
@ -459,12 +511,10 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
testIP(ip){
|
testIP(){
|
||||||
this.formIp.ip=ip;
|
|
||||||
this.dialogFormVisible1=true;
|
this.dialogFormVisible1=true;
|
||||||
},
|
},
|
||||||
testPhone(tel){
|
testPhone(){
|
||||||
this.formInline.tel=tel;
|
|
||||||
this.dialogFormVisible=true;
|
this.dialogFormVisible=true;
|
||||||
},
|
},
|
||||||
phonePlace(){
|
phonePlace(){
|
||||||
|
|
Loading…
Reference in New Issue