index.js 702 B

1234567891011121314151617181920212223242526272829303132333435
  1. Component({
  2. properties: {
  3. list: Array,
  4. getResult: Function,
  5. result: Array
  6. },
  7. options: {
  8. addGlobalClass: true
  9. },
  10. data: {
  11. show: false
  12. },
  13. methods: {
  14. onChange({
  15. detail
  16. }) {
  17. this.setData({
  18. result: detail
  19. })
  20. },
  21. onClose() {
  22. this.setData({
  23. show: false
  24. })
  25. },
  26. handleReturn() {
  27. if (!this.data.result.length) return;
  28. this.triggerEvent("getResult", this.data.result)
  29. this.setData({
  30. show: false,
  31. result: []
  32. })
  33. }
  34. }
  35. })