ZCM 5 years ago
parent
commit
0c50ae9c6b
6 changed files with 89 additions and 28 deletions
  1. +3
    -3
      android/app/build.gradle
  2. +12
    -10
      lib/chat/ChatPageItem.dart
  3. +12
    -11
      lib/chat/group_chat_item.dart
  4. +4
    -2
      lib/chat/input_bar.dart
  5. +57
    -1
      lib/home/photo_page.dart
  6. +1
    -1
      lib/models/ChatMsg.dart

+ 3
- 3
android/app/build.gradle View File

@@ -56,9 +56,9 @@ android {
// manifestPlaceholders = [ // manifestPlaceholders = [
// AMAP_KEY : "1fd4e93e3b4b13747da41f484c955fe2", /// 高德地图key // AMAP_KEY : "1fd4e93e3b4b13747da41f484c955fe2", /// 高德地图key
// ] // ]
// ndk {
// abiFilters 'armeabi-v7a'
// }
// ndk {
// abiFilters 'armeabi-v7a'
// }
multiDexEnabled true multiDexEnabled true
manifestPlaceholders = [ manifestPlaceholders = [
JPUSH_PKGNAME : 'com.cyhd.henhoandroid', JPUSH_PKGNAME : 'com.cyhd.henhoandroid',


+ 12
- 10
lib/chat/ChatPageItem.dart View File

@@ -433,17 +433,19 @@ class _ChatPageItemState extends State<ChatPageItem>
quoteItem['showTimeStr'], quoteItem['quoteContent'], true)); quoteItem['showTimeStr'], quoteItem['quoteContent'], true));
} }
var contentWidth = _getTextWidth(textList[curTextType]); 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( return Container(
constraints: BoxConstraints(maxWidth: Screen.width - 120), constraints: BoxConstraints(maxWidth: Screen.width - 120),


+ 12
- 11
lib/chat/group_chat_item.dart View File

@@ -397,18 +397,19 @@ class _GroupChatPageItemState extends State<GroupChatPageItem>
quoteItem['showTimeStr'], quoteItem['quoteContent'], true)); quoteItem['showTimeStr'], quoteItem['quoteContent'], true));
} }
var contentWidth = _getTextWidth(textList[curTextType]); 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( return Container(
constraints: BoxConstraints(maxWidth: Screen.width - 120), constraints: BoxConstraints(maxWidth: Screen.width - 120),


+ 4
- 2
lib/chat/input_bar.dart View File

@@ -143,6 +143,7 @@ class InputBarState extends State<InputBar>
print('处理引用消息'); print('处理引用消息');
setState(() { setState(() {
_isComposingMessage = true;
showKeyBoard(); showKeyBoard();
}); });
} }
@@ -196,7 +197,8 @@ class InputBarState extends State<InputBar>
var postion = alterPosition[i]; var postion = alterPosition[i];
if (currentIndex >= postion.startIndex && if (currentIndex >= postion.startIndex &&
currentIndex < postion.endIndex) { currentIndex < postion.endIndex) {
result = originalInputStr.replaceRange(postion.startIndex, postion.endIndex, '');
result = originalInputStr.replaceRange(
postion.startIndex, postion.endIndex, '');
starIndex = postion.startIndex; starIndex = postion.startIndex;
alterPosition.removeAt(i); alterPosition.removeAt(i);
break; break;
@@ -893,7 +895,7 @@ class InputBarState extends State<InputBar>
} }
bool checkMessage() { bool checkMessage() {
if (_textCtrl.text.length == 0) {
if (_textCtrl.text.length == 0 && refMsg == null) {
showToast(I18n.of(context).msg_not); showToast(I18n.of(context).msg_not);
return false; return false;
} }


+ 57
- 1
lib/home/photo_page.dart View File

@@ -23,7 +23,9 @@ import 'package:multi_image_picker/multi_image_picker.dart';
import 'package:oktoast/oktoast.dart'; import 'package:oktoast/oktoast.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';


import 'VerificationCenter.dart';
import 'VipPage.dart'; import 'VipPage.dart';
import 'money_picture_view.dart';


const double LeftSize = 80; const double LeftSize = 80;
const MaxImgSize = 20; const MaxImgSize = 20;
@@ -151,7 +153,47 @@ class _PhotoPageState extends State<PhotoPage> {
leading: CustomUI.buildCustomLeading(context), leading: CustomUI.buildCustomLeading(context),
titleSpacing: -10, titleSpacing: -10,
centerTitle: true, centerTitle: true,
elevation: 1),
elevation: 1,
actions: <Widget>[
!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, backgroundColor: Colors.white,
body: SafeArea( body: SafeArea(
child: SingleChildScrollView( child: SingleChildScrollView(
@@ -162,6 +204,20 @@ class _PhotoPageState extends State<PhotoPage> {
return CustomUI.buildPageLoading(context, content, !isLoadingFinish); 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() { buyPhoto() {
//女性用户付费,男性用户会员的话免费解锁,非会员付费解锁 //女性用户付费,男性用户会员的话免费解锁,非会员付费解锁
becomeVip() { becomeVip() {


+ 1
- 1
lib/models/ChatMsg.dart View File

@@ -194,6 +194,6 @@ class MsgModel {
} }
} }
return textList;
return textList.length == 0 ? [''] : textList;
} }
} }

Loading…
Cancel
Save