<template> <div class="login_container"> <div class="top"> <div class="loginBtn"> <p @click="loginFn">{{ user.token ? '已登录' : '登录/注册' }}</p> </div> <div class="title">{{ setting.title }}</div> </div> <div class="main-content"> <div class="personal-center"> <div class="leftBox"> <h2>个人中心</h2> <p>学生8527</p> <button class="btn1" @click="handleHomeClick">首页</button> <button class="btn2" @click="handleRecordClick">学习/成绩记录</button> <button class="btn3" @click="handlePasswordClick">密码管理</button> </div> <div class="rightBoxes"> <div class="topBox"></div> <div class="bottomBox"></div> </div> </div> </div> </div> </template> <script setup lang="ts" name="spacePage"> import { ref } from "vue" import { useRouter } from 'vue-router' import settingStore from "@/store/modules/setting"; const setting = settingStore(); import userStore from '@/store/modules/user'; const router = useRouter() const user = userStore(); const loginFn = () => { router.push('/login') } const handleHomeClick = () => { // 处理首页按钮点击逻辑,如路由跳转 console.log('首页按钮被点击'); }; const handleRecordClick = () => { console.log('学习/成绩记录按钮被点击'); }; const handlePasswordClick = () => { console.log('密码管理按钮被点击'); }; </script> <style lang="less" scoped> .login_container { position: relative; width: 100%; // height: 1080px; min-height: 100vh; background-color: #091d22; background: url("../assets//images/bg3.png") no-repeat; background-size: cover; .top { width: 100%; height: 75px; text-align: center; font-size: 42px; line-height: 75px; font-style: italic; background: url("../assets/images/topbgc.png") no-repeat; // background-position: center bottom -10px; background-size: cover; .title { color: #fff; } .loginBtn { position: absolute; /* 清除浮动影响 */ float: left; /* 向左浮动 */ top: 10px; left: 230px; border: 1px solid #33FEFE; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); width: 142px; height: 40px; line-height: 37px; background: linear-gradient(to bottom, #08B9C1, #0758B8); transform: skew(-30deg); cursor: pointer; /* 在X轴方向倾斜 -30 度 */ border-radius: 5%; p { transform: skew(30deg); /* 反向倾斜,抵消父元素的变形 */ font-size: 18px; color: #fff; } } } } .main-content { display: flex; justify-content: center; align-items: center; .personal-center { display: flex; width: 1800px; height: 600px; margin-top: 150px; justify-content: space-evenly; .leftBox { position: relative; width: 550px; height: 600px; background: url("../assets/images/space1.png") no-repeat; transform: skewX(-5deg); margin-right: -150px; // flex-direction: column; background-size: 98%; h2 { position: absolute; top: 6px; left: 60%; transform: translateX(-50%); color: #ededd8; font-size: 16px; font-weight: 700; height: 40px; line-height: 40px; font-size: 20px; } p { position: absolute; top: 28%; left: 55%; transform: translateX(-50%); color: #fdeda0; font-size: 20px; font-weight: 700; height: 40px; line-height: 40px; } .btn1, .btn2, .btn3 { display: block; width: 200px; height: 55px; background-color: #e9ddab; margin: 25px auto; border: none; border-radius: 5px; color: #333; font-size: 20px; font-weight: 700; transform: skewX(-17deg); } .btn1 { position: absolute; top: 268px; left: 31%; } .btn2 { position: absolute; left: 26%; top: 360px; } .btn3 { position: absolute; left: 22%; top: 453px; } } .rightBoxes { width: 1200px; height: 600px; // background-color: skyblue; // flex: 1; display: flex; justify-content: space-around; flex-direction: column; transform: skewX(-17deg); .topBox { // width: 800px; // height: 300px; flex: 1; background-color: lightgreen; background: url("../assets/images/space2.png") no-repeat; background-size: 98%; // display: flex; // justify-content: center; // align-items: center; transform: skewX(15deg); } .bottomBox { margin-top: 36px; flex: 1; // width: 800px; // height: 200px; background-color: lightcoral; background: url("../assets/images/space3.png") no-repeat; background-size: 98%; // display: flex; // justify-content: center; // align-items: center; transform: skewX(15deg); } } } } // .personal-center { // background-color: #003366; // padding: 20px; // color: white; // border-radius: 10px; // transform: skewX(-15deg); // display: flex; // }</style>