瀏覽代碼

修复bug:

1.搜索界面下拉刷新双图标问题。
2.连麦,私聊拉黑及时性问题
3.编辑资料名字文本框长度限制
master
ZCM 5 年之前
父節點
當前提交
e972171164
共有 14 個檔案被更改,包括 153 行新增70 行删除
  1. +3
    -1
      i18n/en-US.json
  2. +3
    -1
      i18n/ja-JP.json
  3. +3
    -1
      i18n/ko-KR.json
  4. +3
    -1
      i18n/vi-VN.json
  5. +3
    -1
      i18n/zh-CN.json
  6. +3
    -1
      i18n/zh-HK.json
  7. +2
    -7
      lib/chat/ChatPage.dart
  8. +27
    -34
      lib/chat/util_keyboard.dart
  9. +77
    -8
      lib/generated/i18n.dart
  10. +5
    -11
      lib/home/ProfilePage.dart
  11. +2
    -2
      lib/home/SearchPage.dart
  12. +2
    -1
      lib/map/google_map_location_picker.dart
  13. +2
    -1
      lib/map/search_input.dart
  14. +18
    -0
      lib/utils/blacklist_mgr.dart

+ 3
- 1
i18n/en-US.json 查看文件

@@ -1160,5 +1160,7 @@
"not_add_Myself":"你不能添加自己", "not_add_Myself":"你不能添加自己",
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到"
"send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置"
} }

+ 3
- 1
i18n/ja-JP.json 查看文件

@@ -1160,5 +1160,7 @@
"not_add_Myself":"你不能添加自己", "not_add_Myself":"你不能添加自己",
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到"
"send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置"
} }

+ 3
- 1
i18n/ko-KR.json 查看文件

@@ -1159,5 +1159,7 @@
"not_have_user":"用户不存在", "not_have_user":"用户不存在",
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到"
"send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置"
} }

+ 3
- 1
i18n/vi-VN.json 查看文件

@@ -1160,5 +1160,7 @@
"not_add_Myself":"你不能添加自己", "not_add_Myself":"你不能添加自己",
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到"
"send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置"
} }

+ 3
- 1
i18n/zh-CN.json 查看文件

@@ -1160,5 +1160,7 @@
"not_add_Myself":"你不能添加自己", "not_add_Myself":"你不能添加自己",
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "发送到"
"send_to": "发送到",
"search_plach":"搜索位置",
"finding_place":"查找位置"
} }

+ 3
- 1
i18n/zh-HK.json 查看文件

@@ -1160,5 +1160,7 @@
"not_add_Myself":"你不能添加自己", "not_add_Myself":"你不能添加自己",
"you_are_blaklisted":"對方已拉黑了你", "you_are_blaklisted":"對方已拉黑了你",
"confrim_recovery":"確定恢復已被焚毀的照片嗎?\n(已經看過的用戶可以再看一次)", "confrim_recovery":"確定恢復已被焚毀的照片嗎?\n(已經看過的用戶可以再看一次)",
"send_to": "發送到"
"send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置"
} }

+ 2
- 7
lib/chat/ChatPage.dart 查看文件

@@ -36,6 +36,7 @@ import 'ChatPageItem.dart';
import 'input_bar.dart'; import 'input_bar.dart';
import 'package:chat/utils/PopUpMenu.dart' as myPop; 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 {
final int friendId; final int friendId;
final int enterType; // 0默认 1图片 final int enterType; // 0默认 1图片
@@ -479,13 +480,7 @@ class _ChatPageState extends State<ChatPage> {
sendMsg(MsgModel msg) { sendMsg(MsgModel msg) {
print('对方是否拉黑你 ${friendInfo.isBlackened}'); print('对方是否拉黑你 ${friendInfo.isBlackened}');
if (BlacklistMgr.isBlaklistMe(friendInfo.userId)) {
showToast(I18n.of(context).you_are_blaklisted);
return;
}
if (BlacklistMgr.isInMyblaklist(friendInfo.userId)) {
showToast(I18n.of(context).reject_message);
if (BlacklistMgr.isBlack(friendInfo.userId)) {
return; return;
} }


+ 27
- 34
lib/chat/util_keyboard.dart 查看文件

@@ -32,7 +32,6 @@ import 'package:file_picker/file_picker.dart';
import '../r.dart'; import '../r.dart';
class UtilKeyboard extends StatelessWidget { class UtilKeyboard extends StatelessWidget {
final double keyboardHeight; final double keyboardHeight;
final Function sendMsg; final Function sendMsg;
@@ -163,13 +162,8 @@ class UtilKeyboard extends StatelessWidget {
showToast(I18n.of(context).cantt_voice); showToast(I18n.of(context).cantt_voice);
return; return;
} }
if (BlacklistMgr.isBlaklistMe(info.userId)) {
showToast(I18n.of(context).you_are_blaklisted);
return;
}
if (BlacklistMgr.isInMyblaklist(info.userId)) {
showToast(I18n.of(context).reject_message);
if (BlacklistMgr.isBlack(info.userId)) {
return; return;
} }
@@ -303,39 +297,38 @@ class UtilKeyboard extends StatelessWidget {
int fileSize = file.lengthSync(); int fileSize = file.lengthSync();
print('选择的文件 ${file.path} 大小 $fileSize'); print('选择的文件 ${file.path} 大小 $fileSize');
if (fileSize > 33 * 1024 * 1024) {
showToast('文件大于33M');
return;
}
int friendId = 0;
if (!isGroup) {
friendId = Provider.of<int>(context);
}
if (fileSize > 33 * 1024 * 1024) {
showToast('文件大于33M');
return;
}
var fileName = file.path.split('/').last;
print('fileName $fileName');
int friendId = 0;
if (!isGroup) {
friendId = Provider.of<int>(context);
}
var ext = '';
var extList = fileName.split('.');
if (extList.length > 1) {
ext = extList.last;
}
print('ext $ext');
var fileName = file.path.split('/').last;
print('fileName $fileName');
var fileMsg = FileChat.create();
fileMsg.type = ext;
fileMsg.size = fileSize;
fileMsg.name = fileName;
var ext = '';
var extList = fileName.split('.');
if (extList.length > 1) {
ext = extList.last;
}
print('ext $ext');
var msg = MsgHandler.createSendMsg(ChatType.FileChatType, fileMsg.writeToBuffer(),
friendId: friendId,
localFile: file.path,
channelType:
isGroup ? ChatChannelType.Group : ChatChannelType.Session);
var fileMsg = FileChat.create();
fileMsg.type = ext;
fileMsg.size = fileSize;
fileMsg.name = fileName;
sendMsg(msg);
var msg = MsgHandler.createSendMsg(
ChatType.FileChatType, fileMsg.writeToBuffer(),
friendId: friendId,
localFile: file.path,
channelType: isGroup ? ChatChannelType.Group : ChatChannelType.Session);
sendMsg(msg);
} }
void _sendVideo(BuildContext context) async { void _sendVideo(BuildContext context) async {


+ 77
- 8
lib/generated/i18n.dart 查看文件

@@ -2357,6 +2357,10 @@ class I18n implements WidgetsLocalizations {
String get confrim_recovery => "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)"; String get confrim_recovery => "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)";
/// "發送到" /// "發送到"
String get send_to => "發送到"; String get send_to => "發送到";
/// "搜索位置"
String get search_plach => "搜索位置";
/// "查找位置"
String get finding_place => "查找位置";
} }


class _I18n_en_US extends I18n { class _I18n_en_US extends I18n {
@@ -5846,8 +5850,7 @@ class _I18n_vi_VN extends I18n {
/// "你不能添加自己" /// "你不能添加自己"
@override @override
String get not_add_Myself => "你不能添加自己"; String get not_add_Myself => "你不能添加自己";

/// "对方已拉黑了你"
/// "对方已拉黑了你"
@override @override
String get you_are_blaklisted => "对方已拉黑了你"; String get you_are_blaklisted => "对方已拉黑了你";
/// "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)" /// "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)"
@@ -5856,6 +5859,12 @@ class _I18n_vi_VN extends I18n {
/// "發送到" /// "發送到"
@override @override
String get send_to => "發送到"; String get send_to => "發送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";


@override @override
TextDirection get textDirection => TextDirection.ltr; TextDirection get textDirection => TextDirection.ltr;
@@ -8840,9 +8849,9 @@ class _I18n_zh_HK extends I18n {
/// "今日簽到可領取/s1積分" /// "今日簽到可領取/s1積分"
@override @override
String get today_score => "今日簽到可領取/s1積分"; String get today_score => "今日簽到可領取/s1積分";
/// "1、每日簽到可領取積分,累計天數越多積分越高\n2、積分可兌換H幣,兌換將消耗對應積分,請慎重兌換\n3、每月最後一天將重置簽到,清零積分,請記得及時兌換"
/// "1、每日簽到可領取積分,累計天數越多積分越高\n2、積分可兌換H幣,兌換將消耗對應積分,請慎重兌換\n3、每月最後一天將重置簽到,清零積分,請記得及時兌換"
@override @override
String get sign_tips => "1、每日簽到可領取積分,累計天數越多積分越高\n2、積分可兌換H幣,兌換將消耗對應積分,請慎重兌換\n3、每月最後一天將重置簽到,清零積分,請記得及時兌換";
String get sign_tips => "1、每日簽到可領取積分,累計天數越多積分越高\n2、積分可兌換H幣,兌換將消耗對應積分,請慎重兌換\n3、每月最後一天將重置簽到,清零積分,請記得及時兌換";
/// "簽到" /// "簽到"
@override @override
String get sign_in => "簽到"; String get sign_in => "簽到";
@@ -9341,6 +9350,21 @@ class _I18n_zh_HK extends I18n {
/// "你不能添加自己" /// "你不能添加自己"
@override @override
String get not_add_Myself => "你不能添加自己"; String get not_add_Myself => "你不能添加自己";
/// "對方已拉黑了你"
@override
String get you_are_blaklisted => "對方已拉黑了你";
/// "確定恢復已被焚毀的照片嗎?\n(已經看過的用戶可以再看一次)"
@override
String get confrim_recovery => "確定恢復已被焚毀的照片嗎?\n(已經看過的用戶可以再看一次)";
/// "發送到"
@override
String get send_to => "發送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";


@override @override
TextDirection get textDirection => TextDirection.ltr; TextDirection get textDirection => TextDirection.ltr;
@@ -12325,9 +12349,9 @@ class _I18n_zh_CN extends _I18n_zh_HK {
/// "今日签到可领取/s1积分" /// "今日签到可领取/s1积分"
@override @override
String get today_score => "今日签到可领取/s1积分"; String get today_score => "今日签到可领取/s1积分";
/// "1、每日签到可领取积分,累计天数越多积分越高\n2、积分可兑换H币,兑换将消耗对应积分,请慎重兑换\n3、每月最后一天将重置签到,清零积分,请记得及时兑换"
/// "1、每日签到可领取积分,累计天数越多积分越高\n2、积分可兑换H币,兑换将消耗对应积分,请慎重兑换\n3、每月最后一天将重置签到,清零积分,请记得及时兑换"
@override @override
String get sign_tips => "1、每日签到可领取积分,累计天数越多积分越高\n2、积分可兑换H币,兑换将消耗对应积分,请慎重兑换\n3、每月最后一天将重置签到,清零积分,请记得及时兑换";
String get sign_tips => "1、每日签到可领取积分,累计天数越多积分越高\n2、积分可兑换H币,兑换将消耗对应积分,请慎重兑换\n3、每月最后一天将重置签到,清零积分,请记得及时兑换";
/// "签到" /// "签到"
@override @override
String get sign_in => "签到"; String get sign_in => "签到";
@@ -12826,6 +12850,21 @@ class _I18n_zh_CN extends _I18n_zh_HK {
/// "你不能添加自己" /// "你不能添加自己"
@override @override
String get not_add_Myself => "你不能添加自己"; String get not_add_Myself => "你不能添加自己";
/// "对方已拉黑了你"
@override
String get you_are_blaklisted => "对方已拉黑了你";
/// "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)"
@override
String get confrim_recovery => "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)";
/// "发送到"
@override
String get send_to => "发送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";


@override @override
TextDirection get textDirection => TextDirection.ltr; TextDirection get textDirection => TextDirection.ltr;
@@ -16308,6 +16347,21 @@ class _I18n_ko_KR extends I18n {
/// "用户不存在" /// "用户不存在"
@override @override
String get not_have_user => "用户不存在"; String get not_have_user => "用户不存在";
/// "对方已拉黑了你"
@override
String get you_are_blaklisted => "对方已拉黑了你";
/// "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)"
@override
String get confrim_recovery => "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)";
/// "發送到"
@override
String get send_to => "發送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";


@override @override
TextDirection get textDirection => TextDirection.ltr; TextDirection get textDirection => TextDirection.ltr;
@@ -19292,9 +19346,9 @@ class _I18n_ja_JP extends I18n {
/// "本日サインして/s1ポイントが受け入れる" /// "本日サインして/s1ポイントが受け入れる"
@override @override
String get today_score => "本日サインして/s1ポイントが受け入れる"; String get today_score => "本日サインして/s1ポイントが受け入れる";
/// "1.毎日サインしてポイントが受け入れます、累積日数が多ければ多いほどポイントが高くなります\n2.ポイントはH幤に交換できます、交換はポイントを消費しますので慎重に交換してください\n3.サインは毎月の最終日にリセットされ、ポイントもクリアされます。時間内に交換することを忘れないでください "
/// "1.毎日サインしてポイントが受け入れます、累積日数が多ければ多いほどポイントが高くなります.\n2.ポイントはH幤に交換できます、交換はポイントを消費しますので慎重に交換してください.\n3.サインは毎月の最終日にリセットされ、ポイントもクリアされます。時間内に交換することを忘れないでください."
@override @override
String get sign_tips => "1.毎日サインしてポイントが受け入れます、累積日数が多ければ多いほどポイントが高くなります\n2.ポイントはH幤に交換できます、交換はポイントを消費しますので慎重に交換してください\n3.サインは毎月の最終日にリセットされ、ポイントもクリアされます。時間内に交換することを忘れないでください ";
String get sign_tips => "1.毎日サインしてポイントが受け入れます、累積日数が多ければ多いほどポイントが高くなります.\n2.ポイントはH幤に交換できます、交換はポイントを消費しますので慎重に交換してください.\n3.サインは毎月の最終日にリセットされ、ポイントもクリアされます。時間内に交換することを忘れないでください.";
/// "サイン" /// "サイン"
@override @override
String get sign_in => "サイン"; String get sign_in => "サイン";
@@ -19793,6 +19847,21 @@ class _I18n_ja_JP extends I18n {
/// "你不能添加自己" /// "你不能添加自己"
@override @override
String get not_add_Myself => "你不能添加自己"; String get not_add_Myself => "你不能添加自己";
/// "对方已拉黑了你"
@override
String get you_are_blaklisted => "对方已拉黑了你";
/// "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)"
@override
String get confrim_recovery => "确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)";
/// "發送到"
@override
String get send_to => "發送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";


@override @override
TextDirection get textDirection => TextDirection.ltr; TextDirection get textDirection => TextDirection.ltr;


+ 5
- 11
lib/home/ProfilePage.dart 查看文件

@@ -1090,9 +1090,8 @@ class _ProfilePageState extends State<ProfilePage>
top: 20, top: 20,
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
if (!userInfo.isLike) { if (!userInfo.isLike) {
HttpUtil().setLove(userInfo.userId, () {
HttpUtil().setLove(userInfo.userId, () {
MessageMgr().emit('refresh_love_list', MessageMgr().emit('refresh_love_list',
{'UserId': userInfo.userId, 'flag': 0}); {'UserId': userInfo.userId, 'flag': 0});
setState(() { setState(() {
@@ -2090,7 +2089,8 @@ class _ProfilePageState extends State<ProfilePage>
description: I18n.of(context).recovery_photo, description: I18n.of(context).recovery_photo,
showDivider: false, showDivider: false,
showRightIcon: false, showRightIcon: false,
onPressed: () async {CustomUI.buildOneConfirm(
onPressed: () async {
CustomUI.buildOneConfirm(
context, context,
I18n.of(context).confrim_recovery, I18n.of(context).confrim_recovery,
I18n.of(context).determine, () async { I18n.of(context).determine, () async {
@@ -2320,7 +2320,7 @@ class _ProfilePageState extends State<ProfilePage>
), ),
onTap: isblack onTap: isblack
? () async { ? () async {
HttpUtil().cancleBlackUser(
HttpUtil().cancleBlackUser(
userInfo.userId, () { userInfo.userId, () {
Navigator.of(context).pop(); Navigator.of(context).pop();
isblack = false; isblack = false;
@@ -2529,13 +2529,7 @@ class _ProfilePageState extends State<ProfilePage>
showToast(I18n.of(context).cantt_voice); showToast(I18n.of(context).cantt_voice);
return; return;
} }
if (BlacklistMgr.isBlaklistMe(userInfo.userId)) {
showToast(I18n.of(context).you_are_blaklisted);
return;
}
if (BlacklistMgr.isInMyblaklist(userInfo.userId)) {
showToast(I18n.of(context).reject_message);
if (BlacklistMgr.isBlack(userInfo.userId)) {
return; return;
} }
//对方关闭陌生人消息,则提示 //对方关闭陌生人消息,则提示


+ 2
- 2
lib/home/SearchPage.dart 查看文件

@@ -175,8 +175,8 @@ class _SearchPageState extends State<SearchPage> {
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
SmartRefresher( SmartRefresher(
enablePullDown: list.length > 0,
enablePullUp: true,
enablePullDown: !isLoading,
enablePullUp: !isLoading,
header: MaterialClassicHeader(), header: MaterialClassicHeader(),
footer: CustomUI.buildLoadingFooter(), footer: CustomUI.buildLoadingFooter(),
controller: _refreshController, controller: _refreshController,


+ 2
- 1
lib/map/google_map_location_picker.dart 查看文件

@@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:chat/generated/i18n.dart';
import 'package:chat/map/auto_comp_iete_item.dart'; import 'package:chat/map/auto_comp_iete_item.dart';
import 'package:chat/map/location_provider.dart'; import 'package:chat/map/location_provider.dart';
import 'package:chat/map/location_result.dart'; import 'package:chat/map/location_result.dart';
@@ -137,7 +138,7 @@ class LocationPickerState extends State<LocationPicker> {
), ),
Expanded( Expanded(
child: Text( child: Text(
"Finding place...",
"${I18n.of(context).finding_place}...",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
), ),


+ 2
- 1
lib/map/search_input.dart 查看文件

@@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:chat/generated/i18n.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Custom Search input field, showing the search and clear icons. /// Custom Search input field, showing the search and clear icons.
@@ -80,7 +81,7 @@ class SearchInputState extends State {
keyboardAppearance: Brightness.light, keyboardAppearance: Brightness.light,
style: TextStyle(textBaseline: TextBaseline.alphabetic), style: TextStyle(textBaseline: TextBaseline.alphabetic),
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Search place',
hintText: I18n.of(context).search_plach,
border: InputBorder.none, border: InputBorder.none,
), ),
controller: editController, controller: editController,


+ 18
- 0
lib/utils/blacklist_mgr.dart 查看文件

@@ -1,3 +1,7 @@
import 'package:chat/generated/i18n.dart';
import 'package:chat/utils/LoadingDialog.dart';
import 'package:oktoast/oktoast.dart';
class BlacklistMgr { class BlacklistMgr {
//我拉黑的用户id //我拉黑的用户id
@@ -30,4 +34,18 @@ class BlacklistMgr {
static bool isBlaklistMe(int userId) { static bool isBlaklistMe(int userId) {
return blacklistMeSet.contains(userId); return blacklistMeSet.contains(userId);
} }
//判断是否被别人拉黑或者拉黑别人
static bool isBlack(int userId) {
if (isBlaklistMe(userId)) {
showToast(I18n.of(LoadingManage.context).you_are_blaklisted);
return true;
}
if (BlacklistMgr.isInMyblaklist(userId)) {
showToast(I18n.of(LoadingManage.context).reject_message);
return true;
}
return false;
}
} }

正在載入中…
取消
儲存