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

style,refactor,feat: 统一卡片布局为图片在上并优化细节

1. 调整全局默认卡片样式为image_top,更新各页面默认布局配置
2. 给文章卡片添加variant属性适配双列/单列布局
3. 优化文章内容区域文字样式与评论列表空状态
4. 简化快捷导航组件代码,移除冗余样式与多余props
5. 优化markdown渲染配置与评论头像空格格式
This commit is contained in:
小莫唐尼
2026-09-09 17:47:54 +08:00
parent b41e01106a
commit d528d214b5
9 changed files with 32 additions and 62 deletions
@@ -117,7 +117,7 @@
return raw
})
const cardLayout = computed(() => CARD_LAYOUTS[effectiveLayout.value] ?? CARD_LAYOUTS.image_bottom)
const cardLayout = computed(() => CARD_LAYOUTS[effectiveLayout.value] ?? CARD_LAYOUTS.image_top)
/** 社交卡片形态(封面在下):左上用户信息(头像 + 昵称/日期垂直)、右上浏览数 */
const isSocialCard = computed(() => effectiveLayout.value === 'image_bottom')
@@ -183,7 +183,7 @@
</template>
</view>
<view class="flex items-center text-xs text-gray-500" :class="cardLayout.footer">
<view v-if="!isGrid" class="flex items-center" :class="cardLayout.authorGroup">
<view class="flex items-center" :class="cardLayout.authorGroup">
<image :src="article.owner.avatar" class="uh-global-card-glass h-5 w-5 rounded-full"
:class="cardLayout.avatar" mode="aspectFill" />
<template v-if="isSocialCard">
@@ -199,11 +199,11 @@
</view>
</view>
</template>
<text v-else class="truncate">{{ article.owner.displayName }}</text>
<text v-else class="min-w-0 flex-1 truncate">{{ article.owner.displayName }}</text>
</view>
<text v-if="!isGrid && !isSocialCard" class="text-gray-400"
:class="cardLayout.time">{{ publishTimeText }}</text>
<view v-if="!isSocialCard" class="visits flex items-center gap-x-1" :class="cardLayout.visits">
<view v-if="!isGrid && !isSocialCard" class="visits flex items-center gap-x-1" :class="cardLayout.visits">
浏览
<text class="number">{{ visitCount }}</text>
次
@@ -39,7 +39,7 @@
result.value = res.data
dataList.value = res.data.items.map((item) => {
// todo:临时
item.spec.owner.avatar = checkAvatarUrl(item.spec.owner.avatar??'https://api.dicebear.com/10.x/adventurer-neutral/svg')
item.spec.owner.avatar = checkAvatarUrl(item.spec.owner.avatar ?? 'https://api.dicebear.com/10.x/adventurer-neutral/svg')
return item
})
loading.value = 'success'
@@ -101,8 +101,7 @@
<uh-section-title>
评论列表
<template #right>
<view class="flex items-center gap-1.5 text-xs text-gray-500 font-normal"
@click="handleGetData">
<view class="flex items-center gap-1.5 text-xs text-gray-500 font-normal" @click="handleGetData">
<wd-icon name="refresh" size="28rpx" />
<text class="">刷新</text>
</view>
@@ -135,20 +134,15 @@
<view v-if="dataList.length === 0" class="empty py-12">
<view class="empty-box flex flex-col items-center">
<wd-empty>
<template #image>
<wd-icon name="empty" size="100rpx" class="text-primary" />
</template>
<template #bottom>
<text class="mt-2 text-sm text-gray-500">{{disallowComment ? '暂无评论' : '暂无评论'}}</text>
<view v-if="disallowComment" class="mt-2 text-xs text-red-400">
文章已开启禁止评论
</view>
<view v-else class="mt-2 bg-primary text-black text-sm px-4 py-1.5 rounded-lg" @click="handleToComment()">
抢沙发
</view>
</template>
</wd-empty>
<wd-icon class-prefix="uhemoji-icon" name="-confused" size="100rpx" class="text-primary" />
<text class="mt-2 text-sm text-gray-500">{{disallowComment ? '暂无评论' : '暂无评论'}}</text>
<view v-if="disallowComment" class="mt-2 text-xs text-red-400">
文章已开启禁止评论
</view>
<view v-else class="mt-2 bg-primary text-black text-sm px-4 py-1.5 rounded-lg"
@click="handleToComment()">
抢沙发
</view>
</view>
</view>
@@ -96,7 +96,7 @@
:style="{
backgroundColor: item.bgGlass
}">
<wd-icon :class-prefix="item.iconPrefix" :name="item.icon" size="64rpx" :color="item.color" />
<wd-icon :class-prefix="item.iconPrefix" :name="item.icon" size="64rpx"/>
</view>
<view class="text-xs text-gray-900">
{{ item.title }}
@@ -104,17 +104,4 @@
</view>
</view>
</view>
</template>
<style scoped lang="scss">
/* 彩色玻璃图标:低透明度同色底 + 同色描边 + 柔和同色投影,图标用实体色保证通透感 */
.quick-nav-icon {
backdrop-filter: blur(16rpx) saturate(160%);
-webkit-backdrop-filter: blur(16rpx) saturate(160%);
/* 低端安卓 WebView 不支持 backdrop-filter 的兜底:提高底色不透明度保证可读性 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
background-color: rgb(255 255 255 / 60%) !important;
}
}
</style>
</template>