loading.js 338 B

12345678910111213141516171819202122
  1. Page({
  2. data: {
  3. tips: '请稍后',
  4. show: true,
  5. animated: true
  6. },
  7. onShow() {
  8. this.timer = setInterval(() => {
  9. this.setData({
  10. show: !this.data.show
  11. })
  12. }, 2000)
  13. },
  14. close() {
  15. this.setData({
  16. animated: !this.data.animated
  17. })
  18. },
  19. onUnload() {
  20. clearInterval(this.timer)
  21. }
  22. })