diff --git a/lib/chat/group_chat_view.dart b/lib/chat/group_chat_view.dart index 41aec0e..a33f2b9 100644 --- a/lib/chat/group_chat_view.dart +++ b/lib/chat/group_chat_view.dart @@ -521,7 +521,7 @@ class _GroupChatPageState extends State { var lastMsgTime; if (index < msgList.length - 1) { - lastMsgTime = msgList[index].time; + lastMsgTime = msgList[index+1].time; } MsgModel msg = msgList[index]; diff --git a/lib/data/chat_data_mgr.dart b/lib/data/chat_data_mgr.dart index 0000f3f..f36f894 100644 --- a/lib/data/chat_data_mgr.dart +++ b/lib/data/chat_data_mgr.dart @@ -127,19 +127,22 @@ class ChatDataMgr { int curIndex = 0; if (record != null && record.length > 0) { + print('#### 有历史聊天记录 条数 ${record.length}'); for (var i = 0; i < record.length; i++) { if (record[i].time == msgModel.time) { curIndex = i; break; } } + }else{ + print('#### 没有聊天记录'); } - int maxLen = min(curIndex + 1, record.length); - + int maxLen = min(curIndex + 4, record.length); + print('curIndex:$curIndex maxLen:$maxLen}'); for (var i = curIndex + 1; i < maxLen; i++) { var shortDesc = record[i].shortRecordForTranslator(); - print(shortDesc); +// print('shortDesc'+shortDesc['Content']); res.add(shortDesc); } diff --git a/lib/models/ChatMsg.dart b/lib/models/ChatMsg.dart index 70dd2ac..bcd307a 100644 --- a/lib/models/ChatMsg.dart +++ b/lib/models/ChatMsg.dart @@ -283,8 +283,8 @@ class MsgModel { return { 'SendTime': DateUtils() - .getFormartData(timeSamp: time, format: 'yyyy:MM:dd hh:mm:ss'), - 'Content': desc, + .getFormartData(timeSamp: time, format: 'yyyy-MM-dd hh:mm:ss'), + 'Content': base64Encode(utf8.encode(desc)), 'UserId': from }; } diff --git a/lib/utils/HttpUtil.dart b/lib/utils/HttpUtil.dart index 34e190e..1f35c0c 100644 --- a/lib/utils/HttpUtil.dart +++ b/lib/utils/HttpUtil.dart @@ -171,7 +171,7 @@ class HttpUtil { if (CancelToken.isCancel(e)) { print('post请求取消! ' + e.message); } - print('post请求发生错误:$e'); + print('post请求发生错误 url:$url 参数:$data 错误:$e'); if (isShowLoading) LoadingManage().closeLoading(); showToast(I18n.of(Constants.getCurrentContext()).server_error_tips); if (failback != null) failback();