|
|
|
@ -15,6 +15,7 @@
|
|
|
|
|
<img v-if="previewAvatar" :src="previewAvatar" alt="新头像预览" class="new-avatar">
|
|
|
|
|
</div>
|
|
|
|
|
<label class="upload-btn">
|
|
|
|
|
<span class="plus-icon">+</span>
|
|
|
|
|
选择新头像
|
|
|
|
|
<input type="file" accept="image/*" @change="handleAvatarChange" class="file-input">
|
|
|
|
|
</label>
|
|
|
|
@ -143,7 +144,7 @@ import { ref, computed, onMounted } from 'vue';
|
|
|
|
|
import { useUserStore } from '@/stores/user';
|
|
|
|
|
import request from '@/utils/request';
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
|
|
const userInfo = computed(() => userStore.userInfo);
|
|
|
|
@ -384,9 +385,10 @@ onMounted(() => {
|
|
|
|
|
max-width: 700px;
|
|
|
|
|
margin: 2rem auto;
|
|
|
|
|
padding: 2.5rem 2rem 2rem 2rem;
|
|
|
|
|
background: #f8f9fa;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
box-shadow: 0 4px 16px rgba(52, 152, 219, 0.08);
|
|
|
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
@ -396,6 +398,8 @@ onMounted(() => {
|
|
|
|
|
margin-bottom: 2.2rem;
|
|
|
|
|
letter-spacing: 1px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-bottom: 2px solid #ff88aa;
|
|
|
|
|
padding-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.section-title {
|
|
|
|
@ -428,13 +432,15 @@ onMounted(() => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.new-avatar {
|
|
|
|
|
border-color: #3498db;
|
|
|
|
|
border-color: #ff88aa;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.upload-btn {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
padding: 0.5rem 1.2rem;
|
|
|
|
|
background: linear-gradient(90deg, #3498db 60%, #6dd5fa 100%);
|
|
|
|
|
background: #ff88aa;
|
|
|
|
|
color: white;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
@ -445,7 +451,12 @@ onMounted(() => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.upload-btn:hover {
|
|
|
|
|
background: linear-gradient(90deg, #2980b9 60%, #3498db 100%);
|
|
|
|
|
background: #ff6699;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.plus-icon {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.file-input {
|
|
|
|
@ -483,17 +494,17 @@ onMounted(() => {
|
|
|
|
|
.input, .textarea, select.input {
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
border: 1px solid #bdc3c7;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
border: 1px solid #e0e0e0;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
transition: border-color 0.3s ease;
|
|
|
|
|
background: #fff;
|
|
|
|
|
background: #f9f9f9;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input:focus, .textarea:focus, select.input:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: #3498db;
|
|
|
|
|
box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.08);
|
|
|
|
|
border-color: #ff88aa;
|
|
|
|
|
box-shadow: 0 0 0 2px rgba(255, 136, 170, 0.08);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input-error {
|
|
|
|
@ -514,10 +525,10 @@ onMounted(() => {
|
|
|
|
|
.submit-btn {
|
|
|
|
|
width: 100%;
|
|
|
|
|
padding: 0.85rem;
|
|
|
|
|
background: linear-gradient(90deg, #3498db 60%, #6dd5fa 100%);
|
|
|
|
|
background: #ff88aa;
|
|
|
|
|
color: white;
|
|
|
|
|
border: none;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
cursor: pointer;
|
|
|
|
@ -527,6 +538,34 @@ onMounted(() => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.submit-btn:hover {
|
|
|
|
|
background: linear-gradient(90deg, #2980b9 60%, #3498db 100%);
|
|
|
|
|
background: #ff6699;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 花瓣动画(与背景呼应) */
|
|
|
|
|
@keyframes fall {
|
|
|
|
|
0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
|
|
|
|
|
100% { transform: translateY(100vh) rotate(360deg); opacity: 0.5; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.petal {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 10px;
|
|
|
|
|
height: 15px;
|
|
|
|
|
background: pink;
|
|
|
|
|
border-radius: 50% 50% 0 0;
|
|
|
|
|
animation: fall 5s linear infinite;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 初始化花瓣(可在mounted中动态生成,此处简化) */
|
|
|
|
|
.change-info-container::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
animation: none; /* 避免重复动画 */
|
|
|
|
|
}
|
|
|
|
|
</style>
|