Procházet zdrojové kódy

人工翻译接口/群聊时间显示

master
jiahao před 5 roky
rodič
revize
687b3fdee6
4 změnil soubory, kde provedl 10 přidání a 7 odebrání
  1. +1
    -1
      lib/chat/group_chat_view.dart
  2. +6
    -3
      lib/data/chat_data_mgr.dart
  3. +2
    -2
      lib/models/ChatMsg.dart
  4. +1
    -1
      lib/utils/HttpUtil.dart

+ 1
- 1
lib/chat/group_chat_view.dart Zobrazit soubor

@@ -521,7 +521,7 @@ class _GroupChatPageState extends State<GroupChatPage> {
var lastMsgTime;
if (index < msgList.length - 1) {
lastMsgTime = msgList[index].time;
lastMsgTime = msgList[index+1].time;
}
MsgModel msg = msgList[index];


+ 6
- 3
lib/data/chat_data_mgr.dart Zobrazit soubor

@@ -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);
}


+ 2
- 2
lib/models/ChatMsg.dart Zobrazit soubor

@@ -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
};
}


+ 1
- 1
lib/utils/HttpUtil.dart Zobrazit soubor

@@ -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();


Načítá se…
Zrušit
Uložit