pull-down-refresh.js 679 B

123456789101112131415161718192021222324252627282930313233343536
  1. Page({
  2. onShareAppMessage() {
  3. return {
  4. title: '下拉刷新',
  5. path: 'packageAPI/pages/page/pull-down-refresh/pull-down-refresh'
  6. }
  7. },
  8. onPullDownRefresh() {
  9. wx.showToast({
  10. title: 'loading...',
  11. icon: 'loading'
  12. })
  13. console.log('onPullDownRefresh', new Date())
  14. },
  15. stopPullDownRefresh() {
  16. wx.stopPullDownRefresh({
  17. complete(res) {
  18. wx.hideToast()
  19. console.log(res, new Date())
  20. }
  21. })
  22. },
  23. onLoad() {
  24. this.setData({
  25. theme: wx.getSystemInfoSync().theme || 'light'
  26. })
  27. if (wx.onThemeChange) {
  28. wx.onThemeChange(({theme}) => {
  29. this.setData({theme})
  30. })
  31. }
  32. }
  33. })