zlwu há 7 meses atrás
pai
commit
8d23ed28dd

+ 7 - 4
frontend/src/pages/ChatBotPage.tsx

@@ -3160,8 +3160,9 @@ export const ChatBotPage = () => {
                   height: px2vmin(heightPx),
                   left: px2vmin(leftPx),
                   top: px2vmin(topPx),
-                  // 录音态会出现 zIndex=2 的阴影蒙层;将家具放到其上方,避免“先出现后消失”
-                  zIndex: Math.max(item.z_index ?? 2, CHATBOT_Z_INDEX.GRID_DYNAMIC_MIN),
+                  // 装饰品层级:基于数据库配置的 z-index,渲染时统一 +1
+                  // (原逻辑会强制最小值为 3,导致 DB 的低层级都被钳到同一层)
+                  zIndex: (item.z_index ?? 0) + 1,
                   objectFit: 'contain',
                 }}
               />
@@ -3199,8 +3200,10 @@ export const ChatBotPage = () => {
                   ? (STOOL_LAYOUT.sceneGifOffsetYByScene[scene] ?? 0)
                   : STOOL_LAYOUT.sceneGifOffsetY;
 
-                const avatarZ =
-                  greetingContext.specialAvatarZIndex ?? (Math.max(anchorItem.z_index ?? 0, 2) + 1);
+                // 让特殊场景 GIF 的 z-index 与绑定物(anchorItem)保持一致。
+                // 装饰品层级:基于绑定物的数据库 z-index,渲染时统一 +1
+                const rawBoundZ = (greetingContext.anchorZIndex ?? anchorItem.z_index ?? 0) as number;
+                const avatarZ = rawBoundZ + 1;
 
                 // 窗前:绑定物=窗户矩形;形象相对该矩形用 left/bottom 百分比,形成「站在窗前」的透视(非相对整屏绝对坐标)
                 if (isWindow) {

+ 2 - 1
frontend/src/pages/LumiOutfitsPage.tsx

@@ -646,7 +646,8 @@ export const LumiOutfitsPage = () => {
                     height: px2vmin(heightPx),
                     left: px2vmin(leftPx),
                     top: px2vmin(topPx),
-                    zIndex: Math.max(item.z_index ?? 2, CHATBOT_Z_INDEX.GRID_DYNAMIC_MIN),
+                    // 装饰品层级:基于数据库配置的 z-index,渲染时统一 +1
+                    zIndex: (item.z_index ?? 0) + 1,
                     objectFit: 'contain',
                   }}
                 />

+ 2 - 1
frontend/src/pages/LumiShopPage.tsx

@@ -772,7 +772,8 @@ export const LumiShopPage = () => {
                   height: px2vmin(heightPx),
                   left: px2vmin(leftPx),
                   top: px2vmin(topPx),
-                  zIndex: Math.max(item.z_index ?? 2, CHATBOT_Z_INDEX.GRID_DYNAMIC_MIN),
+                  // 装饰品层级:基于数据库配置的 z-index,渲染时统一 +1
+                  zIndex: (item.z_index ?? 0) + 1,
                   objectFit: 'contain',
                 }}
               />

+ 38 - 35
frontend/src/pages/ProfilePage.tsx

@@ -144,6 +144,7 @@ export const ProfilePage = () => {
     () => formatJournalConversedAt(journalConversedAtIso),
     [journalConversedAtIso],
   );
+  const hasJournalSpecialScene = Boolean(journalLatestTopicKey);
 
   /** 自注册日起的日历时长文案(profile Lumi 页) */
   const lumiRegistrationAgeText = useMemo(() => {
@@ -1147,52 +1148,54 @@ export const ProfilePage = () => {
               flexDirection: 'row',
               alignItems: 'flex-start',
               justifyContent: 'flex-start',
-              columnGap: px2vmin(10),
+              columnGap: hasJournalSpecialScene ? px2vmin(10) : 0,
               boxSizing: 'border-box',
             }}
           >
-            <div
-              style={{
-                position: 'relative',
-                width: px2vmin(197),
-                height: px2vmin(144),
-                flexShrink: 0,
-                borderRadius: px2vmin(16),
-                overflow: 'hidden',
-              }}
-            >
-              <img
-                src={journalLeftImageUrl}
-                alt=""
-                draggable={false}
+            {hasJournalSpecialScene ? (
+              <div
                 style={{
+                  position: 'relative',
                   width: px2vmin(197),
                   height: px2vmin(144),
-                  objectFit: 'cover',
-                  display: 'block',
+                  flexShrink: 0,
+                  borderRadius: px2vmin(16),
+                  overflow: 'hidden',
                 }}
-              />
-              {journalConversedAtLabel ? (
-                <span
+              >
+                <img
+                  src={journalLeftImageUrl}
+                  alt=""
+                  draggable={false}
                   style={{
-                    position: 'absolute',
-                    right: px2vmin(8),
-                    bottom: px2vmin(10),
-                    color: 'rgba(245, 243, 240, 0.6)',
-                    fontSize: px2vmin(11),
-                    lineHeight: px2vmin(14),
-                    fontWeight: 500,
-                    pointerEvents: 'none',
+                    width: px2vmin(197),
+                    height: px2vmin(144),
+                    objectFit: 'cover',
+                    display: 'block',
                   }}
-                >
-                  {journalConversedAtLabel}
-                </span>
-              ) : null}
-            </div>
+                />
+                {journalConversedAtLabel ? (
+                  <span
+                    style={{
+                      position: 'absolute',
+                      right: px2vmin(8),
+                      bottom: px2vmin(10),
+                      color: 'rgba(245, 243, 240, 0.6)',
+                      fontSize: px2vmin(11),
+                      lineHeight: px2vmin(14),
+                      fontWeight: 500,
+                      pointerEvents: 'none',
+                    }}
+                  >
+                    {journalConversedAtLabel}
+                  </span>
+                ) : null}
+              </div>
+            ) : null}
             <div
               style={{
                 position: 'relative',
-                width: px2vmin(94),
+                width: hasJournalSpecialScene ? px2vmin(94) : px2vmin(301),
                 height: px2vmin(144),
                 flexShrink: 0,
                 borderRadius: px2vmin(16),
@@ -1204,7 +1207,7 @@ export const ProfilePage = () => {
                 alt=""
                 draggable={false}
                 style={{
-                  width: px2vmin(94),
+                  width: hasJournalSpecialScene ? px2vmin(94) : px2vmin(301),
                   height: px2vmin(144),
                   objectFit: 'cover',
                   display: 'block',