bottom-reply.js 775 B

123456789101112131415161718192021222324252627282930313233343536
  1. import {getEventParam} from "../../../../utils/utils";
  2. Component({
  3. properties: {},
  4. data: {
  5. message: '',
  6. bottom: 0,
  7. top: 0,
  8. },
  9. methods: {
  10. changeMessage(e) {
  11. this.setData({
  12. message: getEventParam(e)
  13. })
  14. },
  15. reply(e) {
  16. this.triggerEvent("message", {msg: this.data.message});
  17. },
  18. clear() {
  19. this.setData({
  20. message: ""
  21. })
  22. },
  23. onFocus(e) {
  24. const keyboradHeight = getEventParam(e, "height");
  25. this.setData({
  26. top: keyboradHeight
  27. })
  28. },
  29. onBlur() {
  30. this.setData({
  31. top: 0
  32. })
  33. },
  34. }
  35. });