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.
286 lines
4.8 KiB
286 lines
4.8 KiB
.chat-page-container {
|
|
height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
box-sizing: border-box;
|
|
background-color: #f0f0f0;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.chat-header {
|
|
background-color: #fff;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 16rpx 0;
|
|
border-bottom: 1rpx solid #e8e8e8;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
width: 100%;
|
|
}
|
|
|
|
.header-back, .header-more {
|
|
width: 60rpx;
|
|
height: 60rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 32rpx;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.header-info {
|
|
flex: 1;
|
|
text-align: center;
|
|
}
|
|
|
|
.header-name {
|
|
font-size: 32rpx;
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
|
|
.chat-scroll-area,
|
|
.chat-content {
|
|
flex: 1;
|
|
padding: 20rpx 20rpx 140rpx 20rpx; /* 增加底部padding,避免被固定输入框遮挡 */
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.chat-messages {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20rpx;
|
|
}
|
|
|
|
.message-item {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
gap: 16rpx;
|
|
max-width: 100%;
|
|
opacity: 1;
|
|
transform: translateY(0) scale(1);
|
|
transition: all 0.3s ease-out;
|
|
animation-fill-mode: forwards;
|
|
}
|
|
|
|
/* 新消息初始状态 */
|
|
.message-item.new {
|
|
opacity: 0;
|
|
transform: translateY(20rpx) scale(0.95);
|
|
}
|
|
|
|
.message-item.other {
|
|
flex-direction: row;
|
|
}
|
|
|
|
.message-item.me {
|
|
flex-direction: row;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.message-item.me .avatar {
|
|
margin-right: 16rpx;
|
|
}
|
|
|
|
.avatar {
|
|
width: 64rpx;
|
|
height: 64rpx;
|
|
border-radius: 50%;
|
|
overflow: hidden;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.avatar image {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.message-bubble {
|
|
max-width: 70%;
|
|
padding: 16rpx 24rpx;
|
|
border-radius: 20rpx;
|
|
position: relative;
|
|
}
|
|
|
|
/* 对方消息气泡 */
|
|
.message-item.other .message-bubble {
|
|
background-color: #fff;
|
|
border-bottom-left-radius: 8rpx;
|
|
}
|
|
|
|
/* 对方消息气泡尖角 */
|
|
.message-item.other .message-bubble::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: -16rpx;
|
|
bottom: 16rpx;
|
|
width: 0;
|
|
height: 0;
|
|
border-top: 16rpx solid transparent;
|
|
border-bottom: 16rpx solid transparent;
|
|
border-right: 16rpx solid #fff;
|
|
}
|
|
|
|
/* 自己消息气泡 */
|
|
.message-item.me .message-bubble {
|
|
background-color: #92E3A9;
|
|
border-bottom-right-radius: 8rpx;
|
|
}
|
|
|
|
/* 自己消息气泡尖角 */
|
|
.message-item.me .message-bubble::before {
|
|
content: '';
|
|
position: absolute;
|
|
right: -16rpx;
|
|
bottom: 16rpx;
|
|
width: 0;
|
|
height: 0;
|
|
border-top: 16rpx solid transparent;
|
|
border-bottom: 16rpx solid transparent;
|
|
border-left: 16rpx solid #92E3A9;
|
|
}
|
|
|
|
.message-content {
|
|
display: block;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
line-height: 1.5;
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
.message-item.me .message-content {
|
|
color: #000;
|
|
}
|
|
|
|
.message-time {
|
|
display: block;
|
|
font-size: 22rpx;
|
|
color: #999;
|
|
text-align: right;
|
|
margin-top: 8rpx;
|
|
}
|
|
|
|
.chat-input-area {
|
|
background-color: #fff;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 16rpx 24rpx;
|
|
border-top: 1rpx solid #e8e8e8;
|
|
gap: 20rpx;
|
|
z-index: 100;
|
|
height: 100rpx;
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* 新消息提示按钮样式 */
|
|
.new-message-tip {
|
|
background-color: #FF6B81;
|
|
color: white;
|
|
font-size: 26rpx;
|
|
padding: 12rpx 24rpx;
|
|
border-radius: 28rpx;
|
|
position: fixed;
|
|
bottom: 120rpx;
|
|
right: 30rpx;
|
|
z-index: 99;
|
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.15);
|
|
opacity: 0.9;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.new-message-tip:hover {
|
|
opacity: 1;
|
|
transform: translateY(-2rpx);
|
|
box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.message-input {
|
|
flex: 5;
|
|
background-color: #f5f5f5;
|
|
border-radius: 28rpx;
|
|
padding: 16rpx 24rpx;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
min-height: 56rpx;
|
|
max-height: 200rpx;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.send-button {
|
|
flex: 1;
|
|
background-color: #FF6B81;
|
|
color: #fff;
|
|
font-size: 28rpx;
|
|
font-weight: bold;
|
|
padding: 16rpx 24rpx;
|
|
border-radius: 28rpx;
|
|
border: none;
|
|
max-width: 160rpx;
|
|
text-align: center;
|
|
line-height: normal;
|
|
height: 56rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.send-button:hover {
|
|
background-color: #FF526D;
|
|
}
|
|
|
|
/* 商品消息卡片样式 */
|
|
.goods-message-card {
|
|
width: 100%;
|
|
min-width: 280rpx;
|
|
max-width: 400rpx;
|
|
}
|
|
|
|
.goods-message-card .goods-card {
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
/* 商品卡片在小消息气泡中的适配 */
|
|
.message-item .message-bubble {
|
|
padding: 12rpx;
|
|
}
|
|
|
|
.goods-message-card .goods-image-area {
|
|
height: 200rpx;
|
|
}
|
|
|
|
.goods-message-card .goods-info {
|
|
padding: 12rpx;
|
|
}
|
|
|
|
.goods-message-card .goods-title {
|
|
font-size: 24rpx;
|
|
height: 66rpx;
|
|
}
|
|
|
|
.goods-message-card .goods-spec {
|
|
font-size: 20rpx;
|
|
}
|
|
|
|
.goods-message-card .goods-tags {
|
|
margin: 4rpx 0;
|
|
}
|
|
|
|
.goods-message-card .tag {
|
|
font-size: 18rpx;
|
|
padding: 2rpx 6rpx;
|
|
}
|
|
|
|
.goods-message-card .price-value {
|
|
font-size: 32rpx;
|
|
}
|
|
|
|
.goods-message-card .price-unit {
|
|
font-size: 22rpx;
|
|
}
|