index.js 785 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. currentType: 1
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad(options) {
  17. this.resetData()
  18. },
  19. setType({
  20. currentTarget
  21. }) {
  22. console.log(currentTarget.dataset.type);
  23. this.setData({
  24. currentType: currentTarget.dataset.type
  25. })
  26. this.resetData()
  27. },
  28. // 获取分类的内容
  29. loadMore() {
  30. let type = this.data.currentType
  31. this.getData(getFansList, {
  32. pageSize: 20
  33. })
  34. },
  35. jumpUserInfo({
  36. currentTarget
  37. }) {
  38. let uid = currentTarget.dataset.uid
  39. wx.navigateTo({
  40. url: `/pages/personal/index?uid=${uid}`,
  41. })
  42. }
  43. })