2018-06-02 04:34:53 +00:00
|
|
|
<template>
|
2018-06-02 07:13:32 +00:00
|
|
|
<mk-ui>
|
2018-11-08 18:44:35 +00:00
|
|
|
<span slot="header"><fa :icon="['far', 'envelope']"/>{{ $t('title') }}</span>
|
2018-06-02 04:34:53 +00:00
|
|
|
|
2018-06-02 07:13:32 +00:00
|
|
|
<main>
|
2018-06-02 06:51:43 +00:00
|
|
|
<div v-for="req in requests">
|
|
|
|
<router-link :key="req.id" :to="req.follower | userPage">{{ req.follower | userName }}</router-link>
|
|
|
|
<span>
|
2018-11-08 18:44:35 +00:00
|
|
|
<a @click="accept(req.follower)">{{ $t('accept') }}</a>|<a @click="reject(req.follower)">{{ $t('reject') }}</a>
|
2018-06-02 06:51:43 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
2018-06-02 07:13:32 +00:00
|
|
|
</main>
|
|
|
|
</mk-ui>
|
2018-06-02 04:34:53 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-11-08 18:44:35 +00:00
|
|
|
import i18n from '../../../i18n';
|
2018-06-02 07:13:32 +00:00
|
|
|
import Progress from '../../../common/scripts/loading';
|
|
|
|
|
2018-06-02 04:34:53 +00:00
|
|
|
export default Vue.extend({
|
2018-11-08 18:44:35 +00:00
|
|
|
i18n: i18n('mobile/views/pages/received-follow-requests.vue'),
|
2018-06-02 04:34:53 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fetching: true,
|
|
|
|
requests: []
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
2018-11-08 18:44:35 +00:00
|
|
|
document.title = this.$t('title');
|
2018-06-02 07:13:32 +00:00
|
|
|
|
|
|
|
Progress.start();
|
|
|
|
|
2018-06-02 04:34:53 +00:00
|
|
|
(this as any).api('following/requests/list').then(requests => {
|
|
|
|
this.fetching = false;
|
|
|
|
this.requests = requests;
|
2018-06-02 07:13:32 +00:00
|
|
|
|
|
|
|
Progress.done();
|
2018-06-02 04:34:53 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
methods: {
|
2018-06-02 06:51:43 +00:00
|
|
|
accept(user) {
|
|
|
|
(this as any).api('following/requests/accept', { userId: user.id }).then(() => {
|
|
|
|
this.requests = this.requests.filter(r => r.follower.id != user.id);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
reject(user) {
|
|
|
|
(this as any).api('following/requests/reject', { userId: user.id }).then(() => {
|
|
|
|
this.requests = this.requests.filter(r => r.follower.id != user.id);
|
|
|
|
});
|
2018-06-02 04:34:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-06-02 07:13:32 +00:00
|
|
|
main
|
|
|
|
width 100%
|
|
|
|
max-width 680px
|
|
|
|
margin 0 auto
|
|
|
|
padding 8px
|
2018-06-02 04:34:53 +00:00
|
|
|
|
2018-06-02 07:13:32 +00:00
|
|
|
@media (min-width 500px)
|
|
|
|
padding 16px
|
|
|
|
|
|
|
|
@media (min-width 600px)
|
|
|
|
padding 32px
|
2018-06-02 04:34:53 +00:00
|
|
|
|
2018-06-02 06:51:43 +00:00
|
|
|
> div
|
|
|
|
display flex
|
2018-06-02 04:34:53 +00:00
|
|
|
padding 16px
|
2018-09-28 05:03:55 +00:00
|
|
|
border solid 1px var(--faceDivider)
|
2018-06-02 04:34:53 +00:00
|
|
|
border-radius 4px
|
|
|
|
|
2018-06-02 06:51:43 +00:00
|
|
|
> span
|
|
|
|
margin 0 0 0 auto
|
|
|
|
|
2018-06-02 04:34:53 +00:00
|
|
|
</style>
|