1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-11-13 22:11:42 +08:00

style: 优化多处UI细节与代码结构

1. 调整多处文字大小与间距样式统一视觉
2. 优化导航栏模糊效果与布局
3. 重构评论项头像加载逻辑,增加昵称首字占位兜底
4. 重写我的页面代码结构与布局样式
5. 清理评论列表冗余代码与格式化模板
This commit is contained in:
小莫唐尼
2026-09-13 01:14:59 +08:00
parent 1cb300f07a
commit 713646fc93
14 changed files with 347 additions and 301 deletions
@@ -459,7 +459,7 @@
<uh-data-loading v-if="loadingStatus !== 'success'" :loading-status="loadingStatus"
@refresh="handleGetData()" />
<view v-else class="box-border pt-72">
<view v-else class="box-border pt-72 pb-4">
<!-- 顶部背景封面区域 -->
<view class="fixed left-0 top-0 h-72 w-full">
<image v-if="result?.spec.cover" :src="result.spec.cover" class="h-full w-full" mode="aspectFill" />
@@ -567,7 +567,7 @@
<view v-if="postDetailConfig?.copyrightEnabled" class="box-border px-2 mb-3">
<view class="uh-global-card-glass uh-shadow-xs rounded-xl p-3">
<uh-section-title>版权声明</uh-section-title>
<view class="mt-3 flex flex-col gap-y-2 text-gray-600 text-2xs">
<view class="mt-3 flex flex-col gap-y-2 text-gray-600 text-xs">
<view v-if="postDetailConfig.copyrightAuthor" class="leading-5">
版权归属:{{ postDetailConfig.copyrightAuthor }}
</view>
@@ -592,26 +592,26 @@
</view>
<!-- 悬浮操作 -->
<view class="fixed bottom-2 left-1/2 z-10 flex items-center justify-center pb-safe uh-translate-x-center">
<view class="fixed bottom-0 left-1/2 z-10 flex items-center justify-center pb-safe uh-translate-x-center">
<view
class="uh-global-card-glass box-border flex items-center justify-center gap-2 border rounded-full p-1 text-primary">
<view
class="uh-global-card-glass box-border h-[72rpx] flex flex-1 items-center justify-center gap-x-1 border rounded-full px-4 shadow-none"
:class="[hasUpvoted()?'text-primary':'text-gray-900']" @click="handleDoLikesClick">
<wd-icon class-prefix="uhemoji-icon" name="-kiss-" size="36rpx" />
<text class="shrink-0 text-3xs font-semibold">点赞</text>
<text class="shrink-0 text-xs font-semibold">点赞</text>
</view>
<view v-if="calcIsShowComment"
class="uh-global-card-glass box-border h-[72rpx] flex flex-1 items-center justify-center gap-x-1 border rounded-full px-4 shadow-none"
@click="handleToComment()">
<wd-icon class-prefix="uhemoji-icon" name="-thinking" size="36rpx" />
<text class="shrink-0 text-3xs text-gray-900 font-semibold">评论</text>
<text class="shrink-0 text-xs text-gray-900 font-semibold">评论</text>
</view>
<view
class="uh-global-card-glass box-border h-[72rpx] flex flex-1 items-center justify-center gap-x-1 border rounded-full px-4 shadow-none"
@click="handleTogglePostFavorite">
<wd-icon class-prefix="uhemoji-icon" name="-smile-" size="36rpx" />
<text class="shrink-0 text-3xs font-semibold"
<text class="shrink-0 text-xs font-semibold"
:class="[hasFavorited()?'text-primary':'text-gray-900']">
{{ hasFavorited() ? '已收藏' : '收藏' }}
</text>
@@ -285,7 +285,7 @@
<uh-data-loading v-if="status !== 'success'" :loading-status="status" min-height="60vh" error-text="瞬间内容加载失败"
empty-text="瞬间不存在或已被删除" @refresh="loadMoment" />
<view v-else-if="moment" class="box-border px-3 pt-2 pb-12">
<view v-else-if="moment" class="box-border px-3 pt-2 pb-14">
<view class="mb-3 uh-global-card-glass uh-shadow-xs overflow-hidden rounded-2xl box-border pb-4">
<!-- 刊头:大字日期 -->
<view v-if="moment.spec.releaseTime" class="px-4 pt-4">
@@ -303,17 +303,17 @@
<image class="h-[80rpx] w-[80rpx] shrink-0 rounded-full"
:src="checkAvatarUrl(moment.owner?.avatar || bloggerInfo.avatar)" mode="aspectFill" />
<view class="ml-3 flex flex-col">
<view class="text-[30rpx] text-[#5c7c0f] font-bold">
<view class="text-md text-gray-600 font-medium">
{{ moment.owner?.displayName || bloggerInfo.nickname }}
</view>
<view class="mt-0.5 text-[22rpx] text-gray-400">
<view class="mt-0.5 text-xs text-gray-400">
记录了这美好的一刻
</view>
</view>
</view>
<!-- 正文 -->
<view class="content px-4 mt-6 text-gray-900 text-sm">
<view class="content px-4 mt-6 text-gray-900 text-2xs">
<mp-html lazy-load :domain="markdownConfig.domain ?? ''" :loading-img="markdownConfig.loadingGif"
scroll-table selectable :tag-style="markdownConfig.tagStyle"
:container-style="markdownConfig.containStyle" :content="moment.spec.newHtml || ''"
@@ -368,7 +368,7 @@
<!-- 悬浮操作 -->
<view v-if="moment"
class="fixed bottom-8 left-1/2 z-10 flex items-center justify-center pb-safe uh-translate-x-center">
class="fixed bottom-0 left-1/2 z-10 flex items-center justify-center pb-safe uh-translate-x-center">
<view
class="uh-global-card-glass box-border flex items-center justify-center gap-2 border rounded-full p-1 text-primary">
<!-- 点赞 -->
@@ -376,21 +376,21 @@
class="uh-global-card-glass box-border h-[72rpx] flex flex-1 items-center justify-center gap-x-1 border rounded-full px-4 shadow-none"
:class="[hasUpvoted()?'text-primary':'text-gray-900']" @click="handleDoLikesClick">
<wd-icon class-prefix="uhemoji-icon" name="-kiss-" size="36rpx" />
<text class="shrink-0 text-sm text-gray-900 font-semibold">点赞</text>
<text class="shrink-0 text-xs text-gray-900 font-semibold">点赞</text>
</view>
<!-- 评论 -->
<view v-if="moment.spec.allowComment"
class="uh-global-card-glass box-border h-[72rpx] flex flex-1 items-center justify-center gap-x-1 border rounded-full px-4 shadow-none"
@click="handleToComment()">
<wd-icon class-prefix="uhemoji-icon" name="-thinking" size="36rpx" />
<text class="shrink-0 text-sm text-gray-900 font-semibold">评论</text>
<text class="shrink-0 text-xs text-gray-900 font-semibold">评论</text>
</view>
<!-- 收藏 -->
<view
class="uh-global-card-glass box-border h-[72rpx] flex flex-1 items-center justify-center gap-x-1 border rounded-full px-4 shadow-none"
@click="handleToggleMomentFavorite">
<wd-icon class-prefix="uhemoji-icon" name="-smile-" size="36rpx" />
<text class="shrink-0 text-sm font-semibold"
<text class="shrink-0 text-xs font-semibold"
:class="[momentFavorited ? 'text-primary' : 'text-gray-900']">{{ momentFavorited ? '已收藏' : '收藏' }}</text>
</view>
</view>
+2 -2
View File
@@ -214,12 +214,12 @@
<!-- 自定义导航 -->
<uh-navbar :scroll-y="scrollY" default-title="内容搜索" title-color="text-gray-900" />
<uh-plugin-unavailable v-if="!uniHaloPluginAvailable" :plugin-id="pluginId" :error-text="tips"
<uh-plugin-unavailable v-if="!uniHaloPluginAvailable" custom-class="min-h-[80vh]" :plugin-id="pluginId" :error-text="tips"
:checking="checking" @on-refresh="handlePluginRefresh" />
<template v-else>
<!-- 顶部搜索框-->
<wd-sticky class="">
<wd-sticky>
<view class="w-screen box-border px-3 py-2">
<view class="box-border uh-global-card-glass h-9 flex items-center gap-3 rounded-full pl-1 pr-3">
<wd-icon name="search" size="16px" />