与牧同行-小程序用户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

677 lines
12 KiB

/* ========== 页面整体样式 ========== */
.consult-page {
width: 100vw;
height: 100vh;
background: #f5f5f5;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ========== 头部样式 ========== */
.consult-header {
background: #ffffff;
border-bottom: 1rpx solid #e5e5e5;
position: relative;
z-index: 1000;
box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.05);
flex-shrink: 0;
}
.header-content {
display: flex;
align-items: center;
padding: 12rpx 24rpx;
height: 96rpx;
}
.header-center {
flex: 1;
display: flex;
justify-content: center;
}
.expert-info {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.expert-name {
font-size: 32rpx;
font-weight: 600;
color: #000000;
line-height: 44rpx;
margin-bottom: 4rpx;
}
.expert-status {
display: flex;
align-items: center;
justify-content: center;
}
.status-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
margin-right: 8rpx;
}
.status-dot.online {
background: #07c160;
animation: pulse 2s infinite;
}
.status-dot.offline {
background: #cccccc;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0.4); }
70% { box-shadow: 0 0 0 8rpx rgba(7, 193, 96, 0); }
100% { box-shadow: 0 0 0 0 rgba(7, 193, 96, 0); }
}
.status-text {
font-size: 24rpx;
color: #666666;
}
/* ========== 聊天容器 ========== */
.chat-container {
flex: 1;
padding: 20rpx 0;
background: #f5f5f5;
overflow-y: auto;
position: relative;
height: 0;
}
/* 日期分隔线 */
.date-divider {
display: flex;
justify-content: center;
margin: 40rpx 0 30rpx;
}
.date-text {
background: rgba(0, 0, 0, 0.1);
padding: 8rpx 32rpx;
border-radius: 100rpx;
font-size: 24rpx;
color: #ffffff;
background-color: #d8d8d8;
}
/* ========== 消息项 ========== */
.message-item {
display: flex;
margin-bottom: 24rpx;
padding: 0 30rpx;
opacity: 0;
animation: fadeIn 0.3s ease forwards;
align-items: flex-start;
position: relative;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10rpx); }
to { opacity: 1; transform: translateY(0); }
}
.message-left { justify-content: flex-start; }
.message-right { justify-content: flex-end; }
/* 头像 */
.message-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 8rpx;
overflow: hidden;
flex-shrink: 0;
background: #ffffff;
border: 1rpx solid #f0f0f0;
position: relative;
z-index: 1;
}
.message-left .message-avatar { margin-right: 16rpx; }
.message-right .message-avatar { margin-left: 16rpx; }
.avatar-img {
width: 100%;
height: 100%;
object-fit: cover;
}
/* 消息内容包装器 */
.message-content-wrapper {
max-width: 480rpx;
position: relative;
display: flex;
flex-direction: column;
z-index: 2;
}
.message-left .message-content-wrapper { align-items: flex-start; }
.message-right .message-content-wrapper { align-items: flex-end; }
/* 气泡箭头 */
.message-arrow {
position: absolute;
width: 0;
height: 0;
border-style: solid;
border-width: 12rpx;
top: 30rpx;
z-index: 1;
}
.arrow-left {
left: -24rpx;
border-color: transparent #ffffff transparent transparent;
}
.arrow-right {
right: -24rpx;
border-color: transparent transparent transparent #95ec69;
}
/* 消息气泡 */
.message-bubble {
position: relative;
padding: 16rpx 20rpx;
word-break: break-word;
box-sizing: border-box;
min-height: 60rpx;
display: flex;
align-items: center;
}
.bubble-left {
background: #ffffff;
border-radius: 10rpx;
border-top-left-radius: 4rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}
.bubble-right {
background: #95ec69;
border-radius: 10rpx;
border-top-right-radius: 4rpx;
box-shadow: 0 2rpx 8rpx rgba(149, 236, 105, 0.2);
}
/* 文本消息 */
.message-text {
font-size: 32rpx;
color: #000000;
line-height: 1.4;
}
.bubble-right .message-text { color: #000000; }
/* 媒体消息 */
.media-bubble {
position: relative;
border-radius: 10rpx;
overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
background: #ffffff;
min-height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
}
.message-left .media-bubble { border-top-left-radius: 4rpx; }
.message-right .media-bubble { border-top-right-radius: 4rpx; }
.message-image {
width: 280rpx;
height: 280rpx;
display: block;
}
.message-video {
width: 280rpx;
height: 280rpx;
background: #000000;
}
.video-play-overlay {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
}
.play-icon {
width: 40rpx;
height: 40rpx;
margin-left: 4rpx;
}
/* 文件消息 */
.message-file {
min-width: 280rpx;
padding: 20rpx;
display: flex;
align-items: center;
min-height: 60rpx;
}
.file-icon-box {
width: 56rpx;
height: 72rpx;
margin-right: 16rpx;
position: relative;
flex-shrink: 0;
}
.file-icon {
width: 100%;
height: 100%;
}
.file-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
}
.file-name {
font-size: 28rpx;
font-weight: 500;
color: #000000;
margin-bottom: 6rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.file-size {
font-size: 24rpx;
color: #666666;
}
/* 上传进度 */
.upload-progress {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
border-radius: inherit;
}
.progress-circle {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
border: 6rpx solid rgba(255, 255, 255, 0.3);
border-top-color: #ffffff;
animation: spin 1s linear infinite;
display: flex;
align-items: center;
justify-content: center;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.progress-text {
font-size: 20rpx;
color: #ffffff;
font-weight: 600;
}
/* 底部留白 */
.chat-bottom-space { height: 40rpx; }
/* 加载更多 */
.load-more-tip {
display: flex;
justify-content: center;
align-items: center;
padding: 30rpx 0;
color: #999999;
font-size: 24rpx;
}
/* 空状态 */
.empty-tip {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
color: #999999;
}
.empty-icon {
width: 200rpx;
height: 200rpx;
margin-bottom: 30rpx;
opacity: 0.6;
}
.empty-text {
font-size: 28rpx;
color: #999999;
}
/* ========== 输入区域 - 优化垂直对齐和按钮美化 ========== */
.input-section {
background: #ffffff;
border-top: 1rpx solid #e5e5e5;
padding: 16rpx 30rpx;
position: relative;
z-index: 100;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
flex-shrink: 0;
width: 100%;
box-sizing: border-box;
}
/* 文字输入面板 - 垂直居中优化 */
.text-input-panel {
display: flex;
align-items: center;
gap: 16rpx;
min-height: 72rpx;
}
/* 添加按钮 - 完美垂直居中 */
.add-btn {
width: 72rpx;
height: 72rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.add-icon {
width: 60rpx;
height: 60rpx;
}
/* 输入框包装器 - 优化高度和内边距 */
.input-wrapper {
flex: 1;
position: relative;
background: #f5f5f5;
border-radius: 36rpx;
min-height: 72rpx;
display: flex;
align-items: center;
padding: 0 24rpx;
transition: all 0.2s;
box-sizing: border-box;
}
.input-wrapper:active {
background: #e8e8e8;
}
/* 多行文本输入框 - 优化垂直居中 */
.chat-textarea {
flex: 1;
width: 100%;
font-size: 30rpx;
color: #333333;
line-height: 1.4;
min-height: 48rpx;
max-height: 160rpx;
padding: 12rpx 0;
margin: 0;
background: transparent;
border: none;
box-sizing: border-box;
overflow-y: auto;
}
/* 占位符样式 */
.input-placeholder {
color: #999999;
font-size: 28rpx;
line-height: 1.4;
}
/* 清空按钮 - 完美垂直居中 */
.input-actions {
position: absolute;
right: 16rpx;
top: 50%;
transform: translateY(-50%);
z-index: 2;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
}
.clear-btn {
width: 36rpx;
height: 36rpx;
border: none;
background: transparent;
padding: 0;
margin: 0;
line-height: 1;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.clear-btn::after {
border: none;
}
.clear-btn:active {
background: rgba(0, 0, 0, 0.1);
}
.clear-icon {
width: 28rpx;
height: 28rpx;
}
/* 发送按钮 - 美观渐变绿色,完美垂直居中 */
.send-btn {
background: linear-gradient(135deg, #07c160 0%, #06ae56 100%);
width: 112rpx;
height: 72rpx;
border-radius: 36rpx;
border: none;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
padding: 0;
margin: 0;
line-height: 1;
flex-shrink: 0;
box-shadow: 0 4rpx 8rpx rgba(7, 193, 96, 0.2);
position: relative;
overflow: hidden;
}
/* 发送按钮点击效果 */
.send-btn:active {
background: linear-gradient(135deg, #06ae56 0%, #059c4c 100%);
transform: scale(0.96);
box-shadow: 0 2rpx 4rpx rgba(7, 193, 96, 0.3);
}
/* 发送按钮水波纹效果 */
.send-btn::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-radius: 50%;
background: rgba(255, 255, 255, 0.3);
transform: translate(-50%, -50%);
transition: width 0.3s, height 0.3s;
}
.send-btn:active::after {
width: 200rpx;
height: 200rpx;
opacity: 0;
}
.send-text {
font-size: 28rpx;
color: #ffffff;
font-weight: 600;
letter-spacing: 2rpx;
}
/* 发送按钮占位 - 保持布局稳定 */
.send-placeholder {
width: 112rpx;
height: 72rpx;
flex-shrink: 0;
}
/* 适配小屏幕 */
@media screen and (max-width: 320px) {
.send-btn { width: 100rpx; }
.send-placeholder { width: 100rpx; }
}
/* ========== 多媒体选择面板 ========== */
.media-action-sheet {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: flex-end;
justify-content: center;
z-index: 2000;
animation: fadeIn 0.3s ease;
}
.media-sheet-content {
width: 100%;
background: #F7F7F7;
border-radius: 40rpx 40rpx 0 0;
padding: 40rpx 30rpx calc(10rpx + env(safe-area-inset-bottom));
animation: slideUp 0.3s ease;
box-sizing: border-box;
}
@keyframes slideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.media-sheet-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 40rpx;
padding: 0 10rpx 20rpx;
border-bottom: 1px solid #E4E4E4;
}
.sheet-title {
font-size: 32rpx;
font-weight: 600;
color: #000000;
}
.close-sheet-btn {
display: flex;
align-items: center;
justify-content: center;
}
.close-sheet-btn image {
width: 60rpx;
height: 60rpx;
}
.media-options-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 40rpx 30rpx;
margin-bottom: 40rpx;
}
.media-option {
display: flex;
flex-direction: column;
align-items: center;
border: none;
background: transparent;
padding: 0;
margin: 0;
line-height: 1;
}
.option-icon-box {
width: 120rpx;
height: 120rpx;
border-radius: 30rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 16rpx;
transition: transform 0.2s;
background-color: #fff;
}
.media-option:active .option-icon-box {
transform: scale(0.95);
}
.option-icon-box image {
width: 60rpx;
height: 60rpx;
}
.option-text {
font-size: 26rpx;
color: #666666;
}
.sheet-bottom {
text-align: center;
}
.bottom-tip {
font-size: 24rpx;
color: #999999;
}
/* 适配全面屏 */
.safe-area-bottom {
padding-bottom: env(safe-area-inset-bottom);
}