//index.js
//获取应用实例
const app = getApp();
import { normalizeLocation, normalizeDailyDate, getLevel, getCurrentPage } from '../../utils/util';
import { getWeatherDataByLocation } from '../../utils/heweather';

Page({
  data: {
    city: '',
    currentWeatherImgSrc: '',
    currentWeatherImgAlt: '',
    currentTemp: '',
    currentWeather: '',
    observationTime: '',
    temperatureRange: '',
    airQualityLevel: '',
    airQualityValue: '',
    airQualityPM25Value: '',
    forecast: [],
    aqi: []
  },
  bindViewCities: function() {
    wx.navigateTo({
      url: '../cities/cities'
    });
  },
  onLoad: function () {
    getWeatherDataByLocation(getCurrentPage().options.cid || 'auto_ip', (data) => {
      const { location, current_observation, forecast, aqi } = data;
      const { icon_url, weather, temperature, observation_time, pm25 } = current_observation;
      this.setData({
        city: normalizeLocation(location.state, location.city),
        currentTemp: `${temperature}${isNaN(temperature) ? '' : '℃'}`,
        currentWeather: weather,
        observationTime: observation_time,
        temperatureRange: `${forecast[0].low_temperature} ~ ${forecast[0].high_temperature}℃`,
        airQualityValue: current_observation.aqi,
        airQualityLevel: `air_quality_${getLevel(Number(current_observation.aqi))}`,
        airQualityPM25Value: pm25,
        forecast: forecast.map(item => {
          item.date = normalizeDailyDate(item.date);
          return item;
        }),
        aqi: aqi.map(item => {
          item.aqiLevel = getLevel(Number(item.aqi));
          return item;
        })
      })
    });
  }
})

@@ -605,12 +605,12 @@
   on
-Load
+Show
 : fu
@@ -619,14 +619,63 @@
 tion
- 
 () %7B%0A
+    wx.showLoading(%7B%0A      title: '%E5%8A%A0%E8%BD%BD%E4%B8%AD',%0A    %7D);%0A%0A
     
@@ -1666,24 +1666,49 @@
  %7D)%0A      %7D)
+;%0A      wx.hideLoading();
 %0A    %7D);%0A  %7D

Update pages/index/index.js: use the onShow hook instead of onLoad