mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-07-27 04:20:43 +08:00
feat: 完成uni-halo小程序基础功能迭代
本次提交完成多项核心功能升级与优化: 1. 新增页面背景色变量page3并替换部分页面背景样式 2. 新增通用列表分页请求基础接口类型 3. 调整首页默认跳转路径为首页 4. 重构配置结构,新增插件配置模块 5. 新增瞬间、友链、相册相关API接口与类型定义 6. 重构useRequest导出方式,修复hook导出问题 7. 移除部分调试日志代码 8. 新增padStart兼容polyfill工具函数 9. 新增文章卡片多种布局样式支持 10. 优化友链页面UI展示与交互逻辑 11. 新增瞬间页面时间轴展示模式与时间解析工具 12. 新增相册页面多种浏览模式切换功能
This commit is contained in:
@@ -5,11 +5,11 @@ import type { ListedPostVo } from '@halo-dev/api-client'
|
||||
|
||||
interface IProps {
|
||||
post?: ListedPostVo
|
||||
type?: 'default' | 'topCover' | 'rightCover'
|
||||
type?: 'noCover' | 'leftCover' | 'bottomCover' | 'rightCover' | 'topCover'
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<IProps>(), {
|
||||
type: 'default',
|
||||
type: 'leftCover',
|
||||
post: undefined,
|
||||
})
|
||||
|
||||
@@ -20,6 +20,15 @@ const wrapClass = computed(() => {
|
||||
if (props.type === 'rightCover') {
|
||||
return 'relative h-28 p-0! border-2 border-solid border-white'
|
||||
}
|
||||
if (props.type === 'noCover') {
|
||||
return 'pl-0'
|
||||
}
|
||||
if (props.type === 'leftCover') {
|
||||
return ' '
|
||||
}
|
||||
if (props.type === 'bottomCover') {
|
||||
return 'flex-col gap-y-2'
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
@@ -30,7 +39,16 @@ const coverClass = computed(() => {
|
||||
if (props.type === 'rightCover') {
|
||||
return 'absolute right-0 top-0 bottom-0 w-32 rounded-lt-0 rounded-lb-0'
|
||||
}
|
||||
return 'h-22 w-22'
|
||||
if (props.type === 'noCover') {
|
||||
return 'hidden!'
|
||||
}
|
||||
if (props.type === 'leftCover') {
|
||||
return 'h-22 w-22'
|
||||
}
|
||||
if (props.type === 'bottomCover') {
|
||||
return 'w-full h-32 order-2'
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
const textWrapClass = computed(() => {
|
||||
@@ -40,6 +58,10 @@ const textWrapClass = computed(() => {
|
||||
if (props.type === 'rightCover') {
|
||||
return 'p-4 pr-32 relative z-10'
|
||||
}
|
||||
|
||||
if (props.type === 'bottomCover') {
|
||||
return 'order-1'
|
||||
}
|
||||
return 'pl-4'
|
||||
})
|
||||
|
||||
@@ -47,9 +69,15 @@ const textContainerClass = computed(() => {
|
||||
if (props.type === 'topCover') {
|
||||
return 'gap-y-2'
|
||||
}
|
||||
if (props.type === 'noCover') {
|
||||
return 'gap-y-2'
|
||||
}
|
||||
if (props.type === 'rightCover') {
|
||||
return ''
|
||||
}
|
||||
if (props.type === 'bottomCover') {
|
||||
return 'gap-y-2'
|
||||
}
|
||||
return ''
|
||||
})
|
||||
|
||||
@@ -60,12 +88,15 @@ const textFooterClass = computed(() => {
|
||||
if (props.type === 'rightCover') {
|
||||
return 'gap-x-2'
|
||||
}
|
||||
if (props.type === 'bottomCover') {
|
||||
return ''
|
||||
}
|
||||
return 'gap-x-2'
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view v-if="post" class="uh-shadow-xs flex justify-center overflow-hidden rounded-2xl bg-white p-4" :class="wrapClass">
|
||||
<view v-if="post" class="uh-shadow-xs box-border w-full flex justify-center overflow-hidden rounded-2xl bg-white p-4" :class="wrapClass">
|
||||
<view class="shrink-0 overflow-hidden rounded-lg" :class="coverClass">
|
||||
<image :src="completeUrl(post.spec.cover)" mode="aspectFill" class="h-full w-full" />
|
||||
<view v-if="props.type === 'rightCover'" class="absolute bottom-0 left-0 top-0 z-10 h-full w-full from-white/0 via-white/10 to-white bg-gradient-to-l" />
|
||||
@@ -79,7 +110,7 @@ const textFooterClass = computed(() => {
|
||||
{{ post.status.excerpt }}
|
||||
</view>
|
||||
<view class="w-full flex items-center" :class="textFooterClass">
|
||||
<view class="text-[11px] text-gray-600">
|
||||
<view class="line-clamp-1 text-[11px] text-gray-600">
|
||||
{{ timeFrom(post.spec.publishTime) }}
|
||||
</view>
|
||||
<view class="shrink-0 text-xs text-gray-600">
|
||||
@@ -99,7 +130,7 @@ const textFooterClass = computed(() => {
|
||||
<view class="shrink-0 text-xs text-gray-600">
|
||||
·
|
||||
</view>
|
||||
<view class="text-[11px] text-gray-600">
|
||||
<view class="line-clamp-1 text-[11px] text-gray-600">
|
||||
浏览 {{ post.stats.visit }} 次
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user