Browse Source

修改文件转发错误/禁止部分消息转发/提款规则域名修改/

master
jiahao 5 years ago
parent
commit
e5a9153f74
8 changed files with 58 additions and 17 deletions
  1. +7
    -1
      lib/chat/ChatPage.dart
  2. +20
    -5
      lib/chat/ChatPageItem.dart
  3. +14
    -6
      lib/chat/group_chat_item.dart
  4. +7
    -1
      lib/chat/group_chat_view.dart
  5. +2
    -1
      lib/home/MoneyPage.dart
  6. +1
    -1
      lib/home/service_view.dart
  7. +2
    -2
      lib/utils/HttpUtil.dart
  8. +5
    -0
      lib/utils/upload_util.dart

+ 7
- 1
lib/chat/ChatPage.dart View File

@@ -1,5 +1,6 @@
import 'dart:convert';
import 'dart:io';
import 'package:chat/utils/upload_util.dart';
import 'package:fixnum/fixnum.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:chat/chat/translate_state.dart';
@@ -215,7 +216,12 @@ class _ChatPageState extends State<ChatPage> {
MsgModel msg = MsgHandler.createSendMsg(
ChatType.valueOf(originMsg.msgType), originMsg.msgContent);
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.friendId = widget.friendId;
if (msg.localFile != null) {


+ 20
- 5
lib/chat/ChatPageItem.dart View File

@@ -629,7 +629,7 @@ class _ChatPageItemState extends State<ChatPageItem>
List<String> actions = [
I18n.of(context).delete,
I18n.of(context).reply,
I18n.of(context).forward
];
actionsFunc.add(() {
@@ -639,10 +639,25 @@ class _ChatPageItemState extends State<ChatPageItem>
print('发送引用的消息');
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) {


+ 14
- 6
lib/chat/group_chat_item.dart View File

@@ -574,7 +574,6 @@ class _GroupChatPageItemState extends State<GroupChatPageItem>
List<Function> actionsFunc = [];
List<String> actions = [
I18n.of(context).reply,
I18n.of(context).forward,
I18n.of(context).delete,
];
@@ -582,16 +581,25 @@ class _GroupChatPageItemState extends State<GroupChatPageItem>
print('发送引用的消息');
MessageMgr().emit('Reply Select Message', widget.msg);
});
actionsFunc.add(() {
print('转发消息');
AppNavigator.pushForwardPage(context, widget.msg);
});
actionsFunc.add(() {
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) {


+ 7
- 1
lib/chat/group_chat_view.dart View File

@@ -23,6 +23,7 @@ import 'package:chat/utils/screen.dart';
import 'package:chat/utils/sound_util.dart';
import 'package:chat/utils/sp_utils.dart';
import 'package:chat/utils/sql_util.dart';
import 'package:chat/utils/upload_util.dart';
import 'package:extended_text/extended_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@@ -111,7 +112,12 @@ class _GroupChatPageState extends State<GroupChatPage> {
ChatType.valueOf(originMsg.msgType), originMsg.msgContent,
channelType: ChatChannelType.Group);
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;
if (msg.localFile != null) {
msg.state = MsgState.Uploaded;


+ 2
- 1
lib/home/MoneyPage.dart View File

@@ -684,9 +684,10 @@ class MoneyPageState extends State<MoneyPage>
],
),
InkWell(
onTap: () {
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(
margin: EdgeInsets.only(top: 25, bottom: 10, left: 13.5),


+ 1
- 1
lib/home/service_view.dart View File

@@ -31,7 +31,7 @@ class ServiceMsgModel {
ServiceMsgModel({this.isMe, this.msg});
}
class ServiceCenterPage extends StatefulWidget {
class ServiceCenterPage extends StatefulWidget {
final int questionIndex;
ServiceCenterPage({this.questionIndex = -1});


+ 2
- 2
lib/utils/HttpUtil.dart View File

@@ -44,9 +44,9 @@ class HttpUtil {
//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://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 = 'https://datasm.chengyouhd.com/';
// static const String BaseUrl = 'https://datasm.chengyouhd.com/';
static HttpUtil _getInstance() {
if (_instance == null) {


+ 5
- 0
lib/utils/upload_util.dart View File

@@ -199,7 +199,12 @@ class UploadUtil {
Future downloadFile(MsgModel msg, {CancelToken cancelToken}) async {
Response response;
var fullUrl = getFullUrl(msg.extraFile, msg.sessionId, msg.channelType);
if(msg.extraFile.contains('http://')){
fullUrl = msg.extraFile;
}
print('下载文件$fullUrl');


Loading…
Cancel
Save