有人知道吗?帮忙解决下
小程序appdata数据与API获取的数据不一致一个Appdate获取的数据一个是API获取的数据,从API获得到的数据是正确的,传到Appdate上就错误了 [图片]
2018-12-31大家帮忙解答下,感谢
thirdScriptError我获取和风天气原先是V5可以获取到,现在升级为S6,修改后就报错 VM2445:1 thirdScriptError Cannot read property 'tmp' of undefined [图片] getWeather: function (city) { var that = this var url = "https://free-api.heweather.com/s6/weather" var params = { city: city, key: "894fc2a749104d679fa022c3e71afe83" } wx.request({ url: url, data: params, success: function (res) { var tmp = res.data.HeWeather6[0].now.tmp; var txt = res.data.HeWeather6[0].now.cond.txt; var code = res.data.HeWeather6[0].now.cond.code; var qlty = res.data.HeWeather6[0].aqi.city.qlty; var dir = res.data.HeWeather6[0].now.wind.dir; var sc = res.data.HeWeather6[0].now.wind.sc; var hum = res.data.HeWeather6[0].now.hum; var fl = res.data.HeWeather6[0].now.fl; var daily_forecast = res.data.HeWeather6[0].daily_forecast; that.setData({ tmp: tmp, txt: txt, code: code, qlty: qlty, dir: dir, sc: sc, hum: hum, fl: fl, daily_forecast: daily_forecast }) }, fail: function (res) { }, complete: function (res) { }, }) }
2018-12-31