findme-miniprogram-frontend/pages/user-profile/user-profile.wxss
2025-12-27 17:16:03 +08:00

464 lines
No EOL
7.3 KiB
Text

/* 用户资料页面样式 */
/* 基础样式重置 */
page {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: #f5f5f5;
color: #333;
overflow-x: hidden;
}
/* 顶部导航栏 */
.nav-bar {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: rgba(255, 255, 255, 0.95);
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}
.nav-left, .nav-right {
width: 44px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
}
.back-icon {
width: 20px;
height: 20px;
}
.nav-title {
font-size: 18px;
font-weight: 600;
color: #333;
}
/* 加载状态 */
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.loading-img {
width: 80rpx;
height: 80rpx;
animation: rotate 1s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.loading-text {
margin-top: 20rpx;
font-size: 28rpx;
color: #999;
}
/* 错误状态 */
.error-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.error-img {
width: 80rpx;
height: 80rpx;
opacity: 0.6;
}
.error-text {
margin-top: 20rpx;
font-size: 28rpx;
color: #999;
text-align: center;
padding: 0 40rpx;
}
.retry-btn {
margin-top: 40rpx;
background-color: #1aad19;
color: #fff;
font-size: 28rpx;
padding: 0 60rpx;
line-height: 70rpx;
border-radius: 35rpx;
}
.retry-btn:active {
opacity: 0.8;
}
/* 封面区域 */
.cover-section {
width: 100%;
height: 400rpx;
background-color: #f0f0f0;
overflow: hidden;
position: relative;
}
.cover-image {
width: 100%;
height: 100%;
object-fit: cover;
}
/* 用户基本信息区域 */
.user-info-section {
background-color: #fff;
padding: 20rpx 30rpx 40rpx;
margin-top: -80rpx;
border-radius: 20rpx 20rpx 0 0;
position: relative;
}
/* 头像和昵称信息 */
.avatar-info {
display: flex;
align-items: flex-start;
padding-bottom: 20rpx;
border-bottom: 1px solid #f0f0f0;
}
.user-avatar {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
border: 4rpx solid #fff;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.user-basic-info {
margin-left: 30rpx;
flex: 1;
}
.user-nickname {
font-size: 40rpx;
font-weight: 700;
color: #333;
display: block;
margin-bottom: 10rpx;
}
.user-id {
font-size: 28rpx;
color: #999;
display: block;
}
/* 操作按钮区域 */
.action-buttons {
display: flex;
justify-content: flex-end;
margin-top: 20rpx;
gap: 20rpx;
padding-top: 20rpx;
position: absolute;
z-index: 3;
right: 0;
}
.message-btn, .add-friend-btn, .follow-btn, .edit-btn {
display: flex;
align-items: center;
justify-content: center;
min-width: 180rpx;
height: 70rpx;
font-size: 28rpx;
line-height: 70rpx;
padding: 0 30rpx;
border-radius: 35rpx;
}
.message-btn {
background-color: #1aad19;
color: #fff;
border: none;
}
.add-friend-btn {
background-color: #1aad19;
color: #fff;
border: none;
}
.follow-btn {
background-color: #f0f0f0;
color: #666;
border: none;
}
.edit-btn {
background-color: #1aad19;
color: #fff;
border: none;
}
.btn-icon {
width: 30rpx;
height: 30rpx;
margin-right: 8rpx;
}
.btn-text {
font-size: 28rpx;
}
/* 用户个人简介 */
.user-intro {
margin-top: 30rpx;
padding: 20rpx;
background-color: #f9f9f9;
border-radius: 10rpx;
}
.intro-text {
font-size: 32rpx;
line-height: 48rpx;
color: #666;
}
/* 用户基本信息详情 */
.user-details {
margin-top: 30rpx;
}
.detail-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
border-bottom: 1px solid #f0f0f0;
}
.detail-item:last-child {
border-bottom: none;
}
.detail-label {
font-size: 32rpx;
color: #666;
}
.detail-value {
font-size: 32rpx;
color: #333;
}
/* 统计数据区域 */
.stats-section {
display: flex;
justify-content: space-around;
align-items: center;
background-color: #fff;
padding: 30rpx 0;
margin-top: 20rpx;
border-radius: 10rpx;
}
.stat-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex: 1;
}
.stat-number {
font-size: 40rpx;
font-weight: 700;
color: #333;
margin-bottom: 10rpx;
}
.stat-label {
font-size: 28rpx;
color: #999;
}
.stat-divider {
width: 1rpx;
height: 60rpx;
background-color: #f0f0f0;
}
/* 动态列表标题 */
.feed-section-header {
background-color: #fff;
margin-top: 20rpx;
padding: 20rpx 30rpx;
border-radius: 10rpx 10rpx 0 0;
}
.section-title {
font-size: 34rpx;
font-weight: 600;
color: #333;
}
/* 动态列表区域 */
.feed-section {
background-color: #fff;
padding: 0 30rpx 40rpx;
border-radius: 0 0 10rpx 10rpx;
margin-bottom: 30rpx;
}
/* 动态项 */
.feed-item {
padding: 30rpx 0;
border-bottom: 1px solid #f0f0f0;
}
.feed-item:last-child {
border-bottom: none;
}
/* 动态内容 */
.feed-content {
margin-bottom: 20rpx;
}
/* 为内部text标签添加换行样式 */
.feed-content text,
.feed-content .content-text {
word-break: break-all !important; /* 允许在任意字符处断行 */
word-wrap: break-word !important; /* 允许长单词换行到下一行 */
overflow-wrap: break-word !important; /* 更现代的换行属性,支持更多浏览器 */
white-space: pre-wrap !important; /* 保留空白并自动换行 */
display: block;
width: 100%;
overflow: hidden; /* 防止内容溢出容器 */
/* 针对连续英文和数字的特殊处理 */
-webkit-hyphens: auto; /* WebKit浏览器支持 */
hyphens: auto; /* 允许自动断词并添加连字符 */
}
.content-text {
font-size: 32rpx;
line-height: 48rpx;
color: #333;
white-space: pre-wrap !important;
word-break: break-all !important;
word-wrap: break-word !important;
overflow-wrap: break-word !important;
display: block;
overflow: hidden;
-webkit-hyphens: auto;
hyphens: auto;
}
/* 动态媒体 */
.feed-media {
margin-bottom: 20rpx;
}
.media-grid {
display: flex;
flex-wrap: wrap;
gap: 10rpx;
}
.media-row {
display: flex;
gap: 10rpx;
margin-bottom: 10rpx;
}
.media-row:last-child {
margin-bottom: 0;
}
.media-image {
border-radius: 10rpx;
overflow: hidden;
}
.media-image.small {
width: 220rpx;
height: 220rpx;
}
.media-image.grid {
width: 220rpx;
height: 220rpx;
}
/* 动态时间 */
.feed-footer {
display: flex;
justify-content: flex-end;
}
.feed-time {
font-size: 26rpx;
color: #999;
}
/* 无动态提示 */
.no-feeds {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.no-feeds-img {
width: 120rpx;
height: 120rpx;
opacity: 0.4;
}
.no-feeds-text {
margin-top: 20rpx;
font-size: 28rpx;
color: #999;
}
/* 加载更多提示 */
.loading-more {
display: flex;
justify-content: center;
align-items: center;
padding: 30rpx 0;
}
.loading-more-text {
font-size: 28rpx;
color: #999;
}
/* 没有更多数据提示 */
.no-more {
display: flex;
justify-content: center;
align-items: center;
padding: 30rpx 0;
}
.no-more-text {
font-size: 28rpx;
color: #999;
}