diff --git a/android/gradle.properties b/android/gradle.properties index dc43f24..5ebae62 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m android.useAndroidX=true android.enableJetifier=true -#org.gradle.java.home=D:/jdk-17.0.11 +org.gradle.java.home=D:/jdk-17.0.11 #systemProp.http.proxyHost=127.0.0.1 #systemProp.http.proxyPort=10810 #systemProp.https.proxyHost=127.0.0.1 diff --git a/lib/controller/home/home_controller.dart b/lib/controller/home/home_controller.dart index 4539193..b61975c 100644 --- a/lib/controller/home/home_controller.dart +++ b/lib/controller/home/home_controller.dart @@ -99,6 +99,7 @@ class HomeController extends GetxController { try { print(1); + print(await _locationPlugin.getCurrentLocation()); final location = await _locationPlugin.getCurrentLocation(); print(2); diff --git a/lib/controller/message/chat_controller.dart b/lib/controller/message/chat_controller.dart index 1652326..328ebaa 100644 --- a/lib/controller/message/chat_controller.dart +++ b/lib/controller/message/chat_controller.dart @@ -1,4 +1,5 @@ import 'package:dating_touchme_app/controller/discover/svga_player_manager.dart'; +import 'package:dating_touchme_app/model/home/check_black_data.dart'; import 'package:get/get.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter/material.dart'; @@ -120,6 +121,28 @@ class ChatController extends GetxController { if (_externalNickName != null || _externalAvatarUrl != null) { update(); } + getCheckBlack(); + } + + final blackData = Rx(CheckBlackData()); + + getCheckBlack() async { + + try { + final response = await _networkService.userApi.userCheckUserBlacklist(targetUserId: userId); + if (response.data.isSuccess && response.data.data != null) { + blackData.value = response.data.data ?? CheckBlackData(); + } else { + + // 响应失败,抛出异常 + throw Exception(response.data.message ?? '获取数据失败'); + } + } catch(e){ + print('黑名单数据获取失败: $e'); + SmartDialog.showToast('黑名单数据获取失败'); + rethrow; + + } } void setDialogDismiss(bool flag){ @@ -314,6 +337,13 @@ class ChatController extends GetxController { /// 发送消息 Future sendMessage(String content) async { + if(blackData.value.activeBlack == true){ + SmartDialog.showToast('您已将对方拉黑,不能进行这项操作'); + return false; + } else if(blackData.value.passiveBlack == true){ + SmartDialog.showToast('您已被对方拉黑,不能进行这项操作'); + return false; + } EMMessage? tempMessage; try { if (Get.isLogEnable) { @@ -558,6 +588,13 @@ class ChatController extends GetxController { /// 发送语音消息 Future sendVoiceMessage(String filePath, int seconds) async { + if(blackData.value.activeBlack == true){ + SmartDialog.showToast('您已将对方拉黑,不能进行这项操作'); + return false; + } else if(blackData.value.passiveBlack == true){ + SmartDialog.showToast('您已被对方拉黑,不能进行这项操作'); + return false; + } // 防止重复发送 if (isSendingVoice.value) { if (Get.isLogEnable) { diff --git a/lib/pages/home/report_page.dart b/lib/pages/home/report_page.dart index 279ce6e..aefd88d 100644 --- a/lib/pages/home/report_page.dart +++ b/lib/pages/home/report_page.dart @@ -302,7 +302,7 @@ class ReportPage extends StatelessWidget { ), SizedBox(height: 29.w ,), Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "图片证据(选填)", @@ -311,6 +311,18 @@ class ReportPage extends StatelessWidget { color: const Color.fromRGBO(144, 144, 144, 1) ), ), + Row( + children: [ + Text( + "${controller.imgList.length}/9", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + SizedBox(width: 15,) + ], + ), ], ), SizedBox(height: 13.w ,), @@ -370,7 +382,7 @@ class ReportPage extends StatelessWidget { ), SizedBox(height: 15.w ,), Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "投诉内容(选填)", @@ -379,6 +391,18 @@ class ReportPage extends StatelessWidget { color: const Color.fromRGBO(144, 144, 144, 1) ), ), + Row( + children: [ + Text( + "${controller.message.value.length}/200", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + SizedBox(width: 15,) + ], + ), ], ), Container( @@ -391,6 +415,15 @@ class ReportPage extends StatelessWidget { controller: controller.messageController.value, minLines: 3, // 多行 maxLines: 3, // 自适应高度 + maxLength: 200, + buildCounter: ( + context, { + required int currentLength, + required bool isFocused, + required int? maxLength, + }) { + return null; // 👈 直接不显示计数器 + }, style: TextStyle( fontSize: ScreenUtil().setWidth(12), height: 1 diff --git a/lib/pages/message/chat_page.dart b/lib/pages/message/chat_page.dart index 8aabdaf..fbeff1e 100644 --- a/lib/pages/message/chat_page.dart +++ b/lib/pages/message/chat_page.dart @@ -402,6 +402,13 @@ class _ChatPageState extends State { await controller.sendMessage(message); }, onImageSelected: (imagePaths) async { + if(controller.blackData.value.activeBlack == true){ + SmartDialog.showToast('您已将对方拉黑,不能进行这项操作'); + return; + } else if(controller.blackData.value.passiveBlack == true){ + SmartDialog.showToast('您已被对方拉黑,不能进行这项操作'); + return; + } // 为每个图片路径调用控制器的方法发送图片消息 for (var imagePath in imagePaths) { await controller.sendImageMessage(imagePath); @@ -417,6 +424,13 @@ class _ChatPageState extends State { }, // 视频通话回调 onVideoCall: () async { + if(controller.blackData.value.activeBlack == true){ + SmartDialog.showToast('您已将对方拉黑,不能进行这项操作'); + return; + } else if(controller.blackData.value.passiveBlack == true){ + SmartDialog.showToast('您已被对方拉黑,不能进行这项操作'); + return; + } // 先调用获取聊天音频产品列表接口 final products = await CallController.instance.listChatAudioProduct(widget.userId); // 显示通话类型选择弹框,传入产品数据 diff --git a/lib/pages/setting/blacklist_page.dart b/lib/pages/setting/blacklist_page.dart index f3a51de..dfb875e 100644 --- a/lib/pages/setting/blacklist_page.dart +++ b/lib/pages/setting/blacklist_page.dart @@ -183,6 +183,7 @@ class _BlackItemState extends State { ), ).onTap((){ + Get.back(); Get.to(() => UserInformationPage(miId: widget.item.miId ?? "")); }), Container( @@ -199,6 +200,7 @@ class _BlackItemState extends State { ), ), ).onTap((){ + Get.back(); widget.controller.unBlack(widget.item.id ?? ""); }), Container( @@ -216,6 +218,7 @@ class _BlackItemState extends State { ), ), ).onTap((){ + Get.back(); Get.to(() => ReportPage(id: widget.item.blackUserId ?? "", userId: widget.item.blackUserId ?? "", type: 1,)); }),