2018-02-15 09:33:34 +00:00
|
|
|
<template>
|
2018-02-22 08:32:58 +00:00
|
|
|
<div class="root friends">
|
2018-04-14 16:04:40 +00:00
|
|
|
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:@loading%<mk-ellipsis/></p>
|
2018-02-15 09:33:34 +00:00
|
|
|
<div v-if="!fetching && users.length > 0">
|
|
|
|
<mk-user-card v-for="user in users" :key="user.id" :user="user"/>
|
|
|
|
</div>
|
2018-04-14 16:04:40 +00:00
|
|
|
<p class="empty" v-if="!fetching && users.length == 0">%i18n:@no-users%</p>
|
2018-02-15 09:33:34 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
export default Vue.extend({
|
|
|
|
props: ['user'],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fetching: true,
|
|
|
|
users: []
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2018-02-18 03:35:18 +00:00
|
|
|
(this as any).api('users/get_frequently_replied_users', {
|
2018-03-29 05:48:47 +00:00
|
|
|
userId: this.user.id
|
2018-02-15 09:33:34 +00:00
|
|
|
}).then(res => {
|
|
|
|
this.users = res.map(x => x.user);
|
2018-02-19 14:37:09 +00:00
|
|
|
this.fetching = false;
|
2018-02-15 09:33:34 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-02-22 08:32:58 +00:00
|
|
|
.root.friends
|
2018-02-15 09:33:34 +00:00
|
|
|
> div
|
|
|
|
overflow-x scroll
|
|
|
|
-webkit-overflow-scrolling touch
|
|
|
|
white-space nowrap
|
|
|
|
padding 8px
|
|
|
|
|
2018-02-16 18:01:00 +00:00
|
|
|
> .mk-user-card
|
2018-02-15 09:33:34 +00:00
|
|
|
&:not(:last-child)
|
|
|
|
margin-right 8px
|
|
|
|
|
2018-02-22 08:32:58 +00:00
|
|
|
> .fetching
|
2018-02-15 09:33:34 +00:00
|
|
|
> .empty
|
|
|
|
margin 0
|
|
|
|
padding 16px
|
|
|
|
text-align center
|
|
|
|
color #aaa
|
|
|
|
|
|
|
|
> i
|
|
|
|
margin-right 4px
|
|
|
|
|
|
|
|
</style>
|