1
This commit is contained in:
@@ -64,7 +64,8 @@ class CpsCategoryInfo {
|
||||
|
||||
final cpsCategoryProvider = FutureProvider<List<CpsCategoryInfo>>((ref) async {
|
||||
final api = ref.read(apiClientProvider);
|
||||
final list = await api.get<List<dynamic>>('/cps/category/list');
|
||||
final data = await api.get<Map<String, dynamic>>('/cps/category/list');
|
||||
final list = data['list'] as List<dynamic>? ?? [];
|
||||
return list
|
||||
.map((e) => CpsCategoryInfo(
|
||||
code: e['code'] as String? ?? '',
|
||||
|
||||
@@ -100,7 +100,8 @@ class MemberPlan {
|
||||
|
||||
final memberPlanProvider = FutureProvider<List<MemberPlan>>((ref) async {
|
||||
final api = ref.read(apiClientProvider);
|
||||
final list = await api.get<List<dynamic>>('/member/plan/list');
|
||||
final data = await api.get<Map<String, dynamic>>('/member/plan/list');
|
||||
final list = data['list'] as List<dynamic>? ?? [];
|
||||
return list
|
||||
.map((e) => MemberPlan.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
|
||||
@@ -86,7 +86,8 @@ class OutfitPlanNotifier extends AsyncNotifier<List<OutfitPlanInfo>> {
|
||||
@override
|
||||
Future<List<OutfitPlanInfo>> build() async {
|
||||
final api = ref.read(apiClientProvider);
|
||||
final list = await api.get<List<dynamic>>('/outfit/plan/list');
|
||||
final data = await api.get<Map<String, dynamic>>('/outfit/plan/list');
|
||||
final list = data['list'] as List<dynamic>? ?? [];
|
||||
return list
|
||||
.map((e) => OutfitPlanInfo(
|
||||
id: (e['id'] as num).toInt(),
|
||||
|
||||
@@ -41,9 +41,8 @@ class AvatarViewerPage extends ConsumerWidget {
|
||||
fontSize: 15, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'化身由脸型(20 档)× 体型(6 档)× 肤色(5 档)模板组合而成,'
|
||||
'依据大头照、全身照与身形参数自动匹配。'
|
||||
'3D 渲染在预烘焙 GLB 资产接入后启用。',
|
||||
'化身基于你的三视角全身照(正面/侧面/背面)由 AI 生成 3D 形象,'
|
||||
'构建过程通常需要 1-3 分钟。',
|
||||
style: TextStyle(fontSize: 13, color: Colors.grey),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:image_picker/image_picker.dart';
|
||||
import '../../shared/widgets/loading_view.dart';
|
||||
import 'photo_upload_provider.dart';
|
||||
|
||||
/// 拍照引导:4 类照片(大头照/正面/侧面/背面)逐一上传
|
||||
/// 拍照引导:3 视角全身照(正面/侧面/背面)逐一上传,用于 Tripo 构建 3D 化身
|
||||
class PhotoGuidePage extends ConsumerStatefulWidget {
|
||||
const PhotoGuidePage({super.key});
|
||||
|
||||
@@ -74,7 +74,7 @@ class _PhotoGuidePageState extends ConsumerState<PhotoGuidePage> {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
const Text('按提示拍摄 4 张照片,用于构建你的 3D 形象',
|
||||
const Text('拍摄 3 张全身照(正面/侧面/背面),用于构建你的 3D 形象',
|
||||
style: TextStyle(color: Colors.grey, fontSize: 13)),
|
||||
const SizedBox(height: 12),
|
||||
for (final type in PhotoType.all) ...[
|
||||
|
||||
@@ -23,7 +23,8 @@ class PhotoType {
|
||||
fullBack: '站立背面全身,露出轮廓',
|
||||
};
|
||||
|
||||
static const List<int> all = [headshot, fullFront, fullSide, fullBack];
|
||||
/// 构建 3D 化身所需视角(Tripo 多视角转 3D)
|
||||
static const List<int> all = [fullFront, fullSide, fullBack];
|
||||
}
|
||||
|
||||
class UserPhotoInfo {
|
||||
@@ -42,7 +43,8 @@ class PhotoNotifier extends AsyncNotifier<List<UserPhotoInfo>> {
|
||||
@override
|
||||
Future<List<UserPhotoInfo>> build() async {
|
||||
final api = ref.read(apiClientProvider);
|
||||
final list = await api.get<List<dynamic>>('/user-photo/list');
|
||||
final data = await api.get<Map<String, dynamic>>('/user-photo/list');
|
||||
final list = data['list'] as List<dynamic>? ?? [];
|
||||
return list
|
||||
.map((e) => UserPhotoInfo(
|
||||
id: (e['id'] as num).toInt(),
|
||||
|
||||
@@ -29,7 +29,8 @@ class WardrobeNotifier extends AsyncNotifier<List<WardrobeItemInfo>> {
|
||||
@override
|
||||
Future<List<WardrobeItemInfo>> build() async {
|
||||
final api = ref.read(apiClientProvider);
|
||||
final list = await api.get<List<dynamic>>('/wardrobe/list');
|
||||
final data = await api.get<Map<String, dynamic>>('/wardrobe/list');
|
||||
final list = data['list'] as List<dynamic>? ?? [];
|
||||
return list
|
||||
.map((e) => WardrobeItemInfo(
|
||||
id: (e['id'] as num).toInt(),
|
||||
|
||||
Reference in New Issue
Block a user