wx.showLoading({title: "操作中",mask: true,});api().then(() => {wx.showToast({title: "操作成功",icon: "none",});}).finally(() => {wx.hideLoading();});
类似的代码偶尔会出现showLoading不关闭的现象, 这种情况下的解决方法就是 使用定期器包裹showToast可以解决
setTimeout(() => {wx.showToast({title: "操作成功",icon: "none",});}, 50);