uni-app怎么在外部获取 接口调用成功的回调函数 里面的变量
uni.getImageInfo({
src: this.msg.images[this.curImage],
success: function(image) {
uni.getSystemInfo({
success: function(res) {
let q = res.windowWidth / image.width * image.height;
}
});
}
});
return q;
异步函数同步代码肯定获取不了,一般的使用promise封装下,在.then回调中获取使用