From 0c50ae9c6bfc76348a0cb3d35b614eafbfbe251c Mon Sep 17 00:00:00 2001 From: ZCM <772112648@qq.com> Date: Fri, 10 Apr 2020 14:11:18 +0800 Subject: [PATCH] 1 --- android/app/build.gradle | 6 ++-- lib/chat/ChatPageItem.dart | 22 +++++++------ lib/chat/group_chat_item.dart | 23 +++++++------- lib/chat/input_bar.dart | 6 ++-- lib/home/photo_page.dart | 58 ++++++++++++++++++++++++++++++++++- lib/models/ChatMsg.dart | 2 +- 6 files changed, 89 insertions(+), 28 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2964d4e..77fbfd9 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', diff --git a/lib/chat/ChatPageItem.dart b/lib/chat/ChatPageItem.dart index 8e64096..26318cd 100644 --- a/lib/chat/ChatPageItem.dart +++ b/lib/chat/ChatPageItem.dart @@ -433,17 +433,19 @@ class _ChatPageItemState extends State quoteItem['showTimeStr'], quoteItem['quoteContent'], true)); } var contentWidth = _getTextWidth(textList[curTextType]); - width = min(max(contentWidth, width),maxWidth); + width = min(max(contentWidth, width), maxWidth); - showMsg.add(Container( - constraints: BoxConstraints(maxWidth: maxWidth, minHeight: 22), - alignment: Alignment.centerLeft, - child: extendedText( - textList[curTextType], - color: isUrl ? Colors.blue : Constants.BlackTextColor, - hideKeyboard: widget.hideKeyboard, - fontSize: FontSize, - ))); + if (textList[curTextType] != '') { + showMsg.add(Container( + constraints: BoxConstraints(maxWidth: maxWidth, minHeight: 22), + alignment: Alignment.centerLeft, + child: extendedText( + textList[curTextType], + color: isUrl ? Colors.blue : Constants.BlackTextColor, + hideKeyboard: widget.hideKeyboard, + fontSize: FontSize, + ))); + } return Container( constraints: BoxConstraints(maxWidth: Screen.width - 120), diff --git a/lib/chat/group_chat_item.dart b/lib/chat/group_chat_item.dart index 2cbe02b..a29f525 100644 --- a/lib/chat/group_chat_item.dart +++ b/lib/chat/group_chat_item.dart @@ -397,18 +397,19 @@ class _GroupChatPageItemState extends State quoteItem['showTimeStr'], quoteItem['quoteContent'], true)); } var contentWidth = _getTextWidth(textList[curTextType]); - width = min(max(contentWidth, width),maxWidth); + width = min(max(contentWidth, width), maxWidth); - - showMsg.add(Container( - constraints: BoxConstraints(maxWidth: maxWidth, minHeight: 22), - alignment: Alignment.centerLeft, - child: extendedText( - textList[curTextType], - color: isUrl ? Colors.blue : Constants.BlackTextColor, - hideKeyboard: widget.hideKeyboard, - fontSize: FontSize, - ))); + if (textList[curTextType] != '') { + showMsg.add(Container( + constraints: BoxConstraints(maxWidth: maxWidth, minHeight: 22), + alignment: Alignment.centerLeft, + child: extendedText( + textList[curTextType], + color: isUrl ? Colors.blue : Constants.BlackTextColor, + hideKeyboard: widget.hideKeyboard, + fontSize: FontSize, + ))); + } return Container( constraints: BoxConstraints(maxWidth: Screen.width - 120), diff --git a/lib/chat/input_bar.dart b/lib/chat/input_bar.dart index 94b56ea..28a78ba 100644 --- a/lib/chat/input_bar.dart +++ b/lib/chat/input_bar.dart @@ -143,6 +143,7 @@ class InputBarState extends State print('处理引用消息'); setState(() { + _isComposingMessage = true; showKeyBoard(); }); } @@ -196,7 +197,8 @@ class InputBarState extends State var postion = alterPosition[i]; if (currentIndex >= postion.startIndex && currentIndex < postion.endIndex) { - result = originalInputStr.replaceRange(postion.startIndex, postion.endIndex, ''); + result = originalInputStr.replaceRange( + postion.startIndex, postion.endIndex, ''); starIndex = postion.startIndex; alterPosition.removeAt(i); break; @@ -893,7 +895,7 @@ class InputBarState extends State } bool checkMessage() { - if (_textCtrl.text.length == 0) { + if (_textCtrl.text.length == 0 && refMsg == null) { showToast(I18n.of(context).msg_not); return false; } diff --git a/lib/home/photo_page.dart b/lib/home/photo_page.dart index 9ea5858..eb1d987 100644 --- a/lib/home/photo_page.dart +++ b/lib/home/photo_page.dart @@ -23,7 +23,9 @@ import 'package:multi_image_picker/multi_image_picker.dart'; import 'package:oktoast/oktoast.dart'; import 'package:provider/provider.dart'; +import 'VerificationCenter.dart'; import 'VipPage.dart'; +import 'money_picture_view.dart'; const double LeftSize = 80; const MaxImgSize = 20; @@ -151,7 +153,47 @@ class _PhotoPageState extends State { leading: CustomUI.buildCustomLeading(context), titleSpacing: -10, centerTitle: true, - elevation: 1), + elevation: 1, + actions: [ + !isMan && isMyself + ? Container( + alignment: Alignment.center, + child: new InkWell( + child: new Padding( + padding: EdgeInsets.only( + right: 15, left: 15, top: 10, bottom: 10), + child: new Text( + I18n.of(context).set_photo, + textScaleFactor: 1.0, + style: TextStyle(color: Constants.BlueTextColor,fontSize: 12), + ), + ), + onTap: () { + if (!widget.userInfo.isAttestation) { + _buildNotTrue(); + return; + } + if (imgList.length == 0) { + showToast(I18n.of(context).no_photos); + return; + } + var moneyList = []; + for (int i = 0; i < resultList.length; i++) { + if (resultList[i]['Status'] == 1) { + moneyList.add(resultList[i]); + } + } + Navigator.of(context) + .push(new MaterialPageRoute(builder: (context) { + return MoneyPicture( + imageList: moneyList, + ); + })); + }, + ), + ) + : Container() + ]), backgroundColor: Colors.white, body: SafeArea( child: SingleChildScrollView( @@ -162,6 +204,20 @@ class _PhotoPageState extends State { return CustomUI.buildPageLoading(context, content, !isLoadingFinish); } + void _buildNotTrue() { + CustomUI.buildOneConfirm(context, I18n.of(context).moneyPageTip, + I18n.of(context).authenticate_now, () { + Navigator.pop(context); + Navigator.of(context).push( + new MaterialPageRoute( + builder: (context) { + return VerificationCenterPage(); + }, + ), + ); + }); + } + buyPhoto() { //女性用户付费,男性用户会员的话免费解锁,非会员付费解锁 becomeVip() { diff --git a/lib/models/ChatMsg.dart b/lib/models/ChatMsg.dart index 43d6ff0..b8162cf 100644 --- a/lib/models/ChatMsg.dart +++ b/lib/models/ChatMsg.dart @@ -194,6 +194,6 @@ class MsgModel { } } - return textList; + return textList.length == 0 ? [''] : textList; } }