This commit is contained in:
syuilo 2018-02-22 03:11:24 +09:00
parent 937b6539e0
commit 5daae05bcf
8 changed files with 30 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<component :is="os.isSignedIn ? 'home' : 'welcome'"></component> <component :is="os.isSignedIn ? 'home' : 'welcome'"></component>
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@ -15,7 +15,7 @@ import post from './api/post';
import notify from './api/notify'; import notify from './api/notify';
import MkIndex from './views/pages/index.vue'; import MkIndex from './views/pages/index.vue';
import MkUser from './views/pages/user/user.vue'; import MkUser from './views/pages/user.vue';
import MkSelectDrive from './views/pages/selectdrive.vue'; import MkSelectDrive from './views/pages/selectdrive.vue';
import MkDrive from './views/pages/drive.vue'; import MkDrive from './views/pages/drive.vue';

View File

@ -78,7 +78,7 @@ export default Vue.extend({
search() { search() {
const query = window.prompt('%i18n:mobile.tags.mk-ui-nav.search%'); const query = window.prompt('%i18n:mobile.tags.mk-ui-nav.search%');
if (query == null || query == '') return; if (query == null || query == '') return;
this.page('/search?q=' + encodeURIComponent(query)); this.$router.push('/search?q=' + encodeURIComponent(query));
}, },
onReadAllNotifications() { onReadAllNotifications() {
this.hasUnreadNotifications = false; this.hasUnreadNotifications = false;

View File

@ -14,6 +14,7 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import MkNotify from './notify.vue';
import XHeader from './ui.header.vue'; import XHeader from './ui.header.vue';
import XNav from './ui.nav.vue'; import XNav from './ui.nav.vue';

View File

@ -1,6 +1,7 @@
<template> <template>
<mk-ui :func="fn" func-icon="%fa:pencil-alt%"> <mk-ui :func="fn">
<span slot="header">%fa:home%%i18n:mobile.tags.mk-home.home%</span> <span slot="header">%fa:home%%i18n:mobile.tags.mk-home.home%</span>
<template slot="funcIcon">%fa:pencil-alt%</template>
<mk-home @loaded="onHomeLoaded"/> <mk-home @loaded="onHomeLoaded"/>
</mk-ui> </mk-ui>
</template> </template>
@ -9,7 +10,6 @@
import Vue from 'vue'; import Vue from 'vue';
import Progress from '../../../common/scripts/loading'; import Progress from '../../../common/scripts/loading';
import getPostSummary from '../../../../../common/get-post-summary'; import getPostSummary from '../../../../../common/get-post-summary';
import openPostForm from '../../scripts/open-post-form';
export default Vue.extend({ export default Vue.extend({
data() { data() {
@ -38,7 +38,7 @@ export default Vue.extend({
}, },
methods: { methods: {
fn() { fn() {
openPostForm(); (this as any).apis.post();
}, },
onHomeLoaded() { onHomeLoaded() {
Progress.done(); Progress.done();

View File

@ -0,0 +1,16 @@
<template>
<component :is="os.isSignedIn ? 'home' : 'welcome'"></component>
</template>
<script lang="ts">
import Vue from 'vue';
import Home from './home.vue';
import Welcome from './welcome.vue';
export default Vue.extend({
components: {
Home,
Welcome
}
});
</script>

View File

@ -1,6 +1,7 @@
<template> <template>
<mk-ui :func="fn" func-icon="%fa:pencil-alt%"> <mk-ui :func="fn">
<span slot="header" v-if="!fetching">%fa:user% {{user.name}}</span> <span slot="header" v-if="!fetching">%fa:user% {{user.name}}</span>
<template slot="funcIcon">%fa:pencil-alt%</template>
<div v-if="!fetching" :class="$style.user"> <div v-if="!fetching" :class="$style.user">
<header> <header>
<div class="banner" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=1024)` : ''"></div> <div class="banner" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=1024)` : ''"></div>

View File

@ -0,0 +1,5 @@
<template>
<div>
<mk-signin/>
</div>
</template>