swiper.js 912 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Page({
  2. onShareAppMessage() {
  3. return {
  4. title: 'swiper',
  5. path: 'packageComponent/pages/view/swiper/swiper'
  6. }
  7. },
  8. data: {
  9. theme: 'light',
  10. background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
  11. indicatorDots: true,
  12. vertical: false,
  13. autoplay: false,
  14. interval: 2000,
  15. duration: 500
  16. },
  17. changeIndicatorDots() {
  18. this.setData({
  19. indicatorDots: !this.data.indicatorDots
  20. })
  21. },
  22. changeAutoplay() {
  23. this.setData({
  24. autoplay: !this.data.autoplay
  25. })
  26. },
  27. intervalChange(e) {
  28. this.setData({
  29. interval: e.detail.value
  30. })
  31. },
  32. durationChange(e) {
  33. this.setData({
  34. duration: e.detail.value
  35. })
  36. },
  37. onLoad() {
  38. this.setData({
  39. theme: wx.getSystemInfoSync().theme || 'light'
  40. })
  41. if (wx.onThemeChange) {
  42. wx.onThemeChange(({theme}) => {
  43. this.setData({theme})
  44. })
  45. }
  46. }
  47. })