index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import {
  2. getSelfRead
  3. } from '~/api/user'
  4. import reachBottom from '~/mixins/reachBottom'
  5. Page({
  6. behaviors: [reachBottom],
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. list: [],
  12. // true是人气榜,false是参赛作品
  13. currentType: true,
  14. bannerList: [{
  15. id: 1,
  16. url: "https://efunimgs.ai160.com/xyyf/banner/voucher.png"
  17. }, {
  18. id: 2,
  19. url: "https://efunimgs.ai160.com/xyyf/banner/course.png"
  20. }, {
  21. id: 3,
  22. url: "https://efunimgs.ai160.com/xyyf/banner/video.png"
  23. }, {
  24. id: 4,
  25. url: "https://efunimgs.ai160.com/xyyf/banner/topic.png"
  26. }]
  27. },
  28. /**
  29. * 生命周期函数--监听页面加载
  30. */
  31. onLoad(options) {
  32. this.loadMore()
  33. },
  34. bannelEvent() {},
  35. selectType({
  36. target
  37. }) {
  38. if (target.dataset.type) {
  39. this.setData({
  40. currentType: JSON.parse(target.dataset.type)
  41. })
  42. }
  43. },
  44. loadMore() {
  45. this.getData(getSelfRead)
  46. },
  47. onReachBottom() {
  48. this.loadMore()
  49. },
  50. onShareAppMessage() {
  51. }
  52. })