index.js 924 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Component({
  2. properties: {
  3. list: {
  4. type: Array
  5. },
  6. getResult: {
  7. type: Function
  8. },
  9. result: {
  10. type: Array
  11. }
  12. },
  13. options: {
  14. addGlobalClass: true
  15. },
  16. data: {
  17. show: false
  18. },
  19. lifetimes: {
  20. attached: function () {
  21. getApp().globalData.Language.getLanguagePackage(this)
  22. }
  23. },
  24. methods: {
  25. onChange({
  26. detail
  27. }) {
  28. this.setData({
  29. result: detail
  30. })
  31. },
  32. onClose() {
  33. this.setData({
  34. show: false
  35. })
  36. },
  37. handleReturn() {
  38. if (!this.data.result.length) return;
  39. this.triggerEvent("getResult", this.data.result)
  40. this.setData({
  41. show: false,
  42. result: []
  43. })
  44. }
  45. }
  46. })