|
@@ -1,7 +1,11 @@
|
|
|
import {
|
|
|
- getSelfRead
|
|
|
+ getSelfRead,
|
|
|
+ getFavoritesList
|
|
|
} from '~/api/user'
|
|
|
import {
|
|
|
+ getFollowWorks
|
|
|
+} from '~/api/works'
|
|
|
+import {
|
|
|
getreadInfo
|
|
|
} from '~/api/video'
|
|
|
import share from '~/mixins/share'
|
|
@@ -10,10 +14,20 @@ import reachBottom from '~/mixins/reachBottom'
|
|
|
Page({
|
|
|
behaviors: [reachBottom, share, event],
|
|
|
data: {
|
|
|
- firstWork: ''
|
|
|
+ firstWork: '',
|
|
|
+ type: 'my'
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- console.log(options);
|
|
|
+ if (options.type) {
|
|
|
+ this.setData({
|
|
|
+ type: options.type
|
|
|
+ })
|
|
|
+ if(options.type!='my'){
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
+ title:options.type=='follow'?'关注作品':'收藏作品'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
if (options.id) {
|
|
|
this.getreadInfo(options.id)
|
|
|
wx.nextTick(() => {
|
|
@@ -32,7 +46,13 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
loadMore() {
|
|
|
- this.getData(this.getSelfRead)
|
|
|
+ if (this.data.type == 'follow') {
|
|
|
+ this.getData(getFollowWorks, {})
|
|
|
+ } else if (this.data.type == 'my') {
|
|
|
+ this.getData(getSelfRead, {})
|
|
|
+ } else if (this.data.type == 'collect') {
|
|
|
+ this.getData(getFavoritesList, {})
|
|
|
+ }
|
|
|
},
|
|
|
getSelfRead(data) {
|
|
|
return new Promise(async (reslove) => {
|