myconcern.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. import httpRequestApi from '../../../utils/APIClient';
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. fullScreenBtn: false,
  8. playBtn: false,
  9. gesture: true,
  10. concerns:[
  11. {
  12. nickName: '清然未',
  13. time: '10-18 09:56',
  14. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  15. concerned: '已关注',
  16. followBack: '相互关注',
  17. isEachOther: false
  18. },
  19. {
  20. nickName: '木小雅',
  21. time: '10-18 09:56',
  22. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  23. concerned: '已关注',
  24. followBack: '相互关注',
  25. isEachOther: true
  26. },
  27. {
  28. nickName: '清然未',
  29. time: '10-18 09:56',
  30. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  31. concerned: '已关注',
  32. followBack: '相互关注',
  33. isEachOther: false
  34. },
  35. {
  36. nickName: '木小雅',
  37. time: '10-18 09:56',
  38. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  39. concerned: '已关注',
  40. followBack: '相互关注',
  41. isEachOther: true
  42. },
  43. {
  44. nickName: '清然未',
  45. time: '10-18 09:56',
  46. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  47. concerned: '已关注',
  48. followBack: '相互关注',
  49. isEachOther: false
  50. },
  51. {
  52. nickName: '清然未',
  53. time: '10-18 09:56',
  54. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  55. concerned: '已关注',
  56. followBack: '相互关注',
  57. isEachOther: false
  58. },
  59. {
  60. nickName: '清然未',
  61. time: '10-18 09:56',
  62. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  63. concerned: '已关注',
  64. followBack: '相互关注',
  65. isEachOther: false
  66. },
  67. {
  68. nickName: '木小雅',
  69. time: '10-18 09:56',
  70. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  71. concerned: '已关注',
  72. followBack: '相互关注',
  73. isEachOther: true
  74. },
  75. {
  76. nickName: '木小雅',
  77. time: '10-18 09:56',
  78. avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
  79. concerned: '已关注',
  80. followBack: '相互关注',
  81. isEachOther: true
  82. },
  83. ]
  84. },
  85. /**
  86. * 生命周期函数--监听页面加载
  87. */
  88. onLoad: function (option) {
  89. console.log(option.title);
  90. if (option.title) {
  91. wx.setNavigationBarTitle({
  92. title: option.title//页面标题为路由参数
  93. });
  94. this.setData({
  95. title: option.title
  96. });
  97. }
  98. let uid = 1, pageNo = 8, pageSize = 18;
  99. httpRequestApi.getFollowUsers(uid, pageNo, pageSize).success(res => {
  100. let { data } = res.data;
  101. this.setData({
  102. isEachOther: data.hasPrevious
  103. });
  104. });
  105. },
  106. /**
  107. * 生命周期函数--监听页面初次渲染完成
  108. */
  109. onReady: function () {
  110. },
  111. /**
  112. * 生命周期函数--监听页面显示
  113. */
  114. onShow: function () {
  115. },
  116. /**
  117. * 生命周期函数--监听页面隐藏
  118. */
  119. onHide: function () {
  120. },
  121. /**
  122. * 生命周期函数--监听页面卸载
  123. */
  124. onUnload: function () {
  125. },
  126. /**
  127. * 页面相关事件处理函数--监听用户下拉动作
  128. */
  129. onPullDownRefresh: function () {
  130. },
  131. /**
  132. * 页面上拉触底事件的处理函数
  133. */
  134. onReachBottom: function () {
  135. },
  136. /**
  137. * 用户点击右上角分享
  138. */
  139. onShareAppMessage: function () {
  140. }
  141. })