111
This commit is contained in:
@@ -91,4 +91,15 @@ class ApiEndpoints {
|
||||
|
||||
/// 获取默认钱包地址
|
||||
static const String defaultWallet = '/api/wallet/default';
|
||||
|
||||
// ==================== 福利模块 ====================
|
||||
|
||||
/// 查询新人福利状态
|
||||
static const String bonusStatus = '/api/bonus/status';
|
||||
|
||||
/// 领取新人福利
|
||||
static const String bonusClaim = '/api/bonus/claim';
|
||||
|
||||
/// 每日盈亏
|
||||
static const String dailyProfit = '/api/asset/daily-profit';
|
||||
}
|
||||
|
||||
@@ -89,4 +89,19 @@ class AssetService {
|
||||
queryParameters: params,
|
||||
);
|
||||
}
|
||||
|
||||
/// 获取每日盈亏数据
|
||||
Future<ApiResponse<Map<String, dynamic>>> getDailyProfit({
|
||||
required int year,
|
||||
required int month,
|
||||
}) async {
|
||||
final response = await _client.get<Map<String, dynamic>>(
|
||||
ApiEndpoints.dailyProfit,
|
||||
queryParameters: {'year': year, 'month': month},
|
||||
);
|
||||
if (response.success && response.data != null) {
|
||||
return ApiResponse.success(response.data!, response.message);
|
||||
}
|
||||
return ApiResponse.fail(response.message ?? '获取每日盈亏数据失败');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'data/services/market_service.dart';
|
||||
import 'data/services/trade_service.dart';
|
||||
import 'data/services/asset_service.dart';
|
||||
import 'data/services/fund_service.dart';
|
||||
import 'data/services/bonus_service.dart';
|
||||
import 'providers/auth_provider.dart';
|
||||
import 'providers/market_provider.dart';
|
||||
import 'providers/asset_provider.dart';
|
||||
@@ -89,6 +90,7 @@ class MyApp extends StatelessWidget {
|
||||
Provider<TradeService>(create: (_) => TradeService(dioClient)),
|
||||
Provider<AssetService>(create: (_) => AssetService(dioClient)),
|
||||
Provider<FundService>(create: (_) => FundService(dioClient)),
|
||||
Provider<BonusService>(create: (_) => BonusService(dioClient)),
|
||||
// State Management
|
||||
ChangeNotifierProvider<AuthProvider>(
|
||||
create: (ctx) => AuthProvider(ctx.read<UserService>()),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,6 +60,14 @@ class MainPageState extends State<MainPage> {
|
||||
});
|
||||
}
|
||||
|
||||
/// 切换到指定 tab
|
||||
void switchToTab(int index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
_loadedPages.add(index);
|
||||
});
|
||||
}
|
||||
|
||||
static const _navItems = [
|
||||
_NavItem(label: '首页', icon: LucideIcons.house),
|
||||
_NavItem(label: '行情', icon: LucideIcons.trendingUp),
|
||||
|
||||
Reference in New Issue
Block a user