@@ -1,5 +1,6 @@ | |||||
import 'dart:convert'; | import 'dart:convert'; | ||||
import 'dart:io'; | import 'dart:io'; | ||||
import 'package:chat/utils/upload_util.dart'; | |||||
import 'package:fixnum/fixnum.dart'; | import 'package:fixnum/fixnum.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | import 'package:cached_network_image/cached_network_image.dart'; | ||||
import 'package:chat/chat/translate_state.dart'; | import 'package:chat/chat/translate_state.dart'; | ||||
@@ -215,7 +216,12 @@ class _ChatPageState extends State<ChatPage> { | |||||
MsgModel msg = MsgHandler.createSendMsg( | MsgModel msg = MsgHandler.createSendMsg( | ||||
ChatType.valueOf(originMsg.msgType), originMsg.msgContent); | ChatType.valueOf(originMsg.msgType), originMsg.msgContent); | ||||
msg.extraInfo = originMsg.extraInfo; | msg.extraInfo = originMsg.extraInfo; | ||||
msg.extraFile = originMsg.extraFile; | |||||
if(originMsg.extraFile.contains('http')){ | |||||
msg.extraFile = originMsg.extraFile; | |||||
}else{ | |||||
msg.extraFile = UploadUtil().getFullUrl(originMsg.extraFile, originMsg.sessionId, originMsg.channelType); | |||||
} | |||||
msg.localFile = originMsg.localFile; | msg.localFile = originMsg.localFile; | ||||
msg.friendId = widget.friendId; | msg.friendId = widget.friendId; | ||||
if (msg.localFile != null) { | if (msg.localFile != null) { | ||||
@@ -629,7 +629,7 @@ class _ChatPageItemState extends State<ChatPageItem> | |||||
List<String> actions = [ | List<String> actions = [ | ||||
I18n.of(context).delete, | I18n.of(context).delete, | ||||
I18n.of(context).reply, | I18n.of(context).reply, | ||||
I18n.of(context).forward | |||||
]; | ]; | ||||
actionsFunc.add(() { | actionsFunc.add(() { | ||||
@@ -639,10 +639,25 @@ class _ChatPageItemState extends State<ChatPageItem> | |||||
print('发送引用的消息'); | print('发送引用的消息'); | ||||
MessageMgr().emit('Reply Select Message', widget.msg); | MessageMgr().emit('Reply Select Message', widget.msg); | ||||
}); | }); | ||||
actionsFunc.add(() { | |||||
print('转发消息'); | |||||
AppNavigator.pushForwardPage(context, widget.msg); | |||||
}); | |||||
///转发 | |||||
if (widget.msg.msgType == ChatType.TextChatType.value|| | |||||
widget.msg.msgType == ChatType.ImageChatType.value|| | |||||
widget.msg.msgType == ChatType.ShortVideoChatType.value|| | |||||
widget.msg.msgType == ChatType.PlaceChatType.value|| | |||||
widget.msg.msgType == ChatType.EmoticonType.value|| | |||||
widget.msg.msgType == ChatType.FileChatType.value | |||||
){ | |||||
actions.add( I18n.of(context).forward); | |||||
actionsFunc.add(() { | |||||
print('转发消息'); | |||||
AppNavigator.pushForwardPage(context, widget.msg); | |||||
}); | |||||
} | |||||
if (widget.msg.msgType == ChatType.FileChatType.value &&widget.msg.localFile!=null) { | if (widget.msg.msgType == ChatType.FileChatType.value &&widget.msg.localFile!=null) { | ||||
@@ -574,7 +574,6 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
List<Function> actionsFunc = []; | List<Function> actionsFunc = []; | ||||
List<String> actions = [ | List<String> actions = [ | ||||
I18n.of(context).reply, | I18n.of(context).reply, | ||||
I18n.of(context).forward, | |||||
I18n.of(context).delete, | I18n.of(context).delete, | ||||
]; | ]; | ||||
@@ -582,16 +581,25 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
print('发送引用的消息'); | print('发送引用的消息'); | ||||
MessageMgr().emit('Reply Select Message', widget.msg); | MessageMgr().emit('Reply Select Message', widget.msg); | ||||
}); | }); | ||||
actionsFunc.add(() { | |||||
print('转发消息'); | |||||
AppNavigator.pushForwardPage(context, widget.msg); | |||||
}); | |||||
actionsFunc.add(() { | actionsFunc.add(() { | ||||
MessageMgr().emit('Delete Select Message', widget.msg); | MessageMgr().emit('Delete Select Message', widget.msg); | ||||
}); | }); | ||||
///转发 | |||||
if (widget.msg.msgType == ChatType.TextChatType.value|| | |||||
widget.msg.msgType == ChatType.ImageChatType.value|| | |||||
widget.msg.msgType == ChatType.ShortVideoChatType.value|| | |||||
widget.msg.msgType == ChatType.PlaceChatType.value|| | |||||
widget.msg.msgType == ChatType.EmoticonType.value|| | |||||
widget.msg.msgType == ChatType.FileChatType.value | |||||
){ | |||||
actions.add( I18n.of(context).forward); | |||||
actionsFunc.add(() { | |||||
print('转发消息'); | |||||
AppNavigator.pushForwardPage(context, widget.msg); | |||||
}); | |||||
} | |||||
if (widget.msg.msgType == ChatType.FileChatType.value &&widget.msg.localFile!=null) { | if (widget.msg.msgType == ChatType.FileChatType.value &&widget.msg.localFile!=null) { | ||||
@@ -23,6 +23,7 @@ import 'package:chat/utils/screen.dart'; | |||||
import 'package:chat/utils/sound_util.dart'; | import 'package:chat/utils/sound_util.dart'; | ||||
import 'package:chat/utils/sp_utils.dart'; | import 'package:chat/utils/sp_utils.dart'; | ||||
import 'package:chat/utils/sql_util.dart'; | import 'package:chat/utils/sql_util.dart'; | ||||
import 'package:chat/utils/upload_util.dart'; | |||||
import 'package:extended_text/extended_text.dart'; | import 'package:extended_text/extended_text.dart'; | ||||
import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
@@ -111,7 +112,12 @@ class _GroupChatPageState extends State<GroupChatPage> { | |||||
ChatType.valueOf(originMsg.msgType), originMsg.msgContent, | ChatType.valueOf(originMsg.msgType), originMsg.msgContent, | ||||
channelType: ChatChannelType.Group); | channelType: ChatChannelType.Group); | ||||
msg.extraInfo = originMsg.extraInfo; | msg.extraInfo = originMsg.extraInfo; | ||||
msg.extraFile = originMsg.extraFile; | |||||
// msg.extraFile = originMsg.extraFile; | |||||
if(originMsg.extraFile.contains('http')){ | |||||
msg.extraFile = originMsg.extraFile; | |||||
}else{ | |||||
msg.extraFile = UploadUtil().getFullUrl(originMsg.extraFile, originMsg.sessionId, originMsg.channelType); | |||||
} | |||||
msg.localFile = originMsg.localFile; | msg.localFile = originMsg.localFile; | ||||
if (msg.localFile != null) { | if (msg.localFile != null) { | ||||
msg.state = MsgState.Uploaded; | msg.state = MsgState.Uploaded; | ||||
@@ -684,9 +684,10 @@ class MoneyPageState extends State<MoneyPage> | |||||
], | ], | ||||
), | ), | ||||
InkWell( | InkWell( | ||||
onTap: () { | onTap: () { | ||||
launch( | launch( | ||||
"https://datasm.chengyouhd.com/zh-CN/Home/WithdrawalRole?language=${UserData().language}"); | |||||
"http://datechatagent.chengyouhd.com/zh-CN/Home/WithdrawalRole?language=${UserData().language}"); | |||||
}, | }, | ||||
child: Container( | child: Container( | ||||
margin: EdgeInsets.only(top: 25, bottom: 10, left: 13.5), | margin: EdgeInsets.only(top: 25, bottom: 10, left: 13.5), | ||||
@@ -31,7 +31,7 @@ class ServiceMsgModel { | |||||
ServiceMsgModel({this.isMe, this.msg}); | ServiceMsgModel({this.isMe, this.msg}); | ||||
} | } | ||||
class ServiceCenterPage extends StatefulWidget { | |||||
class ServiceCenterPage extends StatefulWidget { | |||||
final int questionIndex; | final int questionIndex; | ||||
ServiceCenterPage({this.questionIndex = -1}); | ServiceCenterPage({this.questionIndex = -1}); | ||||
@@ -44,9 +44,9 @@ class HttpUtil { | |||||
//static const String BaseUrl = 'http://192.168.0.223:7001/'; | //static const String BaseUrl = 'http://192.168.0.223:7001/'; | ||||
//static const String BaseUrl = 'http://192.168.0.207:9080/'; | //static const String BaseUrl = 'http://192.168.0.207:9080/'; | ||||
// static const String BaseUrl = 'http://120.79.107.63:9080/'; | |||||
static const String BaseUrl = 'http://120.79.107.63:9080/'; | |||||
//static const String BaseUrl = 'http://192.168.0.177:9016/'; | //static const String BaseUrl = 'http://192.168.0.177:9016/'; | ||||
static const String BaseUrl = 'https://datasm.chengyouhd.com/'; | |||||
// static const String BaseUrl = 'https://datasm.chengyouhd.com/'; | |||||
static HttpUtil _getInstance() { | static HttpUtil _getInstance() { | ||||
if (_instance == null) { | if (_instance == null) { | ||||
@@ -199,7 +199,12 @@ class UploadUtil { | |||||
Future downloadFile(MsgModel msg, {CancelToken cancelToken}) async { | Future downloadFile(MsgModel msg, {CancelToken cancelToken}) async { | ||||
Response response; | Response response; | ||||
var fullUrl = getFullUrl(msg.extraFile, msg.sessionId, msg.channelType); | var fullUrl = getFullUrl(msg.extraFile, msg.sessionId, msg.channelType); | ||||
if(msg.extraFile.contains('http://')){ | |||||
fullUrl = msg.extraFile; | |||||
} | |||||
print('下载文件$fullUrl'); | print('下载文件$fullUrl'); | ||||