author-fans.vue
1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
<Layout class="author-fans-page">
<LayoutHeader slot='header' theme="white" class="author-page-header">{{isMine ? '我的' : 'TA'}}粉丝</LayoutHeader>
<UserList :follow-name="isMine ? '回粉' : '关注'" :on-fetch="onFetch"></UserList>
</Layout>
</template>
<script>
import {assign, get} from 'lodash';
import {Scroll, Loading} from 'cube-ui';
import UserList from './components/user-list';
import {createNamespacedHelpers} from 'vuex';
const {mapActions} = createNamespacedHelpers('user');
export default {
name: 'authorFans',
data() {
return {
isMine: false
};
},
created() {
this.isMine = !this.$route.params.id;
this._baseParams = {
authorType: this.$route.params.type || 1,
limit: 20,
};
if (!this.isMine) {
this._baseParams.authorUid = this.$route.params.id;
}
},
methods: {
...mapActions(['authorFansList', 'authorMineFansList']),
onFetch({page, lastedTime}) {
let params = Object.assign({page, lastedTime}, this._baseParams);
return this.isMine ? this.authorMineFansList(params) : this.authorFansList(params);
}
},
components: {
UserList
}
}
</script>
<style lang="scss">
</style>