index.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { $wuxCountUp } from '../../dist/index'
  2. import ad from '../index/ad'
  3. ad({
  4. data: {},
  5. onLoad() {
  6. this.c1 = new $wuxCountUp(1, 1024, 0, 2, {
  7. printValue(value) {
  8. this.setData({
  9. c1: value,
  10. })
  11. },
  12. })
  13. this.c2 = new $wuxCountUp(0, 88.88, 2, 2, {
  14. printValue(value) {
  15. this.setData({
  16. c2: value,
  17. })
  18. },
  19. })
  20. this.c3 = new $wuxCountUp(0, 520, 0, 2, {
  21. printValue(value) {
  22. this.setData({
  23. c3: value,
  24. })
  25. },
  26. })
  27. this.c1.start()
  28. this.c2.start()
  29. },
  30. start() {
  31. this.c3.start(() => {
  32. wx.showToast({
  33. title: '已完成',
  34. })
  35. })
  36. },
  37. reset() {
  38. this.c3.reset()
  39. },
  40. update() {
  41. this.c3.update(1314)
  42. },
  43. pauseResume() {
  44. this.c3.pauseResume()
  45. },
  46. })