for (var i = 0; i < key.length - 1; i++) {
var keyIdx = key[i];
// console.log(aaaData[keyIdx].temperature+“温度”);
var returnlist = _self.temp_list(aaaData[keyIdx].temperature);
date.push(aaaData[keyIdx].date);
weekday.push(aaaData[keyIdx].week);
weather.push(aaaData[keyIdx].weather);
temperature.push(aaaData[keyIdx].temperature);
// console.log(returnlist+“返回list”);
// low_list.push(returnlist[0]);
// high_list.
low_list.push(returnlist[0]);
high_list.push(returnlist[1]);
}
我请求了一个接口的数据然后进行数据处理
报错:
Cannot read property ‘temperature’ of undefined;at App onError function;at api request success callback function
TypeError: Cannot read property ‘temperature’ of undefined
之前这个小程序是正常的 突然就报错了
已经定位了这个问题就在这里(注释掉不报错了,但是影响其他逻辑)