feat: live following

This commit is contained in:
guozhigq
2024-10-26 23:46:19 +08:00
parent 4f6ac4aff4
commit 638e22a60d
8 changed files with 327 additions and 106 deletions

View File

@ -14,6 +14,7 @@ class LiveController extends GetxController {
RxList<LiveItemModel> liveList = <LiveItemModel>[].obs;
RxList<LiveFollowingItemModel> liveFollowingList =
<LiveFollowingItemModel>[].obs;
RxInt liveFollowingCount = 0.obs;
bool flag = false;
OverlayEntry? popupDialog;
Box setting = GStrorage.setting;
@ -27,9 +28,6 @@ class LiveController extends GetxController {
// 获取推荐
Future queryLiveList(type) async {
// if (type == 'init') {
// _currentPage = 1;
// }
var res = await LiveHttp.liveList(
pn: _currentPage,
);
@ -68,13 +66,14 @@ class LiveController extends GetxController {
//
Future fetchLiveFollowing() async {
var res = await LiveHttp.liveFollowing(pn: 1, ps: 20);
var res = await LiveHttp.liveFollowing(pn: 1, ps: 10);
if (res['status']) {
liveFollowingList.value =
(res['data'].list as List<LiveFollowingItemModel>)
.where((LiveFollowingItemModel item) =>
item.liveStatus == 1 && item.recordLiveTime == 0) // 根据条件过滤
.toList();
liveFollowingCount.value = res['data'].liveCount;
}
return res;
}