index.js 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. var app = getApp();
  2. Component({
  3. externalClasses: ["i-class", "i-class-mask"],
  4. properties: {
  5. visible: {
  6. type: Boolean,
  7. value: !1,
  8. observer: function(e) {
  9. var that = this;
  10. this.data.closeDelay ? setTimeout(function() {
  11. that.setData({
  12. isShow: e
  13. });
  14. }, this.data.closeDelay) : this.setData({
  15. isShow: e
  16. });
  17. }
  18. },
  19. maskClosable: {
  20. type: Boolean,
  21. value: true
  22. },
  23. scrollUp: {
  24. type: Boolean,
  25. value: true
  26. },
  27. closeDelay: {
  28. type: Number,
  29. value: 0
  30. }
  31. },
  32. data: {
  33. isIpx: false,
  34. isShow: false
  35. },
  36. attached: function() {
  37. this.setData({
  38. isIpx: app.globalData.isIpx
  39. });
  40. },
  41. methods: {
  42. stopMove: function() {},
  43. handleClickMask: function() {
  44. this.data.maskClosable && this.handleClickCancel();
  45. },
  46. handleClickCancel: function() {
  47. this.triggerEvent("cancel");
  48. }
  49. }
  50. });