mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
refa: later view page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -102,37 +102,42 @@ class WhisperController extends GetxController {
|
||||
Future querySessionList(String? type) async {
|
||||
if (isLoading) return;
|
||||
var res = await MsgHttp.sessionList(
|
||||
endTs: type == 'onLoad' ? sessionList.last.sessionTs : null);
|
||||
if (res['data'].sessionList != null && res['data'].sessionList.isNotEmpty) {
|
||||
await queryAccountList(res['data'].sessionList);
|
||||
// 将 accountList 转换为 Map 结构
|
||||
Map<int, dynamic> accountMap = {};
|
||||
for (var j in accountList) {
|
||||
accountMap[j.mid!] = j;
|
||||
}
|
||||
endTs: type == 'onLoad' ? sessionList.last.sessionTs : null,
|
||||
);
|
||||
if (res['status']) {
|
||||
List<SessionList>? sessionList = res['data'];
|
||||
if (sessionList != null) {
|
||||
if (sessionList.isNotEmpty) {
|
||||
await queryAccountList(sessionList);
|
||||
// 将 accountList 转换为 Map 结构
|
||||
Map<int, dynamic> accountMap = {};
|
||||
for (var j in accountList) {
|
||||
accountMap[j.mid!] = j;
|
||||
}
|
||||
|
||||
// 遍历 sessionList,通过 mid 查找并赋值 accountInfo
|
||||
for (var i in res['data'].sessionList) {
|
||||
var accountInfo = accountMap[i.talkerId];
|
||||
if (accountInfo != null) {
|
||||
i.accountInfo = accountInfo;
|
||||
// 遍历 sessionList,通过 mid 查找并赋值 accountInfo
|
||||
for (var i in sessionList) {
|
||||
var accountInfo = accountMap[i.talkerId];
|
||||
if (accountInfo != null) {
|
||||
i.accountInfo = accountInfo;
|
||||
}
|
||||
if (i.talkerId == 844424930131966) {
|
||||
i.accountInfo = AccountListModel(
|
||||
name: 'UP主小助手',
|
||||
face:
|
||||
'https://message.biliimg.com/bfs/im/489a63efadfb202366c2f88853d2217b5ddc7a13.png',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i.talkerId == 844424930131966) {
|
||||
i.accountInfo = AccountListModel(
|
||||
name: 'UP主小助手',
|
||||
face:
|
||||
'https://message.biliimg.com/bfs/im/489a63efadfb202366c2f88853d2217b5ddc7a13.png',
|
||||
);
|
||||
|
||||
if (type == 'onLoad') {
|
||||
this.sessionList.addAll(sessionList);
|
||||
} else {
|
||||
this.sessionList.value = sessionList;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res['status'] && res['data'].sessionList != null) {
|
||||
if (type == 'onLoad') {
|
||||
sessionList.addAll(res['data'].sessionList);
|
||||
} else {
|
||||
sessionList.value = res['data'].sessionList;
|
||||
}
|
||||
}
|
||||
isLoading = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user