consumer模块完成度95%,准备部署消费者端测试
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="messages-page">
|
||||
<!-- 智能顶部导航栏 - 与主页保持一致 -->
|
||||
<view class="smart-navbar" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
@@ -75,7 +75,7 @@
|
||||
<view
|
||||
v-for="message in serviceMessages"
|
||||
:key="message.id"
|
||||
:class="['message-item', { unread: !message.read, active: message.active }]"
|
||||
:class="['message-item', { active: message.active }]"
|
||||
@click="startChatWithService(message)"
|
||||
>
|
||||
<view class="message-icon-wrapper">
|
||||
@@ -88,6 +88,7 @@
|
||||
<view v-else class="message-icon-default" :style="{ backgroundColor: message.color }">
|
||||
<text class="message-icon-text">{{ message.icon }}</text>
|
||||
</view>
|
||||
<view v-if="message.unreadCount > 0" class="unread-dot"></view>
|
||||
<view v-if="message.online" class="online-dot"></view>
|
||||
</view>
|
||||
<view class="message-content">
|
||||
@@ -96,17 +97,11 @@
|
||||
<text class="message-title">{{ message.title }}</text>
|
||||
<text v-if="message.role" class="message-role">{{ message.role }}</text>
|
||||
</view>
|
||||
<view class="message-header-right">
|
||||
<text class="message-time">{{ message.time }}</text>
|
||||
<text v-if="message.unreadCount > 0" class="message-unread-count">{{ message.unreadCount }}</text>
|
||||
</view>
|
||||
<text class="message-time">{{ message.time }}</text>
|
||||
</view>
|
||||
<view class="message-preview-wrapper">
|
||||
<text class="message-preview">{{ message.content }}</text>
|
||||
<text v-if="message.lastMessage" class="last-message">{{ message.lastMessage }}</text>
|
||||
</view>
|
||||
<view v-if="message.tags" class="message-tags">
|
||||
<text v-for="tag in message.tags" :key="tag" class="message-tag">{{ tag }}</text>
|
||||
<text v-if="message.unreadCount > 0" class="message-unread-count">{{ message.unreadCount > 99 ? '99+' : message.unreadCount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -123,19 +118,24 @@
|
||||
<view
|
||||
v-for="message in systemMessages"
|
||||
:key="message.id"
|
||||
:class="['message-item', { unread: !message.read }]"
|
||||
class="message-item"
|
||||
@click="viewSystemMessage(message)"
|
||||
>
|
||||
<view class="message-icon-wrapper">
|
||||
<text class="message-icon">📢</text>
|
||||
<text class="message-icon-text">📢</text>
|
||||
<view v-if="!message.read" class="unread-dot"></view>
|
||||
</view>
|
||||
<view class="message-content">
|
||||
<view class="message-header">
|
||||
<text class="message-title">{{ message.title }}</text>
|
||||
<view class="message-title-wrapper">
|
||||
<text class="message-title">{{ message.title }}</text>
|
||||
<text v-if="message.important" class="important-tag">重要</text>
|
||||
</view>
|
||||
<text class="message-time">{{ message.time }}</text>
|
||||
</view>
|
||||
<text class="message-preview">{{ message.content }}</text>
|
||||
<view v-if="message.important" class="important-tag">重要</view>
|
||||
<view class="message-preview-wrapper">
|
||||
<text class="message-preview">{{ message.content }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -145,22 +145,27 @@
|
||||
<view
|
||||
v-for="message in orderMessages"
|
||||
:key="message.id"
|
||||
:class="['message-item', { unread: !message.read }]"
|
||||
class="message-item"
|
||||
@click="viewOrderMessage(message)"
|
||||
>
|
||||
<view class="message-icon-wrapper">
|
||||
<text class="message-icon">📦</text>
|
||||
<text class="message-icon-text">📦</text>
|
||||
<view v-if="!message.read" class="unread-dot"></view>
|
||||
</view>
|
||||
<view class="message-content">
|
||||
<view class="message-header">
|
||||
<text class="message-title">{{ message.title }}</text>
|
||||
<view class="message-title-wrapper">
|
||||
<text class="message-title">{{ message.title }}</text>
|
||||
<view v-if="message.status" class="order-status-tag" :class="message.status">
|
||||
{{ message.statusText }}
|
||||
</view>
|
||||
</view>
|
||||
<text class="message-time">{{ message.time }}</text>
|
||||
</view>
|
||||
<text class="message-preview">{{ message.content }}</text>
|
||||
<text class="order-info" v-if="message.order_no">订单号: {{ message.order_no }}</text>
|
||||
<view v-if="message.status" class="order-status" :class="message.status">
|
||||
{{ message.statusText }}
|
||||
<view class="message-preview-wrapper">
|
||||
<text class="message-preview">{{ message.content }}</text>
|
||||
</view>
|
||||
<text class="order-no-text" v-if="message.order_no">订单号: {{ message.order_no }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -649,9 +654,9 @@ const onRefresh = () => {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: #4CAF50;
|
||||
background-color: #ff5000;
|
||||
z-index: 1000;
|
||||
box-shadow: 0 2px 12px rgba(76, 175, 80, 0.15);
|
||||
box-shadow: 0 2px 12px rgba(255, 80, 0, 0.15);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
@@ -758,8 +763,8 @@ const onRefresh = () => {
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
color: #4CAF50;
|
||||
border-bottom-color: #4CAF50;
|
||||
color: #ff5000;
|
||||
border-bottom-color: #ff5000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -826,8 +831,8 @@ const onRefresh = () => {
|
||||
}
|
||||
|
||||
.service-status.online {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
background: #FFF3E0;
|
||||
color: #ff5000;
|
||||
}
|
||||
|
||||
.service-desc {
|
||||
@@ -885,37 +890,31 @@ const onRefresh = () => {
|
||||
background-color: white;
|
||||
border-radius: 12px;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
transition: all 0.3s ease;
|
||||
/* cursor: pointer; removed for uniapp-x support */
|
||||
flex-direction: row;
|
||||
align-items: center; /* 居中对齐头像和内容 */
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.message-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
||||
.message-item:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.message-item.unread {
|
||||
background-color: #f0f9f0;
|
||||
border-left: 3px solid #4CAF50;
|
||||
}
|
||||
|
||||
.message-item.active {
|
||||
border: 1px solid #4CAF50;
|
||||
background-color: white; /* 保持白色背景,通过红点示未读 */
|
||||
}
|
||||
|
||||
.message-icon-wrapper {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 25px;
|
||||
background-color: #f5f5f5;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 24px;
|
||||
background-color: #f8fafc;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 15px;
|
||||
margin-right: 12px;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
}
|
||||
@@ -923,30 +922,40 @@ const onRefresh = () => {
|
||||
.message-icon-default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 25px;
|
||||
border-radius: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.message-icon-text {
|
||||
font-size: 24px;
|
||||
color: white;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.message-avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 25px;
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
.unread-dot {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #ff5000;
|
||||
border-radius: 5px;
|
||||
border: 1.5px solid white;
|
||||
}
|
||||
|
||||
.online-dot {
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
right: 2px;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
background-color: #4CAF50;
|
||||
background-color: #4cd964;
|
||||
border-radius: 6px;
|
||||
border: 2px solid white;
|
||||
}
|
||||
@@ -954,81 +963,83 @@ const onRefresh = () => {
|
||||
.message-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.message-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 8px;
|
||||
align-items: center;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.message-title-wrapper {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-right: 10px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.message-title {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
/* display: block; REMOVED for uniapp-x support */
|
||||
margin-bottom: 4px;
|
||||
color: #1a1a1a;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.message-role {
|
||||
font-size: 12px;
|
||||
color: #4CAF50;
|
||||
background: #E8F5E9;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
/* display: inline-block; REMOVED for uniapp-x support */
|
||||
}
|
||||
|
||||
.message-header-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
/* gap: 4px; removed for uniapp-x support */
|
||||
font-size: 10px;
|
||||
color: #ff5000;
|
||||
background: #fff0eb;
|
||||
padding: 1px 6px;
|
||||
border-radius: 4px;
|
||||
margin-left: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.message-time {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
white-space: nowrap;
|
||||
margin-bottom: 4px; /* replaced gap */
|
||||
}
|
||||
|
||||
.message-unread-count {
|
||||
font-size: 11px;
|
||||
color: white;
|
||||
background: #FF5722;
|
||||
padding: 2px 6px;
|
||||
border-radius: 10px;
|
||||
min-width: 18px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
margin-left: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.message-preview-wrapper {
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.message-preview {
|
||||
font-size: 14px;
|
||||
flex: 1;
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 4px;
|
||||
/* display: -webkit-box; REMOVED for uniapp-x support */
|
||||
/* -webkit-line-clamp: 2; REMOVED for uniapp-x support */
|
||||
/* -webkit-box-orient: vertical; REMOVED for uniapp-x support */
|
||||
lines: 2; /* UTS text truncation */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis; /* Ensure standard CSS property is present */
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.message-unread-count {
|
||||
font-size: 10px;
|
||||
color: white;
|
||||
background: #ff5000;
|
||||
padding: 0 5px;
|
||||
border-radius: 10px;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.last-message {
|
||||
@@ -1055,8 +1066,8 @@ const onRefresh = () => {
|
||||
|
||||
.order-info {
|
||||
font-size: 12px;
|
||||
color: #4CAF50;
|
||||
background-color: #E8F5E9;
|
||||
color: #ff5000;
|
||||
background-color: #FFF3E0;
|
||||
padding: 4px 10px;
|
||||
border-radius: 4px;
|
||||
/* display: inline-block; REMOVED for uniapp-x support */
|
||||
@@ -1085,8 +1096,8 @@ const onRefresh = () => {
|
||||
}
|
||||
|
||||
.order-status.completed {
|
||||
background: #E8F5E9;
|
||||
color: #4CAF50;
|
||||
background: #FFF3E0;
|
||||
color: #ff5000;
|
||||
}
|
||||
|
||||
.important-tag {
|
||||
@@ -1155,26 +1166,65 @@ const onRefresh = () => {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.order-no-text {
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.order-status-tag {
|
||||
font-size: 10px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 4px;
|
||||
margin-left: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.order-status-tag.shipping {
|
||||
background: #e3f2fd;
|
||||
color: #2196f3;
|
||||
}
|
||||
|
||||
.order-status-tag.processing {
|
||||
background: #fff8e1;
|
||||
color: #ffb300;
|
||||
}
|
||||
|
||||
.order-status-tag.completed {
|
||||
background: #fff0eb;
|
||||
color: #ff5000;
|
||||
}
|
||||
|
||||
.important-tag {
|
||||
background-color: #ff5000;
|
||||
color: white;
|
||||
font-size: 10px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 4px;
|
||||
margin-left: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 空状态 */
|
||||
.empty-messages {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 80px 20px;
|
||||
text-align: center;
|
||||
padding-top: 100px;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80px;
|
||||
color: #ddd;
|
||||
margin-bottom: 20px;
|
||||
font-size: 60px;
|
||||
margin-bottom: 16px;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.empty-title {
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
margin-bottom: 10px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.empty-desc {
|
||||
@@ -1191,7 +1241,7 @@ const onRefresh = () => {
|
||||
}
|
||||
|
||||
.action-button {
|
||||
background: linear-gradient(135deg, #4CAF50, #2E7D32);
|
||||
background: linear-gradient(135deg, #ff5000, #e64a00);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
@@ -1310,7 +1360,7 @@ const onRefresh = () => {
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
color: #4CAF50;
|
||||
color: #ff5000;
|
||||
}
|
||||
|
||||
.customer-service-info,
|
||||
@@ -1370,3 +1420,4 @@ const onRefresh = () => {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user