index.js 724 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {
  2. getFansList
  3. } from '~/api/user'
  4. import reachBottom from '~/mixins/reachBottom'
  5. Page({
  6. behaviors: [reachBottom],
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. // 1我的关注;2我的粉丝
  12. currentType: 1
  13. },
  14. onShow() {
  15. this.resetData()
  16. },
  17. setType({
  18. currentTarget
  19. }) {
  20. this.setData({
  21. currentType: currentTarget.dataset.type
  22. })
  23. this.resetData()
  24. },
  25. // 获取分类的内容
  26. loadMore() {
  27. let type = this.data.currentType
  28. this.getData(getFansList, {
  29. pageSize: 20,
  30. type
  31. })
  32. },
  33. jumpUserInfo({
  34. currentTarget
  35. }) {
  36. let uid = currentTarget.dataset.uid
  37. wx.navigateTo({
  38. url: `/pages/personal/index?uid=${uid}`,
  39. })
  40. },
  41. })