拉黑关系的相关功能
This commit is contained in:
parent
117d5a8682
commit
55060f137d
@ -66,10 +66,10 @@ android {
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
ldLibs "log"
|
||||
}
|
||||
// ndk {
|
||||
// abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
// ldLibs "log"
|
||||
// }
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@ -5,27 +5,27 @@
|
||||
android:src="@mipmap/launch_back" />
|
||||
</item>
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:top="141dp"-->
|
||||
<!-- android:left="37dp"-->
|
||||
<!-- android:width="100dp"-->
|
||||
<!-- android:height="100dp"-->
|
||||
<!-- >-->
|
||||
<!-- <bitmap-->
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
<item
|
||||
android:top="141dp"
|
||||
android:left="37dp"
|
||||
android:width="65dp"
|
||||
android:height="65dp"
|
||||
>
|
||||
<bitmap
|
||||
android:src="@mipmap/logo" />
|
||||
</item>
|
||||
|
||||
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:top="141dp"-->
|
||||
<!-- android:left="157dp"-->
|
||||
<!-- android:width="100dp"-->
|
||||
<!-- android:height="100dp"-->
|
||||
<!-- >-->
|
||||
<!-- <bitmap-->
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
<item
|
||||
android:top="141dp"
|
||||
android:left="114dp"
|
||||
android:width="180dp"
|
||||
android:height="73dp"
|
||||
>
|
||||
<bitmap
|
||||
android:src="@mipmap/icon_top" />
|
||||
</item>
|
||||
|
||||
|
||||
|
||||
@ -40,15 +40,14 @@
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:bottom="100dp"-->
|
||||
<!-- android:width="100dp"-->
|
||||
<!-- android:height="100dp"-->
|
||||
<!-- android:gravity="bottom|center_horizontal"-->
|
||||
<!-- >-->
|
||||
<!-- <bitmap-->
|
||||
<item
|
||||
android:bottom="60dp"
|
||||
|
||||
<!-- android:src="@mipmap/logo" />-->
|
||||
<!-- </item>-->
|
||||
android:gravity="bottom|center_horizontal"
|
||||
>
|
||||
<bitmap
|
||||
|
||||
android:src="@mipmap/icon_btn" />
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
|
||||
BIN
circle_app/android/app/src/main/res/mipmap-xxhdpi/icon_btn.png
Normal file
BIN
circle_app/android/app/src/main/res/mipmap-xxhdpi/icon_btn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
circle_app/android/app/src/main/res/mipmap-xxhdpi/icon_top.png
Normal file
BIN
circle_app/android/app/src/main/res/mipmap-xxhdpi/icon_top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1012 KiB After Width: | Height: | Size: 17 KiB |
@ -706,7 +706,7 @@ class Call_outPage extends StatelessWidget {
|
||||
// width: 339.sp,
|
||||
// padding: EdgeInsets.only(left: 17.sp, right: 17.sp),
|
||||
// child: Text(
|
||||
// '为打造纯净的社交环境,更好地服务大家,基于以下几方面考虑:1、平台升级为全天24小时人工审核,保证用户真实,避免骗子、酒托、虚假人士等扰乱平台 ;2、杜绝未入圈用户随意骚扰或影响已入圈的跨友;3、谢绝只会白嫖的猎奇人士。',
|
||||
// '为打造纯净的社交环境,更好地服务大家,基于以下几方面考虑:1、平台升级为全天24小时人工审核,保证用户真实,避免骗子、酒托、虚假人士等扰乱平台 ;2、杜绝未入圈用户随意骚扰或影响已入圈的;3、谢绝只会白嫖的猎奇人士。',
|
||||
// style: TextStyle(
|
||||
// color: Color.fromRGBO(247, 250, 250, 0.8),
|
||||
// fontSize: 12.sp)),
|
||||
|
||||
@ -8,6 +8,7 @@ import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:diff_match_patch/diff_match_patch.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_setting_model.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/friendShip/friendship_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/utils/screen_utils.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -27,6 +28,8 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField
|
||||
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/wide.dart';
|
||||
|
||||
import '../../../../util/eventBus.dart';
|
||||
|
||||
enum MuteStatus { none, me, all }
|
||||
|
||||
GlobalKey<_InputTextFieldState> myInputTextFieldState = GlobalKey();
|
||||
@ -257,8 +260,15 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
return userList;
|
||||
}
|
||||
|
||||
bool isSendLoging = false;
|
||||
onSubmitted() async {
|
||||
if(isSendLoging){
|
||||
return;
|
||||
}
|
||||
if (isBlack) {
|
||||
showToast("您已将对方拉黑,请移除黑名单后在发送消息~");
|
||||
return;
|
||||
}
|
||||
lastText = "";
|
||||
String text = textEditingController.text.trim();
|
||||
final convType = widget.conversationType;
|
||||
@ -302,6 +312,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
}
|
||||
|
||||
if (text.isNotEmpty && text != zeroWidthSpace) {
|
||||
|
||||
if (widget.model.repliedMessage != null) {
|
||||
MessageUtils.handleMessageError(
|
||||
widget.model.sendReplyMessage(
|
||||
@ -317,10 +328,10 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
convID: widget.conversationID,
|
||||
atUserList: getUserIdFromMemberInfoMap());
|
||||
} else {
|
||||
var data =
|
||||
await DioManager.instance.post(
|
||||
url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
|
||||
|
||||
isSendLoging = true;
|
||||
var data = await DioManager.instance
|
||||
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
|
||||
isSendLoging = false;
|
||||
if (data['data']['code'] == 10000) {
|
||||
List words = data['data']['words'];
|
||||
if (words.isNotEmpty) {
|
||||
@ -625,6 +636,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
checkHintText();
|
||||
if (PlatformUtils().isWeb || PlatformUtils().isDesktop) {
|
||||
focusNode = FocusNode(
|
||||
@ -713,7 +725,40 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
(appLocale == AppLocale.zhHans || appLocale == AppLocale.zhHant)
|
||||
? 'zh'
|
||||
: 'en';
|
||||
if(null==commentBlackEvent){
|
||||
commentBlackEvent = EventBusManager.on<CommentBlackEvent>().listen((event) {
|
||||
if(event.userId == widget.currentConversation.userID!){
|
||||
isBlack = event.isBlack;
|
||||
}
|
||||
});
|
||||
getBlack();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
StreamSubscription? commentBlackEvent =null;
|
||||
bool isBlack = false;
|
||||
|
||||
getBlack() async {
|
||||
final FriendshipServices _friendshipServices =
|
||||
serviceLocator<FriendshipServices>();
|
||||
List<V2TimFriendInfo>? blacklist = await _friendshipServices.getBlackList();
|
||||
if (blacklist != null) {
|
||||
isBlack = false;
|
||||
blacklist.forEach((element) {
|
||||
print(element.userProfile!.nickName.toString());
|
||||
if (element.userID == widget.currentConversation.userID!) {
|
||||
isBlack = true;
|
||||
}
|
||||
});
|
||||
await Future.delayed(Duration(milliseconds: 500));
|
||||
EventBusManager.fire(CommentBlackMoreEvent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void didUpdateWidget(TIMInputTextField oldWidget) {
|
||||
@ -726,6 +771,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
textEditingController.clear();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -733,6 +779,12 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
// handleSetDraftText();
|
||||
widget.model.removeListener(onModelChanged);
|
||||
focusNode.dispose();
|
||||
if(null!=commentBlackEvent){
|
||||
print("TIMInputTextField解绑");
|
||||
EventBusManager.cancelSubscription(commentBlackEvent!);
|
||||
}
|
||||
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@ -840,6 +892,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
addStickerToText: addStickerToText,
|
||||
customStickerPanel: widget.customStickerPanel,
|
||||
forbiddenText: forbiddenText,
|
||||
|
||||
onChanged: (text) async {
|
||||
if (widget.onChanged != null) {
|
||||
widget.onChanged!(text);
|
||||
@ -849,6 +902,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
},
|
||||
backgroundColor: widget.backgroundColor,
|
||||
morePanelConfig: widget.morePanelConfig,
|
||||
userId: widget.currentConversation.userID!,
|
||||
repliedMessage: value,
|
||||
currentCursor: currentCursor,
|
||||
hintText: hintText,
|
||||
@ -915,17 +969,12 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
resetHiText(String text) async {
|
||||
if (!hintText!.contains('说些什么吧~') && text.isNotEmpty) {
|
||||
if ((widget.currentConversation.lastMessage
|
||||
?.customElem ??
|
||||
null) !=
|
||||
if ((widget.currentConversation.lastMessage?.customElem ?? null) !=
|
||||
null) {
|
||||
if (widget.currentConversation.lastMessage
|
||||
?.customElem!.extension ==
|
||||
if (widget.currentConversation.lastMessage?.customElem!.extension ==
|
||||
'cardData') {
|
||||
hintText = '说些什么吧~';
|
||||
setState(() {
|
||||
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
} else {
|
||||
var result = await TencentImSDKPlugin.v2TIMManager
|
||||
@ -936,16 +985,13 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
lastMsgID: null,
|
||||
);
|
||||
|
||||
if (result.code == 0 &&
|
||||
(result.data?.isNotEmpty ?? false)) {
|
||||
if (result.code == 0 && (result.data?.isNotEmpty ?? false)) {
|
||||
V2TimMessage msg = result.data!.last!;
|
||||
|
||||
if (msg.customElem != null) {
|
||||
if (msg.customElem!.extension == 'cardData') {
|
||||
hintText = '说些什么吧~';
|
||||
setState(() {
|
||||
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -962,9 +1008,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
Map info = jsonDecode(
|
||||
widget.currentConversation.lastMessage!.customElem!.data!);
|
||||
hintText = info['guide_text'];
|
||||
setState(() {
|
||||
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
} else if (widget.currentConversation.lastMessage == null) {
|
||||
getConverstationLastInfo();
|
||||
|
||||
@ -14,6 +14,7 @@ import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_chat_global_model.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_setting_model.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/friendShip/friendship_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/utils/message.dart';
|
||||
@ -26,6 +27,8 @@ import 'package:tencent_cloud_chat_uikit/ui/views/TIMUIKitChat/TIMUIKitTextField
|
||||
import 'package:tencent_extended_text_field/extended_text_field.dart';
|
||||
import 'package:tencent_keyboard_visibility/tencent_keyboard_visibility.dart';
|
||||
|
||||
import '../../../../../util/eventBus.dart';
|
||||
|
||||
GlobalKey<_TIMTextFieldLayoutNarrowState> TIMnarrowTextFieldKey = GlobalKey();
|
||||
|
||||
class TIMTextFieldLayoutNarrow extends StatefulWidget {
|
||||
@ -72,6 +75,8 @@ class TIMTextFieldLayoutNarrow extends StatefulWidget {
|
||||
/// hint text for textField widget
|
||||
final String? hintText;
|
||||
|
||||
final String? userId;
|
||||
|
||||
final int? currentCursor;
|
||||
|
||||
final ValueChanged<int?> setCurrentCursor;
|
||||
@ -130,6 +135,7 @@ class TIMTextFieldLayoutNarrow extends StatefulWidget {
|
||||
required this.showSendEmoji,
|
||||
required this.showMorePanel,
|
||||
this.hintText,
|
||||
this.userId,
|
||||
required this.customEmojiStickerList,
|
||||
this.controller})
|
||||
: super(key: key);
|
||||
@ -163,7 +169,45 @@ class _TIMTextFieldLayoutNarrowState
|
||||
}
|
||||
});
|
||||
}
|
||||
if(null==commentBlackEvent){
|
||||
commentBlackEvent = EventBusManager.on<CommentBlackEvent>().listen((event) {
|
||||
if(event.userId == widget.userId){
|
||||
isBlack = event.isBlack;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getBlack();
|
||||
}
|
||||
StreamSubscription? commentBlackEvent =null;
|
||||
@override
|
||||
void dispose() {
|
||||
print("TIMTextFieldLayoutNarrow解绑");
|
||||
if(null!=commentBlackEvent){
|
||||
EventBusManager.cancelSubscription(commentBlackEvent!);
|
||||
}
|
||||
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
bool isBlack = false;
|
||||
|
||||
getBlack() async {
|
||||
final FriendshipServices _friendshipServices =
|
||||
serviceLocator<FriendshipServices>();
|
||||
List<V2TimFriendInfo>? blacklist = await _friendshipServices.getBlackList();
|
||||
if (blacklist != null) {
|
||||
isBlack = false;
|
||||
blacklist.forEach((element) {
|
||||
print(element.userProfile!.nickName.toString());
|
||||
if (element.userID == widget.userId) {
|
||||
isBlack = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void setSendButton() {
|
||||
final value = widget.textEditingController.text;
|
||||
@ -362,7 +406,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
setKeyboardHeight ??= OptimizeUtils.debounce((height) {
|
||||
settingModel.keyboardHeight = height;
|
||||
}, const Duration(seconds: 1));
|
||||
|
||||
//
|
||||
final debounceFunc = _debounce((value) {
|
||||
if (isWebDevice() || isAndroidDevice()) {
|
||||
if (value.isEmpty && showMoreButton != true) {
|
||||
@ -596,7 +640,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
width: 10,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
widget.onSubmitted();
|
||||
if (showKeyboard) {
|
||||
widget.focusNode.requestFocus();
|
||||
@ -624,6 +668,10 @@ class _TIMTextFieldLayoutNarrowState
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
if (isBlack) {
|
||||
showToast("您已将对方拉黑,请移除黑名单后在发送消息~");
|
||||
return;
|
||||
}
|
||||
showKeyboard = showSendSoundText;
|
||||
if (showSendSoundText) {
|
||||
widget.focusNode.requestFocus();
|
||||
@ -659,6 +707,10 @@ class _TIMTextFieldLayoutNarrowState
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (isBlack) {
|
||||
showToast("您已将对方拉黑,请移除黑名单后在发送消息~");
|
||||
return;
|
||||
}
|
||||
getImageFile();
|
||||
},
|
||||
child:
|
||||
@ -666,6 +718,10 @@ class _TIMTextFieldLayoutNarrowState
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (isBlack) {
|
||||
showToast("您已将对方拉黑,请移除黑名单后在发送消息~");
|
||||
return;
|
||||
}
|
||||
getTakeImageFile();
|
||||
},
|
||||
child: Image.asset(getMsgImage('take_photo'),
|
||||
|
||||
@ -36,6 +36,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
initEventBus();
|
||||
}
|
||||
|
||||
|
||||
initEventBus()async{
|
||||
EventBusManager.on<SendCoustomMessage>().listen((event) async{
|
||||
V2TimValueCallback<V2TimMessage>? sendMessageRes =
|
||||
@ -98,8 +99,11 @@ class _ChatPageState extends State<ChatPage> {
|
||||
return TIMChat(
|
||||
conversation: Get.arguments,
|
||||
customStickerPanel: renderCustomStickerPanel,
|
||||
onTapAvatar :(String userId,TapDownDetails tapDownDetails){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,arguments: userId.toString().split('_').last);
|
||||
onTapAvatar :(String userId,TapDownDetails tapDownDetails)async{
|
||||
var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: userId.toString().split('_').last);
|
||||
// setState(() {
|
||||
//
|
||||
// });
|
||||
},
|
||||
controller : _timuiKitChatController,
|
||||
config: const TIMUIKitChatConfig(
|
||||
@ -122,8 +126,9 @@ class _ChatPageState extends State<ChatPage> {
|
||||
customAppBar:MyAppBar(
|
||||
centerTitle: con.showName!,
|
||||
actionWdiget: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last);
|
||||
onTap: () async{
|
||||
var data = await Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last);
|
||||
|
||||
},
|
||||
child: Text('TA的主页',style: TextStyle(color: const Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),),
|
||||
),
|
||||
@ -131,7 +136,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
),
|
||||
|
||||
userAvatarBuilder: (BuildContext context, V2TimMessage message) {
|
||||
return avatarWidget((message.faceUrl?.isNotEmpty ?? false) ? message.faceUrl! : 'http://qiniuyun.ikuayou.com/avatar/default/default_header.png');
|
||||
return avatarWidget((message.faceUrl?.isNotEmpty ?? false) ? message.faceUrl! : 'https://qiniuyun.leyuan666.com/quanzi/avatar/default.png');
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
@ -148,7 +148,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.VisitorListActivity);
|
||||
},
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
width: 30.sp * widgets.length,
|
||||
height: 44.sp,
|
||||
child: Stack(
|
||||
@ -207,7 +207,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
url,
|
||||
width: (width - 1).sp,
|
||||
height: (width - 1).sp,
|
||||
fit: BoxFit.fill,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
) : Text(url,style: TextStyle(color: Color(0xffF756FF),fontSize: 12.sp),)
|
||||
],
|
||||
|
||||
175
circle_app/lib/app/dialog/BaseDialog.dart
Normal file
175
circle_app/lib/app/dialog/BaseDialog.dart
Normal file
@ -0,0 +1,175 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_install_app/flutter_install_app.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../main.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/util.dart';
|
||||
|
||||
class BaseDialog extends StatefulWidget {
|
||||
final bool isDismiss;
|
||||
|
||||
BaseDialog({required this.isDismiss});
|
||||
|
||||
@override
|
||||
BaseDialogState createState() => BaseDialogState();
|
||||
}
|
||||
|
||||
double myProgress = 0;
|
||||
|
||||
class BaseDialogState extends State<BaseDialog> {
|
||||
bool isDownload = false;
|
||||
|
||||
void incrementCounter() {}
|
||||
|
||||
void setDownloadUi() {
|
||||
setState(() {
|
||||
isDownload = true;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
return widget.isDismiss;
|
||||
},
|
||||
child: Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 200.sp,
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(1.sp),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
"提示",
|
||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 85.sp,
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 36.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"您已被对方拉进黑名单,去看看其他人吧~",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCF7FAFA),
|
||||
fontSize: 16.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
isDownload
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
//incrementCounter();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
child: CircularProgressIndicator(
|
||||
value: myProgress,
|
||||
backgroundColor: Colors.grey,
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
Color(0xFF30FFD9)),
|
||||
strokeWidth: 4.0.sp,
|
||||
),
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () async {
|
||||
Navigator.pop(context);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
width: 200.sp,
|
||||
margin: EdgeInsets.only(top: 14.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp,
|
||||
left: 52.sp,
|
||||
right: 52.sp),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"好的",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 8.sp,
|
||||
top: 8.sp,
|
||||
child: widget.isDismiss? GestureDetector(
|
||||
onTap: (){
|
||||
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Icon(Icons.close,color: Colors.white,size: 24.sp,)):Container())
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../components/my_app_bar.dart';
|
||||
import '../../main.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../../util/util.dart';
|
||||
import 'logic.dart';
|
||||
@ -222,8 +225,20 @@ class HelpPage extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(20.sp),
|
||||
),
|
||||
child: TextButton.icon(
|
||||
onPressed: () {
|
||||
// Handle contact service button press
|
||||
onPressed: () async{
|
||||
var con;
|
||||
if(kDebugMode){
|
||||
con = V2TimConversation(
|
||||
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
|
||||
}else{
|
||||
con = V2TimConversation(
|
||||
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Chat, arguments: con);
|
||||
// sendTextMsg('qpqz_dev_10_102',content :"你好吗? ");
|
||||
|
||||
// pushChatPage(logic.userInfoBean!.id.toString(), logic.imId,
|
||||
// logic.userInfoBean!.nickname);
|
||||
},
|
||||
icon: Image.asset(
|
||||
getMineImage("im_service"),
|
||||
|
||||
@ -15,7 +15,6 @@ import '../msg/view.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class HomeLogic extends GetxController {
|
||||
|
||||
PageController pageController = PageController(initialPage: 1);
|
||||
int currentIndex = 1;
|
||||
Widget currentPage = Container();
|
||||
@ -45,40 +44,36 @@ class HomeLogic extends GetxController {
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
data, (data) => UpdateInfo.fromJson(data));
|
||||
if (bean.isSuccess() && bean.data.update == 1) {
|
||||
// showReportDialog(Get.context!,bean.data.constraint==0,bean.data);
|
||||
showReportDialog(Get.context!, bean.data.constraint == 0, bean.data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void showReportDialog(BuildContext context,bool isDismiss,UpdateInfo updateInfo) {
|
||||
void showReportDialog(
|
||||
BuildContext context, bool isDismiss, UpdateInfo updateInfo) {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: isDismiss,
|
||||
builder: (BuildContext context) {
|
||||
return UpdateDialog(isDismiss: isDismiss,updateInfo : updateInfo,);
|
||||
}
|
||||
return UpdateDialog(
|
||||
isDismiss: isDismiss,
|
||||
updateInfo: updateInfo,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void getIMData() async {
|
||||
// _coreInstance.;
|
||||
if (!coreInstance.isLoginSuccess) {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getIMInfo);
|
||||
var data = await DioManager.instance.get(url: Api.getIMInfo);
|
||||
if (data['code'] == 200) {
|
||||
loginIM(data['data']['account_id'].toString(), data['data']['user_sig']);
|
||||
loginIM(
|
||||
data['data']['account_id'].toString(), data['data']['user_sig']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String getInfo() {
|
||||
return getBaseImage('image');
|
||||
|
||||
}
|
||||
|
||||
updateIndex(int index) {
|
||||
@ -86,8 +81,7 @@ class HomeLogic extends GetxController {
|
||||
if (index == 1) {
|
||||
final logic = Get.put(CircleLogic());
|
||||
logic.loadCirclePeopleData();
|
||||
}else
|
||||
if(index == 2){
|
||||
} else if (index == 2) {
|
||||
final logic = Get.put(MinefragmentLogic());
|
||||
logic.getMode();
|
||||
}
|
||||
|
||||
@ -173,12 +173,12 @@ class LoginPage extends StatelessWidget {
|
||||
width: 76.sp,
|
||||
height: 29.sp,
|
||||
decoration: BoxDecoration(
|
||||
color:logic.isPhoto ? logic.sendCodeBtn? Colors.white30: Colors.transparent : Colors.white30,
|
||||
color:logic.isPhoto ? logic.sendCodeBtn? Colors.white30:const Color(0xff0AFCFF) : Colors.white30,
|
||||
borderRadius: BorderRadius.circular(
|
||||
29.sp / 2)
|
||||
),
|
||||
child: Text(logic.sendCodeBtn ? '${logic.seconds}s' : '获取验证码', style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),),
|
||||
color: logic.isPhoto ? logic.sendCodeBtn? Colors.white:Colors.black : Colors.white, fontSize: 12.sp),),
|
||||
),
|
||||
)),
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ class TIMConversationItem extends TIMUIKitStatelessWidget {
|
||||
children: [
|
||||
ClipOval(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: faceUrl==""?"http://qiniuyun.ikuayou.com/avatar/default/default_header.png":faceUrl,
|
||||
imageUrl: faceUrl==""?"https://qiniuyun.leyuan666.com/quanzi/avatar/default.png":faceUrl,
|
||||
fit: BoxFit.cover,
|
||||
width: isDesktopScreen ? 40 : 44,
|
||||
height: isDesktopScreen ? 40 : 44,
|
||||
|
||||
@ -48,11 +48,16 @@ class SplashLogic extends GetxController {
|
||||
});
|
||||
Get.offNamed(AppRoutes.Complete_materialPage);
|
||||
return;
|
||||
} else if(bean.code == 5000||bean.code == 5001||bean.code == 5002||bean.code == 5003){
|
||||
pushLoginPage();
|
||||
return;
|
||||
}
|
||||
showToast(bean.msg.toString());
|
||||
if (bean.code == 500) {
|
||||
await Future.delayed(Duration(seconds: 5));
|
||||
onInit();
|
||||
}else {
|
||||
pushLoginPage();
|
||||
}
|
||||
|
||||
// Get.toNamed(AppRoutes.Home);
|
||||
|
||||
@ -1,15 +1,21 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/friendShip/friendship_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../common/config.dart';
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
import '../../util/qiniu.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../dialog/BaseDialog.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class UserinfoLogic extends GetxController {
|
||||
@ -30,17 +36,24 @@ class UserinfoLogic extends GetxController {
|
||||
|
||||
bool isShowAlbum = true;
|
||||
bool isLike = false;
|
||||
bool isBlack = false;
|
||||
bool isBlackBeen = false;
|
||||
bool isDestroy = false;
|
||||
final startTime = DateTime.now();
|
||||
SharedPreferences? sharedPreferences;
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
SmartDialog.showLoading();
|
||||
|
||||
sharedPreferences = await SharedPreferences.getInstance();
|
||||
int? sharedUserId = sharedPreferences!.getInt(SharedPreferencesHelper.USERID);
|
||||
int? sharedUserId =
|
||||
sharedPreferences!.getInt(SharedPreferencesHelper.USERID);
|
||||
|
||||
if (userId.isNotEmpty && sharedUserId != null && sharedUserId.toString() == userId) {
|
||||
if (userId.isNotEmpty &&
|
||||
sharedUserId != null &&
|
||||
sharedUserId.toString() == userId) {
|
||||
userId = '';
|
||||
}
|
||||
|
||||
@ -53,11 +66,28 @@ class UserinfoLogic extends GetxController {
|
||||
fetchUserInfo("${Api.getUserInfoTA + userId}/home");
|
||||
fetchMyAlbum("${Api.getTaAlbum + userId}/albums");
|
||||
fetchUrgeStatus("${Api.getUrgeStatus + userId}/urge/album/status");
|
||||
fetchIsBlack("${Api.setBlock + userId}/block");
|
||||
}
|
||||
SmartDialog.dismiss();
|
||||
fetchQnToken(Api.getqiniuToken);
|
||||
}
|
||||
|
||||
void showBlackDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return BaseDialog(
|
||||
isDismiss: false,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> fetchIsBlack(String url) async {
|
||||
var data = await DioManager.instance.get(url: url);
|
||||
isBlack = data["data"]["status"] == 1;
|
||||
}
|
||||
|
||||
Future<void> fetchUserInfo(String url) async {
|
||||
var data = await DioManager.instance.get(url: url);
|
||||
var bean = BaseResponse<ResponseBean>.fromJson(
|
||||
@ -66,7 +96,8 @@ class UserinfoLogic extends GetxController {
|
||||
if (bean.isSuccess()) {
|
||||
isMe = userId.isEmpty;
|
||||
isLike = bean.data.isFollow;
|
||||
isLikeFoMsg = "${bean.data.imageUrgeCount}位圈友感兴趣,其中${bean.data.likeMeCount}位已催您更新";
|
||||
isLikeFoMsg =
|
||||
"${bean.data.likeMeCount}位圈友感兴趣,其中${bean.data.imageUrgeCount}位已催您更新";
|
||||
userInfoBean = bean.data.user;
|
||||
isVip = userInfoBean?.vip ?? 0;
|
||||
imId = bean.data.accountId;
|
||||
@ -74,6 +105,11 @@ class UserinfoLogic extends GetxController {
|
||||
isOnline = true;
|
||||
} else {
|
||||
isOnline = userInfoBean!.isOnline;
|
||||
isBlackBeen = bean.data.isBlock;
|
||||
isDestroy = bean.data.isDestroy;
|
||||
if(isBlackBeen){
|
||||
showToast("您已被对方拉黑");
|
||||
}
|
||||
}
|
||||
onLineCity = isOnline ? "在线" : "离线";
|
||||
if (userInfoBean?.city != null) {
|
||||
@ -81,7 +117,10 @@ class UserinfoLogic extends GetxController {
|
||||
} else {
|
||||
onLineCity = "$onLineCity·外星";
|
||||
}
|
||||
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age, userInfoBean!.role, userInfoBean!.orientation);
|
||||
ageMsg = getAgeCOntent(userInfoBean!.gender, userInfoBean!.age,
|
||||
userInfoBean!.role, userInfoBean!.orientation);
|
||||
} else if (bean.code == 9999) {
|
||||
showBlackDialog(Get.context!);
|
||||
} else {
|
||||
showToast(bean.msg);
|
||||
}
|
||||
@ -114,10 +153,8 @@ class UserinfoLogic extends GetxController {
|
||||
if (bean.isSuccess()) {
|
||||
quToken = bean.data?.token.toString() ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
urgeChange() async {
|
||||
var data = await DioManager.instance
|
||||
.post(url: "${Api.urgeAlbum + userId}/urge/album");
|
||||
@ -143,6 +180,11 @@ class UserinfoLogic extends GetxController {
|
||||
}
|
||||
|
||||
setLike() async {
|
||||
if(isBlack||isDestroy){
|
||||
showToast("喜欢失败,存在拉黑关系或者该账户已注销");
|
||||
return;
|
||||
}
|
||||
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.setLike + userId}/follow",
|
||||
params: {'status': isLike ? "0" : "1"});
|
||||
@ -157,15 +199,40 @@ class UserinfoLogic extends GetxController {
|
||||
showToast(bean.msg);
|
||||
}
|
||||
|
||||
setBlock() async {
|
||||
var data = await DioManager.instance
|
||||
.post(url: "${Api.setBlock + userId}/block", params: {'status': "1"});
|
||||
setBlock(String status) async {
|
||||
List<String> parts = imId.split('_');
|
||||
if (parts[2] == "10") {
|
||||
showToast("不可拉黑客服号哦~");
|
||||
return;
|
||||
}
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.setBlock + userId}/block", params: {'status': status});
|
||||
var bean = BaseResponse<dynamic>.fromJson(
|
||||
data,
|
||||
(jsonData) => jsonData,
|
||||
);
|
||||
if (bean.isSuccess()) {
|
||||
final FriendshipServices _friendshipServices =
|
||||
serviceLocator<FriendshipServices>();
|
||||
|
||||
isBlack = status == "1";
|
||||
try {
|
||||
if (isBlack) {
|
||||
Navigator.pop(Get.context!);
|
||||
var result =
|
||||
await _friendshipServices.addToBlackList(userIDList: [imId]);
|
||||
print("拉黑成功" + result.toString());
|
||||
} else {
|
||||
var result =
|
||||
await _friendshipServices.deleteFromBlackList(userIDList: [imId]);
|
||||
print("取消拉黑成功" + result.toString());
|
||||
}
|
||||
// await Future.delayed(Duration(milliseconds: 500));
|
||||
// Future.delayed(Duration(seconds: 3),() {
|
||||
EventBusManager.fire(CommentBlackEvent(userId: imId, isBlack: isBlack));
|
||||
// });
|
||||
} catch (e) {}
|
||||
|
||||
update();
|
||||
}
|
||||
showToast(bean.msg);
|
||||
@ -189,7 +256,9 @@ class UserinfoLogic extends GetxController {
|
||||
|
||||
if (myAlbumBean.code == 200) {
|
||||
SmartDialog.dismiss();
|
||||
state.imaglist.insert(0,AlbumListItem(
|
||||
state.imaglist.insert(
|
||||
0,
|
||||
AlbumListItem(
|
||||
id: myAlbumBean.data.id,
|
||||
type: myAlbumBean.data.type,
|
||||
url: result));
|
||||
@ -288,6 +357,8 @@ class ResponseBean {
|
||||
int likeMeCount;
|
||||
int imageUrgeCount;
|
||||
bool isFollow;
|
||||
bool isBlock;
|
||||
bool isDestroy;
|
||||
String accountId;
|
||||
|
||||
ResponseBean(
|
||||
@ -295,6 +366,8 @@ class ResponseBean {
|
||||
required this.likeMeCount,
|
||||
required this.imageUrgeCount,
|
||||
required this.accountId,
|
||||
required this.isBlock,
|
||||
required this.isDestroy,
|
||||
required this.isFollow});
|
||||
|
||||
factory ResponseBean.fromJson(Map<String, dynamic> json) {
|
||||
@ -303,6 +376,8 @@ class ResponseBean {
|
||||
user: UserBean.fromJson(json['user']),
|
||||
likeMeCount: json['like_me_count'],
|
||||
imageUrgeCount: json['image_urge_count'],
|
||||
isBlock: json['is_been_block'],
|
||||
isDestroy: json['is_destroy'],
|
||||
isFollow: json['is_follow'],
|
||||
);
|
||||
}
|
||||
|
||||
@ -94,11 +94,44 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
|
||||
Widget _meInfoButton(UserinfoLogic controller) {
|
||||
if (controller.isMe) {
|
||||
return const SizedBox();
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
await Get.toNamed(
|
||||
AppRoutes.Complete_materialPage,
|
||||
arguments: "user",
|
||||
);
|
||||
logic.onInit();
|
||||
},
|
||||
child: Center(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.sp,
|
||||
horizontal: 55.sp,
|
||||
),
|
||||
child: const Text(
|
||||
"完善个人形象",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
} else {
|
||||
final likeButton = GestureDetector(
|
||||
onTap: () {
|
||||
_showBottomSheet(context);
|
||||
_showBottomSheet(context, controller);
|
||||
},
|
||||
child: Image(
|
||||
image: AssetImage(getMineImage("icon_like")),
|
||||
@ -137,10 +170,20 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
|
||||
final chatButton = GestureDetector(
|
||||
onTap: () {
|
||||
if(logic.isBlack||logic.isDestroy||logic.isBlackBeen){
|
||||
showToast("私聊失败,存在拉黑关系或者该账户已注销");
|
||||
return;
|
||||
}
|
||||
|
||||
if (logic.userInfoBean != null) {
|
||||
String msg = Get.previousRoute;
|
||||
if (msg == AppRoutes.Chat) {
|
||||
Get.back();
|
||||
} else {
|
||||
pushChatPage(logic.userInfoBean!.id.toString(), logic.imId,
|
||||
logic.userInfoBean!.nickname);
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 130.sp,
|
||||
@ -222,7 +265,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8.sp),
|
||||
_buildInfoRow(controller),
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _buildInfoRow(controller),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
@ -238,7 +281,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
: const Color(0xFF787575),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): Text(
|
||||
controller.onLineCity,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
@ -254,7 +297,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
SizedBox(
|
||||
height: 59.sp,
|
||||
child: _buildInterestsListView(interests),
|
||||
child: logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): _buildInterestsListView(interests),
|
||||
),
|
||||
titleTab(controller),
|
||||
Expanded(
|
||||
@ -264,8 +307,8 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
_tabController.animateTo(index);
|
||||
},
|
||||
children: [
|
||||
_imageAdapter(controller),
|
||||
HomeCallOutView(controller.userId),
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container():_imageAdapter(controller),
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): HomeCallOutView(controller.userId),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -360,7 +403,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
);
|
||||
},
|
||||
),
|
||||
GestureDetector(
|
||||
logic.isBlack||logic.isDestroy||logic.isBlackBeen?Container(): GestureDetector(
|
||||
onTap: () {
|
||||
if (controller.isMe) {
|
||||
controller.isEdit = !controller.isEdit;
|
||||
@ -410,21 +453,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
|
||||
Widget _imageAdapter(UserinfoLogic controller) {
|
||||
//print(controller.state.imaglist);
|
||||
return controller.state.imaglist.isEmpty
|
||||
? Column(mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||
const SizedBox(height: 100,),
|
||||
Image.asset(
|
||||
getBaseImage('no_result'),
|
||||
width: 200,
|
||||
// height: 11,
|
||||
),
|
||||
const SizedBox(height: 26,),
|
||||
Text(
|
||||
controller.isMe?"点击管理即可上传形象照哦~":"TA还没有发布过形象照,快去催TA更新吧~",
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
),
|
||||
])
|
||||
: Container(
|
||||
|
||||
// :
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 19.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
@ -438,7 +469,31 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
controller.state.imaglist.isEmpty && !controller.isEdit
|
||||
? Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
Image.asset(
|
||||
getBaseImage('no_result'),
|
||||
width: 200,
|
||||
// height: 11,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 26,
|
||||
),
|
||||
Text(
|
||||
controller.isMe
|
||||
? "点击管理即可上传形象照哦~"
|
||||
: "TA还没有发布过形象照,快去催TA更新吧~",
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
),
|
||||
]),
|
||||
)
|
||||
: Expanded(
|
||||
child: GridView.builder(
|
||||
padding: const EdgeInsets.only(bottom: 58.0),
|
||||
shrinkWrap: true,
|
||||
@ -499,47 +554,6 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
],
|
||||
),
|
||||
if (logic.isMe)
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 26.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
await Get.toNamed(
|
||||
AppRoutes.Complete_materialPage,
|
||||
arguments: "user",
|
||||
);
|
||||
logic.onInit();
|
||||
},
|
||||
child: Center(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.sp,
|
||||
horizontal: 55.sp,
|
||||
),
|
||||
child: const Text(
|
||||
"完善个人形象",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -711,7 +725,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
);
|
||||
}
|
||||
|
||||
void _showBottomSheet(BuildContext context) {
|
||||
void _showBottomSheet(BuildContext context, UserinfoLogic controller) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: Colors.transparent,
|
||||
@ -762,8 +776,13 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (controller.isBlack) {
|
||||
logic.setBlock("0");
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
Navigator.pop(context);
|
||||
_showReportDialog(context);
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -775,8 +794,8 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 2.sp),
|
||||
child: const Text(
|
||||
"拉黑",
|
||||
child: Text(
|
||||
controller.isBlack ? "取消拉黑" : "拉黑",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
@ -1031,7 +1050,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
SizedBox(width: 24.sp),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.setBlock();
|
||||
logic.setBlock("1");
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
class CONFIG{
|
||||
static const IMAGE_HEAD = 'http://qiniuyun.ikuayou.com/';
|
||||
static const IMAGE_HEAD = 'https://qiniuyun.leyuan666.com/';
|
||||
|
||||
|
||||
static const CALL_OUT_VIDEO = 'call_out_video/';
|
||||
|
||||
@ -17,6 +17,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_chat_separate_view_model.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/data_services/core/core_services.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import 'package:tencent_chat_push_for_china/model/appInfo.dart';
|
||||
@ -66,11 +67,11 @@ initPush() {
|
||||
}
|
||||
|
||||
//跳转发消息页面
|
||||
pushChatPage(String userId, String imId, String userName) async {
|
||||
pushChatPage(String userId, String imId, String userName) {
|
||||
var con = V2TimConversation(
|
||||
conversationID: "c2c_$imId", userID: imId, showName: userName, type: 1);
|
||||
await createCustomMsg(userId, imId);
|
||||
Get.toNamed(AppRoutes.Chat, arguments: con);
|
||||
createCustomMsg(userId, imId);
|
||||
}
|
||||
|
||||
createCustomMsg(String userId, String imId) async {
|
||||
@ -272,7 +273,7 @@ class _MyAppState extends State<MyApp> {
|
||||
coreInstance.init(
|
||||
sdkAppID: IM_SDK_APP_ID,
|
||||
// Replace 0 with the SDKAppID of your IM application when integrating
|
||||
// language: LanguageEnum.en, // 界面语言配置,若不配置,则跟随系统语言
|
||||
// language: LanguageEnum.zhHans, // 界面语言配置,若不配置,则跟随系统语言
|
||||
loglevel: LogLevelEnum.V2TIM_LOG_DEBUG,
|
||||
onTUIKitCallbackListener: (TIMCallback callbackValue) {
|
||||
switch (callbackValue.type) {
|
||||
@ -282,6 +283,13 @@ class _MyAppState extends State<MyApp> {
|
||||
break;
|
||||
case TIMCallbackType.API_ERROR:
|
||||
//Prints the API error to console, and shows the error message.
|
||||
if(callbackValue.errorCode==20007){
|
||||
showToast("您已被对方拉黑,换个人聊聊天吧~");
|
||||
return;
|
||||
}
|
||||
if(callbackValue.errorCode==6015){
|
||||
return;
|
||||
}
|
||||
print(
|
||||
"Error from TUIKit: ${callbackValue.errorMsg}, Code: ${callbackValue.errorCode}");
|
||||
if (callbackValue.errorCode == 10004 &&
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class Api {
|
||||
static const baseUrl = kDebugMode ? 'http://192.168.3.55:2000/' : 'http://192.168.3.55:2000/';
|
||||
static const baseUrl = kDebugMode ? 'http://192.168.3.55:2000/' : 'https://leyuan666.com/zuul-service/';
|
||||
|
||||
// static const baseUrl = 'https://leyuan666.com/zuul-service/';
|
||||
|
||||
@ -79,16 +79,35 @@ class Api {
|
||||
static const getUserMine = 'user-service/my/main';
|
||||
|
||||
|
||||
|
||||
//个人信息
|
||||
static const getUserInfo = 'user-service/my/home';
|
||||
|
||||
|
||||
|
||||
//他人信息
|
||||
static const getUserInfoTA = 'user-service/user/';
|
||||
|
||||
|
||||
//拉黑
|
||||
static const setBlock = 'user-service/user/';
|
||||
|
||||
|
||||
//喜欢
|
||||
static const setLike = 'user-service/user/';
|
||||
|
||||
|
||||
//注销账号
|
||||
static const offAccount = 'user-service/user/destroy';
|
||||
|
||||
|
||||
//绑定新手机号
|
||||
static const bindingPhoto = 'user-service/user/phone';
|
||||
|
||||
|
||||
//黑名单列表
|
||||
static const blackList = 'user-service/blacklist/users';
|
||||
|
||||
|
||||
|
||||
|
||||
//我的相册
|
||||
static const getMyAlbum = 'up-service/my/albums';
|
||||
@ -117,13 +136,8 @@ class Api {
|
||||
static const getUrgeStatus = 'up-service/user/';
|
||||
|
||||
|
||||
//拉黑
|
||||
static const setBlock = 'user-service/user/';
|
||||
|
||||
|
||||
//喜欢
|
||||
static const setLike = 'user-service/user/';
|
||||
|
||||
|
||||
|
||||
//关注列表
|
||||
@ -146,26 +160,11 @@ class Api {
|
||||
|
||||
|
||||
|
||||
//注销账号
|
||||
static const offAccount = 'user-service/user/destroy';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//黑名单列表
|
||||
static const blackList = 'user-service/blacklist/users';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//绑定新手机号
|
||||
static const bindingPhoto = 'user-service/user/phone';
|
||||
|
||||
|
||||
|
||||
|
||||
//意见反馈
|
||||
static const getFeedBack = 'up-service/feedback';
|
||||
|
||||
|
||||
@ -38,4 +38,13 @@ class SendCoustomMessage {
|
||||
|
||||
V2TimValueCallback<V2TimMsgCreateInfoResult>? createCustomMessageRes = null;
|
||||
|
||||
SendCoustomMessage(this.createCustomMessageRes);}
|
||||
SendCoustomMessage(this.createCustomMessageRes);
|
||||
}
|
||||
|
||||
class CommentBlackEvent {
|
||||
String userId = "";
|
||||
bool isBlack = false;
|
||||
CommentBlackEvent( {required this.userId,required this.isBlack });
|
||||
}
|
||||
class CommentBlackMoreEvent {
|
||||
}
|
||||
@ -12,6 +12,7 @@ import device_info_plus_macos
|
||||
import fc_native_video_thumbnail_for_us
|
||||
import file_selector_macos
|
||||
import geolocator_apple
|
||||
import local_notifications_for_us
|
||||
import package_info_plus_macos
|
||||
import pasteboard
|
||||
import path_provider_foundation
|
||||
@ -30,6 +31,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FcNativeVideoThumbnailPlugin.register(with: registry.registrar(forPlugin: "FcNativeVideoThumbnailPlugin"))
|
||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||
PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
|
||||
@ -329,6 +329,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
dbus:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dbus
|
||||
sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.7.8"
|
||||
desktop_drop:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -433,6 +441,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.0.0+3"
|
||||
event_bus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: event_bus
|
||||
sha256: "44baa799834f4c803921873e7446a2add0f3efa45e101a054b1f0ab9b95f8edc"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
extended_image:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -542,6 +558,14 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_apns_only:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_apns_only
|
||||
sha256: "70da0d520a5b8088dc7a52abb9a63d3191521c7ec2360461af776cdaee50ab74"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.6.0"
|
||||
flutter_blurhash:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -598,6 +622,22 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
flutter_local_notifications_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_linux
|
||||
sha256: b472bfc173791b59ede323661eae20f7fff0b6908fea33dd720a6ef5d576bae8
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.5.1"
|
||||
flutter_local_notifications_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_platform_interface
|
||||
sha256: "21bceee103a66a53b30ea9daf677f990e5b9e89b62f222e60dd241cd08d63d3a"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
flutter_luban:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -614,6 +654,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.6.15"
|
||||
flutter_native_splash:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_native_splash
|
||||
sha256: "6777a3abb974021a39b5fdd2d46a03ca390e03903b6351f21d10e7ecc969f12d"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.2.16"
|
||||
flutter_page_indicator:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -824,6 +872,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
huawei_push:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: huawei_push
|
||||
sha256: "71e84086f28eeab3bd4fef66f0cefad1adcb537a77ade154020af60c1dfe55fb"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "6.10.0+300"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -952,6 +1008,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.2.0+4"
|
||||
local_notifications_for_us:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: local_notifications_for_us
|
||||
sha256: "0453c3c8e021474d36bc1ccdae06688e7e1c6d3d62114e2f3c4eebd0e2f035d7"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1216,6 +1280,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.6.0"
|
||||
plain_notification_token_for_us:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plain_notification_token_for_us
|
||||
sha256: ba4e5ff9b24abec39aad2d2d07fbfc02966b37fd5ae98ed9f8af20e4c4f906ad
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.0.0+1"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1461,6 +1533,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.0.4"
|
||||
tencent_chat_push_for_china:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: tencent_chat_push_for_china
|
||||
sha256: "7877e18a229c93fd5fa9dcda5b37bea0e4f6ad29ec93ceaeb2bca9bb82d75480"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.6.2+1"
|
||||
tencent_cloud_chat_sdk:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1581,6 +1661,14 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
timezone:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: timezone
|
||||
sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.9.2"
|
||||
transformer_page_view:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1865,10 +1953,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xdg_directories
|
||||
sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1
|
||||
sha256: bd512f03919aac5f1313eb8249f223bacf4927031bf60b02601f81f687689e86
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "0.2.0+3"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user