wip
This commit is contained in:
parent
e651bd12c3
commit
4b228432c1
7 changed files with 92 additions and 87 deletions
|
|
@ -1,10 +1,18 @@
|
|||
<template>
|
||||
<mk-ui>
|
||||
<span slot="header" v-if="!fetching">
|
||||
<template slot="header" v-if="!fetching">
|
||||
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt="">
|
||||
{{ '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) }}
|
||||
</span>
|
||||
<mk-user-followers v-if="!fetching" :user="user" @loaded="onLoaded"/>
|
||||
</template>
|
||||
<mk-users-list
|
||||
v-if="!fetching"
|
||||
:fetch="fetchUsers"
|
||||
:count="user.followers_count"
|
||||
:you-know-count="user.followers_you_know_count"
|
||||
@loaded="onLoaded"
|
||||
>
|
||||
%i18n:mobile.tags.mk-user-followers.no-users%
|
||||
</mk-users-list>
|
||||
</mk-ui>
|
||||
</template>
|
||||
|
||||
|
|
@ -13,29 +21,45 @@ import Vue from 'vue';
|
|||
import Progress from '../../../common/scripts/loading';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['username'],
|
||||
data() {
|
||||
return {
|
||||
fetching: true,
|
||||
user: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route: 'fetch'
|
||||
},
|
||||
created() {
|
||||
this.fetch();
|
||||
},
|
||||
mounted() {
|
||||
Progress.start();
|
||||
|
||||
(this as any).api('users/show', {
|
||||
username: this.username
|
||||
}).then(user => {
|
||||
this.user = user;
|
||||
this.fetching = false;
|
||||
|
||||
document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
|
||||
document.documentElement.style.background = '#313a42';
|
||||
});
|
||||
document.documentElement.style.background = '#313a42';
|
||||
},
|
||||
methods: {
|
||||
fetch() {
|
||||
Progress.start();
|
||||
this.fetching = true;
|
||||
|
||||
(this as any).api('users/show', {
|
||||
username: this.$route.params.user
|
||||
}).then(user => {
|
||||
this.user = user;
|
||||
this.fetching = false;
|
||||
|
||||
document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
|
||||
});
|
||||
},
|
||||
onLoaded() {
|
||||
Progress.done();
|
||||
},
|
||||
fetchUsers(iknow, limit, cursor, cb) {
|
||||
(this as any).api('users/followers', {
|
||||
user_id: this.user.id,
|
||||
iknow: iknow,
|
||||
limit: limit,
|
||||
cursor: cursor ? cursor : undefined
|
||||
}).then(cb);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,18 @@
|
|||
<template>
|
||||
<mk-ui>
|
||||
<span slot="header" v-if="!fetching">
|
||||
<template slot="header" v-if="!fetching">
|
||||
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt="">
|
||||
{{ '%i18n:mobile.tags.mk-user-following-page.following-of'.replace('{}', user.name) }}
|
||||
</span>
|
||||
<mk-user-following v-if="!fetching" :user="user" @loaded="onLoaded"/>
|
||||
{{ '%i18n:mobile.tags.mk-user-following-page.following-of%'.replace('{}', user.name) }}
|
||||
</template>
|
||||
<mk-users-list
|
||||
v-if="!fetching"
|
||||
:fetch="fetchUsers"
|
||||
:count="user.following_count"
|
||||
:you-know-count="user.following_you_know_count"
|
||||
@loaded="onLoaded"
|
||||
>
|
||||
%i18n:mobile.tags.mk-user-following.no-users%
|
||||
</mk-users-list>
|
||||
</mk-ui>
|
||||
</template>
|
||||
|
||||
|
|
@ -13,29 +21,45 @@ import Vue from 'vue';
|
|||
import Progress from '../../../common/scripts/loading';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['username'],
|
||||
data() {
|
||||
return {
|
||||
fetching: true,
|
||||
user: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route: 'fetch'
|
||||
},
|
||||
created() {
|
||||
this.fetch();
|
||||
},
|
||||
mounted() {
|
||||
Progress.start();
|
||||
|
||||
(this as any).api('users/show', {
|
||||
username: this.username
|
||||
}).then(user => {
|
||||
this.user = user;
|
||||
this.fetching = false;
|
||||
|
||||
document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
|
||||
document.documentElement.style.background = '#313a42';
|
||||
});
|
||||
document.documentElement.style.background = '#313a42';
|
||||
},
|
||||
methods: {
|
||||
fetch() {
|
||||
Progress.start();
|
||||
this.fetching = true;
|
||||
|
||||
(this as any).api('users/show', {
|
||||
username: this.$route.params.user
|
||||
}).then(user => {
|
||||
this.user = user;
|
||||
this.fetching = false;
|
||||
|
||||
document.title = '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) + ' | Misskey';
|
||||
});
|
||||
},
|
||||
onLoaded() {
|
||||
Progress.done();
|
||||
},
|
||||
fetchUsers(iknow, limit, cursor, cb) {
|
||||
(this as any).api('users/following', {
|
||||
user_id: this.user.id,
|
||||
iknow: iknow,
|
||||
limit: limit,
|
||||
cursor: cursor ? cursor : undefined
|
||||
}).then(cb);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue