Parcourir la source

Merge remote-tracking branch 'master/master'

master
jiahao il y a 5 ans
Parent
révision
ccbd8de2c1
15 fichiers modifiés avec 110 ajouts et 87 suppressions
  1. +2
    -0
      i18n/en-US.json
  2. +2
    -0
      i18n/ja-JP.json
  3. +2
    -0
      i18n/ko-KR.json
  4. +2
    -0
      i18n/vi-VN.json
  5. +2
    -0
      i18n/zh-CN.json
  6. +2
    -0
      i18n/zh-HK.json
  7. +2
    -34
      lib/chat/ChatPage.dart
  8. +30
    -37
      lib/chat/util_keyboard.dart
  9. +1
    -1
      lib/data/constants.dart
  10. +34
    -0
      lib/generated/i18n.dart
  11. +5
    -11
      lib/home/ProfilePage.dart
  12. +2
    -2
      lib/home/SearchPage.dart
  13. +2
    -1
      lib/map/google_map_location_picker.dart
  14. +2
    -1
      lib/map/search_input.dart
  15. +20
    -0
      lib/utils/blacklist_mgr.dart

+ 2
- 0
i18n/en-US.json Voir le fichier

@@ -1161,6 +1161,8 @@
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到", "send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置",
"real_time_helper": "实时帮", "real_time_helper": "实时帮",
"translation_butler": "翻译管家", "translation_butler": "翻译管家",
"travel_butler": "出行管家", "travel_butler": "出行管家",


+ 2
- 0
i18n/ja-JP.json Voir le fichier

@@ -1161,6 +1161,8 @@
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到", "send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置",
"real_time_helper": "实时帮", "real_time_helper": "实时帮",
"translation_butler": "翻译管家", "translation_butler": "翻译管家",
"travel_butler": "出行管家", "travel_butler": "出行管家",


+ 2
- 0
i18n/ko-KR.json Voir le fichier

@@ -1160,6 +1160,8 @@
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到", "send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置",
"real_time_helper": "实时帮", "real_time_helper": "实时帮",
"translation_butler": "翻译管家", "translation_butler": "翻译管家",
"travel_butler": "出行管家", "travel_butler": "出行管家",


+ 2
- 0
i18n/vi-VN.json Voir le fichier

@@ -1161,6 +1161,8 @@
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "發送到", "send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置",
"real_time_helper": "实时帮", "real_time_helper": "实时帮",
"translation_butler": "翻译管家", "translation_butler": "翻译管家",
"travel_butler": "出行管家", "travel_butler": "出行管家",


+ 2
- 0
i18n/zh-CN.json Voir le fichier

@@ -1161,6 +1161,8 @@
"you_are_blaklisted":"对方已拉黑了你", "you_are_blaklisted":"对方已拉黑了你",
"confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)", "confrim_recovery":"确定恢复已被焚毁的照片吗?\n(已经看过的用户可以再看一次)",
"send_to": "发送到", "send_to": "发送到",
"search_plach":"搜索位置",
"finding_place":"查找位置",
"real_time_helper": "实时帮", "real_time_helper": "实时帮",
"translation_butler": "翻译管家", "translation_butler": "翻译管家",
"travel_butler": "出行管家", "travel_butler": "出行管家",


+ 2
- 0
i18n/zh-HK.json Voir le fichier

@@ -1161,6 +1161,8 @@
"you_are_blaklisted":"對方已拉黑了你", "you_are_blaklisted":"對方已拉黑了你",
"confrim_recovery":"確定恢復已被焚毀的照片嗎?\n(已經看過的用戶可以再看一次)", "confrim_recovery":"確定恢復已被焚毀的照片嗎?\n(已經看過的用戶可以再看一次)",
"send_to": "發送到", "send_to": "發送到",
"search_plach":"搜索位置",
"finding_place":"查找位置",
"real_time_helper": "實時幫", "real_time_helper": "實時幫",
"translation_butler": "翻譯管家", "translation_butler": "翻譯管家",
"travel_butler": "出行管家", "travel_butler": "出行管家",


+ 2
- 34
lib/chat/ChatPage.dart Voir le fichier

@@ -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图片
@@ -365,33 +366,6 @@ class _ChatPageState extends State<ChatPage> {
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: const Color(0xFFE2E9F1), backgroundColor: const Color(0xFFE2E9F1),
// appBar: PreferredSize(
// preferredSize: Size.fromHeight(58),
// child: Container(
// color: AppBarTheme.of(context).color,
// child: SafeArea(
// child: Container(
// height: 56,
// child: Row(children: <Widget>[
// SizedBox(width: 10),
// CustomUI.buildCustomLeading(context),
// Text(
// Provider.of<RefNameProvider>(context)
// .getRefName(friendInfo.userId,
// friendInfo.nickName),
// textScaleFactor: 1.0,
// style: TextStyle(
// textBaseline: TextBaseline.ideographic,
// color: Constants.BlackTextColor,
// fontSize: 16.47),
// ),
// Expanded(
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.end,
// children: actions))
// ]),
// )))),
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
'${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}', '${Provider.of<RefNameProvider>(context).getRefName(friendInfo.userId, friendInfo.nickName)}',
@@ -479,13 +453,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;
} }


+ 30
- 37
lib/chat/util_keyboard.dart Voir le fichier

@@ -32,8 +32,7 @@ import 'package:file_picker/file_picker.dart';
import '../r.dart'; import '../r.dart';
class UtilKeyboard extends StatefulWidget {
class UtilKeyboard extends StatefulWidget {
final double keyboardHeight; final double keyboardHeight;
final Function sendMsg; final Function sendMsg;
final bool isGroup; final bool isGroup;
@@ -44,7 +43,7 @@ import '../r.dart';
} }
class _UtilKeyboardState extends State<UtilKeyboard> { class _UtilKeyboardState extends State<UtilKeyboard> {
bool isAuthority = false;
bool isAuthority = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -168,13 +167,8 @@ class _UtilKeyboardState extends State<UtilKeyboard> {
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;
} }
@@ -308,39 +302,38 @@ class _UtilKeyboardState extends State<UtilKeyboard> {
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 (!widget.isGroup) {
friendId = Provider.of<int>(context);
}
var fileName = file.path.split('/').last;
print('fileName $fileName');
if (fileSize > 33 * 1024 * 1024) {
showToast('文件大于33M');
return;
}
var ext = '';
var extList = fileName.split('.');
if (extList.length > 1) {
ext = extList.last;
}
print('ext $ext');
int friendId = 0;
if (!widget.isGroup) {
friendId = Provider.of<int>(context);
}
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:
widget.isGroup ? ChatChannelType.Group : ChatChannelType.Session);
var fileMsg = FileChat.create();
fileMsg.type = ext;
fileMsg.size = fileSize;
fileMsg.name = fileName;
widget.sendMsg(msg);
var msg = MsgHandler.createSendMsg(
ChatType.FileChatType, fileMsg.writeToBuffer(),
friendId: friendId,
localFile: file.path,
channelType:
widget.isGroup ? ChatChannelType.Group : ChatChannelType.Session);
widget.sendMsg(msg);
} }
void _sendVideo(BuildContext context) async { void _sendVideo(BuildContext context) async {


+ 1
- 1
lib/data/constants.dart Voir le fichier

@@ -117,7 +117,7 @@ class Constants {
static NavigatorState getCurrentState() => navigatorKey.currentState; static NavigatorState getCurrentState() => navigatorKey.currentState;
/// 获取当前的context /// 获取当前的context
static BuildContext getCurrentContext() => navigatorKey.currentContext;
static BuildContext getCurrentContext() => navigatorKey.currentState.overlay.context;//navigatorKey.currentContext;
///在pubspec.yaml中修改版本号 ///在pubspec.yaml中修改版本号
static String versionName = '1.0.0'; static String versionName = '1.0.0';


+ 34
- 0
lib/generated/i18n.dart Voir le fichier

@@ -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 => "查找位置";
/// "实时帮" /// "实时帮"
String get real_time_helper => "实时帮"; String get real_time_helper => "实时帮";
/// "翻译管家" /// "翻译管家"
@@ -5903,6 +5907,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
String get real_time_helper => "实时帮"; String get real_time_helper => "实时帮";
@@ -9469,6 +9479,12 @@ class _I18n_zh_HK extends I18n {
/// "發送到" /// "發送到"
@override @override
String get send_to => "發送到"; String get send_to => "發送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";
/// "實時幫" /// "實時幫"
@override @override
String get real_time_helper => "實時幫"; String get real_time_helper => "實時幫";
@@ -13035,6 +13051,12 @@ class _I18n_zh_CN extends _I18n_zh_HK {
/// "发送到" /// "发送到"
@override @override
String get send_to => "发送到"; String get send_to => "发送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";
/// "实时帮" /// "实时帮"
@override @override
String get real_time_helper => "实时帮"; String get real_time_helper => "实时帮";
@@ -16598,6 +16620,12 @@ class _I18n_ko_KR extends I18n {
/// "發送到" /// "發送到"
@override @override
String get send_to => "發送到"; String get send_to => "發送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";
/// "实时帮" /// "实时帮"
@override @override
String get real_time_helper => "实时帮"; String get real_time_helper => "实时帮";
@@ -20164,6 +20192,12 @@ class _I18n_ja_JP extends I18n {
/// "發送到" /// "發送到"
@override @override
String get send_to => "發送到"; String get send_to => "發送到";
/// "搜索位置"
@override
String get search_plach => "搜索位置";
/// "查找位置"
@override
String get finding_place => "查找位置";
/// "实时帮" /// "实时帮"
@override @override
String get real_time_helper => "实时帮"; String get real_time_helper => "实时帮";


+ 5
- 11
lib/home/ProfilePage.dart Voir le fichier

@@ -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 Voir le fichier

@@ -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 Voir le fichier

@@ -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(
"搜索中...",
"${I18n.of(context).finding_place}...",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
), ),


+ 2
- 1
lib/map/search_input.dart Voir le fichier

@@ -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: '搜索位置',
hintText: I18n.of(context).search_plach,
border: InputBorder.none, border: InputBorder.none,
), ),
controller: editController, controller: editController,


+ 20
- 0
lib/utils/blacklist_mgr.dart Voir le fichier

@@ -1,4 +1,10 @@
import 'package:chat/data/constants.dart';
import 'package:chat/generated/i18n.dart';
import 'package:chat/utils/LoadingDialog.dart';
import 'package:oktoast/oktoast.dart';
class BlacklistMgr { class BlacklistMgr {
//我拉黑的用户id //我拉黑的用户id
static Set<int> myBlacklistSet = new Set(); static Set<int> myBlacklistSet = new Set();
@@ -30,4 +36,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(Constants.getCurrentContext()).you_are_blaklisted);
return true;
}
if (BlacklistMgr.isInMyblaklist(userId)) {
showToast(I18n.of(Constants.getCurrentContext()).reject_message);
return true;
}
return false;
}
} }

Chargement…
Annuler
Enregistrer