loading.js 523 B

123456789101112131415161718192021222324252627282930
  1. import CustomPage from '../../../base/CustomPage'
  2. CustomPage({
  3. onShareAppMessage() {
  4. return {
  5. title: 'loading',
  6. path: 'packageExtend/pages/base/loading/loading'
  7. }
  8. },
  9. data: {
  10. tips: '请稍后',
  11. show: true,
  12. animated: true
  13. },
  14. onShow() {
  15. this.timer = setInterval(() => {
  16. this.setData({
  17. show: !this.data.show
  18. })
  19. }, 2000)
  20. },
  21. close() {
  22. this.setData({
  23. animated: !this.data.animated
  24. })
  25. },
  26. onUnload() {
  27. clearInterval(this.timer)
  28. }
  29. })