修复模态框位置问题

main
lee-zt 4 weeks ago
parent 944b8f37f8
commit 5280af67db

@ -46,7 +46,7 @@ onMounted(() => {
text-align: center; text-align: center;
color: #2c3e50; color: #2c3e50;
margin-top: 60px; margin-top: 60px;
position: relative; position: relative;
z-index: 1; z-index: 1;
} }

@ -174,7 +174,6 @@ watch(() => userStore.userInfo, (newInfo) => {
padding: 0 20px; /* 增加左右内边距,避免内容过于靠边 */ padding: 0 20px; /* 增加左右内边距,避免内容过于靠边 */
border-bottom: 2px solid #e0e0e0; border-bottom: 2px solid #e0e0e0;
background: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(4px); /* 添加毛玻璃效果 */
position: fixed; position: fixed;
top: 0; top: 0;
width: 100%; width: 100%;

@ -206,7 +206,7 @@ async function login() {
userData.userid = userData.id; userData.userid = userData.id;
userStore.login(userData); userStore.login(userData);
window.location.reload(); //
ElMessage({ ElMessage({
message: '登录成功', message: '登录成功',
type: 'success', type: 'success',

@ -2,7 +2,7 @@
<div class="welcome-container"> <div class="welcome-container">
<!-- 上部分欢迎文字 --> <!-- 上部分欢迎文字 -->
<div class="welcome-header"> <div class="welcome-header">
欢迎来到珞珈岛珈人 欢迎来到珞珈岛{{ userStore.userInfo?.username ? userStore.userInfo.username : '珈人' }}
</div> </div>
<!-- 中间部分月份日期星期 --> <!-- 中间部分月份日期星期 -->
@ -33,6 +33,7 @@
<script setup lang="js" name="WelcomeCalendar"> <script setup lang="js" name="WelcomeCalendar">
import { ref } from 'vue'; import { ref } from 'vue';
import { useUserStore } from '@/stores/user';
const today = new Date(); const today = new Date();
@ -40,10 +41,31 @@ const today = new Date();
const currentMonthText = ref(['一', '月']); // const currentMonthText = ref(['一', '月']); //
const currentDay = ref(today.getDate()); // const currentDay = ref(today.getDate()); //
const currentWeekday = ref(['星', '期', '日']); // const currentWeekday = ref(['星', '期', '日']); //
const userStore = useUserStore();
// //
const isCheckedIn = ref(false); const isCheckedIn = ref(false);
//
const getUserKey = () => {
return userStore.userInfo?.userid || userStore.userInfo?.username || 'guest';
};
//
const checkToday = () => {
const todayStr = new Date().toISOString().slice(0, 10);
const userKey = getUserKey();
return localStorage.getItem(`checkin-${userKey}-${todayStr}`) === '1';
};
//
const checkIn = () => {
const todayStr = new Date().toISOString().slice(0, 10);
const userKey = getUserKey();
isCheckedIn.value = true;
localStorage.setItem(`checkin-${userKey}-${todayStr}`, '1');
};
// //
const initializeDate = () => { const initializeDate = () => {
const months = [ const months = [
@ -55,11 +77,7 @@ const initializeDate = () => {
currentMonthText.value = months[today.getMonth()].split(''); currentMonthText.value = months[today.getMonth()].split('');
currentDay.value = today.getDate(); currentDay.value = today.getDate();
currentWeekday.value = weekdays[today.getDay()].split(''); currentWeekday.value = weekdays[today.getDay()].split('');
}; isCheckedIn.value = checkToday();
//
const checkIn = () => {
isCheckedIn.value = true;
}; };
// //

@ -150,7 +150,7 @@ const userInfo = computed(() => userStore.userInfo);
const router = useRouter(); const router = useRouter();
// //
const defaultAvatar = require('@/assets/default-avatar/boy_4.png'); const defaultAvatar = require('@/assets/default-avatar/boy_1.png');
// //
const handleAvatarError = "this.onerror=null;this.src='" + defaultAvatar + "'"; const handleAvatarError = "this.onerror=null;this.src='" + defaultAvatar + "'";

Loading…
Cancel
Save