feat: 搜索页的数据,缺省页

This commit is contained in:
chengsiwen committed 2026-07-06 20:56:12 +08:00
1 parent 9b0fe51fa4
commit b5bce6edcf
18 files changed
+1101 -171

No files matched your search

+2
View File
@@ -36,6 +36,8 @@ class ApiStringUser {
class ApiStringVideo {
static const String getRecommandsList = "/getRecommands";
// getDetailsRecommand
static const String getDetailsRecommand = "/getDetailsRecommand";
static const String getVideoDetail = "/getVideoDetails";
static const String getHomeModules = "/home/all-modules";
+1 -3
View File
@@ -20,7 +20,7 @@ class NyNetworkIntercept extends Interceptor {
// 打印请求日志
HelpLog.print("🔶 REQUEST [${options.method.toUpperCase()}] ${options.uri}");
HelpLog.print("Headers: ${options.headers}");
// HelpLog.print("Headers: ${options.headers}");
if (options.data != null) {
HelpLog.print("Payload: ${options.data}");
}
@@ -68,8 +68,6 @@ class NyNetworkIntercept extends Interceptor {
handler.next(err);
}
// ============ 私有方法 ============
Future<void> _addRequestHeaders(RequestOptions options) async {
if (!kReleaseMode) {
options.headers['security'] = 'false';
+17 -2
View File
@@ -36,13 +36,28 @@ class VideoRequest {
if (list != null) {
// id 28 不显示,删除
categoryList = list.map((e) => NyCategoryModel.fromJson(e)).toList();
categoryList.removeWhere((element) => element.id == 28);
categoryList.removeWhere((element) => element.name.length >= 10);
}
return categoryList;
});
}
// getRecommandsList
static Future<List<NyDramaModel>> getRecommandsList({
int page = 1,
int pageSize = 10,
}) {
Map<String, dynamic> params = _setPage(page: page, pageSize: pageSize);
return ApiRequest.get(ApiStringVideo.getRecommandsList, queryParameters: params).then((value) {
if (value.isSuccess) {
// HelpLog.print('getRecommandsList: ${value.data}');
List list = parseDataForList(value.data);
return list.map((e) => NyDramaModel.fromJson(e)).toList();
}
return [];
});
}
static Future<List<NyDramaModel>> getCategoriesDetail({
required int categoryId,
int page = 1,
@@ -58,7 +73,7 @@ class VideoRequest {
}
// getSearchHots
static Future<List<NyDramaModel>> getSearchHots() {
static Future<List<NyDramaModel>> getSearchTrending() {
return ApiRequest.get(ApiStringVideo.getSearchHots).then((value) {
if (value.isSuccess) {
HelpLog.print('getSearchHots: ${value.data}');
+2
View File
@@ -36,6 +36,7 @@ class ConstImage {
static const String btnBgRad2 = "assets/imgs/btn_bg_rad2.png";
// remove
static const String remove = "assets/imgs/remove.png";
static const String homeEyes = "assets/imgs/home_eyes.png";
/// other
static const String mineBg = "assets/other/mine_bg.png";
@@ -49,6 +50,7 @@ class ConstImage {
// pricary web_site
static const String primary = "assets/other/pricary.png";
static const String webSite = "assets/other/web_site.png";
static const String emptyImg = "assets/other/empty_img.png";
}