index.js 461 B

12345678910111213141516171819202122232425262728293031
  1. import {
  2. getOtherUser
  3. } from '~/api/user'
  4. import reachBottom from '~/mixins/reachBottom'
  5. Page({
  6. behaviors: [reachBottom],
  7. data: {
  8. text: ''
  9. },
  10. onLoad(options) {
  11. list: []
  12. },
  13. setSearch({
  14. detail
  15. }) {
  16. this.setData({
  17. text: detail.value
  18. })
  19. },
  20. loadMore() {
  21. if (!this.data.text) {
  22. return
  23. }
  24. this.getData(getOtherUser, {
  25. query: this.data.text,
  26. })
  27. },
  28. onReachBottom() {
  29. this.loadMore()
  30. }
  31. })