网上一搜大把啊
Page({
data: {
},
onLoad(){
this.code1().then(() => {
this.code2()
})
},
code1() {
return new Promise((resolve, reject) => {
setTimeout(function () {
resolve(console.log(‘code11111111111’));
}, 3000)
})
},
code2() {
console.log(‘code2222222222222222’)
},
})