Ver Fonte

修改bug

lxr há 1 dia atrás
pai
commit
6293fc3828

+ 1 - 0
src/layouts/components/Header/components/NotificationDrawerContent.vue

@@ -469,6 +469,7 @@ function handleMessageItemClick(item: MessageItem) {
   const params = new URLSearchParams({
     receiverId: String(receiverId),
     uName: encodeURIComponent(item.senderName || "用户"),
+    storeName: encodeURIComponent(String(item.storeName ?? "")),
     userImage: item.avatar ? encodeURIComponent(item.avatar) : ""
   });
   router.push(`/storeDecorationManagement/decorationChat?${params.toString()}`);

+ 5 - 4
src/views/storeDecoration/decorationChat.vue

@@ -4,7 +4,7 @@
       <el-button text @click="handleBack" class="back-btn">
         <el-icon><ArrowLeft /></el-icon>
       </el-button>
-      <span class="chat-title">{{ ownerName || "联系业主" }}</span>
+      <span class="chat-title">{{ storeName || "联系业主" }}</span>
     </div>
 
     <div ref="chatContainerRef" class="chat-content" @scroll="handleScroll">
@@ -127,7 +127,8 @@ const isWsReady = () => socketStore.isSocketOpen();
 // 会话信息
 const sendId = ref("");
 const receiverId = ref("");
-const ownerName = ref("");
+/** 左上角标题:店铺名称(由列表/详情跳转时 query.storeName 传入) */
+const storeName = ref("");
 const ownerAvatar = ref("");
 const requirementId = ref("");
 
@@ -464,7 +465,7 @@ watch(
   q => {
     if (q?.receiverId) {
       receiverId.value = String(q.receiverId);
-      ownerName.value = decodeURIComponent(String(q.uName || q.ownerName || "业主"));
+      storeName.value = decodeURIComponent(String(q.storeName || ""));
       ownerAvatar.value = q.userImage ? decodeURIComponent(String(q.userImage)) : "";
       requirementId.value = String(q.id || q.requirementId || "");
       loadChatRecord();
@@ -475,7 +476,7 @@ watch(
 
 onMounted(async () => {
   receiverId.value = String(route.query.receiverId || "");
-  ownerName.value = decodeURIComponent(String(route.query.uName || route.query.ownerName || "业主"));
+  storeName.value = decodeURIComponent(String(route.query.storeName || ""));
   ownerAvatar.value = route.query.userImage ? decodeURIComponent(String(route.query.userImage)) : "";
   requirementId.value = String(route.query.id || route.query.requirementId || "");
 

+ 1 - 0
src/views/storeDecoration/decorationCompany.vue

@@ -100,6 +100,7 @@ const handleContact = (row: any) => {
   const params = new URLSearchParams({
     receiverId: String(receiverId),
     uName: encodeURIComponent(row.contactName || row.userNickname || "业主"),
+    storeName: encodeURIComponent(String(row.storeName ?? "")),
     userImage: encodeURIComponent(row.storeAvatar || ""),
     id: String(row.id || "")
   });

+ 1 - 0
src/views/storeDecoration/decorationCompanyDetail.vue

@@ -242,6 +242,7 @@ const handleContact = () => {
   const params = new URLSearchParams({
     receiverId: String(receiverId),
     uName: encodeURIComponent(data.contactName || data.userNickname || "业主"),
+    storeName: encodeURIComponent(String(data.storeName ?? "")),
     userImage: encodeURIComponent(data.storeAvatar || ""),
     id: String(route.query.id || "")
   });