wx.showToast 在模拟器上显示的时间比较久,但是在真机上运行时就会出现一闪而过的情况,解决办法为:
在wx.showToast方法外部套一个延时定时器
wx.hideLoading();
setTimeout(()=>{
wx.showToast({
title: msg,
icon: 'none',
mask: true,
success:function(){
setTimeout(() => {
wx.hideToast();
}, 2000)
}
});
},200);