提交 e768f8a3 authored 作者: yueweilu's avatar yueweilu

减少网络请求次数

上级 67c93b6c
...@@ -68,9 +68,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -68,9 +68,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
@override @override
void onInit() { void onInit() {
// 获取分类数据
_getTabs();
_controller = AnimationController( _controller = AnimationController(
vsync: this, vsync: this,
duration: const Duration(milliseconds: 100), duration: const Duration(milliseconds: 100),
...@@ -84,8 +81,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -84,8 +81,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
void onReady() async { void onReady() async {
// 获取标签数据 // 获取标签数据
_getLabels(); _getLabels();
// 获取分类数据
_getTabs();
// 获取广告数据
_getAds(); _getAds();
onRefresh();
// Map<String, dynamic> data = { // Map<String, dynamic> data = {
// 'types': 1, // 'types': 1,
...@@ -207,7 +206,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -207,7 +206,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
filterCategories = categories.map((model) { filterCategories = categories.map((model) {
return FilterModel(id: model.categoryId.toString(), name: model.name??'',selected: model.selected); return FilterModel(id: model.categoryId.toString(), name: model.name??'',selected: model.selected);
}).toList(); }).toList();
print('===========$filterCategories');
update(); update();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论