index.js 903 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const getHeight = require("../../utils/getHeight");
  2. Component({
  3. properties: {
  4. show: {
  5. type: Boolean
  6. },
  7. handle: {
  8. type: Function
  9. }, //按钮回调函数
  10. zIndex: {
  11. type: String,
  12. value: 99999,
  13. },
  14. },
  15. lifetimes: {
  16. attached() {
  17. getApp().globalData.Language.getLanguagePackage(this)
  18. console.log("组件111111",this.data.language)
  19. },
  20. ready() {
  21. getHeight.getHeight('.head', this).then(res => this.setData({
  22. listHeight: res - 80
  23. }));
  24. }
  25. },
  26. methods: {
  27. onClick(e) {
  28. const {
  29. name
  30. } = e.target.dataset;
  31. if (name) this.triggerEvent("handle", name)
  32. },
  33. onClose() {
  34. this.triggerEvent("handle", "close")
  35. }
  36. }
  37. })