index.js 623 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. async setFans({
  29. currentTarget
  30. }) {
  31. let uid = currentTarget.dataset.uid
  32. wx.navigateTo({
  33. url: `/pages/personal/index?uid=${uid}`,
  34. })
  35. },
  36. onReachBottom() {
  37. this.loadMore()
  38. }
  39. })