用户消息系统:消息列表、订单群聊、联系对方入口

- 新增消息列表页和聊天详情页,支持 SSE 实时推送
- 订单详情页新增"联系对方"按钮,一键进入订单群聊
- 导航栏新增"消息"入口
- 修复 mobileHost 路径匹配 bug,避免 /m 前缀误匹配
- 优化 dev.sh:提取 mysql 辅助函数、修复空 PID 处理、条件检查依赖

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
yml
2026-05-27 09:46:34 +08:00
co-authored by Claude Opus 4.7
parent 8cbd06dca4
commit 6fb5de204c
7 changed files with 792 additions and 14 deletions
+12
View File
@@ -42,4 +42,16 @@ export const accountRoutes: RouteRecordRaw[] = [
component: () => import('@/views/account/RealnameView.vue'),
meta: { requiresAuth: true },
},
{
path: '/messages',
name: 'messages',
component: () => import('@/views/account/MessagesView.vue'),
meta: { requiresAuth: true },
},
{
path: '/messages/:id',
name: 'chat',
component: () => import('@/views/account/ChatView.vue'),
meta: { requiresAuth: true },
},
]
+7 -3
View File
@@ -14,7 +14,7 @@ export function getMobilePath(path: string): string {
if (path === "/" || path === "") {
return "/m";
}
if (path.startsWith("/m") || path.startsWith("/admin")) {
if (path === "/m" || path.startsWith("/m/") || path.startsWith("/admin")) {
return path;
}
@@ -31,6 +31,9 @@ export function getMobilePath(path: string): string {
if (path === "/seller/listings/create") {
return "/m/seller/listings/create";
}
if (path === "/messages" || path.startsWith("/messages/")) {
return "/m/messages";
}
// PC-only views that don't have mobile counterparts go to mobile profile as fallback
if (path === "/wallet" || path === "/notifications" || path.startsWith("/seller")) {
@@ -41,7 +44,7 @@ export function getMobilePath(path: string): string {
}
export function getPcPath(path: string): string {
if (!path.startsWith("/m") || path.startsWith("/admin")) {
if ((path !== "/m" && !path.startsWith("/m/")) || path.startsWith("/admin")) {
return path;
}
@@ -62,7 +65,8 @@ export function getPcPath(path: string): string {
if (subPath === "/realname") return "/realname";
if (subPath === "/seller/listings/create") return "/seller/listings/create";
if (subPath === "/messages") return "/";
if (subPath === "/messages") return "/messages";
if (subPath.startsWith("/chats/")) return "/messages/" + subPath.substring(7);
if (subPath === "/profile") return "/wallet";
return subPath || "/";