| 123456789101112131415161718192021222324252627282930313233343536373839 |
- Page({
- data: {
- pageToken: 0,
- followData: []
- },
- loadFollowData: function () {
- wx.showNavigationBarLoading()
- wx.cloud.callFunction({
- name: 'listPublishers',
- data: {
- follow: true,
- page_token: this.data.pageToken,
- page_size: 20
- }
- }).then(res => {
- wx.hideNavigationBarLoading()
- if (res.result.status !== 'OK') {
- wx.showToast({
- title: res.result.errMsg,
- icon: 'none'
- })
- return
- }
- this.setData({
- followData: this.data.followData.concat(res.result.list),
- pageToken: res.result.next_page_token
- })
- })
- },
- onReady: function () {
- this.loadFollowData()
- },
- onReachBottom: function () {
- this.loadFollowData()
- }
- })
|