topfans/frontend/components/LoginBackground.vue

150 lines
2.6 KiB
Vue

<template>
<view class="login-bg">
<!-- 状态栏占位 -->
<view class="status-bar"></view>
<view v-if="showBack" class="nav-back" @tap="goBack">
<text class="nav-back-icon">←</text>
</view>
<!-- 背景图片层 -->
<image
class="background-image"
src="/static/login/portal/bg.png"
mode="aspectFill"
></image>
<!-- 女孩图片(点缀) -->
<image
class="character-upper"
src="/static/login/portal/character1.png"
mode="aspectFit"
></image>
<!-- 粉色玩偶(点缀) -->
<image
class="character-lower"
src="/static/login/portal/character2.png"
mode="aspectFit"
></image>
<!-- TOPFANS 标题 -->
<view v-if="showLogo" class="title-wrapper">
<image
class="topfans-logo"
src="/static/login/portal/topfans-logo.png"
mode="aspectFit"
></image>
</view>
<!-- 内容插槽 -->
<slot></slot>
</view>
</template>
<script setup>
defineProps({
showLogo: {
type: Boolean,
default: true,
},
showBack: {
type: Boolean,
default: true,
},
});
const goBack = () => {
uni.navigateBack();
};
</script>
<style scoped>
.login-bg {
position: relative;
width: 100%;
min-height: 100vh;
height: 100vh;
overflow: hidden;
}
.status-bar {
width: 100%;
height: 44rpx;
position: relative;
z-index: 10;
flex-shrink: 0;
}
.nav-back {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 96rpx;
left: 32rpx;
/* background: rgba(255,255,255,0.5);
border-radius: 50%; */
}
.nav-back-icon {
font-size: 48rpx;
font-weight: bold;
color: #fff;
}
/* 背景图:覆盖整个屏幕 */
.background-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
opacity: 0.68;
}
/* 上方人物图(女孩) */
.character-upper {
position: absolute;
left: 50%;
transform: translateX(-50%) rotate(0.5deg);
width: 100%;
height: 100%;
z-index: 1;
object-fit: contain;
}
/* 下方粉色玩偶 */
.character-lower {
position: absolute;
top: 448rpx;
left: 50%;
transform: translateX(-50%) rotate(0.5deg);
width: 135%;
height: 100%;
z-index: 2;
object-fit: contain;
}
/* TOPFANS 标题 */
.title-wrapper {
width: 758rpx;
height: 192rpx;
position: relative;
z-index: 10;
padding-top: 30rpx;
display: flex;
justify-content: center;
flex-shrink: 0;
}
.topfans-logo {
width: 100%;
height: 100%;
/* filter: drop-shadow(0 4rpx 9rpx rgba(177, 19, 19, 0.49)); */
}
</style>