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.
 
 

468 lines
8.2 KiB

/* 微信聊天界面样式 */
.chat-detail-container {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #e5e5e5;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
/* 连接状态显示样式 */
.connection-status {
padding: 8rpx 0;
text-align: center;
font-size: 24rpx;
color: #fff;
position: relative;
z-index: 10;
}
.connection-status.connecting {
background-color: #FF9800;
}
.connection-status.connected {
background-color: #4CAF50;
}
.connection-status.error {
background-color: #F44336;
}
.connection-status.disconnected {
background-color: #9E9E9E;
}
.status-text {
display: inline-block;
padding: 0 20rpx;
border-radius: 10rpx;
}
.reconnect-btn {
display: inline-block;
margin-left: 20rpx;
padding: 0 20rpx;
font-size: 24rpx;
line-height: 40rpx;
background-color: rgba(255, 255, 255, 0.3);
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 16rpx;
}
.test-mode-switch {
padding: 20rpx;
background-color: #f8f8f8;
display: flex;
align-items: center;
justify-content: center;
border-bottom: 1rpx solid #e8e8e8;
}
.mode-label {
margin-left: 20rpx;
font-size: 28rpx;
color: #666;
}
/* 消息列表区域 - 微信风格 */
.wechat-message-list {
flex: 1;
padding: 20rpx 20rpx 40rpx;
box-sizing: border-box;
overflow-y: auto;
background-color: #e5e5e5;
}
/* 消息容器 */
.wechat-message-container {
display: flex;
flex-direction: column;
gap: 20rpx;
}
/* 时间显示 */
.wechat-time-display {
display: flex;
justify-content: center;
margin: 20rpx 0;
}
.wechat-time-text {
background-color: rgba(0, 0, 0, 0.1);
color: #fff;
font-size: 24rpx;
padding: 6rpx 20rpx;
border-radius: 12rpx;
}
/* 系统消息 */
.wechat-system-message {
display: flex;
justify-content: center;
margin: 10rpx 0;
}
.wechat-system-content {
background-color: rgba(255, 255, 255, 0.8);
border-radius: 18rpx;
padding: 16rpx 24rpx;
max-width: 80%;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}
.wechat-warning-title {
color: #ff0000;
font-size: 28rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.wechat-system-text {
color: #606266;
font-size: 26rpx;
line-height: 36rpx;
}
/* 商品信息卡片 */
.wechat-goods-card {
display: flex;
background-color: #ffffff;
border-radius: 18rpx;
padding: 20rpx;
margin: 10rpx 0;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
align-self: flex-start;
max-width: 80%;
}
.wechat-goods-avatar {
width: 120rpx;
height: 120rpx;
background-color: #f0f0f0;
border-radius: 8rpx;
flex-shrink: 0;
margin-right: 20rpx;
}
.wechat-goods-content {
flex: 1;
min-width: 0;
}
.wechat-goods-title {
font-size: 28rpx;
color: #303133;
font-weight: 500;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 10rpx;
}
.wechat-goods-desc {
font-size: 26rpx;
color: #606266;
display: block;
margin-bottom: 10rpx;
line-height: 36rpx;
}
.wechat-goods-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
.wechat-goods-price {
font-size: 32rpx;
color: #e64340;
font-weight: bold;
}
.wechat-goods-type {
font-size: 24rpx;
color: #909399;
background-color: #f0f9ff;
padding: 4rpx 16rpx;
border-radius: 12rpx;
}
/* 消息项 */
.wechat-message-item {
display: flex;
margin: 10rpx 0;
align-items: flex-end;
}
/* 对方消息 */
.wechat-other-message {
flex-direction: row;
}
/* 我的消息 */
.wechat-my-message {
flex-direction: row-reverse;
}
/* 头像 - 圆形 */
.wechat-avatar {
width: 76rpx;
height: 76rpx;
border-radius: 50%;
background-color: #9aa5b1;
display: flex;
align-items: center;
justify-content: center;
margin: 0 12rpx;
flex-shrink: 0;
overflow: hidden;
}
.wechat-my-avatar {
background-color: #d8d8d8;
}
.wechat-avatar-text {
color: #ffffff;
font-size: 32rpx;
font-weight: 500;
}
/* 消息包装器 */
.wechat-message-wrapper {
max-width: 75%;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 6rpx;
}
/* 客服姓名显示 */
.wechat-message-name {
font-size: 24rpx;
color: #909399;
margin-left: 4rpx;
margin-bottom: 2rpx;
}
.wechat-my-wrapper {
align-items: flex-end;
}
/* 消息气泡 - 添加三角形箭头 */
.wechat-message-bubble {
position: relative;
padding: 14rpx 20rpx;
max-width: 100%;
word-wrap: break-word;
word-break: break-all;
}
.wechat-other-bubble {
background-color: #ffffff;
border-radius: 18rpx;
}
.wechat-my-bubble {
background-color: #07c160;
border-radius: 18rpx;
}
/* 对方消息气泡三角形 */
.wechat-other-bubble::before {
content: '';
position: absolute;
left: -10rpx;
bottom: 18rpx;
width: 0;
height: 0;
border-style: solid;
border-width: 10rpx 10rpx 10rpx 0;
border-color: transparent #ffffff transparent transparent;
}
/* 我的消息气泡三角形 */
.wechat-my-bubble::before {
content: '';
position: absolute;
right: -10rpx;
bottom: 18rpx;
width: 0;
height: 0;
border-style: solid;
border-width: 10rpx 0 10rpx 10rpx;
border-color: transparent transparent transparent #07c160;
}
/* 消息文本 */
.wechat-message-text {
font-size: 32rpx;
line-height: 44rpx;
color: #303133;
}
.wechat-my-text {
color: #ffffff;
}
/* 图片消息样式 - 使用微信插件风格 */
.wechat-message-image {
width: 280rpx;
height: 280rpx;
max-width: 75%;
max-height: 500rpx;
border-radius: 16rpx;
margin: 8rpx 0;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
background-color: #f5f5f5;
}
/* 对方图片消息样式 - 左侧缩进 */
.wechat-other-image {
margin-left: 16rpx;
align-self: flex-start;
}
/* 我的图片消息样式 - 右侧缩进 */
.wechat-my-image {
margin-right: 16rpx;
align-self: flex-end;
}
/* 消息项调整,确保图片和文本消息对齐 */
.wechat-message-item {
align-items: flex-start;
padding: 4rpx 0;
}
/* 消息时间 */
.wechat-message-time {
font-size: 22rpx;
color: #909399;
padding: 0 4rpx;
}
.wechat-my-time {
text-align: right;
}
/* 输入区域 - 微信风格 */
.wechat-input-area {
background-color: #f5f5f5;
border-top: 1rpx solid #d8d8d8;
padding: 12rpx 20rpx;
box-sizing: border-box;
}
/* 输入工具栏 */
.wechat-input-toolbar {
display: flex;
align-items: center;
gap: 16rpx;
}
/* 底部安全区域适配 */
@media screen and (min-height: 812px) {
.wechat-input-area {
padding-bottom: calc(12rpx + env(safe-area-inset-bottom, 0rpx));
}
}
/* 左侧按钮 */
.wechat-input-left {
display: flex;
align-items: center;
gap: 10rpx;
}
/* 右侧按钮 */
.wechat-input-right {
display: flex;
align-items: center;
gap: 10rpx;
}
/* 表情按钮 */
.wechat-emoji-btn {
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
}
/* 语音按钮 */
.wechat-voice-btn {
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
}
/* 更多按钮 */
.wechat-more-btn {
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 44rpx;
color: #606266;
}
/* 发送按钮 */
.wechat-send-btn {
background-color: #07c160;
color: #ffffff;
font-size: 28rpx;
padding: 0 28rpx;
height: 64rpx;
line-height: 64rpx;
border-radius: 32rpx;
text-align: center;
}
/* 发送按钮禁用状态 */
.wechat-send-btn:disabled {
background-color: #c8c8c8;
color: #ffffff;
cursor: not-allowed;
}
/* 发送按钮点击状态 */
.wechat-send-btn:active:not(:disabled) {
background-color: #06b354;
}
/* 输入框包装器 */
.wechat-input-wrapper {
flex: 1;
background-color: #ffffff;
border: 1rpx solid #d8d8d8;
border-radius: 32rpx;
padding: 0 20rpx;
min-height: 64rpx;
max-height: 180rpx;
display: flex;
align-items: center;
box-shadow: inset 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
}
/* 消息输入框 */
.wechat-message-input {
flex: 1;
font-size: 32rpx;
color: #303133;
min-height: 44rpx;
max-height: 160rpx;
line-height: 44rpx;
padding: 0;
margin: 10rpx 0;
}