Sửa tooltip của Tour hiển thị là tên của Tour

This commit is contained in:
2026-06-11 19:46:00 +07:00
parent 3994883ec5
commit 393128c2ad
+7 -4
View File
@@ -1005,7 +1005,10 @@ async function loadScenes(urlToken = null) {
if (!assetId) return; // Bỏ qua nếu không có ảnh liên kết if (!assetId) return; // Bỏ qua nếu không có ảnh liên kết
const sceneName = scene.name || scene.title || "Untitled Scene"; const sceneName = scene.name || scene.title || "Untitled Scene";
console.log(`[Frontend] Đang thêm marker cho Scene: ${sceneName} (ID: ${scene._id}, Privacy: ${scene.privacy})`); const tourName = (scene.tourId && typeof scene.tourId === 'object') ? scene.tourId.name : sceneName;
const tourDescription = (scene.tourId && typeof scene.tourId === 'object') ? scene.tourId.description : scene.description;
console.log(`[Frontend] Đang thêm marker cho Tour: ${tourName} (Scene đại diện: ${sceneName})`);
const isProcessing = scene.status === 'processing'; const isProcessing = scene.status === 'processing';
if (isProcessing) foundProcessing++; if (isProcessing) foundProcessing++;
@@ -1037,15 +1040,15 @@ async function loadScenes(urlToken = null) {
const marker = L.marker([latNum, lngNum], { const marker = L.marker([latNum, lngNum], {
icon: calloutIcon, icon: calloutIcon,
title: sceneName title: tourName
}); });
// Tạo nội dung thông tin khi Hover (Tooltip) // Tạo nội dung thông tin khi Hover (Tooltip)
const createdDate = formatSystemDate(scene.assetId?.createdAt); const createdDate = formatSystemDate(scene.assetId?.createdAt);
const tooltipContent = ` const tooltipContent = `
<div class="scene-hover-info"> <div class="scene-hover-info">
<strong>${sceneName}</strong><br> <strong>${tourName}</strong><br>
${scene.description ? `<small>${scene.description}</small><br>` : ''} ${tourDescription ? `<small>${tourDescription}</small><br>` : ''}
<span>Người tạo: ${scene.createdBy ? scene.createdBy.username : 'Ẩn danh'}</span><br> <span>Người tạo: ${scene.createdBy ? scene.createdBy.username : 'Ẩn danh'}</span><br>
<span>Ngày tạo: ${createdDate}</span> <span>Ngày tạo: ${createdDate}</span>
</div> </div>