|
|
@@ -4,6 +4,7 @@ import 'dart:convert'; |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:zhiying_base_widget/dialog/loading/loading.dart'; |
|
|
|
import 'package:zhiying_base_widget/dialog/loading/loading_dialog.dart'; |
|
|
|
import 'package:zhiying_base_widget/widgets/hot_ranking/hot_ranking_list/model/hot_ranking_list_data_model.dart'; |
|
|
|
import 'package:zhiying_comm/util/base_bloc.dart'; |
|
|
@@ -29,7 +30,7 @@ class HotRankingListBloc extends BlocBase { |
|
|
|
_dataController = null; |
|
|
|
} |
|
|
|
|
|
|
|
void loadData(String typeId, int page,Function complete) { |
|
|
|
void loadData(String typeId, int page, Function complete) { |
|
|
|
if (isLoading) { |
|
|
|
complete(); |
|
|
|
return; |
|
|
@@ -39,17 +40,18 @@ class HotRankingListBloc extends BlocBase { |
|
|
|
NetUtil.request( |
|
|
|
'/api/v1/rec/taobao?type_id=' + typeId + '&page=' + page.toString(), |
|
|
|
method: NetMethod.GET, onSuccess: (data) { |
|
|
|
|
|
|
|
complete(); |
|
|
|
complete(); |
|
|
|
isLoading = false; |
|
|
|
_loadData(data); |
|
|
|
Loading.dismiss(); |
|
|
|
}, onError: (e) { |
|
|
|
complete(); |
|
|
|
Loading.dismiss(); |
|
|
|
complete(); |
|
|
|
isLoading = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
void loadMoreData(String typeId,Function complete) { |
|
|
|
void loadMoreData(String typeId, Function complete) { |
|
|
|
if (isLoading) { |
|
|
|
complete(); |
|
|
|
return; |
|
|
|