|
@@ -164,25 +164,7 @@
|
|
|
},
|
|
|
onLoad() {
|
|
|
// #ifdef H5
|
|
|
- mapinfo().then((res) => {
|
|
|
- console.log(res)
|
|
|
- const currTitleContent = '当前气象信息: ';
|
|
|
- const currProvince = ((res.regeocode || {}).addressComponent || {}).province;
|
|
|
- const currCity = ((res.regeocode || {}).addressComponent || {}).city;
|
|
|
- const currDistrict = ((res.regeocode || {}).addressComponent || {}).district;
|
|
|
- const currDate = new Date();
|
|
|
- const currFormatDate = currDate.getFullYear() + '年' + (currDate.getMonth() + 1) + '月' + currDate.getDate() +
|
|
|
- '日' + currDate.getHours() + '时' + currDate.getMinutes() + '分' + currDate.getSeconds() + '秒';
|
|
|
- const currWeather = (res.weatherInfo || {}).weather;
|
|
|
- const currTemperature = (res.weatherInfo || {}).temperature;
|
|
|
- const currWinddirection = (res.weatherInfo || {}).winddirection;
|
|
|
- const currWindpower = (res.weatherInfo || {}).windpower;
|
|
|
- const currHumidity = (res.weatherInfo || {}).humidity;
|
|
|
- this.titleContentList = [
|
|
|
- currTitleContent + currProvince + currCity + currDistrict + currFormatDate + currWeather +
|
|
|
- currTemperature + '℃' + currWinddirection + '风' + currWindpower + '级空气湿度' + currHumidity
|
|
|
- ];
|
|
|
- });
|
|
|
+ // this.initMapinfo();
|
|
|
// #endif
|
|
|
},
|
|
|
methods: {
|
|
@@ -194,6 +176,26 @@
|
|
|
uni.navigateTo({
|
|
|
url: this.mainNavigateToObj[itemData]
|
|
|
});
|
|
|
+ },
|
|
|
+ initMapinfo() {
|
|
|
+ mapinfo().then((res) => {
|
|
|
+ const currTitleContent = '当前气象信息: ';
|
|
|
+ const currProvince = ((res.regeocode || {}).addressComponent || {}).province;
|
|
|
+ const currCity = ((res.regeocode || {}).addressComponent || {}).city;
|
|
|
+ const currDistrict = ((res.regeocode || {}).addressComponent || {}).district;
|
|
|
+ const currDate = new Date();
|
|
|
+ const currFormatDate = currDate.getFullYear() + '年' + (currDate.getMonth() + 1) + '月' + currDate.getDate() +
|
|
|
+ '日' + currDate.getHours() + '时' + currDate.getMinutes() + '分' + currDate.getSeconds() + '秒';
|
|
|
+ const currWeather = (res.weatherInfo || {}).weather;
|
|
|
+ const currTemperature = (res.weatherInfo || {}).temperature;
|
|
|
+ const currWinddirection = (res.weatherInfo || {}).winddirection;
|
|
|
+ const currWindpower = (res.weatherInfo || {}).windpower;
|
|
|
+ const currHumidity = (res.weatherInfo || {}).humidity;
|
|
|
+ this.titleContentList = [
|
|
|
+ currTitleContent + currProvince + currCity + currDistrict + currFormatDate + currWeather +
|
|
|
+ currTemperature + '℃' + currWinddirection + '风' + currWindpower + '级空气湿度' + currHumidity
|
|
|
+ ];
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|