From dd038ad43ad0d0168288f360db583fb79399a736 Mon Sep 17 00:00:00 2001 From: KerwinZheng <772112648@qq.com> Date: Thu, 2 Apr 2020 18:13:48 +0800 Subject: [PATCH] 1 --- i18n/vi-VN.json | 2 +- lib/chat/company_server_view.dart | 2 +- lib/chat/download_item.dart | 20 ++++++++++++-------- lib/chat/input_bar.dart | 2 +- lib/home/AddProgram.dart | 2 +- lib/home/InformUser.dart | 2 +- lib/home/ProfilePage.dart | 29 ++++++++++++++++++++--------- 7 files changed, 37 insertions(+), 22 deletions(-) diff --git a/i18n/vi-VN.json b/i18n/vi-VN.json index 3189d6a..84df8d9 100644 --- a/i18n/vi-VN.json +++ b/i18n/vi-VN.json @@ -723,7 +723,7 @@ "she_liar": "Em ấy là một kẻ lừa đảo", "he_liar": "Anh ấy là một kẻ lừa đảo", "provide_screenshots": "Xin cung cấp ảnh chụp màn hình liên quan để chúng tôi theo dõi xác thực", - "describe_details": "Vui lòng mô tả chi tiết (trong vòng 100 từ)", + "describe_details": "Vui lòng mô tả chi tiết(trong vòng 100 ký tự)", "report_reason": "Vui lòng chọn lý do báo cáo", "report_success2": "Báo cáo thành công", "successfully_modified": "Đã sửa đổi thành công", diff --git a/lib/chat/company_server_view.dart b/lib/chat/company_server_view.dart index 8de0f58..a33b439 100644 --- a/lib/chat/company_server_view.dart +++ b/lib/chat/company_server_view.dart @@ -169,7 +169,7 @@ class _CompanyServerPageState extends State { for (var i = 0; i < resultList.length; i++) { Asset photoEntity = resultList[i]; ByteData byteData = await photoEntity.getByteData(); - File file = await FileCacheMgr().writeFile('temp-photo-${DateTime.now().millisecondsSinceEpoch}-${photoEntity.name}', byteData.buffer.asInt8List(0)); + File file = await FileCacheMgr().writeFile('temp-photo-${DateTime.now().millisecondsSinceEpoch}.png', byteData.buffer.asInt8List(0)); _sendPhotoFile(file); } } diff --git a/lib/chat/download_item.dart b/lib/chat/download_item.dart index 44297da..cdddc69 100644 --- a/lib/chat/download_item.dart +++ b/lib/chat/download_item.dart @@ -13,13 +13,14 @@ class DownloadItem extends StatefulWidget { final bool isAutoDown; final Function onComplete; final Function onFinishTap; - DownloadItem( - {this.msg, - this.child, - this.isShowProgress = true, - this.isAutoDown = true, - this.onComplete, - this.onFinishTap}); + DownloadItem({ + this.msg, + this.child, + this.isShowProgress = true, + this.isAutoDown = true, + this.onComplete, + this.onFinishTap, + }); @override _DownloadItemState createState() => _DownloadItemState(); } @@ -134,7 +135,10 @@ class _DownloadItemState extends State { onTap: isNeedDown ? downloadRes : widget.onFinishTap, child: Stack( alignment: Alignment.center, - children: [widget.child, _downloadWidget()], + children: [ + widget.child, + _downloadWidget(), + ], )); } } diff --git a/lib/chat/input_bar.dart b/lib/chat/input_bar.dart index bce93f5..8e7f1ba 100644 --- a/lib/chat/input_bar.dart +++ b/lib/chat/input_bar.dart @@ -771,7 +771,7 @@ class InputBarState extends State Asset photoEntity = resultList[i]; ByteData byteData = await photoEntity.getByteData(); File file = await FileCacheMgr().writeFile( - 'temp-photo-${DateTime.now().millisecondsSinceEpoch}-${photoEntity.name}', + 'temp-photo-${DateTime.now().millisecondsSinceEpoch}.png', byteData.buffer.asInt8List(0)); _sendPhotoFile(file); } diff --git a/lib/home/AddProgram.dart b/lib/home/AddProgram.dart index 1ec8966..27f6ec4 100644 --- a/lib/home/AddProgram.dart +++ b/lib/home/AddProgram.dart @@ -732,7 +732,7 @@ class _AddProgramState extends State { Asset photoEntity = resultList[i]; print('名字:${photoEntity.name}'); ByteData byteData = await photoEntity.getByteData(); - File file = await FileCacheMgr().writeFile('temp-photo-${DateTime.now().millisecondsSinceEpoch}-${photoEntity.name}', byteData.buffer.asInt8List(0)); + File file = await FileCacheMgr().writeFile('temp-photo-${DateTime.now().millisecondsSinceEpoch}.png', byteData.buffer.asInt8List(0)); fileList.add(file); } diff --git a/lib/home/InformUser.dart b/lib/home/InformUser.dart index 8dbc889..1ad700d 100644 --- a/lib/home/InformUser.dart +++ b/lib/home/InformUser.dart @@ -201,7 +201,7 @@ class _InformUserPageState extends State { for (var i = 0; i < resultList.length; i++) { Asset photoEntity = resultList[i]; ByteData byteData = await photoEntity.getByteData(); - File file = await FileCacheMgr().writeFile('temp-photo-${DateTime.now().millisecondsSinceEpoch}-${photoEntity.name}', byteData.buffer.asInt8List(0)); + File file = await FileCacheMgr().writeFile('temp-photo-${DateTime.now().millisecondsSinceEpoch}.png', byteData.buffer.asInt8List(0)); fileList.add(file); } Map data = {"type": 3, "userId": UserData().basicInfo.userId}; diff --git a/lib/home/ProfilePage.dart b/lib/home/ProfilePage.dart index 66eea87..5be2db1 100644 --- a/lib/home/ProfilePage.dart +++ b/lib/home/ProfilePage.dart @@ -434,8 +434,10 @@ class _ProfilePageState extends State // } int leftLength = MaxImgSize - imgList.length; - if(leftLength <=0){ - showToast(I18n.of(context).max_upload_size.replaceFirst('/s1', MaxImgSize.toString())); + if (leftLength <= 0) { + showToast(I18n.of(context) + .max_upload_size + .replaceFirst('/s1', MaxImgSize.toString())); return; } List resultList = List(); @@ -461,7 +463,7 @@ class _ProfilePageState extends State print('名字:${photoEntity.name}'); ByteData byteData = await photoEntity.getByteData(); File file = await FileCacheMgr().writeFile( - 'temp-photo-${DateTime.now().millisecondsSinceEpoch}-${photoEntity.name}', + 'temp-photo-${DateTime.now().millisecondsSinceEpoch}.png', byteData.buffer.asInt8List(0)); fileList.add(file); @@ -483,8 +485,8 @@ class _ProfilePageState extends State showToast(I18n.of(context).hava_error_photo); } MessageMgr().emit('refresh_photo'); - }else{ - showToast(resData['msg']); + } else { + showToast(resData['msg']); } } @@ -1382,8 +1384,8 @@ class _ProfilePageState extends State return; } var moneyList = []; - for(int i = 0 ; i< imgList.length;i++){ - if(imgList[i]['Status'] == 1){ + for (int i = 0; i < imgList.length; i++) { + if (imgList[i]['Status'] == 1) { moneyList.add(imgList[i]); } } @@ -1869,6 +1871,15 @@ class _ProfilePageState extends State } } + clickChatAccout() { + if (widget.fromWhere != null && widget.fromWhere == 0) { + ///如果是聊天界面跳转过来的,直接返回 + Navigator.of(context).pop(); + } else { + testChatPermission(() {}); + } + } + buyPhoto() { //女性用户付费,男性用户会员的话免费解锁,非会员付费解锁 becomeVip() { @@ -1983,12 +1994,12 @@ class _ProfilePageState extends State _bottomBorderBox(I18n.of(context).expect_lover, lovePeople, true, () {}), (userInfo.wechat != null && userInfo.wechat != '') ? _bottomBorderBox( - I18n.of(context).wechat_number, wechat, true, buyChatAccount, + I18n.of(context).wechat_number, wechat, true, clickChatAccout, showIcon: !isAuthority) : Container(), (userInfo.facebook != null && userInfo.facebook != '') ? _bottomBorderBox( - I18n.of(context).facebook, facebook, true, buyChatAccount, + I18n.of(context).facebook, facebook, true, clickChatAccout, showIcon: !isAuthority) : Container(), userInfo.ownMsg != null && userInfo.ownMsg != ''