async openTipsDialog() {
wx.showModal({
title: '提示',
content: '这是一个模态弹窗',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
const { serialNumber } = this.data;
const { code } = await app.$api({
url: `/api/commodity/delete/${serialNumber}`,
});
!code && this.setData({ tipsDialogVisible: true });
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
success: async res => { ... }
appservice 生成错误] pages/product/edit/edit.js: file: pages/product/edit/edit.js
unknown: Unexpected reserved word 'await'. (204:27)
202 | console.log('用户点击确定')
203 | const { serialNumber } = this.data;
> 204 | const { code } = await app.$api({
| ^
205 | url: `/api/commodity/delete/${serialNumber}`,
206 | });
207 | !code && this.setData({ tipsDialogVisible: true });(env: Windows,mp,1.05.2107090; lib: 2.16.0)