ui.js 521 B

1234567891011121314151617181920212223242526
  1. export const showToast = function(content,duration) {
  2. if(!duration) duration = 2000
  3. wx.showToast({
  4. title: content,
  5. icon: 'none',
  6. duration: duration,
  7. })
  8. }
  9. var isShowLoading = false
  10. export const showLoading = function(title) {
  11. if(isShowLoading) return
  12. wx.showLoading({
  13. title: title?title:'',
  14. mask:true,
  15. success:()=>{
  16. isShowLoading = true
  17. }
  18. })
  19. }
  20. export const hideLoading = function() {
  21. if(!isShowLoading) return
  22. isShowLoading = false
  23. wx.hideLoading()
  24. }