demo.js 555 B

1234567891011121314151617181920212223242526272829303132
  1. var app = getApp()
  2. var that;
  3. var animation;
  4. Page({
  5. data: {
  6. animationInfo:'',
  7. popupCx:''
  8. },
  9. onLoad() {
  10. that = this;
  11. },
  12. onShow() {
  13. animation = dd.createAnimation({
  14. duration: 200,
  15. timeFunction: "linear",
  16. });
  17. },
  18. onOpen(){
  19. animation.translateY(0).step();
  20. that.setData({
  21. animationInfo: animation.export(),
  22. popupCx: 'container__mask'
  23. });
  24. },
  25. onClose() {
  26. animation.translateY(1200).step();
  27. that.setData({
  28. animationInfo: animation.export(),
  29. popupCx: ''
  30. });
  31. },
  32. });