mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-11-13 22:11:42 +08:00
feat: 重构评论交互与请求错误处理,新增搜索页
- 请求层:非 200 响应统一抛 UniHaloError,Halo 来源响应归一化 - 评论弹窗:新增 allowNotification、验证码错误自动刷新与错误详情提示 - 评论回复结构调整为分页结果(replies.items) - 首页:快捷导航改 5 列、最新列表跳转搜索页,移除旧文章列表页 - 图库:分类切换改用 wd-tabs/wd-tab 组件 - 新增搜索页、uh-data-loading 组件、useDataLoadingStatus 与 exception 工具 Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
import { DataLoadingStatusEnum } from '@/hooks/useDataLoadingStatus'
|
||||
|
||||
interface IProps {
|
||||
loadingStatus?: DataLoadingStatusEnum
|
||||
}
|
||||
const props = withDefaults(defineProps<IProps>(), {
|
||||
loadingStatus: DataLoadingStatusEnum.Loading,
|
||||
})
|
||||
|
||||
const emit = defineEmits(['refresh'])
|
||||
|
||||
function handleRefresh() {
|
||||
emit('refresh')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="min-h-screen w-full flex items-center justify-center">
|
||||
<!-- 加载中 -->
|
||||
<wd-loading v-if="props.loadingStatus === DataLoadingStatusEnum.Loading" :size="60">
|
||||
<view>加载中...</view>
|
||||
</wd-loading>
|
||||
|
||||
<!-- 加载错误 -->
|
||||
<wd-empty v-else-if="props.loadingStatus === DataLoadingStatusEnum.Error" :icon-size="60" icon="no-result">
|
||||
<view>加载失败</view>
|
||||
<wd-button @click="handleRefresh">
|
||||
刷新试试
|
||||
</wd-button>
|
||||
</wd-empty>
|
||||
|
||||
<!-- 加载成功 -->
|
||||
<wd-empty v-else-if="props.loadingStatus === DataLoadingStatusEnum.Empty" :icon-size="60" icon="success">
|
||||
<view>无数据</view>
|
||||
<wd-button @click="handleRefresh">
|
||||
刷新试试
|
||||
</wd-button>
|
||||
</wd-empty>
|
||||
</view>
|
||||
</template>
|
||||
Reference in New Issue
Block a user