2018-02-12 16:17:08 +02:00
|
|
|
<template>
|
2018-02-20 16:22:19 +02:00
|
|
|
<div class="profile">
|
2018-02-12 16:17:08 +02:00
|
|
|
<label class="avatar ui from group">
|
2018-04-14 19:04:40 +03:00
|
|
|
<p>%i18n:@avatar%</p>
|
2018-03-29 08:48:47 +03:00
|
|
|
<img class="avatar" :src="`${os.i.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
|
2018-04-14 19:04:40 +03:00
|
|
|
<button class="ui" @click="updateAvatar">%i18n:@choice-avatar%</button>
|
2018-02-12 16:17:08 +02:00
|
|
|
</label>
|
|
|
|
<label class="ui from group">
|
2018-04-14 19:04:40 +03:00
|
|
|
<p>%i18n:@name%</p>
|
2018-02-12 16:17:08 +02:00
|
|
|
<input v-model="name" type="text" class="ui"/>
|
|
|
|
</label>
|
|
|
|
<label class="ui from group">
|
2018-04-14 19:04:40 +03:00
|
|
|
<p>%i18n:@location%</p>
|
2018-02-12 16:17:08 +02:00
|
|
|
<input v-model="location" type="text" class="ui"/>
|
|
|
|
</label>
|
|
|
|
<label class="ui from group">
|
2018-04-14 19:04:40 +03:00
|
|
|
<p>%i18n:@description%</p>
|
2018-02-12 16:17:08 +02:00
|
|
|
<textarea v-model="description" class="ui"></textarea>
|
|
|
|
</label>
|
|
|
|
<label class="ui from group">
|
2018-04-14 19:04:40 +03:00
|
|
|
<p>%i18n:@birthday%</p>
|
2018-03-03 07:25:36 +02:00
|
|
|
<el-date-picker v-model="birthday" type="date" value-format="yyyy-MM-dd"/>
|
2018-02-12 16:17:08 +02:00
|
|
|
</label>
|
2018-04-14 19:04:40 +03:00
|
|
|
<button class="ui primary" @click="save">%i18n:@save%</button>
|
2018-03-01 23:26:31 +02:00
|
|
|
<section>
|
|
|
|
<h2>その他</h2>
|
2018-04-07 21:58:11 +03:00
|
|
|
<mk-switch v-model="os.i.isBot" @change="onChangeIsBot" text="このアカウントはbotです"/>
|
2018-03-01 23:26:31 +02:00
|
|
|
</section>
|
2018-02-12 16:17:08 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
data() {
|
|
|
|
return {
|
2018-02-20 16:22:19 +02:00
|
|
|
name: null,
|
|
|
|
location: null,
|
|
|
|
description: null,
|
|
|
|
birthday: null,
|
2018-02-12 16:17:08 +02:00
|
|
|
};
|
|
|
|
},
|
2018-02-20 16:22:19 +02:00
|
|
|
created() {
|
2018-04-05 19:36:34 +03:00
|
|
|
this.name = (this as any).os.i.name || '';
|
2018-04-07 21:58:11 +03:00
|
|
|
this.location = (this as any).os.i.profile.location;
|
2018-02-20 16:22:19 +02:00
|
|
|
this.description = (this as any).os.i.description;
|
2018-04-07 21:58:11 +03:00
|
|
|
this.birthday = (this as any).os.i.profile.birthday;
|
2018-02-20 16:22:19 +02:00
|
|
|
},
|
2018-02-12 16:17:08 +02:00
|
|
|
methods: {
|
|
|
|
updateAvatar() {
|
2018-02-20 22:55:19 +02:00
|
|
|
(this as any).apis.updateAvatar();
|
2018-02-12 16:17:08 +02:00
|
|
|
},
|
|
|
|
save() {
|
2018-02-18 05:35:18 +02:00
|
|
|
(this as any).api('i/update', {
|
2018-04-05 19:36:34 +03:00
|
|
|
name: this.name || null,
|
2018-02-12 16:17:08 +02:00
|
|
|
location: this.location || null,
|
|
|
|
description: this.description || null,
|
|
|
|
birthday: this.birthday || null
|
|
|
|
}).then(() => {
|
2018-02-20 19:53:34 +02:00
|
|
|
(this as any).apis.notify('プロフィールを更新しました');
|
2018-02-12 16:17:08 +02:00
|
|
|
});
|
2018-03-01 23:26:31 +02:00
|
|
|
},
|
|
|
|
onChangeIsBot() {
|
|
|
|
(this as any).api('i/update', {
|
2018-04-07 21:58:11 +03:00
|
|
|
isBot: (this as any).os.i.isBot
|
2018-03-01 23:26:31 +02:00
|
|
|
});
|
2018-02-12 16:17:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-02-20 16:22:19 +02:00
|
|
|
.profile
|
2018-02-12 16:17:08 +02:00
|
|
|
> .avatar
|
|
|
|
> img
|
|
|
|
display inline-block
|
|
|
|
vertical-align top
|
|
|
|
width 64px
|
|
|
|
height 64px
|
|
|
|
border-radius 4px
|
|
|
|
|
|
|
|
> button
|
|
|
|
margin-left 8px
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|