index.js 579 B

12345678910111213141516171819202122232425262728293031323334353637
  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. async search() {
  21. if (!this.data.text) {
  22. return
  23. }
  24. let list = await getOtherUser({
  25. query: this.data.text,
  26. pageNo: 1,
  27. pageSize: 20
  28. })
  29. console.log(list);
  30. /* this.setData({
  31. list
  32. }) */
  33. },
  34. loadMore() {
  35. this.getData(getSelfRead)
  36. },
  37. })