@@ -1164,7 +1164,7 @@ | |||||
"search_plach": "Rà soát địa điểm", | "search_plach": "Rà soát địa điểm", | ||||
"finding_place": " Tìm địa điểm", | "finding_place": " Tìm địa điểm", | ||||
"real_time_helper": "Hỗ trợ nhanh", | "real_time_helper": "Hỗ trợ nhanh", | ||||
"translation_butler": "Dịch vụ dịch thuật thời gian thực", | |||||
"translation_butler": "Dịch vụ dịch thuật \nthời gian thực", | |||||
"travel_butler": " Trợ lý chỉ đường", | "travel_butler": " Trợ lý chỉ đường", | ||||
"translation_butler_tips": "Trợ lý dịch thuật giúp bạn giải quyết trở ngại ngôn ngữ", | "translation_butler_tips": "Trợ lý dịch thuật giúp bạn giải quyết trở ngại ngôn ngữ", | ||||
"choose_language": " Vui lòng chọn một ngôn ngữ để dịch ", | "choose_language": " Vui lòng chọn một ngôn ngữ để dịch ", | ||||
@@ -1,10 +1,11 @@ | |||||
#!/bin/sh | #!/bin/sh | ||||
# This is a generated file; do not edit or check into version control. | # This is a generated file; do not edit or check into version control. | ||||
export "FLUTTER_ROOT=G:\flutter" | |||||
export "FLUTTER_APPLICATION_PATH=F:\flutterCode\Hibok" | |||||
export "FLUTTER_TARGET=lib\main.dart" | |||||
export "FLUTTER_ROOT=/Users/random/sdk/flutter_sdk" | |||||
export "FLUTTER_APPLICATION_PATH=/Users/random/code/flutter/project/hibok" | |||||
export "FLUTTER_TARGET=/Users/random/code/flutter/project/hibok/lib/main.dart" | |||||
export "FLUTTER_BUILD_DIR=build" | export "FLUTTER_BUILD_DIR=build" | ||||
export "SYMROOT=${SOURCE_ROOT}/../build\ios" | |||||
export "FLUTTER_FRAMEWORK_DIR=G:\flutter\bin\cache\artifacts\engine\ios" | |||||
export "SYMROOT=${SOURCE_ROOT}/../build/ios" | |||||
export "FLUTTER_FRAMEWORK_DIR=/Users/random/sdk/flutter_sdk/bin/cache/artifacts/engine/ios" | |||||
export "FLUTTER_BUILD_NAME=1.1.0" | export "FLUTTER_BUILD_NAME=1.1.0" | ||||
export "FLUTTER_BUILD_NUMBER=15" | export "FLUTTER_BUILD_NUMBER=15" | ||||
export "TRACK_WIDGET_CREATION=true" |
@@ -188,6 +188,8 @@ | |||||
</array> | </array> | ||||
<key>io.flutter.embedded_views_preview</key> | <key>io.flutter.embedded_views_preview</key> | ||||
<true/> | <true/> | ||||
<key>UISupportsDocumentBrowser</key> | |||||
<true/> | |||||
<key>kTCCServiceMediaLibrary</key> | <key>kTCCServiceMediaLibrary</key> | ||||
<string>App need your agree, can visit your music</string> | <string>App need your agree, can visit your music</string> | ||||
</dict> | </dict> | ||||
@@ -48,6 +48,9 @@ import 'package:chat/utils/PopUpMenu.dart' as myPop; | |||||
import 'package:chat/models/money_change.dart'; | import 'package:chat/models/money_change.dart'; | ||||
class ChatPage extends StatefulWidget { | class ChatPage extends StatefulWidget { | ||||
static bool isChatPageActive=false; | |||||
final int friendId; | final int friendId; | ||||
final int enterType; // 0默认 1图片 | final int enterType; // 0默认 1图片 | ||||
final dynamic enterContent; | final dynamic enterContent; | ||||
@@ -104,6 +107,7 @@ class _ChatPageState extends State<ChatPage> { | |||||
SoundUtils().stop(); | SoundUtils().stop(); | ||||
nickNameController.dispose(); | nickNameController.dispose(); | ||||
super.dispose(); | super.dispose(); | ||||
ChatPage.isChatPageActive =false; | |||||
} | } | ||||
jumpToMsg(time) async { | jumpToMsg(time) async { | ||||
@@ -132,6 +136,7 @@ class _ChatPageState extends State<ChatPage> { | |||||
void initState() { | void initState() { | ||||
super.initState(); | super.initState(); | ||||
print('init chatpage'); | print('init chatpage'); | ||||
ChatPage.isChatPageActive=true; | |||||
getDefaultSetting(); | getDefaultSetting(); | ||||
getUserInfo(); | getUserInfo(); | ||||
@@ -194,6 +199,28 @@ class _ChatPageState extends State<ChatPage> { | |||||
TranslateHKMgr().order=null; | TranslateHKMgr().order=null; | ||||
}); | }); | ||||
if(!UserData().isTranslateUser){ | |||||
var cancle = InkWell(onTap: (){Navigator.pop(context);},child: Container( | |||||
decoration: BoxDecoration( | |||||
color: const Color(0XFFC7E5FF), | |||||
borderRadius: BorderRadius.all( | |||||
Radius.circular(Constants.LittleButtonRadius))), | |||||
margin: EdgeInsets.only(top: 0, bottom: 18.5), | |||||
height: 37.5, | |||||
width: 200, | |||||
alignment: Alignment.center, | |||||
child: CountDownButton(I18n.of(context).cancel, (){Navigator.of(context).pop();},isOnlyRichText: true,countDownTime: 10,)),); | |||||
CustomUI.buildTowConfirmWithCountDown(context, '是否再来一单', '是的', (){ | |||||
MsgHandler.sendAnotherOrderReq(); | |||||
Navigator.of(context).pop(); | |||||
}, cancle); | |||||
} | |||||
} | } | ||||
void _sendFile(File file) async { | void _sendFile(File file) async { | ||||
@@ -336,6 +363,9 @@ class _ChatPageState extends State<ChatPage> { | |||||
); | ); | ||||
} | } | ||||
List<Widget> actions = []; | List<Widget> actions = []; | ||||
int voucher = Provider.of<VoucherChangeProvider>(context).voucher; | int voucher = Provider.of<VoucherChangeProvider>(context).voucher; | ||||
@@ -412,78 +442,79 @@ class _ChatPageState extends State<ChatPage> { | |||||
}))); | }))); | ||||
return WillPopScope( | |||||
child: Stack( | |||||
children: <Widget>[ | |||||
MultiProvider( | |||||
providers: [ | |||||
ChangeNotifierProvider(create: (_) => _keyboardIndexProvider), | |||||
Provider<bool>.value(value: false), | |||||
Provider<int>.value(value: widget.friendId), | |||||
], | |||||
child: GestureDetector( | |||||
onTap: hideKeyBoard, | |||||
child: ExtendedTextSelectionPointerHandler( | |||||
///选择文字,消除弹窗 | |||||
builder: (states) { | |||||
return Listener( | |||||
child: Scaffold( | |||||
resizeToAvoidBottomInset: false, | |||||
backgroundColor: const Color(0xFFE2E9F1), | |||||
appBar: AppBar( | |||||
title: Text( | |||||
'${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}', | |||||
textScaleFactor: 1.0, | |||||
style: TextStyle( | |||||
color: Constants.BlackTextColor, | |||||
fontSize: 16.47), | |||||
), | |||||
leading: CustomUI.buildCustomLeading(context,onTap:(){ | |||||
goBackCheck(); | |||||
}), | |||||
titleSpacing: -10, | |||||
centerTitle: false, | |||||
elevation: 1, | |||||
actions: actions), | |||||
body: SafeArea( | |||||
child: Column( | |||||
children: <Widget>[ | |||||
NetStateWidget(), | |||||
(isTranslateButler) | |||||
? _buildTranslationButler() | |||||
: Container(), | |||||
Expanded(child: _buildMessageList()), | |||||
InputBar(sendMsg: sendMsg,isTranslateHK: isTranslateButler,), | |||||
], | |||||
))), | |||||
behavior: HitTestBehavior.translucent, | |||||
onPointerDown: (value) { | |||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
//clear other selection | |||||
state.clearSelection(); | |||||
} | |||||
} | |||||
}, | |||||
onPointerMove: (value) { | |||||
var allItem = Stack( | |||||
children: <Widget>[ | |||||
MultiProvider( | |||||
providers: [ | |||||
ChangeNotifierProvider(create: (_) => _keyboardIndexProvider), | |||||
Provider<bool>.value(value: false), | |||||
Provider<int>.value(value: widget.friendId), | |||||
], | |||||
child: GestureDetector( | |||||
onTapDown: (args){hideKeyBoard();}, | |||||
child: ExtendedTextSelectionPointerHandler( | |||||
///选择文字,消除弹窗 | |||||
builder: (states) { | |||||
return Listener( | |||||
child: Scaffold( | |||||
resizeToAvoidBottomInset: false, | |||||
backgroundColor: const Color(0xFFE2E9F1), | |||||
appBar: AppBar( | |||||
title: Text( | |||||
'${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}', | |||||
textScaleFactor: 1.0, | |||||
style: TextStyle( | |||||
color: Constants.BlackTextColor, | |||||
fontSize: 16.47), | |||||
), | |||||
leading: CustomUI.buildCustomLeading(context,onTap:(){ | |||||
goBackCheck(); | |||||
}), | |||||
titleSpacing: -10, | |||||
centerTitle: false, | |||||
elevation: 1, | |||||
actions: actions), | |||||
body: SafeArea( | |||||
child: Column( | |||||
children: <Widget>[ | |||||
NetStateWidget(), | |||||
(isTranslateButler) | |||||
? _buildTranslationButler() | |||||
: Container(), | |||||
Expanded(child: _buildMessageList()), | |||||
InputBar(sendMsg: sendMsg,isTranslateHK: isTranslateButler,), | |||||
], | |||||
))), | |||||
behavior: HitTestBehavior.translucent, | |||||
onPointerDown: (value) { | |||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
//clear other selection | //clear other selection | ||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
//clear other selection | |||||
state.clearSelection(); | |||||
} | |||||
} | |||||
}, | |||||
); | |||||
state.clearSelection(); | |||||
} | |||||
} | |||||
}, | }, | ||||
))), | |||||
isTranslateButler ? getAudioChatView() : Container(), | |||||
isTranslateButler ? zoomAudioButton() : Container() | |||||
], | |||||
), | |||||
onPointerMove: (value) { | |||||
//clear other selection | |||||
for (var state in states) { | |||||
if (!state.containsPosition(value.position)) { | |||||
//clear other selection | |||||
state.clearSelection(); | |||||
} | |||||
} | |||||
}, | |||||
); | |||||
}, | |||||
))), | |||||
isTranslateButler ? getAudioChatView() : Container(), | |||||
isTranslateButler ? zoomAudioButton() : Container() | |||||
], | |||||
); | |||||
return isTranslateButler?WillPopScope( | |||||
child: allItem, | |||||
onWillPop: () { | onWillPop: () { | ||||
if(isTranslateButler && !isTranslateButlerFinish){ | if(isTranslateButler && !isTranslateButlerFinish){ | ||||
if(UserData().isTranslateUser){ | if(UserData().isTranslateUser){ | ||||
@@ -508,7 +539,7 @@ class _ChatPageState extends State<ChatPage> { | |||||
}else{ | }else{ | ||||
Navigator.of(context).pop(); } | Navigator.of(context).pop(); } | ||||
return Future.value(false); | return Future.value(false); | ||||
}); | |||||
}):allItem; | |||||
} | } | ||||
@@ -530,7 +561,7 @@ class _ChatPageState extends State<ChatPage> { | |||||
MsgHandler.sendEndTransHKOrderReq(); | MsgHandler.sendEndTransHKOrderReq(); | ||||
Navigator.of(context).pop(); | Navigator.of(context).pop(); | ||||
}, | }, | ||||
'取消', | |||||
I18n.of(context).cancel, | |||||
(){ Navigator.of(context).pop();}); | (){ Navigator.of(context).pop();}); | ||||
} | } | ||||
}else{ | }else{ | ||||
@@ -165,7 +165,7 @@ class _CompanyServerPageState extends State<CompanyServerPage> { | |||||
actionBarColor: "#50A7F9", | actionBarColor: "#50A7F9", | ||||
actionBarTitle: "Hibok", | actionBarTitle: "Hibok", | ||||
allViewTitle: "", | allViewTitle: "", | ||||
useDetailsView: false, | |||||
useDetailsView: true, | |||||
selectCircleStrokeColor: "#000000", | selectCircleStrokeColor: "#000000", | ||||
), | ), | ||||
); | ); | ||||
@@ -1,8 +1,10 @@ | |||||
import 'dart:io'; | import 'dart:io'; | ||||
import 'dart:typed_data'; | import 'dart:typed_data'; | ||||
import 'package:chat/data/constants.dart'; | |||||
import 'package:chat/generated/i18n.dart'; | import 'package:chat/generated/i18n.dart'; | ||||
import 'package:chat/models/ChatMsg.dart'; | import 'package:chat/models/ChatMsg.dart'; | ||||
import 'package:chat/r.dart'; | |||||
import 'package:chat/utils/screen.dart'; | import 'package:chat/utils/screen.dart'; | ||||
import 'package:extended_image/extended_image.dart'; | import 'package:extended_image/extended_image.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
@@ -98,19 +100,17 @@ class _PhotoPageState extends State<PhotoPage> | |||||
)) | )) | ||||
], | ], | ||||
)), | )), | ||||
Positioned(bottom: 1,child: UnconstrainedBox(child: Container( width: Screen.width,height: 95,child: Image.asset(R.assetsImagesImgCheckPhotoBg,fit: BoxFit.fill,),),),), | |||||
Positioned( | Positioned( | ||||
right: 10, | |||||
bottom: 10, | |||||
child: Material(child: InkWell( | |||||
right: 15, | |||||
bottom: 15, | |||||
child: Material(color: Colors.transparent,child: InkWell( | |||||
onTap: saveToGallery, | onTap: saveToGallery, | ||||
child: Container( | child: Container( | ||||
width: 50, | width: 50, | ||||
height: 50, | height: 50, | ||||
padding: EdgeInsets.all(5), | padding: EdgeInsets.all(5), | ||||
decoration: BoxDecoration( | |||||
color: Colors.grey.withAlpha(150), | |||||
borderRadius: BorderRadius.circular(8)), | |||||
child: Icon(Icons.save_alt, color: Colors.white70), | |||||
child: Icon( IconData(0xe680, fontFamily: Constants.IconFontFamily), color: Colors.white70,size: 40,), | |||||
)),)) | )),)) | ||||
], | ], | ||||
))),); | ))),); | ||||
@@ -829,36 +829,31 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
selectionEnabled: false, hideKeyboard: widget.hideKeyboard)); | selectionEnabled: false, hideKeyboard: widget.hideKeyboard)); | ||||
} | } | ||||
double _getTextWidth(String text, {double fontSize = FontSize}) { | |||||
double _getTextWidth(String text, {double fontSize: FontSize}) { | |||||
var tp = TextPainter( | var tp = TextPainter( | ||||
text: TextSpan( | |||||
style: TextStyle(fontSize: fontSize), text: textList[curTextType]), | |||||
text: TextSpan(style: TextStyle(fontSize: fontSize), text: text), | |||||
textAlign: TextAlign.left, | textAlign: TextAlign.left, | ||||
textDirection: TextDirection.ltr, | textDirection: TextDirection.ltr, | ||||
textScaleFactor: 1, | textScaleFactor: 1, | ||||
); | ); | ||||
tp.layout(maxWidth: maxWidth); | |||||
if (text.contains('[')) { | |||||
if (text.length < 5 && text.startsWith('[') && text.endsWith(']')) { | |||||
///单表情 | |||||
return 25; | |||||
} | |||||
int length = text.split('[').length; | |||||
if (length > 1) { | |||||
///包含表情 | |||||
int scale = 6; | |||||
tp.layout(maxWidth: Screen.width - 140); | |||||
if (length > 6) scale = 7; | |||||
RegExp alterStr = RegExp(r'\[([0-9]+)\]'); | |||||
Iterable<Match> matches = alterStr.allMatches(text); | |||||
// print('~~~~~~~~~~~~~~${matches.length}~~~~~~~~~~~~~~~'); | |||||
double width = tp.width + length * scale; | |||||
return width > (maxWidth) ? maxWidth : width; | |||||
double delta = 0; | |||||
for (Match m in matches) { | |||||
// print('~~~~~~~~~~~~~~${m.group(1)}~~~~~~~~~~~~~~~'); | |||||
if (int.parse(m.group(1)) > 10) { | |||||
delta += 20 + 4 - 25; | |||||
} else { | |||||
delta += 20 + 4 - 16.8; | |||||
} | } | ||||
} | } | ||||
return tp.width; | |||||
///单文字 | |||||
return tp.width + delta; | |||||
} | } | ||||
blueDot(bool isShow) { | blueDot(bool isShow) { | ||||
@@ -290,7 +290,7 @@ class _GroupChatPageState extends State<GroupChatPage> { | |||||
Provider<GroupInfoModel>.value(value: widget.groupInfoModel), | Provider<GroupInfoModel>.value(value: widget.groupInfoModel), | ||||
], | ], | ||||
child: GestureDetector( | child: GestureDetector( | ||||
onTap: hideKeyBoard, | |||||
onTapDown: (args){hideKeyBoard();}, | |||||
child: ExtendedTextSelectionPointerHandler( | child: ExtendedTextSelectionPointerHandler( | ||||
///选择文字,消除弹窗 | ///选择文字,消除弹窗 | ||||
builder: (states) { | builder: (states) { | ||||
@@ -760,7 +760,7 @@ class InputBarState extends State<InputBar> | |||||
actionBarColor: "#50A7F9", | actionBarColor: "#50A7F9", | ||||
actionBarTitle: "Hibok", | actionBarTitle: "Hibok", | ||||
allViewTitle: "", | allViewTitle: "", | ||||
useDetailsView: false, | |||||
useDetailsView: true, | |||||
selectCircleStrokeColor: "#000000", | selectCircleStrokeColor: "#000000", | ||||
), | ), | ||||
); | ); | ||||
@@ -6046,9 +6046,9 @@ class _I18n_vi_VN extends I18n { | |||||
/// "Hỗ trợ nhanh" | /// "Hỗ trợ nhanh" | ||||
@override | @override | ||||
String get real_time_helper => "Hỗ trợ nhanh"; | String get real_time_helper => "Hỗ trợ nhanh"; | ||||
/// "Dịch vụ dịch thuật thời gian thực" | |||||
/// "Dịch vụ dịch thuật \nthời gian thực" | |||||
@override | @override | ||||
String get translation_butler => "Dịch vụ dịch thuật thời gian thực"; | |||||
String get translation_butler => "Dịch vụ dịch thuật \nthời gian thực"; | |||||
/// " Trợ lý chỉ đường" | /// " Trợ lý chỉ đường" | ||||
@override | @override | ||||
String get travel_butler => " Trợ lý chỉ đường"; | String get travel_butler => " Trợ lý chỉ đường"; | ||||
@@ -190,7 +190,7 @@ class _InformUserPageState extends State<InformUserPage> { | |||||
actionBarColor: "#50A7F9", | actionBarColor: "#50A7F9", | ||||
actionBarTitle: "Hibok", | actionBarTitle: "Hibok", | ||||
allViewTitle: "", | allViewTitle: "", | ||||
useDetailsView: false, | |||||
useDetailsView: true, | |||||
selectCircleStrokeColor: "#000000", | selectCircleStrokeColor: "#000000", | ||||
), | ), | ||||
); | ); | ||||
@@ -448,7 +448,7 @@ class _ProfilePageState extends State<ProfilePage> | |||||
actionBarColor: "#50A7F9", | actionBarColor: "#50A7F9", | ||||
actionBarTitle: "Hibok", | actionBarTitle: "Hibok", | ||||
allViewTitle: "", | allViewTitle: "", | ||||
useDetailsView: false, | |||||
useDetailsView: true, | |||||
selectCircleStrokeColor: "#000000", | selectCircleStrokeColor: "#000000", | ||||
), | ), | ||||
); | ); | ||||
@@ -8,6 +8,7 @@ import 'package:chat/utils/MessageBox.dart'; | |||||
import 'package:chat/utils/MessageMgr.dart'; | import 'package:chat/utils/MessageMgr.dart'; | ||||
import 'package:chat/utils/PicSwiper.dart'; | import 'package:chat/utils/PicSwiper.dart'; | ||||
import 'package:chat/utils/app_navigator.dart'; | import 'package:chat/utils/app_navigator.dart'; | ||||
import 'package:chat/utils/local_notification_util.dart'; | |||||
import 'package:chat/utils/msgHandler.dart'; | import 'package:chat/utils/msgHandler.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:oktoast/oktoast.dart'; | import 'package:oktoast/oktoast.dart'; | ||||
@@ -67,6 +68,9 @@ class _ProgramDetailPageState extends State<ProgramDetailPage> { | |||||
MessageMgr().on('update_dy', msgUpdateDy); | MessageMgr().on('update_dy', msgUpdateDy); | ||||
MessageMgr().on('refresh_list', msgRefreshList); | MessageMgr().on('refresh_list', msgRefreshList); | ||||
getData(); | getData(); | ||||
LocalNotificationUtil().cleanAllNotifications(); | |||||
} | } | ||||
msgRefreshList(data) { | msgRefreshList(data) { | ||||
@@ -501,7 +501,7 @@ class DailyBouusState extends State with SingleTickerProviderStateMixin { | |||||
child: Text( | child: Text( | ||||
bean.state == 1 | bean.state == 1 | ||||
? I18n.of(context).have_get | ? I18n.of(context).have_get | ||||
: '${bean.h}${I18n.of(context).daily_translate_voucher}', | |||||
: '${bean.h}', | |||||
textScaleFactor: 1.0, | textScaleFactor: 1.0, | ||||
style: TextStyle(color: Colors.white, fontSize: 12), | style: TextStyle(color: Colors.white, fontSize: 12), | ||||
), | ), | ||||
@@ -6,6 +6,7 @@ import 'package:chat/data/translate_hk_data_mgr.dart'; | |||||
import 'package:chat/generated/i18n.dart'; | import 'package:chat/generated/i18n.dart'; | ||||
import 'package:chat/home/SystemEditPage.dart'; | import 'package:chat/home/SystemEditPage.dart'; | ||||
import 'package:chat/home/find_page.dart'; | import 'package:chat/home/find_page.dart'; | ||||
import 'package:chat/home/realtimehelper/real_time_helper_page.dart'; | |||||
import 'package:chat/home/unread_dot_widget.dart'; | import 'package:chat/home/unread_dot_widget.dart'; | ||||
import 'package:chat/models/UserInfo.dart'; | import 'package:chat/models/UserInfo.dart'; | ||||
import 'package:chat/models/ref_name_provider.dart'; | import 'package:chat/models/ref_name_provider.dart'; | ||||
@@ -361,79 +362,22 @@ class _HomeMainState extends State<HomeMain> { | |||||
I18n.of(context).me | I18n.of(context).me | ||||
]; | ]; | ||||
// _navigationViews = [ | |||||
// NavigationIconView( | |||||
// title: _titles[2], | |||||
// icon: IconData( | |||||
// 0xe67c, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// isShowdot: true, | |||||
// iconSize: 29), | |||||
// NavigationIconView( | |||||
// title: _titles[0], | |||||
// isShowdot: true, | |||||
// iconMargin: EdgeInsets.only(top: 2), | |||||
// type: 5, | |||||
// icon: IconData( | |||||
// 0xe66e, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// iconSize: 26.5), | |||||
// NavigationIconView( | |||||
// title: _titles[1], | |||||
// icon: IconData( | |||||
// 0xe656, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// isCenter: true, | |||||
// iconSize: 31), | |||||
// NavigationIconView( | |||||
// title: _titles[1], | |||||
// isShowdot: true, | |||||
// icon: IconData( | |||||
// 0xe60b, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// type: 6, | |||||
// iconSize: 26.5), | |||||
// NavigationIconView( | |||||
// title: _titles[3], | |||||
// icon: IconData( | |||||
// 0xe67b, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// iconSize: 26.5), | |||||
// ]; | |||||
// | |||||
// _pages = [ | |||||
// RealTimeHelperPage(), | |||||
// FriendPage(), | |||||
// FindPage(), | |||||
// ConversActionPage(), | |||||
//// GroupChatListPage(), | |||||
// ProfilePage( | |||||
// userId: UserData().basicInfo.userId, | |||||
// ), | |||||
// ]; | |||||
_navigationViews = [ | _navigationViews = [ | ||||
NavigationIconView( | NavigationIconView( | ||||
title: _titles[1], | |||||
isShowdot: true, | |||||
title: _titles[2], | |||||
icon: IconData( | icon: IconData( | ||||
0xe60b, | |||||
0xe67c, | |||||
fontFamily: 'iconfont', | fontFamily: 'iconfont', | ||||
), | ), | ||||
type: 1, | |||||
iconSize: 26.5), | |||||
isShowdot: true, | |||||
iconSize: 29), | |||||
NavigationIconView( | NavigationIconView( | ||||
title: _titles[0], | title: _titles[0], | ||||
isShowdot: true, | isShowdot: true, | ||||
iconMargin: EdgeInsets.only(top: 2), | iconMargin: EdgeInsets.only(top: 2), | ||||
type: 5, | type: 5, | ||||
icon: IconData( | icon: IconData( | ||||
0xe663, | |||||
0xe66e, | |||||
fontFamily: 'iconfont', | fontFamily: 'iconfont', | ||||
), | ), | ||||
iconSize: 26.5), | iconSize: 26.5), | ||||
@@ -445,17 +389,15 @@ class _HomeMainState extends State<HomeMain> { | |||||
), | ), | ||||
isCenter: true, | isCenter: true, | ||||
iconSize: 31), | iconSize: 31), | ||||
NavigationIconView( | NavigationIconView( | ||||
title: _titles[3], | |||||
title: _titles[1], | |||||
isShowdot: true, | isShowdot: true, | ||||
icon: IconData( | icon: IconData( | ||||
0xe66e, | |||||
0xe60b, | |||||
fontFamily: 'iconfont', | fontFamily: 'iconfont', | ||||
), | ), | ||||
type: 4, | |||||
type: 6, | |||||
iconSize: 26.5), | iconSize: 26.5), | ||||
NavigationIconView( | NavigationIconView( | ||||
title: _titles[3], | title: _titles[3], | ||||
icon: IconData( | icon: IconData( | ||||
@@ -466,16 +408,75 @@ class _HomeMainState extends State<HomeMain> { | |||||
]; | ]; | ||||
_pages = [ | _pages = [ | ||||
ConversActionPage(), | |||||
// RealTimeHelperPage(), | |||||
RealTimeHelperPage(), | |||||
FriendPage(), | FriendPage(), | ||||
FindPage(), | FindPage(), | ||||
// ConversActionPage(), | |||||
GroupChatListPage(), | |||||
ConversActionPage(), | |||||
// GroupChatListPage(), | |||||
ProfilePage( | ProfilePage( | ||||
userId: UserData().basicInfo.userId, | userId: UserData().basicInfo.userId, | ||||
), | ), | ||||
]; | ]; | ||||
// _navigationViews = [ | |||||
// NavigationIconView( | |||||
// title: _titles[1], | |||||
// isShowdot: true, | |||||
// icon: IconData( | |||||
// 0xe60b, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// type: 1, | |||||
// iconSize: 26.5), | |||||
// NavigationIconView( | |||||
// title: _titles[0], | |||||
// isShowdot: true, | |||||
// iconMargin: EdgeInsets.only(top: 2), | |||||
// type: 5, | |||||
// icon: IconData( | |||||
// 0xe663, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// iconSize: 26.5), | |||||
// NavigationIconView( | |||||
// title: _titles[1], | |||||
// icon: IconData( | |||||
// 0xe656, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// isCenter: true, | |||||
// iconSize: 31), | |||||
// | |||||
// NavigationIconView( | |||||
// title: _titles[3], | |||||
// isShowdot: true, | |||||
// icon: IconData( | |||||
// 0xe66e, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// type: 4, | |||||
// iconSize: 26.5), | |||||
// | |||||
// NavigationIconView( | |||||
// title: _titles[3], | |||||
// icon: IconData( | |||||
// 0xe67b, | |||||
// fontFamily: 'iconfont', | |||||
// ), | |||||
// iconSize: 26.5), | |||||
// ]; | |||||
// | |||||
// _pages = [ | |||||
// ConversActionPage(), | |||||
//// RealTimeHelperPage(), | |||||
// FriendPage(), | |||||
// FindPage(), | |||||
//// ConversActionPage(), | |||||
// GroupChatListPage(), | |||||
// ProfilePage( | |||||
// userId: UserData().basicInfo.userId, | |||||
// ), | |||||
// ]; | |||||
} | } | ||||
@override | @override | ||||
@@ -552,11 +553,12 @@ class _HomeMainState extends State<HomeMain> { | |||||
_navigationViews.map((NavigationIconView view) { | _navigationViews.map((NavigationIconView view) { | ||||
return view.item; | return view.item; | ||||
}).toList(), | }).toList(), | ||||
onTap: (int index) { | |||||
onTap: (int index) async{ | |||||
if (_currentIndex == index) { | if (_currentIndex == index) { | ||||
//在当前页面点击不刷新 | //在当前页面点击不刷新 | ||||
return; | return; | ||||
} | } | ||||
setStatusBar(); | |||||
//刷新我的界面数据 | //刷新我的界面数据 | ||||
if (index == 4) { | if (index == 4) { | ||||
MessageMgr().emit('update_data'); | MessageMgr().emit('update_data'); | ||||
@@ -132,7 +132,7 @@ class TranslationButlerPageState extends State<TranslationButlerPage> { | |||||
print('time:$time'); | print('time:$time'); | ||||
int second = int.parse(time) ~/ 1000; | int second = int.parse(time) ~/ 1000; | ||||
if((DateTime.now().millisecondsSinceEpoch ~/ 1000 - second)>8*3600){ ///超过5小时清除缓存记录 | |||||
if((DateTime.now().millisecondsSinceEpoch ~/ 1000 - second)>1800){ ///超过半小时清除缓存记录 | |||||
SPUtils.save(Constants.TranslationHelper,null); | SPUtils.save(Constants.TranslationHelper,null); | ||||
return; | return; | ||||
} | } | ||||
@@ -42,14 +42,14 @@ class SplashPageState extends State<SplashPage> { | |||||
list.add(SplashBean( | list.add(SplashBean( | ||||
'assets/images/img_splash_4.png', | 'assets/images/img_splash_4.png', | ||||
I18n.of(Constants.getCurrentContext()).translation_butler, | |||||
I18n.of(Constants.getCurrentContext()).splash_tips_content4, | |||||
I18n.of(Constants.getCurrentContext()).travel_butler, | |||||
I18n.of(Constants.getCurrentContext()).splash_tips_content5, | |||||
Color(0xFF2B79F7))); | Color(0xFF2B79F7))); | ||||
list.add(SplashBean( | list.add(SplashBean( | ||||
'assets/images/img_splash_5.png', | 'assets/images/img_splash_5.png', | ||||
I18n.of(Constants.getCurrentContext()).travel_butler, | |||||
I18n.of(Constants.getCurrentContext()).splash_tips_content5, | |||||
I18n.of(Constants.getCurrentContext()).translation_butler, | |||||
I18n.of(Constants.getCurrentContext()).splash_tips_content4, | |||||
Color(0xFFBE58FF))); | Color(0xFFBE58FF))); | ||||
@@ -176,6 +176,7 @@ class SplashPageState extends State<SplashPage> { | |||||
Text( | Text( | ||||
data.title, | data.title, | ||||
textScaleFactor: 1.0, | textScaleFactor: 1.0, | ||||
textAlign: TextAlign.center, | |||||
style: TextStyle(color: data.titleColor, fontSize: 30), | style: TextStyle(color: data.titleColor, fontSize: 30), | ||||
), | ), | ||||
SizedBox( | SizedBox( | ||||
@@ -294,6 +294,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver { | |||||
MessageMgr().emit( | MessageMgr().emit( | ||||
'Receive AudioChat Request', MsgHandler.audioChatRequestFriendId); | 'Receive AudioChat Request', MsgHandler.audioChatRequestFriendId); | ||||
} | } | ||||
// await FlutterStatusbarcolor.setStatusBarColor(Colors.white); | |||||
break; | break; | ||||
case AppLifecycleState.paused: // 应用程序不可见,后台 | case AppLifecycleState.paused: // 应用程序不可见,后台 | ||||
print('切换到后台'); | print('切换到后台'); | ||||
@@ -377,6 +377,7 @@ class DeliveryTransHKOrderPush extends $pb.GeneratedMessage { | |||||
class CancellationTransHKOrderPush extends $pb.GeneratedMessage { | class CancellationTransHKOrderPush extends $pb.GeneratedMessage { | ||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo('CancellationTransHKOrderPush', package: const $pb.PackageName('yl_pb')) | static final $pb.BuilderInfo _i = $pb.BuilderInfo('CancellationTransHKOrderPush', package: const $pb.PackageName('yl_pb')) | ||||
..aOS(1, 'orderId') | ..aOS(1, 'orderId') | ||||
..e<TransHKOrderCancellation>(2, 'type', $pb.PbFieldType.OE, TransHKOrderCancellation.TimeOut, TransHKOrderCancellation.valueOf, TransHKOrderCancellation.values) | |||||
..hasRequiredFields = false | ..hasRequiredFields = false | ||||
; | ; | ||||
@@ -398,6 +399,11 @@ class CancellationTransHKOrderPush extends $pb.GeneratedMessage { | |||||
set orderId($core.String v) { $_setString(0, v); } | set orderId($core.String v) { $_setString(0, v); } | ||||
$core.bool hasOrderId() => $_has(0); | $core.bool hasOrderId() => $_has(0); | ||||
void clearOrderId() => clearField(1); | void clearOrderId() => clearField(1); | ||||
TransHKOrderCancellation get type => $_getN(1); | |||||
set type(TransHKOrderCancellation v) { setField(2, v); } | |||||
$core.bool hasType() => $_has(1); | |||||
void clearType() => clearField(2); | |||||
} | } | ||||
class TransHKChatNotice extends $pb.GeneratedMessage { | class TransHKChatNotice extends $pb.GeneratedMessage { | ||||
@@ -447,3 +453,61 @@ class TransHKChatNotice extends $pb.GeneratedMessage { | |||||
void clearEmployer() => clearField(5); | void clearEmployer() => clearField(5); | ||||
} | } | ||||
class AnotherOrderReq extends $pb.GeneratedMessage { | |||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo('AnotherOrderReq', package: const $pb.PackageName('yl_pb')) | |||||
..aOS(1, 'orderId') | |||||
..hasRequiredFields = false | |||||
; | |||||
AnotherOrderReq._() : super(); | |||||
factory AnotherOrderReq() => create(); | |||||
factory AnotherOrderReq.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); | |||||
factory AnotherOrderReq.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); | |||||
AnotherOrderReq clone() => AnotherOrderReq()..mergeFromMessage(this); | |||||
AnotherOrderReq copyWith(void Function(AnotherOrderReq) updates) => super.copyWith((message) => updates(message as AnotherOrderReq)); | |||||
$pb.BuilderInfo get info_ => _i; | |||||
@$core.pragma('dart2js:noInline') | |||||
static AnotherOrderReq create() => AnotherOrderReq._(); | |||||
AnotherOrderReq createEmptyInstance() => create(); | |||||
static $pb.PbList<AnotherOrderReq> createRepeated() => $pb.PbList<AnotherOrderReq>(); | |||||
static AnotherOrderReq getDefault() => _defaultInstance ??= create()..freeze(); | |||||
static AnotherOrderReq _defaultInstance; | |||||
$core.String get orderId => $_getS(0, ''); | |||||
set orderId($core.String v) { $_setString(0, v); } | |||||
$core.bool hasOrderId() => $_has(0); | |||||
void clearOrderId() => clearField(1); | |||||
} | |||||
class AnotherOrderRes extends $pb.GeneratedMessage { | |||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo('AnotherOrderRes', package: const $pb.PackageName('yl_pb')) | |||||
..a<$core.int>(1, 'errorCode', $pb.PbFieldType.O3) | |||||
..aOS(2, 'orderId') | |||||
..hasRequiredFields = false | |||||
; | |||||
AnotherOrderRes._() : super(); | |||||
factory AnotherOrderRes() => create(); | |||||
factory AnotherOrderRes.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); | |||||
factory AnotherOrderRes.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); | |||||
AnotherOrderRes clone() => AnotherOrderRes()..mergeFromMessage(this); | |||||
AnotherOrderRes copyWith(void Function(AnotherOrderRes) updates) => super.copyWith((message) => updates(message as AnotherOrderRes)); | |||||
$pb.BuilderInfo get info_ => _i; | |||||
@$core.pragma('dart2js:noInline') | |||||
static AnotherOrderRes create() => AnotherOrderRes._(); | |||||
AnotherOrderRes createEmptyInstance() => create(); | |||||
static $pb.PbList<AnotherOrderRes> createRepeated() => $pb.PbList<AnotherOrderRes>(); | |||||
static AnotherOrderRes getDefault() => _defaultInstance ??= create()..freeze(); | |||||
static AnotherOrderRes _defaultInstance; | |||||
$core.int get errorCode => $_get(0, 0); | |||||
set errorCode($core.int v) { $_setSignedInt32(0, v); } | |||||
$core.bool hasErrorCode() => $_has(0); | |||||
void clearErrorCode() => clearField(1); | |||||
$core.String get orderId => $_getS(1, ''); | |||||
set orderId($core.String v) { $_setString(1, v); } | |||||
$core.bool hasOrderId() => $_has(1); | |||||
void clearOrderId() => clearField(2); | |||||
} | |||||
@@ -30,6 +30,23 @@ class TransHKOrderState extends $pb.ProtobufEnum { | |||||
const TransHKOrderState._($core.int v, $core.String n) : super(v, n); | const TransHKOrderState._($core.int v, $core.String n) : super(v, n); | ||||
} | } | ||||
class TransHKOrderCancellation extends $pb.ProtobufEnum { | |||||
static const TransHKOrderCancellation TimeOut = TransHKOrderCancellation._(1, 'TimeOut'); | |||||
static const TransHKOrderCancellation Rejection = TransHKOrderCancellation._(2, 'Rejection'); | |||||
static const TransHKOrderCancellation ActiveCancellation = TransHKOrderCancellation._(3, 'ActiveCancellation'); | |||||
static const $core.List<TransHKOrderCancellation> values = <TransHKOrderCancellation> [ | |||||
TimeOut, | |||||
Rejection, | |||||
ActiveCancellation, | |||||
]; | |||||
static final $core.Map<$core.int, TransHKOrderCancellation> _byValue = $pb.ProtobufEnum.initByValue(values); | |||||
static TransHKOrderCancellation valueOf($core.int value) => _byValue[value]; | |||||
const TransHKOrderCancellation._($core.int v, $core.String n) : super(v, n); | |||||
} | |||||
class TransHKChatNoticeType extends $pb.ProtobufEnum { | class TransHKChatNoticeType extends $pb.ProtobufEnum { | ||||
static const TransHKChatNoticeType StartChat = TransHKChatNoticeType._(1, 'StartChat'); | static const TransHKChatNoticeType StartChat = TransHKChatNoticeType._(1, 'StartChat'); | ||||
static const TransHKChatNoticeType EndChat = TransHKChatNoticeType._(2, 'EndChat'); | static const TransHKChatNoticeType EndChat = TransHKChatNoticeType._(2, 'EndChat'); | ||||
@@ -16,6 +16,15 @@ const TransHKOrderState$json = const { | |||||
], | ], | ||||
}; | }; | ||||
const TransHKOrderCancellation$json = const { | |||||
'1': 'TransHKOrderCancellation', | |||||
'2': const [ | |||||
const {'1': 'TimeOut', '2': 1}, | |||||
const {'1': 'Rejection', '2': 2}, | |||||
const {'1': 'ActiveCancellation', '2': 3}, | |||||
], | |||||
}; | |||||
const TransHKChatNoticeType$json = const { | const TransHKChatNoticeType$json = const { | ||||
'1': 'TransHKChatNoticeType', | '1': 'TransHKChatNoticeType', | ||||
'2': const [ | '2': const [ | ||||
@@ -117,6 +126,7 @@ const CancellationTransHKOrderPush$json = const { | |||||
'1': 'CancellationTransHKOrderPush', | '1': 'CancellationTransHKOrderPush', | ||||
'2': const [ | '2': const [ | ||||
const {'1': 'OrderId', '3': 1, '4': 1, '5': 9, '10': 'OrderId'}, | const {'1': 'OrderId', '3': 1, '4': 1, '5': 9, '10': 'OrderId'}, | ||||
const {'1': 'Type', '3': 2, '4': 1, '5': 14, '6': '.yl_pb.TransHKOrderCancellation', '10': 'Type'}, | |||||
], | ], | ||||
}; | }; | ||||
@@ -131,3 +141,18 @@ const TransHKChatNotice$json = const { | |||||
], | ], | ||||
}; | }; | ||||
const AnotherOrderReq$json = const { | |||||
'1': 'AnotherOrderReq', | |||||
'2': const [ | |||||
const {'1': 'OrderId', '3': 1, '4': 1, '5': 9, '10': 'OrderId'}, | |||||
], | |||||
}; | |||||
const AnotherOrderRes$json = const { | |||||
'1': 'AnotherOrderRes', | |||||
'2': const [ | |||||
const {'1': 'ErrorCode', '3': 1, '4': 1, '5': 5, '10': 'ErrorCode'}, | |||||
const {'1': 'OrderId', '3': 2, '4': 1, '5': 9, '10': 'OrderId'}, | |||||
], | |||||
}; | |||||
@@ -13,6 +13,11 @@ enum TransHKOrderState{ | |||||
Completed = 5; //已完成 | Completed = 5; //已完成 | ||||
} | } | ||||
enum TransHKOrderCancellation { | |||||
TimeOut = 1; //超时 | |||||
Rejection = 2; //绝收 | |||||
ActiveCancellation = 3; //主动取消 | |||||
} | |||||
enum TransHKChatNoticeType{ | enum TransHKChatNoticeType{ | ||||
StartChat = 1; //开始 | StartChat = 1; //开始 | ||||
EndChat = 2; //结束 | EndChat = 2; //结束 | ||||
@@ -65,11 +70,11 @@ message EndTransHKOrderRes{ | |||||
optional string OrderId = 2; //订单号 | optional string OrderId = 2; //订单号 | ||||
} | } | ||||
//翻译官设置是否接单Msg= 9 | |||||
//Msg= 9 翻译官设置是否接单 | |||||
message TransHKInterSetIsReceiptReq { | message TransHKInterSetIsReceiptReq { | ||||
optional bool IsReceipt = 1; //详见错误码文档 | optional bool IsReceipt = 1; //详见错误码文档 | ||||
} | } | ||||
//翻译官设置是否接单Msg= 10 | |||||
//Msg= 10 翻译官设置是否接单 | |||||
message TransHKInterSetIsReceiptRes { | message TransHKInterSetIsReceiptRes { | ||||
optional int32 ErrorCode = 1; //详见错误码文档 | optional int32 ErrorCode = 1; //详见错误码文档 | ||||
optional bool IsReceipt = 2; //详见错误码文档 | optional bool IsReceipt = 2; //详见错误码文档 | ||||
@@ -88,10 +93,10 @@ message DeliveryTransHKOrderPush { | |||||
//Msg= 21 订单取消推送 | //Msg= 21 订单取消推送 | ||||
message CancellationTransHKOrderPush { | message CancellationTransHKOrderPush { | ||||
optional string OrderId =1; //订单号 | |||||
optional string OrderId =1; //订单号s | |||||
optional TransHKOrderCancellation Type = 2;//取消原因 | |||||
} | } | ||||
//翻译会话通告消息 | //翻译会话通告消息 | ||||
message TransHKChatNotice { | message TransHKChatNotice { | ||||
optional TransHKChatNoticeType NoticeType = 1; //公告类型 | optional TransHKChatNoticeType NoticeType = 1; //公告类型 | ||||
@@ -99,4 +104,14 @@ message TransHKChatNotice { | |||||
repeated BaseUserInfo OperateduId = 3; //被操作用户Ids 有可能是多人 | repeated BaseUserInfo OperateduId = 3; //被操作用户Ids 有可能是多人 | ||||
optional BaseUserInfo Inter = 4; //翻译官 | optional BaseUserInfo Inter = 4; //翻译官 | ||||
optional BaseUserInfo Employer = 5; //客户 | optional BaseUserInfo Employer = 5; //客户 | ||||
} | |||||
} | |||||
//Msg = 30 再来一单 | |||||
message AnotherOrderReq { | |||||
optional string OrderId =1; //上一单的订单号 | |||||
} | |||||
//Msg = 31 再来一单回应 | |||||
message AnotherOrderRes { | |||||
optional int32 ErrorCode = 1; //详见错误码文档 | |||||
optional string OrderId =2; //订单号 | |||||
} |
@@ -1289,4 +1289,24 @@ class CustomUI { | |||||
..layout(); | ..layout(); | ||||
return _textPainter.width; | return _textPainter.width; | ||||
} | } | ||||
static void buildTowConfirmWithCountDown( | |||||
BuildContext context, | |||||
String tipTitle, | |||||
String confirmButtonTitle, | |||||
confirmCallback, | |||||
cancelCountDown, | |||||
{title = ''}) { | |||||
var confirm = buildConfirmBotton(confirmButtonTitle, confirmCallback); | |||||
// var cancle = buildCancleBotton(cancleButtonTitle, cancleCallback); | |||||
buildTip( | |||||
context, | |||||
title, | |||||
buildConfirmContent( | |||||
_buildContentTip(tipTitle), | |||||
Column( | |||||
children: <Widget>[cancelCountDown, confirm], | |||||
))); | |||||
} | |||||
} | } |
@@ -105,7 +105,7 @@ class AppNavigator { | |||||
if (enterType == 1 ||enterType == 2) { | if (enterType == 1 ||enterType == 2) { | ||||
Navigator.of(context).pop(context); | Navigator.of(context).pop(context); | ||||
} | } | ||||
AppNavigator.push( | |||||
AppNavigator.defaultPush( | |||||
context, | context, | ||||
ChatPage( | ChatPage( | ||||
key: Key('Chat'), | key: Key('Chat'), | ||||
@@ -10,7 +10,8 @@ class CountDownButton extends StatefulWidget{ | |||||
final Function onPress; | final Function onPress; | ||||
final int countDownTime; | final int countDownTime; | ||||
final AlignmentGeometry align; | final AlignmentGeometry align; | ||||
CountDownButton(this.text,this.countDownCallBack,{this.countDownTime=5*60,this.align=Alignment.center,this.onPress}); | |||||
final bool isOnlyRichText; | |||||
CountDownButton(this.text,this.countDownCallBack,{this.countDownTime=5*60,this.align=Alignment.center,this.onPress,this.isOnlyRichText=false}); | |||||
@override | @override | ||||
State<StatefulWidget> createState() { | State<StatefulWidget> createState() { | ||||
@@ -62,7 +63,21 @@ class CountDownButtonState extends State<CountDownButton> { | |||||
// ~/ 取整操作 | // ~/ 取整操作 | ||||
int seconds = secondsPassed % 60; | int seconds = secondsPassed % 60; | ||||
int minutes = secondsPassed ~/ 60; | int minutes = secondsPassed ~/ 60; | ||||
return Container( | |||||
return widget.isOnlyRichText?RichText( | |||||
maxLines: 1, | |||||
textAlign: TextAlign.center, | |||||
text: TextSpan(children: [ | |||||
TextSpan( | |||||
text: widget.text, | |||||
style: TextStyle( | |||||
color: Colors.white, | |||||
fontSize: 16)), | |||||
TextSpan( | |||||
text:' ('+ getFull(minutes)+' : '+getFull(seconds)+')', | |||||
style: TextStyle( | |||||
color: Colors.white, fontSize: 13)), | |||||
])): | |||||
Container( | |||||
alignment: widget.align, | alignment: widget.align, | ||||
// margin: EdgeInsets.only(left: 30, right: 30, top: 20,bottom: 20), | // margin: EdgeInsets.only(left: 30, right: 30, top: 20,bottom: 20), | ||||
height: 48, | height: 48, | ||||
@@ -1,6 +1,7 @@ | |||||
import 'dart:async'; | import 'dart:async'; | ||||
import 'dart:convert'; | import 'dart:convert'; | ||||
import 'dart:typed_data'; | import 'dart:typed_data'; | ||||
import 'package:chat/chat/ChatPage.dart'; | |||||
import 'package:chat/chat/group_chat_view.dart'; | import 'package:chat/chat/group_chat_view.dart'; | ||||
import 'package:chat/data/UserData.dart'; | import 'package:chat/data/UserData.dart'; | ||||
import 'package:chat/data/chat_data_mgr.dart'; | import 'package:chat/data/chat_data_mgr.dart'; | ||||
@@ -124,12 +125,12 @@ class MsgHandler { | |||||
static createSendMsg(ChatType chatType, content, | static createSendMsg(ChatType chatType, content, | ||||
{int extra, | {int extra, | ||||
int friendId, | |||||
String localFile, | |||||
MsgModel refMsg, | |||||
String refShortTxt, | |||||
List<int> altUsers, | |||||
ChatChannelType channelType = ChatChannelType.Session}) { | |||||
int friendId, | |||||
String localFile, | |||||
MsgModel refMsg, | |||||
String refShortTxt, | |||||
List<int> altUsers, | |||||
ChatChannelType channelType = ChatChannelType.Session}) { | |||||
MsgModel msg; | MsgModel msg; | ||||
if (content is String) { | if (content is String) { | ||||
@@ -247,7 +248,7 @@ class MsgHandler { | |||||
seq.channelType = ChatChannelType.CSD; | seq.channelType = ChatChannelType.CSD; | ||||
} else { | } else { | ||||
seq.channelType = | seq.channelType = | ||||
isGroup ? ChatChannelType.Group : ChatChannelType.Session; | |||||
isGroup ? ChatChannelType.Group : ChatChannelType.Session; | |||||
} | } | ||||
NetWork().sendMsg(ComId.Chat, 5, seq); | NetWork().sendMsg(ComId.Chat, 5, seq); | ||||
@@ -257,6 +258,7 @@ class MsgHandler { | |||||
static int mLastClickTime = 0; | static int mLastClickTime = 0; | ||||
static int timeInterval = 2500; | static int timeInterval = 2500; | ||||
static handlerReceiveMsg(PushChat chat) async { | static handlerReceiveMsg(PushChat chat) async { | ||||
bool isGroup = false; | bool isGroup = false; | ||||
bool isTranslateHK = false; | bool isTranslateHK = false; | ||||
if (chat.channelType == ChatChannelType.Group) { | if (chat.channelType == ChatChannelType.Group) { | ||||
@@ -265,6 +267,8 @@ class MsgHandler { | |||||
} else if (chat.channelType == ChatChannelType.TransHK) { | } else if (chat.channelType == ChatChannelType.TransHK) { | ||||
print('聊天管家消息'); | print('聊天管家消息'); | ||||
isTranslateHK = true; | isTranslateHK = true; | ||||
}else if (chat.channelType == ChatChannelType.CSD) { | |||||
print('反馈消息'); | |||||
} | } | ||||
MsgModel msgModel; | MsgModel msgModel; | ||||
@@ -317,7 +321,7 @@ class MsgHandler { | |||||
} | } | ||||
MessageMgr().emit('Update Translate Message', findMsg); | MessageMgr().emit('Update Translate Message', findMsg); | ||||
} else { | |||||
}else{ | |||||
debugPrint2('更新消息找不到!!!!!!'); | debugPrint2('更新消息找不到!!!!!!'); | ||||
} | } | ||||
} else { | } else { | ||||
@@ -416,42 +420,51 @@ class MsgHandler { | |||||
} | } | ||||
} else if (isTranslateHK) { | } else if (isTranslateHK) { | ||||
var myId = UserData().basicInfo.userId; | var myId = UserData().basicInfo.userId; | ||||
TransHKChatNotice notice = | |||||
TransHKChatNotice.fromBuffer(chat.contentBuff); | |||||
BaseUserInfo friendId; | |||||
TranslateHKMgr().isUser = myId == notice.employer.id; | |||||
TransHKChatNotice notice = TransHKChatNotice.fromBuffer(chat.contentBuff); | |||||
BaseUserInfo friendId ; | |||||
TranslateHKMgr().isUser = myId== notice.employer.id; ///判断自己是翻译官还是用户 | |||||
///判断自己是翻译官还是用户 | |||||
if (myId == notice.employer.id) { | |||||
friendId = notice.inter; | |||||
} else { | |||||
if(myId== notice.employer.id){ | |||||
friendId =notice.inter; | |||||
}else{ | |||||
friendId = notice.employer; | friendId = notice.employer; | ||||
} | } | ||||
print('friend id: ${friendId.id} '); | print('friend id: ${friendId.id} '); | ||||
print('结束chat.sendTime ${chat.sendTime}'); | print('结束chat.sendTime ${chat.sendTime}'); | ||||
int sessionId = chat.targetId; | int sessionId = chat.targetId; | ||||
if (chat.cType == ChatType.GroupChatNoticeType) { | if (chat.cType == ChatType.GroupChatNoticeType) { | ||||
msgModel = MsgModel(0, friendId.id, chat.cType.value, | msgModel = MsgModel(0, friendId.id, chat.cType.value, | ||||
chat.contentBuff, chat.sendTime.toInt(), sessionId, | chat.contentBuff, chat.sendTime.toInt(), sessionId, | ||||
channelType: ChatChannelType.Session.value); | channelType: ChatChannelType.Session.value); | ||||
} | } | ||||
///接到开始翻译管家消息-打开翻译管家聊天页面 | ///接到开始翻译管家消息-打开翻译管家聊天页面 | ||||
if (notice.noticeType == TransHKChatNoticeType.StartChat) { | |||||
Future.delayed(Duration(seconds: 1), () { | |||||
if(notice.noticeType==TransHKChatNoticeType.StartChat){ | |||||
if(ChatPage.isChatPageActive){ | |||||
Navigator.of(context).pop(); | |||||
} | |||||
Future.delayed(Duration(seconds: 1),(){ | |||||
TranslateHKMgr().orderStatus = TranslateHKMgr.ORDER_STATUS_EMPTY; | TranslateHKMgr().orderStatus = TranslateHKMgr.ORDER_STATUS_EMPTY; | ||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_REFRESH_ORDER); | |||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_REFRESH_ORDER ); | |||||
curActiveSession = sessionId; | curActiveSession = sessionId; | ||||
print('curActiveSession:$curActiveSession'); | print('curActiveSession:$curActiveSession'); | ||||
MessageMgr() | |||||
.emit(MessageMgr.TRANSLATE_HK_START_CHAT, friendId.id); | |||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_START_CHAT, friendId.id); | |||||
}); | }); | ||||
} else if (notice.noticeType == TransHKChatNoticeType.EndChat) { | |||||
}else if(notice.noticeType==TransHKChatNoticeType.EndChat){ | |||||
print('chat.contentBuff cccc'); | print('chat.contentBuff cccc'); | ||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_END_CHAT, friendId.id); | MessageMgr().emit(MessageMgr.TRANSLATE_HK_END_CHAT, friendId.id); | ||||
} | } | ||||
} else { | } else { | ||||
//私聊通知消息 | //私聊通知消息 | ||||
@@ -486,6 +499,7 @@ class MsgHandler { | |||||
UserData().shock(); | UserData().shock(); | ||||
int sessionId = chat.targetId; | int sessionId = chat.targetId; | ||||
print('sessionId $sessionId'); | print('sessionId $sessionId'); | ||||
print('chat.sendUserId ${chat.sendUserId}'); | |||||
if (isGroup) { | if (isGroup) { | ||||
GroupInfoMgr() | GroupInfoMgr() | ||||
.getGroupInfo(sessionId) | .getGroupInfo(sessionId) | ||||
@@ -494,7 +508,24 @@ class MsgHandler { | |||||
if (groupInfo != null) { | if (groupInfo != null) { | ||||
showGroup = groupInfo.messageFree == 0; | showGroup = groupInfo.messageFree == 0; | ||||
} | } | ||||
if (showGroup) { | |||||
bool isAt = false;///@的消息无论开不开群打扰都要显示推送 | |||||
if (chat.altUserIds.length > 0) { | |||||
print('存在@消息'); | |||||
msgModel.altUsers = chat.altUserIds; | |||||
var myId = UserData().basicInfo.userId; | |||||
for (var i = 0; i < msgModel.altUsers.length; i++) { | |||||
if (msgModel.altUsers[i] == myId) { | |||||
isAt = true; | |||||
} | |||||
} | |||||
} | |||||
if (showGroup || isAt) { | |||||
int nowTime = DateTime.now().millisecondsSinceEpoch; | int nowTime = DateTime.now().millisecondsSinceEpoch; | ||||
if (nowTime - mLastClickTime < timeInterval && | if (nowTime - mLastClickTime < timeInterval && | ||||
@@ -587,8 +618,7 @@ class MsgHandler { | |||||
debugPrint2('消息为空,无法保存'); | debugPrint2('消息为空,无法保存'); | ||||
return; | return; | ||||
} | } | ||||
debugPrint2( | |||||
'收到消息,准备保存 会话Id:${msgModel.sessionId} friendId: ${msgModel.friendId} ChatType: ${msgModel.channelType}'); | |||||
debugPrint2('收到消息,准备保存 会话Id:${msgModel.sessionId} friendId: ${msgModel.friendId} ChatType: ${msgModel.channelType}'); | |||||
// showToast('收到消息,准备保存 会话Id:${msgModel.sessionId} friendId: ${msgModel.friendId} ChatType: ${msgModel.channelType}'); | // showToast('收到消息,准备保存 会话Id:${msgModel.sessionId} friendId: ${msgModel.friendId} ChatType: ${msgModel.channelType}'); | ||||
ChatDataMgr().saveMsg(msgModel); | ChatDataMgr().saveMsg(msgModel); | ||||
if (msgModel.msgType == ChatType.ShortVoiceChatType.value) { | if (msgModel.msgType == ChatType.ShortVoiceChatType.value) { | ||||
@@ -833,7 +863,8 @@ class MsgHandler { | |||||
ChatDataMgr().updateRecordWithUnreadMsg(noticeList); | ChatDataMgr().updateRecordWithUnreadMsg(noticeList); | ||||
} | } | ||||
static int msgCount = 0; | |||||
static int msgCount=0; | |||||
static handlerServerMsg(int comId, int msgId, List<int> content) { | static handlerServerMsg(int comId, int msgId, List<int> content) { | ||||
switch (comId) { | switch (comId) { | ||||
@@ -916,9 +947,10 @@ class MsgHandler { | |||||
LocalNotificationUtil.instance | LocalNotificationUtil.instance | ||||
.show(I18n.of(context).notice, I18n.of(context).new_video_msg); | .show(I18n.of(context).notice, I18n.of(context).new_video_msg); | ||||
playAudioRing(); | playAudioRing(); | ||||
if (TranslateHKMgr().order == null) { | |||||
if(TranslateHKMgr().order==null){ | |||||
MessageMgr().emit('Receive AudioChat Request', friendId); | MessageMgr().emit('Receive AudioChat Request', friendId); | ||||
} | } | ||||
} | } | ||||
} else if (msgId == 14) { | } else if (msgId == 14) { | ||||
var msgContent = PushRealtimeCallRespond.fromBuffer(content); | var msgContent = PushRealtimeCallRespond.fromBuffer(content); | ||||
@@ -982,12 +1014,14 @@ class MsgHandler { | |||||
handlerCancelTranslateOrder(content); | handlerCancelTranslateOrder(content); | ||||
} else if (msgId == 20) { | } else if (msgId == 20) { | ||||
handlerDeliveryInterpreterOrderPush(content); | handlerDeliveryInterpreterOrderPush(content); | ||||
} else if (msgId == 21) { | |||||
}else if(msgId==21){ | |||||
handlerCancellationTransHKOrderPush(content); | handlerCancellationTransHKOrderPush(content); | ||||
} else if (msgId == 8) { | |||||
}else if(msgId==8){ | |||||
handlerEndTransHKOrderRes(content); | handlerEndTransHKOrderRes(content); | ||||
} else if (msgId == 10) { | |||||
}else if(msgId==10){ | |||||
handlerTransHKInterSetIsReceiptRes(content); | handlerTransHKInterSetIsReceiptRes(content); | ||||
}else if(msgId==31){ | |||||
handlerAnotherOrderRes(content); | |||||
} | } | ||||
break; | break; | ||||
@@ -1000,7 +1034,7 @@ class MsgHandler { | |||||
switch (type) { | switch (type) { | ||||
case 'notice': | case 'notice': | ||||
///由于极光本地推送点击事件无反应,暂时不走这,由远端推 | |||||
///由于极光本地推送点击事件无反应,暂时不走这,由远端推 | |||||
String messageJson = map['message']; | String messageJson = map['message']; | ||||
Map messageMap = json.decode(messageJson); | Map messageMap = json.decode(messageJson); | ||||
@@ -1134,9 +1168,9 @@ class MsgHandler { | |||||
Navigator.pushReplacement(context, | Navigator.pushReplacement(context, | ||||
MaterialPageRoute<void>(builder: (BuildContext context) { | MaterialPageRoute<void>(builder: (BuildContext context) { | ||||
return GroupChatPage( | |||||
key: Key('GroupChat'), groupInfoModel: groupInfoModel); | |||||
})); | |||||
return GroupChatPage( | |||||
key: Key('GroupChat'), groupInfoModel: groupInfoModel); | |||||
})); | |||||
} else { | } else { | ||||
switch (res.errorCode) { | switch (res.errorCode) { | ||||
case 3007: | case 3007: | ||||
@@ -1277,11 +1311,10 @@ class MsgHandler { | |||||
} | } | ||||
//发布翻译管家帮助订单 | //发布翻译管家帮助订单 | ||||
static sendCreateTranslateOrder( | |||||
int fromLanguage, int toLanguage, int scences, String extraDesc) { | |||||
TranslateHKMgr().isUser = true; | |||||
debugPrint2( | |||||
'发布翻译管家帮助订单 fromLanguage:$fromLanguage toLanguage: $toLanguage | ${fromLanguage | toLanguage}'); | |||||
static sendCreateTranslateOrder(int fromLanguage,int toLanguage,int scences,String extraDesc) { | |||||
TranslateHKMgr().isUser=true; | |||||
debugPrint2('发布翻译管家帮助订单 fromLanguage:$fromLanguage toLanguage: $toLanguage | ${fromLanguage|toLanguage}' ); | |||||
var seq = IssueTransHKOrderReq.create(); | var seq = IssueTransHKOrderReq.create(); | ||||
seq.tLanguage = fromLanguage | toLanguage; | seq.tLanguage = fromLanguage | toLanguage; | ||||
seq.scenes = scences; | seq.scenes = scences; | ||||
@@ -1304,24 +1337,30 @@ class MsgHandler { | |||||
} else { | } else { | ||||
debugPrint2('发布翻译管家帮助订单失败 ${res.errorCode}'); | debugPrint2('发布翻译管家帮助订单失败 ${res.errorCode}'); | ||||
String errorStr = I18n.of(context).translation_butler_order_failed; | |||||
switch (res.errorCode) { | |||||
String errorStr=I18n.of(context).translation_butler_order_failed; | |||||
switch(res.errorCode){ | |||||
case 5014: | case 5014: | ||||
errorStr = I18n.of(context).translation_butler_order_failed2; | |||||
case 5014: | |||||
errorStr=I18n.of(context).translation_butler_order_failed2; | |||||
break; | break; | ||||
case 5015: | case 5015: | ||||
errorStr = I18n.of(context).not_enough; | |||||
errorStr=I18n.of(context).not_enough; | |||||
break; | break; | ||||
} | } | ||||
showToast('$errorStr -${res.errorCode}', duration: Duration(seconds: 3)); | |||||
showToast('$errorStr -${res.errorCode}',duration: Duration(seconds: 3)); | |||||
TranslateHKMgr().orderStatus = TranslateHKMgr.ORDER_STATUS_EMPTY; | TranslateHKMgr().orderStatus = TranslateHKMgr.ORDER_STATUS_EMPTY; | ||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_REFRESH_ORDER); | MessageMgr().emit(MessageMgr.TRANSLATE_HK_REFRESH_ORDER); | ||||
} | } | ||||
} | } | ||||
//翻译官开启/关闭接收订单 | //翻译官开启/关闭接收订单 | ||||
static translateReceiptOrStopOrder(bool isReceipt) { | static translateReceiptOrStopOrder(bool isReceipt) { | ||||
debugPrint2('翻译官开启/关闭接收订单 请求 $isReceipt'); | |||||
debugPrint2('翻译官开启/关闭接收订单 请求 $isReceipt' ); | |||||
var seq = TransHKInterSetIsReceiptReq.create(); | var seq = TransHKInterSetIsReceiptReq.create(); | ||||
seq.isReceipt = isReceipt; | seq.isReceipt = isReceipt; | ||||
@@ -1333,8 +1372,7 @@ class MsgHandler { | |||||
debugPrint2('翻译官开启/关闭接收订单 回应'); | debugPrint2('翻译官开启/关闭接收订单 回应'); | ||||
var res = TransHKInterSetIsReceiptRes.fromBuffer(msgContent); | var res = TransHKInterSetIsReceiptRes.fromBuffer(msgContent); | ||||
if (res.errorCode == 0) { | if (res.errorCode == 0) { | ||||
MessageMgr() | |||||
.emit(MessageMgr.TRANSLATE_HK_IS_RECEIVED_ORDER, res.isReceipt); | |||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_IS_RECEIVED_ORDER,res.isReceipt); | |||||
debugPrint2('翻译官开启/关闭接收订单 回应成功: ${res.isReceipt}'); | debugPrint2('翻译官开启/关闭接收订单 回应成功: ${res.isReceipt}'); | ||||
} else { | } else { | ||||
@@ -1342,6 +1380,7 @@ class MsgHandler { | |||||
} | } | ||||
} | } | ||||
//撤销订单消息 | //撤销订单消息 | ||||
static sendCancelTranslateOrder() { | static sendCancelTranslateOrder() { | ||||
debugPrint2('取消订单 orderid:${TranslateHKMgr().orderId}'); | debugPrint2('取消订单 orderid:${TranslateHKMgr().orderId}'); | ||||
@@ -1370,28 +1409,31 @@ class MsgHandler { | |||||
'OrderId: ${res.orderId} createTime: ${res.createTime} tLanguage:${res.tLanguage} scenes:${res.scenes} desc${res.desc}'); | 'OrderId: ${res.orderId} createTime: ${res.createTime} tLanguage:${res.tLanguage} scenes:${res.scenes} desc${res.desc}'); | ||||
TranslateOrder order = new TranslateOrder(); | TranslateOrder order = new TranslateOrder(); | ||||
order.orderId = res.orderId; | |||||
order.desc = res.desc; | |||||
order.createTime = res.createTime.toInt(); | |||||
order.tLanguage = res.tLanguage.toInt(); | |||||
order.scenes = res.scenes.toInt(); | |||||
order.orderId=res.orderId; | |||||
order.desc=res.desc; | |||||
order.createTime=res.createTime.toInt(); | |||||
order.tLanguage=res.tLanguage.toInt(); | |||||
order.scenes=res.scenes.toInt(); | |||||
order.userName = res.employer.niceName; | order.userName = res.employer.niceName; | ||||
TranslateHKMgr().order = order; | TranslateHKMgr().order = order; | ||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_RECEIVE_ORDER, order); | MessageMgr().emit(MessageMgr.TRANSLATE_HK_RECEIVE_ORDER, order); | ||||
} | } | ||||
//派送订单已被取消 | //派送订单已被取消 | ||||
static handlerCancellationTransHKOrderPush(List<int> msgContent) { | static handlerCancellationTransHKOrderPush(List<int> msgContent) { | ||||
var res = CancellationTransHKOrderPush.fromBuffer(msgContent); | var res = CancellationTransHKOrderPush.fromBuffer(msgContent); | ||||
debugPrint2('派送订单已被取消: orderId${res.orderId}'); | debugPrint2('派送订单已被取消: orderId${res.orderId}'); | ||||
// print('OrderId: ${res.orderId} createTime: ${res.createTime} tLanguage:${res.tLanguage} scenes:${res.scenes} desc${res.desc}'); | // print('OrderId: ${res.orderId} createTime: ${res.createTime} tLanguage:${res.tLanguage} scenes:${res.scenes} desc${res.desc}'); | ||||
TranslateHKMgr().order = null; | TranslateHKMgr().order = null; | ||||
MessageMgr().emit(MessageMgr.TRANSLATE_HK_CANCEL_ORDER); | MessageMgr().emit(MessageMgr.TRANSLATE_HK_CANCEL_ORDER); | ||||
showToast(I18n.of(context).translation_butler_order_time_out, | |||||
duration: Duration(seconds: 3)); | |||||
showToast(I18n.of(context).translation_butler_order_time_out,duration: Duration(seconds: 3)); | |||||
} | } | ||||
//接收订单请求 | //接收订单请求 | ||||
static sendReceiveOrder() { | static sendReceiveOrder() { | ||||
TranslateOrder order = TranslateHKMgr().order; | TranslateOrder order = TranslateHKMgr().order; | ||||
@@ -1414,9 +1456,36 @@ class MsgHandler { | |||||
} | } | ||||
} | } | ||||
//用户发送再来一单请求 | |||||
static sendAnotherOrderReq() { | |||||
debugPrint2('用户发送再来一单请求 orderId:${ TranslateHKMgr().orderId}'); | |||||
var seq = AnotherOrderReq.create(); | |||||
seq.orderId = TranslateHKMgr().orderId; | |||||
NetWork().sendMsg(ComId.TranslateOrder, 30, seq); | |||||
} | |||||
//用户发送再来一单请求回应 | |||||
static handlerAnotherOrderRes(List<int> msgContent) { | |||||
debugPrint2('用户发送再来一单请求回应'); | |||||
var res = AnotherOrderRes.fromBuffer(msgContent); | |||||
if (res.errorCode == 0) { | |||||
TranslateHKMgr().orderId = res.orderId; | |||||
// GroupInfoMgr().updateMemberMsgFree(res.groupId, res.messageFree); | |||||
debugPrint2('用户发送再来一单请求回应成功: '); | |||||
} else { | |||||
debugPrint2('用户发送再来一单请求回应失败${res.errorCode}'); | |||||
} | |||||
} | |||||
//用户主动结束翻译管家服务 | //用户主动结束翻译管家服务 | ||||
static sendEndTransHKOrderReq() { | static sendEndTransHKOrderReq() { | ||||
debugPrint2('用户主动结束翻译管家服务 ${TranslateHKMgr().orderId}'); | |||||
debugPrint2('用户主动结束翻译管家服务 ${TranslateHKMgr().orderId}' ); | |||||
var seq = EndTransHKOrderReq.create(); | var seq = EndTransHKOrderReq.create(); | ||||
seq.orderId = TranslateHKMgr().orderId; | seq.orderId = TranslateHKMgr().orderId; | ||||
NetWork().sendMsg(ComId.TranslateOrder, 7, seq); | NetWork().sendMsg(ComId.TranslateOrder, 7, seq); | ||||
@@ -1427,6 +1496,7 @@ class MsgHandler { | |||||
debugPrint2('用户主动结束翻译管家服务'); | debugPrint2('用户主动结束翻译管家服务'); | ||||
var res = EndTransHKOrderRes.fromBuffer(msgContent); | var res = EndTransHKOrderRes.fromBuffer(msgContent); | ||||
if (res.errorCode == 0) { | if (res.errorCode == 0) { | ||||
// GroupInfoMgr().updateMemberMsgFree(res.groupId, res.messageFree); | // GroupInfoMgr().updateMemberMsgFree(res.groupId, res.messageFree); | ||||
debugPrint2('用户主动结束翻译管家服务 成功: '); | debugPrint2('用户主动结束翻译管家服务 成功: '); | ||||
} else { | } else { | ||||
@@ -1434,6 +1504,11 @@ class MsgHandler { | |||||
} | } | ||||
} | } | ||||
//消息免打扰请求结果 | //消息免打扰请求结果 | ||||
static handlerGroupIsShowMenberNiceName(List<int> msgContent) { | static handlerGroupIsShowMenberNiceName(List<int> msgContent) { | ||||
print('设置是否显示群昵称'); | print('设置是否显示群昵称'); | ||||
@@ -203,6 +203,11 @@ class _MenuPopWidgetState extends State<_MenuPopWidget> { | |||||
(_curPageChildCount - 1 + _curArrowCount) * _separatorWidth + | (_curPageChildCount - 1 + _curArrowCount) * _separatorWidth + | ||||
_curArrowWidth; | _curArrowWidth; | ||||
// if(widget.actions.length==1){ | |||||
// _curPageWidth =_curPageWidth-200; | |||||
// } | |||||
return GestureDetector( | return GestureDetector( | ||||
behavior: HitTestBehavior.opaque, | behavior: HitTestBehavior.opaque, | ||||
onTap: () { | onTap: () { | ||||
@@ -261,86 +266,87 @@ class _MenuPopWidgetState extends State<_MenuPopWidget> { | |||||
child: Container( | child: Container( | ||||
color: widget.backgroundColor, | color: widget.backgroundColor, | ||||
height: widget.menuHeight, | height: widget.menuHeight, | ||||
), | |||||
), | |||||
Row( | |||||
mainAxisSize: MainAxisSize.min, | |||||
children: <Widget>[ | |||||
// 左箭头:判断是否是第一页,如果是第一页则不显示 | |||||
_curPage == 0 | |||||
? Container( | |||||
height: widget.menuHeight, | |||||
) | |||||
: InkWell( | |||||
onTap: () { | |||||
setState(() { | |||||
_curPage--; | |||||
}); | |||||
}, | |||||
child: Container( | |||||
alignment: Alignment.centerRight, | |||||
width: _arrowWidth + 3, | |||||
height: widget.menuHeight - 10, | |||||
child: Image.asset( | |||||
'assets/images/left_white.png', | |||||
fit: BoxFit.none, | |||||
), | |||||
child: Row( | |||||
mainAxisSize: MainAxisSize.min, | |||||
children: <Widget>[ | |||||
// 左箭头:判断是否是第一页,如果是第一页则不显示 | |||||
_curPage == 0 | |||||
? Container( | |||||
height: widget.menuHeight, | |||||
) | |||||
: InkWell( | |||||
onTap: () { | |||||
setState(() { | |||||
_curPage--; | |||||
}); | |||||
}, | |||||
child: Container( | |||||
alignment: Alignment.center, | |||||
width: _arrowWidth , | |||||
height: widget.menuHeight - 10, | |||||
child: Image.asset( | |||||
'assets/images/left_white.png', | |||||
fit: BoxFit.none, | |||||
), | ), | ||||
), | ), | ||||
// 左箭头:判断是否是第一页,如果是第一页则不显示 | |||||
_curPage == 0 | |||||
? Container( | |||||
height: widget.menuHeight, | |||||
) | |||||
: Container( | |||||
width: 1, | |||||
height: widget.menuHeight, | |||||
color: Colors.grey, | |||||
), | |||||
// 中间是ListView | |||||
_buildList(_curPageChildCount, _curPageWidth, | |||||
_curArrowWidth, _curArrowCount), | |||||
// 右箭头:判断是否有箭头,如果有就显示,没有就不显示 | |||||
_curArrowCount > 0 | |||||
? Container( | |||||
width: 1, | |||||
color: Colors.grey, | |||||
height: widget.menuHeight, | |||||
) | |||||
: Container( | |||||
), | |||||
// 左箭头:判断是否是第一页,如果是第一页则不显示 | |||||
_curPage == 0 | |||||
? Container( | |||||
height: widget.menuHeight, | |||||
) | |||||
: Container( | |||||
width: 1, | |||||
height: widget.menuHeight, | |||||
color: Colors.grey, | |||||
), | |||||
// 中间是ListView | |||||
_buildList(_curPageChildCount, _curPageWidth, | |||||
_curArrowWidth, _curArrowCount), | |||||
// 右箭头:判断是否有箭头,如果有就显示,没有就不显示 | |||||
_curArrowCount > 0 | |||||
? Container( | |||||
width: 1, | |||||
color: Colors.grey, | |||||
height: widget.menuHeight, | |||||
) | |||||
: Container( | |||||
height: widget.menuHeight, | |||||
), | |||||
_curArrowCount > 0 | |||||
? InkWell( | |||||
onTap: () { | |||||
if ((_curPage + 1) * | |||||
widget._pageMaxChildCount < | |||||
widget.actions.length) | |||||
setState(() { | |||||
_curPage++; | |||||
}); | |||||
}, | |||||
child: Container( | |||||
width: _arrowWidth-4, | |||||
height: widget.menuHeight, | height: widget.menuHeight, | ||||
), | |||||
_curArrowCount > 0 | |||||
? InkWell( | |||||
onTap: () { | |||||
if ((_curPage + 1) * | |||||
widget._pageMaxChildCount < | |||||
widget.actions.length) | |||||
setState(() { | |||||
_curPage++; | |||||
}); | |||||
}, | |||||
child: Container( | |||||
width: _arrowWidth-4, | |||||
height: widget.menuHeight, | |||||
child: Image.asset( | |||||
(_curPage + 1) * | |||||
widget | |||||
._pageMaxChildCount >= | |||||
widget.actions.length | |||||
? 'assets/images/right_gray.png' | |||||
: 'assets/images/right_white.png', | |||||
fit: BoxFit.none, | |||||
), | |||||
child: Image.asset( | |||||
(_curPage + 1) * | |||||
widget | |||||
._pageMaxChildCount >= | |||||
widget.actions.length | |||||
? 'assets/images/right_gray.png' | |||||
: 'assets/images/right_white.png', | |||||
fit: BoxFit.none, | |||||
), | ), | ||||
) | |||||
: Container( | |||||
height: widget.menuHeight, | |||||
), | ), | ||||
], | |||||
) | |||||
: Container( | |||||
height: widget.menuHeight, | |||||
), | |||||
], | |||||
), | |||||
), | |||||
), | ), | ||||
], | ], | ||||
), | ), | ||||
), | ), | ||||
@@ -392,7 +398,7 @@ class _MenuPopWidgetState extends State<_MenuPopWidget> { | |||||
// (_curPageChildCount - 1 + _curArrowCount) * | // (_curPageChildCount - 1 + _curArrowCount) * | ||||
// _separatorWidth) / | // _separatorWidth) / | ||||
// _curPageChildCount, | // _curPageChildCount, | ||||
width: (text.length / (totalTxtLength) * (width)) + minPadding, | |||||
width: _curPageChildCount==1?180:(text.length / (totalTxtLength) * (width)) + minPadding, | |||||
height: widget.menuHeight, | height: widget.menuHeight, | ||||
child: Center( | child: Center( | ||||
child: Text( | child: Text( | ||||