uni-app app端 调用实时天气 及 7天 天气预报

总而言之 简单粗暴

 uni.getLocation({
	type:''wgs84",
	geocode:true,//必写项
	success:(res)=>{
		if (data.address){
		     this.city = data.address.city;
			  var city = this.city
			  uni.request({
			  	url:'http://wthrcdn.etouch.cn/weather_mini?city=' + city,
			  	data:{},
			  	success:(res)=>{
			  		console.log(res)
			  	}
			 })
		 }
	}
})

你可能感兴趣的:(uni-app app端 调用实时天气 及 7天 天气预报)