与牧同行-小程序用户端
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.
 

897 lines
14 KiB

/* 页面整体样式 */
.consult-page {
width: 100vw;
height: 100vh;
background: #f5f5f5;
display: flex;
flex-direction: column;
}
/* 头部样式 */
.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);
}
.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;
}
/* 日期分隔线 */
.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;
font-weight: 400;
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; /* 固定在头像中间位置 (80rpx/2 = 40rpx) */
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-audio {
min-width: 240rpx;
padding: 20rpx;
display: flex;
align-items: center;
min-height: 60rpx;
}
.audio-icon-left,
.audio-icon-right {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
.audio-icon-left {
margin-right: 16rpx;
}
.audio-icon-right {
margin-left: 16rpx;
}
.audio-content {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
}
.audio-wave {
display: flex;
align-items: flex-end;
height: 28rpx;
margin-right: 16rpx;
}
.wave-bar {
width: 4rpx;
margin: 0 2rpx;
background: currentColor;
border-radius: 2rpx;
animation: wave 1s ease-in-out infinite;
}
@keyframes wave {
0%, 100% {
height: 12rpx;
}
50% {
height: 28rpx;
}
}
.audio-duration {
font-size: 26rpx;
font-weight: 500;
color: #000000;
}
/* 文件消息 */
.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: 20rpx 30rpx;
position: relative;
z-index: 100;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
}
/* 语音输入面板 */
.voice-input-panel {
display: flex;
align-items: center;
gap: 20rpx;
height: 80rpx;
}
/* 文字输入面板 */
.text-input-panel {
display: flex;
align-items: center;
gap: 20rpx;
height: 80rpx;
}
/* 语音输入按钮(切换按钮) */
.voice-input-btn {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.voice-btn-icon {
width: 70rpx;
height: 70rpx;
}
/* 输入框包装器 */
.input-wrapper {
flex: 1;
position: relative;
background: #f5f5f5;
border-radius: 40rpx;
height: 80rpx;
display: flex;
align-items: center;
transition: all 0.2s;
overflow: hidden;
min-width: 0;
}
/* 语音输入模式下的输入框 */
.voice-input-panel .input-wrapper {
padding: 0;
background: #f5f5f5;
}
/* 文字输入模式下的输入框 */
.text-input-panel .input-wrapper {
padding: 0 30rpx;
}
.input-wrapper:active {
background: #e8e8e8;
}
/* 语音输入按钮 */
.voice-record-btn {
width: 100%;
height: 100%;
border-radius: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.voice-record-btn:active {
background: #e0e0e0;
}
.voice-tip {
font-size: 24rpx;
color: #666666;
}
/* 文字输入框 */
.chat-input {
flex: 1;
height: 100%;
font-size: 32rpx;
color: #000000;
line-height: 80rpx;
min-width: 0;
}
.input-placeholder {
color: #999999;
font-size: 24rpx;
}
.input-actions {
position: absolute;
right: 20rpx;
top: 50%;
transform: translateY(-50%);
}
.clear-btn {
width: 40rpx;
height: 40rpx;
border: none;
background: transparent;
padding: 0;
margin: 0;
line-height: 1;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.clear-btn:active {
background: rgba(0, 0, 0, 0.05);
}
.clear-icon {
width: 32rpx;
height: 32rpx;
}
/* 更多按钮 */
.more-btn {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
border: none;
background: transparent;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
padding: 0;
margin: 0;
line-height: 1;
flex-shrink: 0;
}
.more-btn:active {
background: rgba(0, 0, 0, 0.05);
}
.more-icon {
width: 70rpx;
height: 70rpx;
}
/* 发送按钮 */
.send-btn {
background: #07c160;
width: 120rpx;
border-radius: 40rpx;
height: 80rpx;
border: none;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
padding: 0;
margin: 0;
line-height: 1;
flex-shrink: 0;
}
.send-btn:active {
background: #06ad56;
transform: scale(0.98);
}
.send-text {
font-size: 28rpx;
color: #ffffff;
font-weight: 500;
}
/* 多媒体选择面板 */
.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;
}
/* 录音模态框 */
.recording-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 3000;
animation: fadeIn 0.2s ease;
}
.recording-box {
background: rgba(0, 0, 0, 0.8);
border-radius: 40rpx;
padding: 60rpx 80rpx;
display: flex;
flex-direction: column;
align-items: center;
min-width: 400rpx;
}
.recording-box.is-canceling {
background: rgba(0, 0, 0, 0.9);
}
.recording-icon {
width: 160rpx;
height: 160rpx;
margin-bottom: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.recording-mic-icon {
width: 120rpx;
height: 120rpx;
}
.recording-tip {
font-size: 32rpx;
color: #ffffff;
font-weight: 500;
margin-bottom: 30rpx;
text-align: center;
}
.recording-box.is-canceling .recording-tip {
color: #ff4444;
}
.recording-meter {
display: flex;
flex-direction: column;
align-items: center;
}
.recording-waves {
display: flex;
align-items: flex-end;
height: 60rpx;
margin-bottom: 20rpx;
}
.recording-wave {
width: 8rpx;
margin: 0 4rpx;
background: #07c160;
border-radius: 4rpx;
animation: recordingWave 1.2s ease-in-out infinite;
}
.recording-box.is-canceling .recording-wave {
background: #ff4444;
}
@keyframes recordingWave {
0%, 100% {
height: 20rpx;
}
50% {
height: 60rpx;
}
}
.recording-time {
font-size: 36rpx;
color: #ffffff;
font-weight: bold;
}
/* 适配全面屏 */
.safe-area-bottom {
padding-bottom: env(safe-area-inset-bottom);
}