index.js 661 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. onShow(){
  14. this.resetData()
  15. },
  16. setSearch({
  17. detail
  18. }) {
  19. this.setData({
  20. text: detail.value
  21. })
  22. },
  23. loadMore() {
  24. if (!this.data.text) {
  25. return
  26. }
  27. this.getData(getOtherUser, {
  28. query: this.data.text,
  29. })
  30. },
  31. async setFans({
  32. currentTarget
  33. }) {
  34. let uid = currentTarget.dataset.uid
  35. wx.navigateTo({
  36. url: `/pages/personal/index?uid=${uid}`,
  37. })
  38. },
  39. onReachBottom() {
  40. this.loadMore()
  41. }
  42. })