Skip to content

Commit

Permalink
登录页代码重构
Browse files Browse the repository at this point in the history
  • Loading branch information
Junvary committed Oct 19, 2022
1 parent 3a0b8b9 commit e7407ed
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 279 deletions.
86 changes: 0 additions & 86 deletions GQA-FRONTEND/src/components/GqaScrollDown/index.vue

This file was deleted.

7 changes: 4 additions & 3 deletions GQA-FRONTEND/src/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
.gqa-form {
& .q-field {
&__bottom--animated {
left : -5px;
bottom : 15px !important;
z-index: 10;
left : -5px;
bottom : 15px !important;
z-index : 10;
pointer-events: none;

& .q-field__messages {
& div {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<section id="gqa-banner" v-if="bannerImage !== ''">
<section id="gqa-banner">
<q-img :src="bannerImage" fit="cover" style="width: 100%; max-height: 95vh">
<div class="container-custom">
<div class="container-title">
Expand Down Expand Up @@ -29,43 +29,13 @@
</div>
</q-img>
</section>

<section class="gin-quasar-admin-banner" id="gqa-banner" v-else>
<div class="container-default">
<div class="container-title">
<h1>
{{ gqaFrontend.subTitle }}
</h1>
<p class="small-title">
{{ gqaFrontend.webDescribe }}
</p>
<div class="buttons">
<q-btn push color="primary" @click="openLink('https://gitee.com/junvary/gin-quasar-admin')"
v-if="gqaFrontend.showGit === 'yesNo_yes'">
Gitee
</q-btn>

<q-btn push color="primary" @click="showLoginForm">
{{ $t('Login') }}
</q-btn>

<q-btn push color="primary" @click="openLink('https://github.com/Junvary/gin-quasar-admin')"
v-if="gqaFrontend.showGit === 'yesNo_yes'">
Github
</q-btn>
</div>
</div>
</div>
</section>

<login-dialog ref="loginDialog" />

</div>
</template>

<script setup>
import { ref, computed, toRefs } from 'vue';
import LoginDialog from './LoginDialog.vue'
import { ref, computed } from 'vue';
import LoginDialog from '../LoginDialog.vue'
import { useStorageStore } from 'src/stores/storage'
const loginDialog = ref(null);
Expand All @@ -77,7 +47,7 @@ const bannerImage = computed(() => {
if (gqaFrontend.value.bannerImage && gqaFrontend.value.bannerImage.substring(0, 11) === 'gqa-upload:') {
return process.env.API + gqaFrontend.value.bannerImage.substring(11)
}
return ''
return "/img/sky.jpg"
})
const showLoginForm = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<q-layout style="overflow-x: hidden">
<q-page-container>
<page-banner />
<!-- <GqaScrollDown id="login-layout-scroll-down" class="login-layout-scroll-down"
v-if="pluginCurrent && pluginComponent && showScrollDown" @click="scrollDown" /> -->
<component v-if="pluginCurrent && pluginComponent" :key="pluginCurrent" :is="pluginComponent" />
<q-card v-else class="row items-center justify-center" style="padding: 20px 0;">
<q-btn color="primary" :label="$t('LoginLayoutWithoutPlugin')"></q-btn>
Expand All @@ -20,7 +18,6 @@
import { ref, onUnmounted, onBeforeMount, toRefs } from 'vue';
import PageBanner from './PageBanner.vue'
import PageFooter from './PageFooter.vue'
import GqaScrollDown from 'src/components/GqaScrollDown/index.vue'
const props = defineProps({
pluginComponent: {
Expand All @@ -43,12 +40,6 @@ onUnmounted(() => {
window.removeEventListener('scroll', documentTop())
})
const scrollDown = () => {
document.getElementById('login-layout-scroll-down').nextElementSibling.scrollIntoView({
behavior: 'smooth',
})
}
const documentTop = () => {
let top = document.documentElement.scrollTop
if (top > 200) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
</div>
</template>


<script setup>
import { onMounted, ref, computed } from 'vue'
import { useQuasar } from 'quasar'
Expand Down Expand Up @@ -175,4 +176,4 @@ const checkDb = async () => {
}
}
}
</script>
</script>
9 changes: 3 additions & 6 deletions GQA-FRONTEND/src/layouts/LoginLayout/LoginDialog.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<q-dialog v-model="loginVisible">
<q-card bordered style="width: 800px; max-width: 50vw;">
<q-card bordered style="width: 1000px; max-width: 50vw;">
<q-card-section horizontal>
<q-img class="col-6" :src="bannerImage" fit="cover" />
<LoginForm class="col-6" />
Expand All @@ -16,12 +16,12 @@ import { ref, computed } from 'vue';
const { gqaFrontend } = useCommon()
const loginVisible = ref(false);
const randomImg = 'https://api.ixiaowai.cn/api/api.php'
const bannerImage = computed(() => {
if (gqaFrontend.value.bannerImage && gqaFrontend.value.bannerImage.substring(0, 11) === 'gqa-upload:') {
return process.env.API + gqaFrontend.value.bannerImage.substring(11)
}
return randomImg
return "/img/sky.jpg"
})
const show = () => {
Expand All @@ -32,6 +32,3 @@ defineExpose({
show
})
</script>

<style lang="scss" scoped>
</style>
Loading

0 comments on commit e7407ed

Please sign in to comment.