Promise.all函数的使用
Promise.all([this.getCity('guess'),this.getCity('hot'),this.getCity('group')]).then(res=>{ // console.log(res[1].data) this.setData({ guessCity:res[0].data, hotCity:res[1].data, cities:this.formateCities (res[2].data) }) })显而易见,promise.al的使用就是当所有的请求结束l后才会调用后面的方法,参数为一个数组,数组中可以写方法,和请求的数据