feat: 优化图片加载和展示功能

- 新增 SmartImage 组件优化图片加载体验
- 新增 ImageGrid 组件支持多图布局展示
- 新增 imageHelper 工具函数
- 优化 PostCard 帖子卡片图片展示
- 优化消息页面 SegmentRenderer
- 优化日程页面 ScheduleScreen
- 优化上传服务 uploadService
This commit is contained in:
2026-03-15 02:25:55 +08:00
parent e9d42fdb01
commit 592167e667
8 changed files with 299 additions and 46 deletions

View File

@@ -35,6 +35,8 @@ function resolveFileInfo(uri: string, providedType?: string): { name: string; ty
// 上传响应
export interface UploadResponse {
url: string;
preview_url?: string; // 列表/网格预览图
preview_url_large?: string; // 详情页预览图
width?: number;
height?: number;
size?: number;
@@ -162,7 +164,19 @@ class UploadService {
for (const file of files) {
const result = await this.uploadImage(file);
if (result) {
urls.push(result.url);
// 将预览图信息合并到 URL 中url|preview_url|preview_url_large
const parts = [result.url];
if (result.preview_url) {
parts.push(result.preview_url);
} else {
parts.push(''); // 空占位
}
if (result.preview_url_large) {
parts.push(result.preview_url_large);
} else {
parts.push(''); // 空占位
}
urls.push(parts.join('|'));
}
}