toast_util.js 429 B

12345678910111213141516171819202122
  1. function show(title,icon="none", duration) {
  2. wx.hideLoading();
  3. setTimeout(() => {
  4. if (duration == null) {
  5. wx.showToast({
  6. icon: icon,
  7. title: title,
  8. });
  9. } else {
  10. wx.showToast({
  11. icon: icon,
  12. title: title,
  13. duration: 1000,
  14. });
  15. }
  16. }, 300)
  17. }
  18. module.exports = {
  19. show,
  20. }