index.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. "use strict";
  2. var _page = _interopRequireDefault(require("../../common/page"));
  3. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  4. (0, _page["default"])({
  5. data: {
  6. show: false,
  7. name: "fade",
  8. showCustom: false
  9. },
  10. onClickFade: function onClickFade() {
  11. this.trigger("fade");
  12. },
  13. onClickFadeUp: function onClickFadeUp() {
  14. this.trigger("fade-up");
  15. },
  16. onClickFadeDown: function onClickFadeDown() {
  17. this.trigger("fade-down");
  18. },
  19. onClickFadeLeft: function onClickFadeLeft() {
  20. this.trigger("fade-left");
  21. },
  22. onClickFadeRight: function onClickFadeRight() {
  23. this.trigger("fade-right");
  24. },
  25. onClickSlideUp: function onClickSlideUp() {
  26. this.trigger("slide-up");
  27. },
  28. onClickSlideDown: function onClickSlideDown() {
  29. this.trigger("slide-down");
  30. },
  31. onClickSlideLeft: function onClickSlideLeft() {
  32. this.trigger("slide-left");
  33. },
  34. onClickSlideRight: function onClickSlideRight() {
  35. this.trigger("slide-right");
  36. },
  37. trigger: function trigger(name) {
  38. var _this = this;
  39. this.setData({
  40. name: name,
  41. show: true
  42. });
  43. setTimeout(function () {
  44. _this.setData({
  45. show: false
  46. });
  47. }, 500);
  48. },
  49. onClickCustom: function onClickCustom() {
  50. var _this2 = this;
  51. this.setData({
  52. showCustom: true
  53. });
  54. setTimeout(function () {
  55. _this2.setData({
  56. showCustom: false
  57. });
  58. }, 1000);
  59. },
  60. onBeforeEnter: function onBeforeEnter() {
  61. console.log("before enter");
  62. },
  63. onEnter: function onEnter() {
  64. console.log("enter");
  65. },
  66. onAfterEnter: function onAfterEnter() {
  67. console.log("after enter");
  68. },
  69. onBeforeLeave: function onBeforeLeave() {
  70. console.log("before leave");
  71. },
  72. onLeave: function onLeave() {
  73. console.log("leave");
  74. },
  75. onAfterLeave: function onAfterLeave() {
  76. console.log("after leave");
  77. }
  78. });