diff --git a/android/app/build.gradle b/android/app/build.gradle index c2c5d18..cec925d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -56,9 +56,9 @@ android { // manifestPlaceholders = [ // AMAP_KEY : "1fd4e93e3b4b13747da41f484c955fe2", /// 高德地图key // ] - // ndk { - // abiFilters 'armeabi-v7a' - // } +// ndk { +// abiFilters 'armeabi-v7a' +// } multiDexEnabled true manifestPlaceholders = [ JPUSH_PKGNAME : 'com.cyhd.henhoandroid', @@ -75,7 +75,7 @@ android { OPPO_APPKEY : "OP-cd9ece5049514019842f54d537068018", // OPPO平台注册的appkey OPPO_APPID : "OP-30233397", // OPPO平台注册的appid - OPPO_APPSECRET: "OP-您的应用对应OPPO的APPSECRET",//OPPO平台注册的appsecret + OPPO_APPSECRET: "OP-4c16a9e57e614e72ae518fbb4a55f439",//OPPO平台注册的appsecret // // MEIZU_APPKEY:"MZ-您的应用对应的魅族appkey",//魅族平台注册的appkey diff --git a/i18n/zh-CN.json b/i18n/zh-CN.json index 645ae29..cbd4e2f 100644 --- a/i18n/zh-CN.json +++ b/i18n/zh-CN.json @@ -1169,7 +1169,7 @@ "translation_butler_tips": "您的实时贴身翻译,随时随地帮您解决语言不通", "choose_language": "请选择要翻译的语言", "translation_butler_rules": "呼叫管家需要预付H币,管家服务时长为5分钟", - "translation_butler_scenes": "您当所在场景", + "translation_butler_scenes": "您所在场景", "translation_butler_scenes_tips": "根据大数据显示,选择了场景并描述问题的用户得到了更有效的帮助哦!", "translation_butler_call": "呼叫管家", "travel_my_location": "我的位置", diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index 5ec5632..e87fbfb 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -6,6 +6,6 @@ export "FLUTTER_TARGET=/Users/random/code/flutter/project/hibok/lib/main.dart" export "FLUTTER_BUILD_DIR=build" 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_NUMBER=15" +export "FLUTTER_BUILD_NAME=1.1.1" +export "FLUTTER_BUILD_NUMBER=16" export "TRACK_WIDGET_CREATION=true" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5e0d418..0faefc9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -803,7 +803,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 14; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = QJ9M3998Q6; EMBEDDED_CONTENT_CONTAINS_SWIFT_CODE = YES; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/lib/chat/ChatPage.dart b/lib/chat/ChatPage.dart index fa00612..e657ba4 100644 --- a/lib/chat/ChatPage.dart +++ b/lib/chat/ChatPage.dart @@ -691,7 +691,7 @@ class _ChatPageState extends State { return Container( padding: EdgeInsets.fromLTRB(10, 10, 10, 10), - color: Colors.white, + decoration: BoxDecoration(color: Colors.white,border: Border(bottom: BorderSide(color: Colors.grey, width: .3))), child: Row( children: [ ClipRRect( diff --git a/lib/chat/ChatPageItem.dart b/lib/chat/ChatPageItem.dart index f87ff7d..72f83f7 100644 --- a/lib/chat/ChatPageItem.dart +++ b/lib/chat/ChatPageItem.dart @@ -1404,10 +1404,15 @@ class _ChatPageItemState extends State double width = 130; double minWidth = 0; - if (textList.length > 0) { + if (textList.length > 0 && textList[curTextType].length>0) { + print('textList哒哒哒哒哒 ${textList[curTextType]}'); width = _getTextWidth(textList[curTextType]) + 20; width = min(width, Screen.width - 120); + if(width<130){ + width=130; + } + showMsg.add(Padding( padding: EdgeInsets.symmetric(vertical: 5), child: Divider( diff --git a/lib/chat/group_chat_item.dart b/lib/chat/group_chat_item.dart index 1bef1a3..295e8cd 100644 --- a/lib/chat/group_chat_item.dart +++ b/lib/chat/group_chat_item.dart @@ -1369,11 +1369,15 @@ class _GroupChatPageItemState extends State double width = 130; double minWidth = 0; - if (textList.length > 0) { + if (textList.length > 0 && textList[curTextType].length>0) { width = _getTextWidth(textList[curTextType]) + 20; width = min(width, Screen.width - 120); minWidth = max(width, 150); + if(width<130){ + width=130; + } + showMsg.add(Padding( padding: EdgeInsets.symmetric(vertical: 5), child: Divider( diff --git a/lib/chat/record_view.dart b/lib/chat/record_view.dart index 942e94f..6f8f16f 100644 --- a/lib/chat/record_view.dart +++ b/lib/chat/record_view.dart @@ -161,7 +161,7 @@ class _RecordViewState extends State { tipStr = I18n.of(context).voice_tips; } - return Container( + return InkWell(onTap: (){},child: Container( width: double.infinity, height: double.infinity, padding: EdgeInsets.only(top: 10, bottom: 20), @@ -224,7 +224,7 @@ class _RecordViewState extends State { } }else { - cancelRecorder(); + cancelRecorder(); } }, onLongPressEnd: (LongPressEndDetails details) { @@ -262,7 +262,7 @@ class _RecordViewState extends State { child: Text(tipStr, textScaleFactor: 1.0,), ) ], - )); + )),); } checkValideArea(Offset position) { diff --git a/lib/home/ConversActionPage.dart b/lib/home/ConversActionPage.dart index 7f1cf53..3d646f3 100644 --- a/lib/home/ConversActionPage.dart +++ b/lib/home/ConversActionPage.dart @@ -1,620 +1,3 @@ -import 'package:chat/data/UserData.dart'; -import 'package:chat/data/WebData.dart'; -import 'package:chat/data/conversation.dart'; -import 'package:chat/data/group_data_mgr.dart'; -import 'package:chat/generated/i18n.dart'; -import 'package:chat/home/InfoList.dart'; -import 'package:chat/home/last_chat_record_widget.dart'; -import 'package:chat/home/rich_title.dart'; -import 'package:chat/home/unread_dot_widget.dart'; -import 'package:chat/models/group_info_model.dart'; -import 'package:chat/utils/CustomUI.dart'; -import 'package:chat/utils/HttpUtil.dart'; -import 'package:chat/utils/MessageMgr.dart'; -import 'package:chat/utils/TokenMgr.dart'; -import 'package:chat/utils/screen.dart'; -import 'package:dio/dio.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import '../data/constants.dart' - show - AppColors, - AppStyles, - Constants, - GlobalSearchPageType, - GroupOperatingPageType; -import 'package:cached_network_image/cached_network_image.dart'; - -import 'create_group_view.dart'; -import 'global_search.dart'; -import 'group_item_widget.dart'; - -class _ConversationItem extends StatelessWidget { - const _ConversationItem( - {Key key, - this.conversation, - this.callback, - this.icon, - this.bgColor, - this.iconSize = 20}) - : assert(conversation != null), - super(key: key); - final icon; - final double iconSize; - final Conversation conversation; - final callback; - final bgColor; - - @override - Widget build(BuildContext context) { - Widget avatar; - if (icon != null) { - avatar = Container( - height: 47.5, - width: 47.5, - margin: EdgeInsets.only(left: 6), - alignment: Alignment.center, - decoration: BoxDecoration( - gradient: bgColor, - borderRadius: BorderRadius.all(Radius.circular(50))), - child: Image.asset( - icon, - height: iconSize, - )); - } else if (conversation.isAvatarFromNet()) { - avatar = CachedNetworkImage( - imageUrl: conversation.avatar, - placeholder: CustomUI.buildImgLoding, - width: Constants.ConversationAvatarSize, - height: Constants.ConversationAvatarSize, - ); - } else { - avatar = Image.asset( - conversation.avatar, - width: Constants.ConversationAvatarSize, - height: Constants.ConversationAvatarSize, - ); - } - List _rightArea = [ - Container( - padding: EdgeInsets.only(top: 4), - alignment: Alignment.center, - child: Text(conversation.updateAt, - textScaleFactor: 1.0, - style: TextStyle(fontSize: 11, color: const Color(0xFFC6C6C6))), - ) - ]; - if (conversation.unreadMsgCount > 0) { - var countStr = conversation.unreadMsgCount.toString(); - if (conversation.unreadMsgCount > 99) { - countStr = '99+'; - } - // 未读消息角标 - Widget unreadMsgCountText = Container( - width: Constants.UnReadMsgNotifyDotSize, - height: Constants.UnReadMsgNotifyDotSize, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(Constants.UnReadMsgNotifyDotSize / 2.0), - color: Color(0xFFFF5454), - ), - child: Text(countStr, - textScaleFactor: 1.0, style: AppStyles.UnreadMsgCountDotStyle), - ); - _rightArea.add(Expanded( - child: Align( - alignment: Alignment.bottomCenter, - child: unreadMsgCountText, - ))); - } - - return InkWell( - child: Container( - padding: const EdgeInsets.all(10.0), - decoration: BoxDecoration( - color: Color(AppColors.ConversationItemBgColor), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - avatar, - Container(width: 17.0), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(conversation.title, - textScaleFactor: 1.0, - style: TextStyle( - color: Colors.black, - )), - SizedBox( - height: 5, - ), - Text(conversation.desc, - textScaleFactor: 1.0, - style: TextStyle( - fontSize: 12, color: const Color(0xFF9B9B9B))) - ], - ), - ), - // Container(width: 10.0), - SizedBox( - height: Constants.ConversationAvatarSize, - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.start, - children: _rightArea, - ), - ) - ], - ), - ), - onTap: () { - callback(); - }, - ); - } -} - -class ConversActionPage extends StatefulWidget { - ConversActionPage({Key key}) : super(key: key); - - _ConversActionPageState createState() => _ConversActionPageState(); -} - -Map systemInfo = { - 'applyList': null, - 'applyCount': 0, - 'evaluateList': null, - 'evaluateCount': 0, - 'parkList': null, - 'parkCount': 0, - 'castList': null, - 'castCount': 0, - 'walletList': null, - 'walletCount': 0, -}; - -int msgNum = 0; -bool isShowMsg() { - return msgNum > 0; -} - -getAllResNum(prefs) { - getResNum(prefs, Constants.ApplyCount); - getResNum(prefs, Constants.EvaluateCount); - getResNum(prefs, Constants.ParkCount); - getResNum(prefs, Constants.CastCount); - getResNum(prefs, Constants.WalletCount); -} - -getResNum(prefs, url) async { - var count = prefs.getInt(url + UserData().basicInfo.userId.toString()); - systemInfo[url] = count == null ? systemInfo[url] : (systemInfo[url] - count); - - msgNum += systemInfo[url]; -} - -setResNum(url) async { - var localKey = url + UserData().basicInfo.userId.toString(); - if (systemInfo[url] > 0) { - SharedPreferences prefs = await SharedPreferences.getInstance(); - var count = prefs.getInt(localKey); - prefs.setInt( - localKey, count == null ? systemInfo[url] : (systemInfo[url] + count)); - msgNum -= systemInfo[url]; - systemInfo[url] = 0; - } -} - -class _ConversActionPageState extends State - with SingleTickerProviderStateMixin { - TabController tabCtrl; - - void getSystemMsg(data) async { - Map data = { - "userId": UserData().basicInfo.userId, - "type": UserData().basicInfo.sex - }; - data['sign'] = TokenMgr().getSign(data); - - Response res = await HttpUtil().post('message/all/message', data: data); - if (res == null) { - return; - } - Map resData = res.data; - if (resData['code'] == 0) { - SharedPreferences prefs = await SharedPreferences.getInstance(); - systemInfo = resData['data']; - msgNum = 0; - getAllResNum(prefs); - if (mounted) { - setState(() {}); - } - } - } - - @override - void initState() { - super.initState(); - - MessageMgr().on('update_system', getSystemMsg); - MessageMgr().on('Quit Group', quitGroup); - - MessageMgr().on('Update Group List', updateGroupLastMsg); - getSystemMsg(null); - - tabCtrl = TabController(length: 3, vsync: this); - } - - @override - void dispose() { - tabCtrl.dispose(); - MessageMgr().off('update_system', getSystemMsg); - super.dispose(); - MessageMgr().off('Quit Group', quitGroup); - - MessageMgr().off('Update Group List', updateGroupLastMsg); - } - - @override - Widget build(BuildContext context) { - List groupList = GroupInfoMgr().groupInfoList; - - return Scaffold( - backgroundColor: Colors.white, - appBar: AppBar( - //backgroundColor: Constants.LightGreyBackgroundColor, - centerTitle: false, - title: Text( - I18n.of(context).message_center, - textScaleFactor: 1.0, - style: Constants.MainTitleStyle, - ), - actions: [ - Container( - child: IconButton( - icon: CircleAvatar( - backgroundColor: Constants.GreyBackgroundColor, - radius: 13.75, - child: Padding( - padding: EdgeInsets.only(bottom: 1.5), - child: Icon( - IconData(0xe659, - fontFamily: Constants.IconFontFamily), - color: Constants.BlackTextColor, - size: 21, - ))), - onPressed: () { - CustomUI().goScanPage(context); - }, - ), - ), - // InkWell( - // onTap: () { - // Navigator.of(context).push( - // new MaterialPageRoute( - // builder: (context) { - // return MessagePushPage(); - // }, - // ), - // ); - // }, - // child: Padding( - // padding: EdgeInsets.only(right: 10), - // child: CircleAvatar( - // backgroundColor: Constants.GreyBackgroundColor, - // radius: 13.75, - // child: Icon( - // Icons.settings, - // color: Constants.BlackTextColor, - // size: 22, - // )), - // )), - ], - elevation: 0, - bottom: PreferredSize( - preferredSize: Size.fromHeight(28), - child: Container( - padding: EdgeInsets.only(left: 2), - decoration: BoxDecoration( - //color: Constants.LightGreyBackgroundColor, - border: - Border(bottom: BorderSide(color: Color(0xffeaeaea)))), - alignment: Alignment.centerLeft, - child: TabBar( - isScrollable: true, - indicatorPadding: EdgeInsets.only(left: 9, right: 9), - tabs: [ - UnreadDot( - child: Container( - margin: EdgeInsets.only(right: 4), - child: Text(I18n.of(context).text_chat, - textScaleFactor: 1.0), - ), - type: 1), - UnreadDot( - child: Container( - margin: EdgeInsets.only(right: 4), - child: Text(I18n.of(context).group_chat, - textScaleFactor: 1.0), - ), - type: 4), - UnreadDot( - child: Container( - margin: EdgeInsets.only(right: 4), - child: Text(I18n.of(context).system_information, - textScaleFactor: 1.0)), - type: 2), - ], - controller: tabCtrl, - ), - )), - ), - body: SafeArea( - child: TabBarView( - children: [ - LastChatPage(), - ListView.builder( -// controller: _scrollController, - itemBuilder: (BuildContext context, int index) { - if (index == 0) { - return _buildCreateButton(); - } else { - var info = groupList[index - 1]; - return GroupItem(ValueKey(info), groupInfoModel: info); - } - }, - itemCount: groupList.length + 1, - ), - ListView( - children: [ - SizedBox(height: 8.5), - _ConversationItem( - icon: 'assets/images/chat/icon1.png', - bgColor: Constants.RadioGradient, - conversation: Conversation( - avatar: 'assets/images/ic_tx_news.png', - title: I18n.of(context).radio_message, - desc: RichTitle.normalTitle( - systemInfo['castList'], context, InfoType.Radio), - updateAt: systemInfo['castList'] == null - ? "" - : WebData().getLoginTime( - context, systemInfo['castList']['CreateTime']), - unreadMsgCount: systemInfo['castCount'], - ), - callback: () { - setResNum(Constants.CastCount); - Navigator.of(context).push( - new MaterialPageRoute( - builder: (context) { - return InfoListPage( - title: I18n.of(context).radio_message, - type: InfoType.Radio, - ); - }, - ), - ); - }, - ), - _ConversationItem( - icon: 'assets/images/chat/icon4.png', - bgColor: Constants.MoneyGradient, - conversation: Conversation( - avatar: 'assets/images/ic_tx_news.png', - title: I18n.of(context).wallet_reminder, - desc: RichTitle.normalTitle( - systemInfo['walletList'], context, InfoType.IncomeMoney), - updateAt: systemInfo['walletList'] == null - ? "" - : WebData().getLoginTime( - context, systemInfo['walletList']['CreateTime']), - unreadMsgCount: systemInfo['walletCount'], - ), - callback: () { - setResNum(Constants.WalletCount); - Navigator.of(context).push( - new MaterialPageRoute( - builder: (context) { - return InfoListPage( - title: I18n.of(context).wallet_reminder, - type: InfoType.IncomeMoney, - ); - }, - ), - ); - }, - ), - _ConversationItem( - icon: 'assets/images/chat/icon3.png', - iconSize: 27, - bgColor: Constants.ApplyGradient, - conversation: Conversation( - avatar: 'assets/images/ic_tx_news.png', - title: I18n.of(context).application_notice, - desc: RichTitle.normalTitle( - systemInfo['applyList'], context, InfoType.Apply), - updateAt: systemInfo['applyList'] == null - ? "" - : WebData().getLoginTime( - context, systemInfo['applyList']['CreatTime']), - unreadMsgCount: systemInfo['applyCount'], - ), - callback: () { - setResNum(Constants.ApplyCount); - Navigator.of(context).push( - new MaterialPageRoute( - builder: (context) { - return InfoListPage( - title: I18n.of(context).application_notice, - type: InfoType.Apply, - ); - }, - ), - ); - }, - ), - _ConversationItem( - icon: 'assets/images/chat/icon6.png', - bgColor: Constants.EvaGradient, - conversation: Conversation( - avatar: 'assets/images/ic_tx_news.png', - title: I18n.of(context).evaluation_notice, - desc: RichTitle.normalTitle(systemInfo['evaluateList'], - context, InfoType.Evaluation), - updateAt: systemInfo['evaluateList'] == null - ? '' - : WebData().getLoginTime( - context, systemInfo['evaluateList']['CreateTime']), - unreadMsgCount: systemInfo['evaluateCount'], - ), - callback: () { - setResNum(Constants.EvaluateCount); - Navigator.of(context).push( - new MaterialPageRoute( - builder: (context) { - return InfoListPage( - title: I18n.of(context).evaluation_notice, - type: 2, - ); - }, - ), - ); - }, - ), - _ConversationItem( - icon: 'assets/images/chat/icon5.png', - bgColor: Constants.ParkGradient, - conversation: Conversation( - avatar: 'assets/images/ic_tx_news.png', - title: I18n.of(context).appName, - desc: RichTitle.normalTitle( - systemInfo['parkList'], context, InfoType.System), - updateAt: systemInfo['parkList'] == null - ? "" - : WebData().getLoginTime( - context, systemInfo['parkList']['CreateTime']), - unreadMsgCount: systemInfo['parkCount'], - ), - callback: () { - setResNum(Constants.ParkCount); - Navigator.of(context).push( - new MaterialPageRoute( - builder: (context) { - return InfoListPage( - title: I18n.of(context).appName, - type: InfoType.System, - ); - }, - ), - ); - }, - ) - ], - ) - ], - controller: tabCtrl, - ))); - } - - Widget _buildCreateButton() { - List groupList = GroupInfoMgr().groupInfoList; - Widget _avatarIcon = ClipRRect( - borderRadius: BorderRadius.circular(GroupRadius), - child: Container( - color: const Color(0xFFF2F2F2), - height: AvatarSize, - width: AvatarSize, - child: Icon( - IconData(0xe66f, fontFamily: Constants.IconFontFamily), - color: Constants.BlueTextColor, - size: 35, - ), - )); - - Widget _button = InkWell( - onTap: () { - Navigator.of(context).push( - new MaterialPageRoute( - builder: (context) { - return CreateGroupPage( - GroupOperatingPageType.CreateGroup, [], null); - }, - ), - ); - }, - child: Container( - padding: EdgeInsets.only(top: 14, bottom: 14), - color: Constants.GreyBackgroundColor, - child: Container( - height: ItemHeight, - decoration: BoxDecoration(color: Colors.white), - child: Row( - children: [ - SizedBox(width: LeftPadding), - _avatarIcon, - SizedBox(width: 14.0), - Text( - I18n.of(context).create_group_chat, - style: TextStyle(fontSize: 15.5), - ), - ], - ), - ))); - - Widget tips = Container( - alignment: Alignment.centerLeft, - width: Screen.width, - height: 33.5, - padding: EdgeInsets.only(left: LeftPadding), - decoration: BoxDecoration( - color: Colors.white, - border: Border(bottom: Constants.GreyBorderSide)), - child: Text(I18n.of(context).group_chat + '(${groupList.length})'), - ); - - return Column( - children: [ - SizedBox( - height: 10, - ), - CustomUI.buildSearchButton(context, () { - Navigator.of(context).push( - new MaterialPageRoute( - builder: (context) { - return GlobalSearchPage( - type: GlobalSearchPageType.SearchGroup, - ); - }, - ), - ); - }, bottom: 10), - _button, - tips, - ], - ); - } - - quitGroup(args) { - if (mounted) { - setState(() { - print('更新群列表'); - }); - } - } - - updateGroupLastMsg(args) async { - await GroupInfoMgr().sortGroupList(); - if (mounted) { - setState(() {}); - } - } -} - //import 'package:chat/data/UserData.dart'; //import 'package:chat/data/WebData.dart'; //import 'package:chat/data/conversation.dart'; @@ -757,478 +140,1095 @@ class _ConversActionPageState extends State // ], // ), // ), -// // Container(width: 10.0), -// SizedBox( -// height: Constants.ConversationAvatarSize, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.end, -// mainAxisAlignment: MainAxisAlignment.start, -// children: _rightArea, -// ), -// ) +// // Container(width: 10.0), +// SizedBox( +// height: Constants.ConversationAvatarSize, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.end, +// mainAxisAlignment: MainAxisAlignment.start, +// children: _rightArea, +// ), +// ) +// ], +// ), +// ), +// onTap: () { +// callback(); +// }, +// ); +// } +//} +// +//class ConversActionPage extends StatefulWidget { +// ConversActionPage({Key key}) : super(key: key); +// +// _ConversActionPageState createState() => _ConversActionPageState(); +//} +// +//Map systemInfo = { +// 'applyList': null, +// 'applyCount': 0, +// 'evaluateList': null, +// 'evaluateCount': 0, +// 'parkList': null, +// 'parkCount': 0, +// 'castList': null, +// 'castCount': 0, +// 'walletList': null, +// 'walletCount': 0, +//}; +// +//int msgNum = 0; +//bool isShowMsg() { +// return msgNum > 0; +//} +// +//getAllResNum(prefs) { +// getResNum(prefs, Constants.ApplyCount); +// getResNum(prefs, Constants.EvaluateCount); +// getResNum(prefs, Constants.ParkCount); +// getResNum(prefs, Constants.CastCount); +// getResNum(prefs, Constants.WalletCount); +//} +// +//getResNum(prefs, url) async { +// var count = prefs.getInt(url + UserData().basicInfo.userId.toString()); +// systemInfo[url] = count == null ? systemInfo[url] : (systemInfo[url] - count); +// +// msgNum += systemInfo[url]; +//} +// +//setResNum(url) async { +// var localKey = url + UserData().basicInfo.userId.toString(); +// if (systemInfo[url] > 0) { +// SharedPreferences prefs = await SharedPreferences.getInstance(); +// var count = prefs.getInt(localKey); +// prefs.setInt( +// localKey, count == null ? systemInfo[url] : (systemInfo[url] + count)); +// msgNum -= systemInfo[url]; +// systemInfo[url] = 0; +// } +//} +// +//class _ConversActionPageState extends State +// with SingleTickerProviderStateMixin { +// TabController tabCtrl; +// +// void getSystemMsg(data) async { +// Map data = { +// "userId": UserData().basicInfo.userId, +// "type": UserData().basicInfo.sex +// }; +// data['sign'] = TokenMgr().getSign(data); +// +// Response res = await HttpUtil().post('message/all/message', data: data); +// if (res == null) { +// return; +// } +// Map resData = res.data; +// if (resData['code'] == 0) { +// SharedPreferences prefs = await SharedPreferences.getInstance(); +// systemInfo = resData['data']; +// msgNum = 0; +// getAllResNum(prefs); +// if (mounted) { +// setState(() {}); +// } +// } +// } +// +// @override +// void initState() { +// super.initState(); +// +// MessageMgr().on('update_system', getSystemMsg); +// MessageMgr().on('Quit Group', quitGroup); +// +// MessageMgr().on('Update Group List', updateGroupLastMsg); +// getSystemMsg(null); +// +// tabCtrl = TabController(length: 3, vsync: this); +// } +// +// @override +// void dispose() { +// tabCtrl.dispose(); +// MessageMgr().off('update_system', getSystemMsg); +// super.dispose(); +// MessageMgr().off('Quit Group', quitGroup); +// +// MessageMgr().off('Update Group List', updateGroupLastMsg); +// } +// +// @override +// Widget build(BuildContext context) { +// List groupList = GroupInfoMgr().groupInfoList; +// +// return Scaffold( +// backgroundColor: Colors.white, +// appBar: AppBar( +// //backgroundColor: Constants.LightGreyBackgroundColor, +// centerTitle: false, +// title: Text( +// I18n.of(context).message_center, +// textScaleFactor: 1.0, +// style: Constants.MainTitleStyle, +// ), +// actions: [ +// Container( +// child: IconButton( +// icon: CircleAvatar( +// backgroundColor: Constants.GreyBackgroundColor, +// radius: 13.75, +// child: Padding( +// padding: EdgeInsets.only(bottom: 1.5), +// child: Icon( +// IconData(0xe659, +// fontFamily: Constants.IconFontFamily), +// color: Constants.BlackTextColor, +// size: 21, +// ))), +// onPressed: () { +// CustomUI().goScanPage(context); +// }, +// ), +// ), +// // InkWell( +// // onTap: () { +// // Navigator.of(context).push( +// // new MaterialPageRoute( +// // builder: (context) { +// // return MessagePushPage(); +// // }, +// // ), +// // ); +// // }, +// // child: Padding( +// // padding: EdgeInsets.only(right: 10), +// // child: CircleAvatar( +// // backgroundColor: Constants.GreyBackgroundColor, +// // radius: 13.75, +// // child: Icon( +// // Icons.settings, +// // color: Constants.BlackTextColor, +// // size: 22, +// // )), +// // )), // ], +// elevation: 0, +// bottom: PreferredSize( +// preferredSize: Size.fromHeight(28), +// child: Container( +// padding: EdgeInsets.only(left: 2), +// decoration: BoxDecoration( +// //color: Constants.LightGreyBackgroundColor, +// border: +// Border(bottom: BorderSide(color: Color(0xffeaeaea)))), +// alignment: Alignment.centerLeft, +// child: TabBar( +// isScrollable: true, +// indicatorPadding: EdgeInsets.only(left: 9, right: 9), +// tabs: [ +// UnreadDot( +// child: Container( +// margin: EdgeInsets.only(right: 4), +// child: Text(I18n.of(context).text_chat, +// textScaleFactor: 1.0), +// ), +// type: 1), +// UnreadDot( +// child: Container( +// margin: EdgeInsets.only(right: 4), +// child: Text(I18n.of(context).group_chat, +// textScaleFactor: 1.0), +// ), +// type: 4), +// UnreadDot( +// child: Container( +// margin: EdgeInsets.only(right: 4), +// child: Text(I18n.of(context).system_information, +// textScaleFactor: 1.0)), +// type: 2), +// ], +// controller: tabCtrl, +// ), +// )), // ), -// ), -// onTap: () { -// callback(); -// }, -// ); -// } -//} -// -//class ConversActionPage extends StatefulWidget { -// ConversActionPage({Key key}) : super(key: key); -// -// _ConversActionPageState createState() => _ConversActionPageState(); -//} -// -//Map systemInfo = { -// 'applyList': null, -// 'applyCount': 0, -// 'evaluateList': null, -// 'evaluateCount': 0, -// 'parkList': null, -// 'parkCount': 0, -// 'castList': null, -// 'castCount': 0, -// 'walletList': null, -// 'walletCount': 0, -//}; -// -//int msgNum = 0; -//bool isShowMsg() { -// return msgNum > 0; -//} +// body: SafeArea( +// child: TabBarView( +// children: [ +// LastChatPage(), +// ListView.builder( +//// controller: _scrollController, +// itemBuilder: (BuildContext context, int index) { +// if (index == 0) { +// return _buildCreateButton(); +// } else { +// var info = groupList[index - 1]; +// return GroupItem(ValueKey(info), groupInfoModel: info); +// } +// }, +// itemCount: groupList.length + 1, +// ), +// ListView( +// children: [ +// SizedBox(height: 8.5), +// _ConversationItem( +// icon: 'assets/images/chat/icon1.png', +// bgColor: Constants.RadioGradient, +// conversation: Conversation( +// avatar: 'assets/images/ic_tx_news.png', +// title: I18n.of(context).radio_message, +// desc: RichTitle.normalTitle( +// systemInfo['castList'], context, InfoType.Radio), +// updateAt: systemInfo['castList'] == null +// ? "" +// : WebData().getLoginTime( +// context, systemInfo['castList']['CreateTime']), +// unreadMsgCount: systemInfo['castCount'], +// ), +// callback: () { +// setResNum(Constants.CastCount); +// Navigator.of(context).push( +// new MaterialPageRoute( +// builder: (context) { +// return InfoListPage( +// title: I18n.of(context).radio_message, +// type: InfoType.Radio, +// ); +// }, +// ), +// ); +// }, +// ), +// _ConversationItem( +// icon: 'assets/images/chat/icon4.png', +// bgColor: Constants.MoneyGradient, +// conversation: Conversation( +// avatar: 'assets/images/ic_tx_news.png', +// title: I18n.of(context).wallet_reminder, +// desc: RichTitle.normalTitle( +// systemInfo['walletList'], context, InfoType.IncomeMoney), +// updateAt: systemInfo['walletList'] == null +// ? "" +// : WebData().getLoginTime( +// context, systemInfo['walletList']['CreateTime']), +// unreadMsgCount: systemInfo['walletCount'], +// ), +// callback: () { +// setResNum(Constants.WalletCount); +// Navigator.of(context).push( +// new MaterialPageRoute( +// builder: (context) { +// return InfoListPage( +// title: I18n.of(context).wallet_reminder, +// type: InfoType.IncomeMoney, +// ); +// }, +// ), +// ); +// }, +// ), +// _ConversationItem( +// icon: 'assets/images/chat/icon3.png', +// iconSize: 27, +// bgColor: Constants.ApplyGradient, +// conversation: Conversation( +// avatar: 'assets/images/ic_tx_news.png', +// title: I18n.of(context).application_notice, +// desc: RichTitle.normalTitle( +// systemInfo['applyList'], context, InfoType.Apply), +// updateAt: systemInfo['applyList'] == null +// ? "" +// : WebData().getLoginTime( +// context, systemInfo['applyList']['CreatTime']), +// unreadMsgCount: systemInfo['applyCount'], +// ), +// callback: () { +// setResNum(Constants.ApplyCount); +// Navigator.of(context).push( +// new MaterialPageRoute( +// builder: (context) { +// return InfoListPage( +// title: I18n.of(context).application_notice, +// type: InfoType.Apply, +// ); +// }, +// ), +// ); +// }, +// ), +// _ConversationItem( +// icon: 'assets/images/chat/icon6.png', +// bgColor: Constants.EvaGradient, +// conversation: Conversation( +// avatar: 'assets/images/ic_tx_news.png', +// title: I18n.of(context).evaluation_notice, +// desc: RichTitle.normalTitle(systemInfo['evaluateList'], +// context, InfoType.Evaluation), +// updateAt: systemInfo['evaluateList'] == null +// ? '' +// : WebData().getLoginTime( +// context, systemInfo['evaluateList']['CreateTime']), +// unreadMsgCount: systemInfo['evaluateCount'], +// ), +// callback: () { +// setResNum(Constants.EvaluateCount); +// Navigator.of(context).push( +// new MaterialPageRoute( +// builder: (context) { +// return InfoListPage( +// title: I18n.of(context).evaluation_notice, +// type: 2, +// ); +// }, +// ), +// ); +// }, +// ), +// _ConversationItem( +// icon: 'assets/images/chat/icon5.png', +// bgColor: Constants.ParkGradient, +// conversation: Conversation( +// avatar: 'assets/images/ic_tx_news.png', +// title: I18n.of(context).appName, +// desc: RichTitle.normalTitle( +// systemInfo['parkList'], context, InfoType.System), +// updateAt: systemInfo['parkList'] == null +// ? "" +// : WebData().getLoginTime( +// context, systemInfo['parkList']['CreateTime']), +// unreadMsgCount: systemInfo['parkCount'], +// ), +// callback: () { +// setResNum(Constants.ParkCount); +// Navigator.of(context).push( +// new MaterialPageRoute( +// builder: (context) { +// return InfoListPage( +// title: I18n.of(context).appName, +// type: InfoType.System, +// ); +// }, +// ), +// ); +// }, +// ) +// ], +// ) +// ], +// controller: tabCtrl, +// ))); +// } // -//getAllResNum(prefs) { -// getResNum(prefs, Constants.ApplyCount); -// getResNum(prefs, Constants.EvaluateCount); -// getResNum(prefs, Constants.ParkCount); -// getResNum(prefs, Constants.CastCount); -// getResNum(prefs, Constants.WalletCount); -//} +// Widget _buildCreateButton() { +// List groupList = GroupInfoMgr().groupInfoList; +// Widget _avatarIcon = ClipRRect( +// borderRadius: BorderRadius.circular(GroupRadius), +// child: Container( +// color: const Color(0xFFF2F2F2), +// height: AvatarSize, +// width: AvatarSize, +// child: Icon( +// IconData(0xe66f, fontFamily: Constants.IconFontFamily), +// color: Constants.BlueTextColor, +// size: 35, +// ), +// )); // -//getResNum(prefs, url) async { -// var count = prefs.getInt(url + UserData().basicInfo.userId.toString()); -// systemInfo[url] = count == null ? systemInfo[url] : (systemInfo[url] - count); +// Widget _button = InkWell( +// onTap: () { +// Navigator.of(context).push( +// new MaterialPageRoute( +// builder: (context) { +// return CreateGroupPage( +// GroupOperatingPageType.CreateGroup, [], null); +// }, +// ), +// ); +// }, +// child: Container( +// padding: EdgeInsets.only(top: 14, bottom: 14), +// color: Constants.GreyBackgroundColor, +// child: Container( +// height: ItemHeight, +// decoration: BoxDecoration(color: Colors.white), +// child: Row( +// children: [ +// SizedBox(width: LeftPadding), +// _avatarIcon, +// SizedBox(width: 14.0), +// Text( +// I18n.of(context).create_group_chat, +// style: TextStyle(fontSize: 15.5), +// ), +// ], +// ), +// ))); // -// msgNum += systemInfo[url]; -//} +// Widget tips = Container( +// alignment: Alignment.centerLeft, +// width: Screen.width, +// height: 33.5, +// padding: EdgeInsets.only(left: LeftPadding), +// decoration: BoxDecoration( +// color: Colors.white, +// border: Border(bottom: Constants.GreyBorderSide)), +// child: Text(I18n.of(context).group_chat + '(${groupList.length})'), +// ); // -//setResNum(url) async { -// var localKey = url + UserData().basicInfo.userId.toString(); -// if (systemInfo[url] > 0) { -// SharedPreferences prefs = await SharedPreferences.getInstance(); -// var count = prefs.getInt(localKey); -// prefs.setInt( -// localKey, count == null ? systemInfo[url] : (systemInfo[url] + count)); -// msgNum -= systemInfo[url]; -// systemInfo[url] = 0; +// return Column( +// children: [ +// SizedBox( +// height: 10, +// ), +// CustomUI.buildSearchButton(context, () { +// Navigator.of(context).push( +// new MaterialPageRoute( +// builder: (context) { +// return GlobalSearchPage( +// type: GlobalSearchPageType.SearchGroup, +// ); +// }, +// ), +// ); +// }, bottom: 10), +// _button, +// tips, +// ], +// ); // } -//} -// -//class _ConversActionPageState extends State -// with SingleTickerProviderStateMixin { -// TabController tabCtrl; -// -// void getSystemMsg(data) async { -// Map data = { -// "userId": UserData().basicInfo.userId, -// "type": UserData().basicInfo.sex -// }; -// data['sign'] = TokenMgr().getSign(data); // -// Response res = await HttpUtil().post('message/all/message', data: data); -// if (res == null) { -// return; -// } -// Map resData = res.data; -// if (resData['code'] == 0) { -// SharedPreferences prefs = await SharedPreferences.getInstance(); -// systemInfo = resData['data']; -// msgNum = 0; -// getAllResNum(prefs); -// if (mounted) { -// setState(() {}); -// } +// quitGroup(args) { +// if (mounted) { +// setState(() { +// print('更新群列表'); +// }); // } // } // -// @override -// void initState() { -// super.initState(); -// -// MessageMgr().on('update_system', getSystemMsg); -//// MessageMgr().on('Quit Group', quitGroup); -//// -//// MessageMgr().on('Update Group List', updateGroupLastMsg); -// getSystemMsg(null); -// -// tabCtrl = TabController(length: 2, vsync: this); -// } -// -// @override -// void dispose() { -// tabCtrl.dispose(); -// MessageMgr().off('update_system', getSystemMsg); -// super.dispose(); +// updateGroupLastMsg(args) async { +// await GroupInfoMgr().sortGroupList(); +// if (mounted) { +// setState(() {}); +// } // } +//} + +import 'package:chat/data/UserData.dart'; +import 'package:chat/data/WebData.dart'; +import 'package:chat/data/conversation.dart'; +import 'package:chat/data/group_data_mgr.dart'; +import 'package:chat/generated/i18n.dart'; +import 'package:chat/home/InfoList.dart'; +import 'package:chat/home/last_chat_record_widget.dart'; +import 'package:chat/home/rich_title.dart'; +import 'package:chat/home/unread_dot_widget.dart'; +import 'package:chat/models/group_info_model.dart'; +import 'package:chat/utils/CustomUI.dart'; +import 'package:chat/utils/HttpUtil.dart'; +import 'package:chat/utils/MessageMgr.dart'; +import 'package:chat/utils/TokenMgr.dart'; +import 'package:chat/utils/screen.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import '../data/constants.dart' + show + AppColors, + AppStyles, + Constants, + GlobalSearchPageType, + GroupOperatingPageType; +import 'package:cached_network_image/cached_network_image.dart'; + +import 'create_group_view.dart'; +import 'global_search.dart'; +import 'group_item_widget.dart'; + +class _ConversationItem extends StatelessWidget { + const _ConversationItem( + {Key key, + this.conversation, + this.callback, + this.icon, + this.bgColor, + this.iconSize = 20}) + : assert(conversation != null), + super(key: key); + final icon; + final double iconSize; + final Conversation conversation; + final callback; + final bgColor; + + @override + Widget build(BuildContext context) { + Widget avatar; + if (icon != null) { + avatar = Container( + height: 47.5, + width: 47.5, + margin: EdgeInsets.only(left: 6), + alignment: Alignment.center, + decoration: BoxDecoration( + gradient: bgColor, + borderRadius: BorderRadius.all(Radius.circular(50))), + child: Image.asset( + icon, + height: iconSize, + )); + } else if (conversation.isAvatarFromNet()) { + avatar = CachedNetworkImage( + imageUrl: conversation.avatar, + placeholder: CustomUI.buildImgLoding, + width: Constants.ConversationAvatarSize, + height: Constants.ConversationAvatarSize, + ); + } else { + avatar = Image.asset( + conversation.avatar, + width: Constants.ConversationAvatarSize, + height: Constants.ConversationAvatarSize, + ); + } + List _rightArea = [ + Container( + padding: EdgeInsets.only(top: 4), + alignment: Alignment.center, + child: Text(conversation.updateAt, + textScaleFactor: 1.0, + style: TextStyle(fontSize: 11, color: const Color(0xFFC6C6C6))), + ) + ]; + if (conversation.unreadMsgCount > 0) { + var countStr = conversation.unreadMsgCount.toString(); + if (conversation.unreadMsgCount > 99) { + countStr = '99+'; + } + // 未读消息角标 + Widget unreadMsgCountText = Container( + width: Constants.UnReadMsgNotifyDotSize, + height: Constants.UnReadMsgNotifyDotSize, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(Constants.UnReadMsgNotifyDotSize / 2.0), + color: Color(0xFFFF5454), + ), + child: Text(countStr, + textScaleFactor: 1.0, style: AppStyles.UnreadMsgCountDotStyle), + ); + _rightArea.add(Expanded( + child: Align( + alignment: Alignment.bottomCenter, + child: unreadMsgCountText, + ))); + } + + return InkWell( + child: Container( + padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: Color(AppColors.ConversationItemBgColor), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + avatar, + Container(width: 17.0), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(conversation.title, + textScaleFactor: 1.0, + style: TextStyle( + color: Colors.black, + )), + SizedBox( + height: 5, + ), + Text(conversation.desc, + textScaleFactor: 1.0, + style: TextStyle( + fontSize: 12, color: const Color(0xFF9B9B9B))) + ], + ), + ), + // Container(width: 10.0), + SizedBox( + height: Constants.ConversationAvatarSize, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, + children: _rightArea, + ), + ) + ], + ), + ), + onTap: () { + callback(); + }, + ); + } +} + +class ConversActionPage extends StatefulWidget { + ConversActionPage({Key key}) : super(key: key); + + _ConversActionPageState createState() => _ConversActionPageState(); +} + +Map systemInfo = { + 'applyList': null, + 'applyCount': 0, + 'evaluateList': null, + 'evaluateCount': 0, + 'parkList': null, + 'parkCount': 0, + 'castList': null, + 'castCount': 0, + 'walletList': null, + 'walletCount': 0, +}; + +int msgNum = 0; +bool isShowMsg() { + return msgNum > 0; +} + +getAllResNum(prefs) { + getResNum(prefs, Constants.ApplyCount); + getResNum(prefs, Constants.EvaluateCount); + getResNum(prefs, Constants.ParkCount); + getResNum(prefs, Constants.CastCount); + getResNum(prefs, Constants.WalletCount); +} + +getResNum(prefs, url) async { + var count = prefs.getInt(url + UserData().basicInfo.userId.toString()); + systemInfo[url] = count == null ? systemInfo[url] : (systemInfo[url] - count); + + msgNum += systemInfo[url]; +} + +setResNum(url) async { + var localKey = url + UserData().basicInfo.userId.toString(); + if (systemInfo[url] > 0) { + SharedPreferences prefs = await SharedPreferences.getInstance(); + var count = prefs.getInt(localKey); + prefs.setInt( + localKey, count == null ? systemInfo[url] : (systemInfo[url] + count)); + msgNum -= systemInfo[url]; + systemInfo[url] = 0; + } +} + +class _ConversActionPageState extends State + with SingleTickerProviderStateMixin { + TabController tabCtrl; + + void getSystemMsg(data) async { + Map data = { + "userId": UserData().basicInfo.userId, + "type": UserData().basicInfo.sex + }; + data['sign'] = TokenMgr().getSign(data); + + Response res = await HttpUtil().post('message/all/message', data: data); + if (res == null) { + return; + } + Map resData = res.data; + if (resData['code'] == 0) { + SharedPreferences prefs = await SharedPreferences.getInstance(); + systemInfo = resData['data']; + msgNum = 0; + getAllResNum(prefs); + if (mounted) { + setState(() {}); + } + } + } + + @override + void initState() { + super.initState(); + + MessageMgr().on('update_system', getSystemMsg); +// MessageMgr().on('Quit Group', quitGroup); // -// @override -// Widget build(BuildContext context) { -//// List groupList = GroupInfoMgr().groupInfoList; -// -// return Scaffold( -// backgroundColor: Colors.white, -// appBar: AppBar( -// //backgroundColor: Constants.LightGreyBackgroundColor, -// centerTitle: false, -// title: Text( -// I18n.of(context).message_center, -// textScaleFactor: 1.0, -// style: Constants.MainTitleStyle, -// ), -// actions: [ -// Container( -// child: IconButton( -// icon: CircleAvatar( -// backgroundColor: Constants.GreyBackgroundColor, -// radius: 13.75, -// child: Padding( -// padding: EdgeInsets.only(bottom: 1.5), -// child: Icon( -// IconData(0xe659, -// fontFamily: Constants.IconFontFamily), -// color: Constants.BlackTextColor, -// size: 21, -// ))), -// onPressed: () { -// CustomUI().goScanPage(context); -// }, -// ), -// ), -// // InkWell( -// // onTap: () { -// // Navigator.of(context).push( -// // new MaterialPageRoute( -// // builder: (context) { -// // return MessagePushPage(); -// // }, -// // ), -// // ); -// // }, -// // child: Padding( -// // padding: EdgeInsets.only(right: 10), -// // child: CircleAvatar( -// // backgroundColor: Constants.GreyBackgroundColor, -// // radius: 13.75, -// // child: Icon( -// // Icons.settings, -// // color: Constants.BlackTextColor, -// // size: 22, -// // )), -// // )), -// ], -// elevation: 0, -// bottom: PreferredSize( -// preferredSize: Size.fromHeight(28), -// child: Container( -// padding: EdgeInsets.only(left: 2), -// decoration: BoxDecoration( -// //color: Constants.LightGreyBackgroundColor, -// border: -// Border(bottom: BorderSide(color: Color(0xffeaeaea)))), -// alignment: Alignment.centerLeft, -// child: TabBar( -// isScrollable: true, -// indicatorPadding: EdgeInsets.only(left: 9, right: 9), -// tabs: [ +// MessageMgr().on('Update Group List', updateGroupLastMsg); + getSystemMsg(null); + + tabCtrl = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + tabCtrl.dispose(); + MessageMgr().off('update_system', getSystemMsg); + super.dispose(); + } + + @override + Widget build(BuildContext context) { +// List groupList = GroupInfoMgr().groupInfoList; + + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + //backgroundColor: Constants.LightGreyBackgroundColor, + centerTitle: false, + title: Text( + I18n.of(context).message_center, + textScaleFactor: 1.0, + style: Constants.MainTitleStyle, + ), + actions: [ + Container( + child: IconButton( + icon: CircleAvatar( + backgroundColor: Constants.GreyBackgroundColor, + radius: 13.75, + child: Padding( + padding: EdgeInsets.only(bottom: 1.5), + child: Icon( + IconData(0xe659, + fontFamily: Constants.IconFontFamily), + color: Constants.BlackTextColor, + size: 21, + ))), + onPressed: () { + CustomUI().goScanPage(context); + }, + ), + ), + // InkWell( + // onTap: () { + // Navigator.of(context).push( + // new MaterialPageRoute( + // builder: (context) { + // return MessagePushPage(); + // }, + // ), + // ); + // }, + // child: Padding( + // padding: EdgeInsets.only(right: 10), + // child: CircleAvatar( + // backgroundColor: Constants.GreyBackgroundColor, + // radius: 13.75, + // child: Icon( + // Icons.settings, + // color: Constants.BlackTextColor, + // size: 22, + // )), + // )), + ], + elevation: 0, + bottom: PreferredSize( + preferredSize: Size.fromHeight(28), + child: Container( + padding: EdgeInsets.only(left: 2), + decoration: BoxDecoration( + //color: Constants.LightGreyBackgroundColor, + border: + Border(bottom: BorderSide(color: Color(0xffeaeaea)))), + alignment: Alignment.centerLeft, + child: TabBar( + isScrollable: true, + indicatorPadding: EdgeInsets.only(left: 9, right: 9), + tabs: [ + UnreadDot( + child: Container( + margin: EdgeInsets.only(right: 4), + child: Text(I18n.of(context).text_chat, + textScaleFactor: 1.0), + ), + type: 1), // UnreadDot( // child: Container( // margin: EdgeInsets.only(right: 4), -// child: Text(I18n.of(context).text_chat, +// child: Text(I18n.of(context).group_chat, // textScaleFactor: 1.0), // ), -// type: 1), -//// UnreadDot( -//// child: Container( -//// margin: EdgeInsets.only(right: 4), -//// child: Text(I18n.of(context).group_chat, -//// textScaleFactor: 1.0), -//// ), -//// type: 4), -// UnreadDot( -// child: Container( -// margin: EdgeInsets.only(right: 4), -// child: Text(I18n.of(context).system_information, -// textScaleFactor: 1.0)), -// type: 2), -// ], -// controller: tabCtrl, -// ), -// )), -// ), -// body: SafeArea( -// child: TabBarView( -// children: [ -// LastChatPage(), -//// ListView.builder( -////// controller: _scrollController, -//// itemBuilder: (BuildContext context, int index) { -//// if (index == 0) { -//// return _buildCreateButton(); -//// } else { -//// var info = groupList[index - 1]; -//// return GroupItem(ValueKey(info), groupInfoModel: info); -//// } -//// }, -//// itemCount: groupList.length + 1, -//// ), -// ListView( -// children: [ -// SizedBox(height: 8.5), -// _ConversationItem( -// icon: 'assets/images/chat/icon1.png', -// bgColor: Constants.RadioGradient, -// conversation: Conversation( -// avatar: 'assets/images/ic_tx_news.png', -// title: I18n.of(context).radio_message, -// desc: RichTitle.normalTitle( -// systemInfo['castList'], context, InfoType.Radio), -// updateAt: systemInfo['castList'] == null -// ? "" -// : WebData().getLoginTime( -// context, systemInfo['castList']['CreateTime']), -// unreadMsgCount: systemInfo['castCount'], -// ), -// callback: () { -// setResNum(Constants.CastCount); -// Navigator.of(context).push( -// new MaterialPageRoute( -// builder: (context) { -// return InfoListPage( -// title: I18n.of(context).radio_message, -// type: InfoType.Radio, -// ); -// }, -// ), -// ); -// }, -// ), -// _ConversationItem( -// icon: 'assets/images/chat/icon4.png', -// bgColor: Constants.MoneyGradient, -// conversation: Conversation( -// avatar: 'assets/images/ic_tx_news.png', -// title: I18n.of(context).wallet_reminder, -// desc: RichTitle.normalTitle(systemInfo['walletList'], -// context, InfoType.IncomeMoney), -// updateAt: systemInfo['walletList'] == null -// ? "" -// : WebData().getLoginTime( -// context, systemInfo['walletList']['CreateTime']), -// unreadMsgCount: systemInfo['walletCount'], -// ), -// callback: () { -// setResNum(Constants.WalletCount); -// Navigator.of(context).push( -// new MaterialPageRoute( -// builder: (context) { -// return InfoListPage( -// title: I18n.of(context).wallet_reminder, -// type: InfoType.IncomeMoney, -// ); -// }, -// ), -// ); -// }, -// ), -// _ConversationItem( -// icon: 'assets/images/chat/icon3.png', -// iconSize: 27, -// bgColor: Constants.ApplyGradient, -// conversation: Conversation( -// avatar: 'assets/images/ic_tx_news.png', -// title: I18n.of(context).application_notice, -// desc: RichTitle.normalTitle( -// systemInfo['applyList'], context, InfoType.Apply), -// updateAt: systemInfo['applyList'] == null -// ? "" -// : WebData().getLoginTime( -// context, systemInfo['applyList']['CreatTime']), -// unreadMsgCount: systemInfo['applyCount'], -// ), -// callback: () { -// setResNum(Constants.ApplyCount); -// Navigator.of(context).push( -// new MaterialPageRoute( -// builder: (context) { -// return InfoListPage( -// title: I18n.of(context).application_notice, -// type: InfoType.Apply, -// ); -// }, -// ), -// ); -// }, -// ), -// _ConversationItem( -// icon: 'assets/images/chat/icon6.png', -// bgColor: Constants.EvaGradient, -// conversation: Conversation( -// avatar: 'assets/images/ic_tx_news.png', -// title: I18n.of(context).evaluation_notice, -// desc: RichTitle.normalTitle(systemInfo['evaluateList'], -// context, InfoType.Evaluation), -// updateAt: systemInfo['evaluateList'] == null -// ? '' -// : WebData().getLoginTime( -// context, systemInfo['evaluateList']['CreateTime']), -// unreadMsgCount: systemInfo['evaluateCount'], -// ), -// callback: () { -// setResNum(Constants.EvaluateCount); -// Navigator.of(context).push( -// new MaterialPageRoute( -// builder: (context) { -// return InfoListPage( -// title: I18n.of(context).evaluation_notice, -// type: 2, -// ); -// }, -// ), -// ); +// type: 4), + UnreadDot( + child: Container( + margin: EdgeInsets.only(right: 4), + child: Text(I18n.of(context).system_information, + textScaleFactor: 1.0)), + type: 2), + ], + controller: tabCtrl, + ), + )), + ), + body: SafeArea( + child: TabBarView( + children: [ + LastChatPage(), +// ListView.builder( +//// controller: _scrollController, +// itemBuilder: (BuildContext context, int index) { +// if (index == 0) { +// return _buildCreateButton(); +// } else { +// var info = groupList[index - 1]; +// return GroupItem(ValueKey(info), groupInfoModel: info); +// } // }, +// itemCount: groupList.length + 1, // ), -// _ConversationItem( -// icon: 'assets/images/chat/icon5.png', -// bgColor: Constants.ParkGradient, -// conversation: Conversation( -// avatar: 'assets/images/ic_tx_news.png', -// title: I18n.of(context).appName, -// desc: RichTitle.normalTitle( -// systemInfo['parkList'], context, InfoType.System), -// updateAt: systemInfo['parkList'] == null -// ? "" -// : WebData().getLoginTime( -// context, systemInfo['parkList']['CreateTime']), -// unreadMsgCount: systemInfo['parkCount'], -// ), -// callback: () { -// setResNum(Constants.ParkCount); -// Navigator.of(context).push( -// new MaterialPageRoute( -// builder: (context) { -// return InfoListPage( -// title: I18n.of(context).appName, -// type: InfoType.System, -// ); -// }, -// ), -// ); -// }, -// ) -// ], -// ) -// ], -// controller: tabCtrl, -// ))); + ListView( + children: [ + SizedBox(height: 8.5), + _ConversationItem( + icon: 'assets/images/chat/icon1.png', + bgColor: Constants.RadioGradient, + conversation: Conversation( + avatar: 'assets/images/ic_tx_news.png', + title: I18n.of(context).radio_message, + desc: RichTitle.normalTitle( + systemInfo['castList'], context, InfoType.Radio), + updateAt: systemInfo['castList'] == null + ? "" + : WebData().getLoginTime( + context, systemInfo['castList']['CreateTime']), + unreadMsgCount: systemInfo['castCount'], + ), + callback: () { + setResNum(Constants.CastCount); + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return InfoListPage( + title: I18n.of(context).radio_message, + type: InfoType.Radio, + ); + }, + ), + ); + }, + ), + _ConversationItem( + icon: 'assets/images/chat/icon4.png', + bgColor: Constants.MoneyGradient, + conversation: Conversation( + avatar: 'assets/images/ic_tx_news.png', + title: I18n.of(context).wallet_reminder, + desc: RichTitle.normalTitle(systemInfo['walletList'], + context, InfoType.IncomeMoney), + updateAt: systemInfo['walletList'] == null + ? "" + : WebData().getLoginTime( + context, systemInfo['walletList']['CreateTime']), + unreadMsgCount: systemInfo['walletCount'], + ), + callback: () { + setResNum(Constants.WalletCount); + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return InfoListPage( + title: I18n.of(context).wallet_reminder, + type: InfoType.IncomeMoney, + ); + }, + ), + ); + }, + ), + _ConversationItem( + icon: 'assets/images/chat/icon3.png', + iconSize: 27, + bgColor: Constants.ApplyGradient, + conversation: Conversation( + avatar: 'assets/images/ic_tx_news.png', + title: I18n.of(context).application_notice, + desc: RichTitle.normalTitle( + systemInfo['applyList'], context, InfoType.Apply), + updateAt: systemInfo['applyList'] == null + ? "" + : WebData().getLoginTime( + context, systemInfo['applyList']['CreatTime']), + unreadMsgCount: systemInfo['applyCount'], + ), + callback: () { + setResNum(Constants.ApplyCount); + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return InfoListPage( + title: I18n.of(context).application_notice, + type: InfoType.Apply, + ); + }, + ), + ); + }, + ), + _ConversationItem( + icon: 'assets/images/chat/icon6.png', + bgColor: Constants.EvaGradient, + conversation: Conversation( + avatar: 'assets/images/ic_tx_news.png', + title: I18n.of(context).evaluation_notice, + desc: RichTitle.normalTitle(systemInfo['evaluateList'], + context, InfoType.Evaluation), + updateAt: systemInfo['evaluateList'] == null + ? '' + : WebData().getLoginTime( + context, systemInfo['evaluateList']['CreateTime']), + unreadMsgCount: systemInfo['evaluateCount'], + ), + callback: () { + setResNum(Constants.EvaluateCount); + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return InfoListPage( + title: I18n.of(context).evaluation_notice, + type: 2, + ); + }, + ), + ); + }, + ), + _ConversationItem( + icon: 'assets/images/chat/icon5.png', + bgColor: Constants.ParkGradient, + conversation: Conversation( + avatar: 'assets/images/ic_tx_news.png', + title: I18n.of(context).appName, + desc: RichTitle.normalTitle( + systemInfo['parkList'], context, InfoType.System), + updateAt: systemInfo['parkList'] == null + ? "" + : WebData().getLoginTime( + context, systemInfo['parkList']['CreateTime']), + unreadMsgCount: systemInfo['parkCount'], + ), + callback: () { + setResNum(Constants.ParkCount); + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return InfoListPage( + title: I18n.of(context).appName, + type: InfoType.System, + ); + }, + ), + ); + }, + ) + ], + ) + ], + controller: tabCtrl, + ))); + } + + Widget _buildCreateButton() { + List groupList = GroupInfoMgr().groupInfoList; + Widget _avatarIcon = ClipRRect( + borderRadius: BorderRadius.circular(GroupRadius), + child: Container( + color: const Color(0xFFF2F2F2), + height: AvatarSize, + width: AvatarSize, + child: Icon( + IconData(0xe66f, fontFamily: Constants.IconFontFamily), + color: Constants.BlueTextColor, + size: 35, + ), + )); + + Widget _button = InkWell( + onTap: () { + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return CreateGroupPage( + GroupOperatingPageType.CreateGroup, [], null); + }, + ), + ); + }, + child: Container( + padding: EdgeInsets.only(top: 14, bottom: 14), + color: Constants.GreyBackgroundColor, + child: Container( + height: ItemHeight, + decoration: BoxDecoration(color: Colors.white), + child: Row( + children: [ + SizedBox(width: LeftPadding), + _avatarIcon, + SizedBox(width: 14.0), + Text( + I18n.of(context).create_group_chat, + textScaleFactor: 1.0, + style: TextStyle(fontSize: 15.5), + ), + ], + ), + ))); + + Widget tips = Container( + alignment: Alignment.centerLeft, + width: Screen.width, + height: 33.5, + padding: EdgeInsets.only(left: LeftPadding), + decoration: BoxDecoration( + color: Colors.white, + border: Border(bottom: Constants.GreyBorderSide)), + child: Text( + I18n.of(context).group_chat + '(${groupList.length})', + textScaleFactor: 1.0, + ), + ); + + return Column( + children: [ + SizedBox( + height: 10, + ), + CustomUI.buildSearchButton(context, () { + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return GlobalSearchPage( + type: GlobalSearchPageType.SearchGroup, + ); + }, + ), + ); + }, bottom: 10), + _button, + tips, + ], + ); + } + +// quitGroup(args) { +// if (mounted) { +// setState(() { +// print('更新群列表'); +// }); +// } // } // -// Widget _buildCreateButton() { -// List groupList = GroupInfoMgr().groupInfoList; -// Widget _avatarIcon = ClipRRect( -// borderRadius: BorderRadius.circular(GroupRadius), -// child: Container( -// color: const Color(0xFFF2F2F2), -// height: AvatarSize, -// width: AvatarSize, -// child: Icon( -// IconData(0xe66f, fontFamily: Constants.IconFontFamily), -// color: Constants.BlueTextColor, -// size: 35, -// ), -// )); -// -// Widget _button = InkWell( -// onTap: () { -// Navigator.of(context).push( -// new MaterialPageRoute( -// builder: (context) { -// return CreateGroupPage( -// GroupOperatingPageType.CreateGroup, [], null); -// }, -// ), -// ); -// }, -// child: Container( -// padding: EdgeInsets.only(top: 14, bottom: 14), -// color: Constants.GreyBackgroundColor, -// child: Container( -// height: ItemHeight, -// decoration: BoxDecoration(color: Colors.white), -// child: Row( -// children: [ -// SizedBox(width: LeftPadding), -// _avatarIcon, -// SizedBox(width: 14.0), -// Text( -// I18n.of(context).create_group_chat, -// textScaleFactor: 1.0, -// style: TextStyle(fontSize: 15.5), -// ), -// ], -// ), -// ))); -// -// Widget tips = Container( -// alignment: Alignment.centerLeft, -// width: Screen.width, -// height: 33.5, -// padding: EdgeInsets.only(left: LeftPadding), -// decoration: BoxDecoration( -// color: Colors.white, -// border: Border(bottom: Constants.GreyBorderSide)), -// child: Text( -// I18n.of(context).group_chat + '(${groupList.length})', -// textScaleFactor: 1.0, -// ), -// ); -// -// return Column( -// children: [ -// SizedBox( -// height: 10, -// ), -// CustomUI.buildSearchButton(context, () { -// Navigator.of(context).push( -// new MaterialPageRoute( -// builder: (context) { -// return GlobalSearchPage( -// type: GlobalSearchPageType.SearchGroup, -// ); -// }, -// ), -// ); -// }, bottom: 10), -// _button, -// tips, -// ], -// ); +// updateGroupLastMsg(args) async { +// await GroupInfoMgr().sortGroupList(); +// if (mounted) { +// setState(() {}); +// } // } -// -//// quitGroup(args) { -//// if (mounted) { -//// setState(() { -//// print('更新群列表'); -//// }); -//// } -//// } -//// -//// updateGroupLastMsg(args) async { -//// await GroupInfoMgr().sortGroupList(); -//// if (mounted) { -//// setState(() {}); -//// } -//// } -//} +} diff --git a/lib/home/homeMain.dart b/lib/home/homeMain.dart index 7d8ec1a..bc643ba 100644 --- a/lib/home/homeMain.dart +++ b/lib/home/homeMain.dart @@ -34,6 +34,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:chat/utils/my_bottom_navigation_bar.dart' as myBottm; import 'friend_page.dart'; +import 'group_chat_page.dart'; class NavigationIconView { final BottomNavigationBarItem item; @@ -361,79 +362,22 @@ class _HomeMainState extends State { 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 = [ // NavigationIconView( -// title: _titles[1], -// isShowdot: true, +// title: _titles[2], // icon: IconData( -// 0xe60b, +// 0xe67c, // fontFamily: 'iconfont', // ), -// type: 1, -// iconSize: 26.5), +// isShowdot: true, +// iconSize: 29), // NavigationIconView( // title: _titles[0], // isShowdot: true, // iconMargin: EdgeInsets.only(top: 2), // type: 5, // icon: IconData( -// 0xe663, +// 0xe66e, // fontFamily: 'iconfont', // ), // iconSize: 26.5), @@ -445,17 +389,15 @@ class _HomeMainState extends State { // ), // isCenter: true, // iconSize: 31), -// // NavigationIconView( -// title: _titles[3], +// title: _titles[1], // isShowdot: true, // icon: IconData( -// 0xe66e, +// 0xe60b, // fontFamily: 'iconfont', // ), -// type: 4, +// type: 6, // iconSize: 26.5), -// // NavigationIconView( // title: _titles[3], // icon: IconData( @@ -466,16 +408,75 @@ class _HomeMainState extends State { // ]; // // _pages = [ -// ConversActionPage(), -//// RealTimeHelperPage(), +// RealTimeHelperPage(), // FriendPage(), // FindPage(), -//// ConversActionPage(), -// GroupChatListPage(), +// ConversActionPage(), +//// GroupChatListPage(), // ProfilePage( // 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 diff --git a/lib/proto/chat.pb.dart b/lib/proto/chat.pb.dart index a55c830..a19a3ce 100644 --- a/lib/proto/chat.pb.dart +++ b/lib/proto/chat.pb.dart @@ -290,6 +290,38 @@ class QuoteMsg extends $pb.GeneratedMessage { void clearContent() => clearField(5); } +class HumanTransFail extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo('HumanTransFail', package: const $pb.PackageName('yl_pb')) + ..a<$core.int>(1, 'money', $pb.PbFieldType.OU3) + ..a<$core.int>(2, 'ticket', $pb.PbFieldType.OU3) + ..hasRequiredFields = false + ; + + HumanTransFail._() : super(); + factory HumanTransFail() => create(); + factory HumanTransFail.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory HumanTransFail.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + HumanTransFail clone() => HumanTransFail()..mergeFromMessage(this); + HumanTransFail copyWith(void Function(HumanTransFail) updates) => super.copyWith((message) => updates(message as HumanTransFail)); + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static HumanTransFail create() => HumanTransFail._(); + HumanTransFail createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + static HumanTransFail getDefault() => _defaultInstance ??= create()..freeze(); + static HumanTransFail _defaultInstance; + + $core.int get money => $_get(0, 0); + set money($core.int v) { $_setUnsignedInt32(0, v); } + $core.bool hasMoney() => $_has(0); + void clearMoney() => clearField(1); + + $core.int get ticket => $_get(1, 0); + set ticket($core.int v) { $_setUnsignedInt32(1, v); } + $core.bool hasTicket() => $_has(1); + void clearTicket() => clearField(2); +} + class ChatSendReq extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo('ChatSendReq', package: const $pb.PackageName('yl_pb')) ..e(1, 'channelType', $pb.PbFieldType.OE, ChatChannelType.Session, ChatChannelType.valueOf, ChatChannelType.values) diff --git a/lib/proto/chat.pbjson.dart b/lib/proto/chat.pbjson.dart index 3f08fe5..ee800e1 100644 --- a/lib/proto/chat.pbjson.dart +++ b/lib/proto/chat.pbjson.dart @@ -148,6 +148,14 @@ const QuoteMsg$json = const { ], }; +const HumanTransFail$json = const { + '1': 'HumanTransFail', + '2': const [ + const {'1': 'Money', '3': 1, '4': 1, '5': 13, '10': 'Money'}, + const {'1': 'Ticket', '3': 2, '4': 1, '5': 13, '10': 'Ticket'}, + ], +}; + const ChatSendReq$json = const { '1': 'ChatSendReq', '2': const [ diff --git a/lib/proto/chat.proto b/lib/proto/chat.proto index 27c2c5f..eab3d0e 100644 --- a/lib/proto/chat.proto +++ b/lib/proto/chat.proto @@ -9,18 +9,18 @@ enum ChatChannelType { } enum ChatType { - TextChatType = 0; //文字聊天 - ImageChatType = 1; //图片 - ShortVoiceChatType = 2; //短语音 - ShortVideoChatType = 3; //短视频 - RealtimeCallVoiceType = 4; //实时通话-语音 - RealtimeCallVideoType = 5; //实时通话-视频 - RedWalletChatType = 6; //红包 - PlaceChatType = 7; //地址类型 - EmoticonType = 8; //表情 - GroupChatNoticeType = 9; //群公告类型 - GiftChatType = 10; //礼物聊天类型 - FileChatType = 11; //文件聊天类型 + TextChatType = 0; //文字聊天 + ImageChatType = 1; //图片 + ShortVoiceChatType = 2; //短语音 + ShortVideoChatType = 3; //短视频 + RealtimeCallVoiceType = 4; //实时通话-语音 + RealtimeCallVideoType = 5; //实时通话-视频 + RedWalletChatType = 6; //红包 + PlaceChatType = 7; //地址类型 + EmoticonType = 8; //表情 + GroupChatNoticeType = 9; //群公告类型 + GiftChatType = 10; //礼物聊天类型 + FileChatType = 11; //文件聊天类型 } enum RedWalletState { @@ -88,6 +88,12 @@ message QuoteMsg{ optional string Content = 5; //消息附件地址 } +//翻译失败返回消息结果 +message HumanTransFail { + optional uint32 Money = 1; //退回h币 + optional uint32 Ticket = 2; //退回翻译券 +} + //-------------------------------------------------------------------------消息-------------------------------------------------------------------------------------------------- // MsgId=1 聊天消息发送请求 message ChatSendReq { diff --git a/pubspec.lock b/pubspec.lock index e8016b3..11aeae3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -418,7 +418,7 @@ packages: name: flutter_inapp_purchase url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.6" + version: "2.0.4" flutter_local_notifications: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 5e04abf..d34cf33 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: chat description: A new Flutter project. #修改版本号后get-clean -version: 1.1.0+15 +version: 1.1.1+16 environment: sdk: ">=2.1.0 <3.0.0"