feat:我的页面,首次重复加载修改

This commit is contained in:
pengtao 2025-10-14 15:55:11 +08:00
parent c9e777b6c7
commit be0d7eae45

View File

@ -38,8 +38,8 @@ class MyListLogic extends GetxController {
state.loadStatus = KtLoadStatusType.loading;
if (refresh) {
state.curFavoriteIndex = 1;
state.favoriteList.clear();
state.chestList.clear();
// state.favoriteList.clear();
// state.chestList.clear();
}
if (loadMore) {
state.curFavoriteIndex++;
@ -64,6 +64,10 @@ class MyListLogic extends GetxController {
refreshCtrl.loadNoData();
chestRefreshCtrl.loadNoData();
}
if (refresh) {
state.favoriteList.clear();
state.chestList.clear();
}
state.favoriteList.addAll(list);
if (state.favoriteList.length > 3) {
state.chestList = state.favoriteList.sublist(0, 3);
@ -86,7 +90,7 @@ class MyListLogic extends GetxController {
getHistoryList({bool refresh = false, bool loadMore = false}) async {
if (refresh) {
state.curHistoryIndex = 1;
state.historyList.clear();
// state.historyList.clear();
}
if (loadMore) {
state.curHistoryIndex++;
@ -107,7 +111,9 @@ class MyListLogic extends GetxController {
...res.data['list'].map((item) => KtHistoryVideoBean.fromJson(item)),
];
if (list.length < 20) refreshCtrl.loadNoData();
if (refresh) {
state.historyList.clear();
}
state.historyList.addAll(list);
update();
} else {