微信小程序对es6的Promise吗?
发布于 5 年前 作者 zluo 17860 次浏览 来自 问答

微信小程序对es6的Promise吗?

4 回复

好像苹果系统的promise有点问题,不晓得有没修复。

const p1= this.mapCtx.getScale({

success(res) {

that.getmarks.scale = res.scale


},

})

const p2=this.mapCtx.getCenterLocation({

success(res) {

that.getmarks = Object.assign(that.getmarks, {

longitude: res.longitude,

latitude: res.latitude,

})


}

})

const p3=this.mapCtx.getRegion({

success(res) {

that.getmarks = Object.assign(that.getmarks, {

'northeast[latitude]': res.northeast.latitude,

'northeast[longitude]': res.northeast.longitude,

'southwest[latitude]': res.southwest.latitude,

'southwest[longitude]': res.southwest.longitude,

})

}

})

上面3个回调没执行完,then里面的回调怎么就先执行了啊

上面3个回调没执行完,then里面的回调怎么就先执行了啊

上面3个回调没执行完,then里面的回调怎么就先执行了啊

Promise.all([p1, p2, p3]).then(()=>{

})

上面3个回调没执行完,then里面的回调怎么就先执行了啊

Promise.all([p1, p2, p3]).then(()=>{

})



在Android和开发者工具也不行啊

const p1= this.mapCtx.getScale({

success(res) {

that.getmarks.scale = res.scale


},

})

const p2=this.mapCtx.getCenterLocation({

success(res) {

that.getmarks = Object.assign(that.getmarks, {

longitude: res.longitude,

latitude: res.latitude,

})


}

})

const p3=this.mapCtx.getRegion({

success(res) {

that.getmarks = Object.assign(that.getmarks, {

'northeast[latitude]': res.northeast.latitude,

'northeast[longitude]': res.northeast.longitude,

'southwest[latitude]': res.southwest.latitude,

'southwest[longitude]': res.southwest.longitude,

})

}

})

上面3个回调没执行完,then里面的回调怎么就先执行了啊

上面3个回调没执行完,then里面的回调怎么就先执行了啊

上面3个回调没执行完,then里面的回调怎么就先执行了啊

Promise.all([p1, p2, p3]).then(()=>{

})

上面3个回调没执行完,then里面的回调怎么就先执行了啊

回到顶部