index.js 472 B

123456789101112131415161718192021222324252627282930313233
  1. Component({
  2. props: {
  3. show: true,
  4. balance: false,
  5. // 是否显示余额
  6. onChange: () => null,
  7. onClose: () => null,
  8. defaultList: []
  9. },
  10. didMount() {},
  11. methods: {
  12. onClosePopup() {
  13. this.props.onClose();
  14. },
  15. onTap(e) {
  16. const {
  17. item
  18. } = e.target.dataset;
  19. this.onClosePopup();
  20. this.props.onChange(item);
  21. },
  22. onOpenPopup() {
  23. this.setData({
  24. show: true
  25. });
  26. }
  27. }
  28. });