//需要同步执行的代码
tbcode: function(a, b, c) {
let that = this;
let dm = new Promise(function(resolve, reject) {
wx.getImageInfo({
src: image,
success: function(imageInfo) {
resolve('success');
}
});
});
return dm;
}
//调用
that.tbcode(a, b, c).then(isSuccess => {
if (isSuccess == 'success') {
//处理其他逻辑,这里保证 tbcode执行后才执行这里的代码
}
});