TEST1() {
wx.showModal({
title: 'NEXT?',
content: 'DO YOU WANT TO NEXT?',
success(res) {
if (res.confirm) {
console.log("sure")
return new Promise(function (resolve, reject) {
resolve('hello');
})
} else {
console.log("no")
return new Promise(function (resolve, reject) {
resolve('hello');
})
}
}
})
console.log('first')
},
async onLoad() {
const f1 = await this.TEST1();
console.log(f1)
const f2 = await this.TEST1();
},
做了一个简单的异步回调函数,我需要第一个TEST1()运行完后再运行TEST1()
但是没有实现我需要的功能,基本还是同步先完成再到异步