{"errMsg": "hideLoading:fail toast can't be found"}
原因
wx.showToast() 和 wx.showLoading()
都是用 wx.hideLoading()来隐藏的
所以一起用的话就会报错
解决办法
1、不要一起用
2、 wx.showToast 在 wx.hideLoading complete 完成之后再用
wx.hideLoading({
success: (response) => {
// 成功
},
complete: response => {
wx.showToast({
title: '成功',
icon:"none"
})
}
})

当同时使用wx.showToast和wx.showLoading,使用wx.hideLoading隐藏时可能会报错。解决方法是避免一起使用,或者确保wx.showToast在wx.hideLoading的complete回调后再执行。例如,可以将wx.showToast放在wx.hideLoading的complete回调函数中。
548

被折叠的 条评论
为什么被折叠?



