1.3.7代码提交

This commit is contained in:
CYH 2023-12-08 09:33:34 +08:00
parent dbb58ccaa6
commit 0751408802
23 changed files with 1189 additions and 352 deletions

View File

@ -71,8 +71,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21 minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode 28 versionCode 29
versionName "1.3.6" versionName "1.3.7"
manifestPlaceholders = [ manifestPlaceholders = [
vivo_APPID: "105669716", vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122", vivo_APPKEY:"84f750207787376b310ca5b0d5969122",

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -450,7 +450,8 @@ class _TIMUIKItHistoryMessageListItemState
String title = ''; String title = '';
if (info.containsKey('title')) { if (info.containsKey('title')) {
var recommendCircleFriendData= info['title']; Map recommendCircleFriendData= info['title'];
if (recommendCircleFriendData['is_follow_me'] && isFromSelf) { if (recommendCircleFriendData['is_follow_me'] && isFromSelf) {
@ -461,16 +462,17 @@ class _TIMUIKItHistoryMessageListItemState
title = '你喜欢了TA'; title = '你喜欢了TA';
} else if (recommendCircleFriendData['has_both_friend']) { } else if (recommendCircleFriendData['has_both_friend']) {
title = '你们有共同喜欢的圈友'; title = '你们有共同喜欢的圈友';
} else if (recommendCircleFriendData.containsKey('is_new_user') && !isFromSelf) {
title = '我刚来到这里哦';
} else if (recommendCircleFriendData['has_friend_follow_to'] && isFromSelf) { } else if (recommendCircleFriendData['has_friend_follow_to'] && isFromSelf) {
title = '你喜欢的圈友也喜欢TA'; title = '你喜欢的圈友也喜欢TA';
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) { } else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) {
title = '很多圈友都喜欢TA'; title = '很多圈友都喜欢TA';
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) { } else if (recommendCircleFriendData['is_excellent_qz_leader'] && isFromSelf) {
title = 'TA是乐园优秀圈主哦~'; title = 'TA是乐园优秀圈主哦~';
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) { } else if (recommendCircleFriendData['is_most_fans'] && isFromSelf) {
title = '可能是你想认识的人'; title = '可能是你想认识的人';
} }
} }

View File

@ -291,15 +291,14 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
bool isSendLoging = false; bool isSendLoging = false;
onSubmitted() async { onSubmitted() async {
if (isSendLoging) {
return;
}
if (isBlack) { if (isBlack) {
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~"); showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
return; return;
} }
if (isSending) return;
isSending = true;
bool isOK = await checkImStatus(); bool isOK = await checkImStatus();
if (!isOK) { if (!isOK) {
@ -314,6 +313,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
if (text.isEmpty) { if (text.isEmpty) {
if (hintText.contains('说些什么吧~')) { if (hintText.contains('说些什么吧~')) {
showOKToast('请输入消息内容后发送'); showOKToast('请输入消息内容后发送');
Future.delayed(Duration(seconds: 1), () {isSending = false;});
return; return;
} else { } else {
if ((widget.currentConversation.lastMessage?.customElem ?? null) != if ((widget.currentConversation.lastMessage?.customElem ?? null) !=
@ -321,6 +321,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
if (widget.currentConversation.lastMessage?.customElem!.extension == if (widget.currentConversation.lastMessage?.customElem!.extension ==
'cardData') { 'cardData') {
sendHiText(); sendHiText();
isSending = false;
} }
} else { } else {
var result = await TencentImSDKPlugin.v2TIMManager var result = await TencentImSDKPlugin.v2TIMManager
@ -344,7 +345,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
showOKToast('请输入消息内容后发送'); showOKToast('请输入消息内容后发送');
} }
} }
Future.delayed(Duration(seconds: 1), () {isSending = false;});
return; return;
} }
} }
@ -369,12 +370,12 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
} else { } else {
bool isOK = await loadIsShowSendGiftDialogData(); bool isOK = await loadIsShowSendGiftDialogData();
if (!isOK) { if (!isOK) {
Future.delayed(Duration(seconds: 1), () {isSending = false;});
return; return;
} }
isSendLoging = true;
var data = await DioManager.instance var data = await DioManager.instance
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2}); .post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
isSendLoging = false;
List words = []; List words = [];
if (data['data']['code'] == 10000) { if (data['data']['code'] == 10000) {
words = data['data']['words']; words = data['data']['words'];
@ -384,7 +385,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
} }
} }
} }
Future.delayed(Duration(seconds: 1), () {isSending = false;});
if (words.isEmpty) { if (words.isEmpty) {
var msgResult = await MessageUtils.handleMessageError( var msgResult = await MessageUtils.handleMessageError(
widget.model.sendTextMessage( widget.model.sendTextMessage(
@ -395,7 +396,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
addChatRecord(text, msgResult!.data!.msgID! ?? '', msgResult!.data!.timestamp!.toString() ?? ''); addChatRecord(text, msgResult!.data!.msgID! ?? '', msgResult!.data!.timestamp!.toString() ?? '');
} else { } else {
textEditingController.text = text;
showOKToast('含违规词汇,无法发送'); showOKToast('含违规词汇,无法发送');
return; return;
} }
@ -407,8 +407,10 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
goDownBottom(); goDownBottom();
_handleSendEditStatus("", false); _handleSendEditStatus("", false);
} else { } else {
showOKToast('请输入消息内容'); showOKToast('请输入消息内容');
isSending = false;
} }
} }
@ -454,6 +456,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
"sendTime": str, "sendTime": str,
"to": widget.conversationID.split('_').last "to": widget.conversationID.split('_').last
}); });
isSending = false;
} }
void goDownBottom() { void goDownBottom() {
@ -818,7 +821,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
StreamSubscription? commentBlackEvent = null; StreamSubscription? commentBlackEvent = null;
bool isBlack = false; bool isBlack = false;
bool isSending = false;
getBlack() async { getBlack() async {
final FriendshipServices _friendshipServices = final FriendshipServices _friendshipServices =
serviceLocator<FriendshipServices>(); serviceLocator<FriendshipServices>();

View File

@ -19,6 +19,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart'; import 'package:get/get_core/src/get_main.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:oktoast/oktoast.dart';
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart'; import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_state.dart'; 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/separate_models/tui_chat_separate_view_model.dart';
@ -39,8 +40,11 @@ import 'package:tencent_keyboard_visibility/tencent_keyboard_visibility.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
import 'package:video_thumbnail/video_thumbnail.dart'; import 'package:video_thumbnail/video_thumbnail.dart';
import '../../../../../common/Widgets/unlock_wx_tip.dart';
import '../../../../../util/eventBus.dart'; import '../../../../../util/eventBus.dart';
import '../../../../call_out/logic.dart'; import '../../../../call_out/logic.dart';
import '../../../../userinfo/logic.dart';
import '../../../view.dart';
import '../../../widget/chat_circle_share_dialog.dart'; import '../../../widget/chat_circle_share_dialog.dart';
import '../../../widget/chat_gift_pannel.dart'; import '../../../widget/chat_gift_pannel.dart';
@ -176,10 +180,16 @@ class _TIMTextFieldLayoutNarrowState
bool showKeyboard = false; bool showKeyboard = false;
Function? setKeyboardHeight; Function? setKeyboardHeight;
double? bottomPadding; double? bottomPadding;
UserBean? userInfoBean;
int unLockWxNum = 0;
var sub1;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
sub1 = EventBusManager.on<ChatLoadUserInfoData>().listen((event) {
loadUserData();
});
if (widget.controller != null) { if (widget.controller != null) {
widget.controller?.addListener(() { widget.controller?.addListener(() {
final actionType = widget.controller?.actionType; final actionType = widget.controller?.actionType;
@ -196,7 +206,7 @@ class _TIMTextFieldLayoutNarrowState
} }
}); });
} }
loadUserData();
getBlack(); getBlack();
} }
@ -204,6 +214,7 @@ class _TIMTextFieldLayoutNarrowState
@override @override
void dispose() { void dispose() {
sub1.cancel();
print("TIMTextFieldLayoutNarrow解绑"); print("TIMTextFieldLayoutNarrow解绑");
if (null != commentBlackEvent) { if (null != commentBlackEvent) {
EventBusManager.cancelSubscription(commentBlackEvent!); EventBusManager.cancelSubscription(commentBlackEvent!);
@ -314,7 +325,8 @@ class _TIMTextFieldLayoutNarrowState
double _getBottomHeight() { double _getBottomHeight() {
if (showKeyboard) { if (showKeyboard) {
final currentKeyboardHeight = MediaQuery.of(context).viewInsets.bottom; final currentKeyboardHeight =
MediaQuery.of(context).viewInsets.bottom + 10.sp;
double originHeight = settingModel.keyboardHeight; double originHeight = settingModel.keyboardHeight;
if (currentKeyboardHeight != 0) { if (currentKeyboardHeight != 0) {
if (currentKeyboardHeight >= originHeight) { if (currentKeyboardHeight >= originHeight) {
@ -704,7 +716,9 @@ class _TIMTextFieldLayoutNarrowState
widget.goDownBottom(); widget.goDownBottom();
}, },
child: Image.asset( child: Image.asset(
getMsgImage('emoji'), !showEmojiPanel
? getMsgImage('emoji')
: getMsgImage('keyboard'),
height: 24.sp, height: 24.sp,
width: 24.sp, width: 24.sp,
), ),
@ -844,18 +858,24 @@ class _TIMTextFieldLayoutNarrowState
), ),
if (!showKeyboard && !showEmojiPanel) if (!showKeyboard && !showEmojiPanel)
Positioned( Positioned(
top: 0, top: 10.sp,
child: Container( child: Container(
// margin: EdgeInsets.only(bottom: 5.sp),
padding: EdgeInsets.only(left: 10.sp, right: 10.sp), padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
height: 50.sp, height: 28.sp,
// color: Colors.red,
width: Get.width, width: Get.width,
child: Row( child: ListView(
scrollDirection: Axis.horizontal,
children: [ children: [
chatActionWidget('hello', '打招呼', () async { chatActionWidget('hello', '打招呼', () async {
var reulst = await DioManager.instance.get(url: Api.msgRandOne); var reulst =
await DioManager.instance.get(url: Api.msgRandOne);
String text = reulst['data']; String text = reulst['data'];
var result = await widget.model.sendTextMessage( var result = await widget.model.sendTextMessage(
text: text, convID: widget.conversationID, convType: ConvType.c2c); text: text,
convID: widget.conversationID,
convType: ConvType.c2c);
}), }),
chatActionWidget('wish', '许个愿', () { chatActionWidget('wish', '许个愿', () {
Get.bottomSheet( Get.bottomSheet(
@ -873,6 +893,8 @@ class _TIMTextFieldLayoutNarrowState
isScrollControlled: true, isScrollControlled: true,
enableDrag: false); enableDrag: false);
}), }),
if (userInfoBean != null)
userInfoBean!.wx_num.isNotEmpty ? chatWxActionWidget() : chatWantWxActionWidget()
], ],
), ),
), ),
@ -903,8 +925,7 @@ class _TIMTextFieldLayoutNarrowState
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset( getMsgImage(img),
getMsgImage(img),
width: 20.sp, width: 20.sp,
), ),
SizedBox( SizedBox(
@ -920,6 +941,123 @@ class _TIMTextFieldLayoutNarrowState
); );
} }
chatWantWxActionWidget() {
double textWidth = boundingTextSize(Get.context!, userInfoBean!.wx_num!, TextStyle(color: Colors.white, fontSize: 16.sp)).width;
return GestureDetector(
onTap: () async {
var result = await DioManager.instance.get(url: Api.noticeWxNum + userInfoBean!.id.toString(),);
if (result['code'] == 200) {
showOKToast('已提醒对方填写');
} else {
showOKToast(result['msg']);
}
},
child: Container(
width:105.sp,
height: 28.sp,
margin: EdgeInsets.only(right: 4.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(14.sp)),
child: Container(
decoration: BoxDecoration(
color: Color(0xFF423055),
borderRadius: BorderRadius.circular(14.sp)),
margin: EdgeInsets.all(1.sp),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 4.sp,
),
Image.asset(
getDisCoverImage('wx'),
width: 20.sp,
),
SizedBox(
width: 2.sp,
),
Text(
'想要微信号',
style: TextStyle(color: Colors.white, fontSize: 13.sp),
),
],
)),
),
);
}
chatWxActionWidget() {
double textWidth = boundingTextSize(Get.context!, userInfoBean!.wx_num!, TextStyle(color: Colors.white, fontSize: 16.sp)).width;
return GestureDetector(
onTap: () async {
if (unLockWxNum != 1) {
var result = await DioManager()
.post(url: Api.UnlockWx, params: {'targetUserId': userInfoBean!.id});
if (result['code'] == 200) {
showToast('解锁成功');
loadUserData();
} else {
Get.bottomSheet(UnlockWxTip(userInfoBean!.id.toString(), userInfoBean!.avatar),
isScrollControlled: true, enableDrag: false)
.then((value) {
if (value != null) {
loadUserData();
}
});
}
}
},
child: Container(
width: textWidth + (unLockWxNum != 1 ? 50.sp : 30.sp),
height: 28.sp,
margin: EdgeInsets.only(right: 4.sp),
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(14.sp)),
child: Container(
decoration: BoxDecoration(
color: Color(0xFF423055),
borderRadius: BorderRadius.circular(14.sp)),
margin: EdgeInsets.all(1.sp),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 4.sp,
),
Image.asset(
getDisCoverImage('wx'),
width: 20.sp,
),
SizedBox(
width: 2.sp,
),
Text(
userInfoBean!.wx_num!,
style: TextStyle(color: Colors.white, fontSize: 13.sp),
),
if (unLockWxNum != 1)
SizedBox(
width: 4.sp,
),
if (unLockWxNum != 1)
Image.asset(
getDisCoverImage('unclock_icon'),
width: 20.sp,
)
],
)),
),
);
}
Future checkImStatus() async { Future checkImStatus() async {
imStatusOK = await loadIsShowSendGiftDialogData(); imStatusOK = await loadIsShowSendGiftDialogData();
if (imStatusOK == false) { if (imStatusOK == false) {
@ -948,11 +1086,16 @@ class _TIMTextFieldLayoutNarrowState
} }
loadIsShowSendGiftDialogData() async { loadIsShowSendGiftDialogData() async {
var data = await DioManager.instance
var data = await DioManager.instance.get(url: Api.isShow_give_gift +widget.userId!.split('_').last); .get(url: Api.isShow_give_gift + widget.userId!.split('_').last);
if (data['code'] == 200) { if (data['code'] == 200) {
if (data['data']) { if (data['data']) {
Get.bottomSheet(SendGiftDialog(accid: widget.userId!,title: data['msg'],), isScrollControlled: true, Get.bottomSheet(
SendGiftDialog(
accid: widget.userId!,
title: data['msg'],
),
isScrollControlled: true,
enableDrag: false); enableDrag: false);
return false; return false;
} }
@ -984,13 +1127,10 @@ class _TIMTextFieldLayoutNarrowState
return isVip; return isVip;
} }
addChatRecord(String msgContent,String msgId,String sendTime) async { addChatRecord(String msgContent, String msgId, String sendTime) async {
String str = DateTime.now().toString().split('.').first; String str = DateTime.now().toString().split('.').first;
var data = var data = await DioManager.instance.post(url: Api.chatRecord, params: {
await DioManager.instance.post(url: Api.chatRecord, params: {
"content": msgContent, "content": msgContent,
"msgId": msgId, "msgId": msgId,
"sendTime": str, "sendTime": str,
@ -1041,7 +1181,8 @@ class _TIMTextFieldLayoutNarrowState
final Duration videoDuration = videoPlayerController!.value.duration; final Duration videoDuration = videoPlayerController!.value.duration;
final double durationInSeconds = videoDuration.inSeconds.toDouble(); final double durationInSeconds = videoDuration.inSeconds.toDouble();
V2TimValueCallback<V2TimMessage>? msgresult = await widget.model.sendVideoMessage( V2TimValueCallback<V2TimMessage>? msgresult =
await widget.model.sendVideoMessage(
videoPath: pickedFile.path, videoPath: pickedFile.path,
snapshotPath: thumbnailPath, snapshotPath: thumbnailPath,
// //
@ -1051,7 +1192,8 @@ class _TIMTextFieldLayoutNarrowState
inputElement: context, inputElement: context,
); );
addChatRecord('[视频]', msgresult!.data!.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? ''); addChatRecord('[视频]', msgresult!.data!.msgID! ?? '',
msgresult!.data!.timestamp!.toString() ?? '');
if (imageSource == ImageSource.camera) { if (imageSource == ImageSource.camera) {
DioManager.instance.get(url: Api.getAddTrialCount + "2"); DioManager.instance.get(url: Api.getAddTrialCount + "2");
@ -1109,7 +1251,8 @@ class _TIMTextFieldLayoutNarrowState
convType: widget.conversationType, convType: widget.conversationType,
inputElement: context); inputElement: context);
addChatRecord('[图片]', msgresult!.data!.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? ''); addChatRecord('[图片]', msgresult!.data!.msgID! ?? '',
msgresult!.data!.timestamp!.toString() ?? '');
var data = await DioManager.instance.get(url: Api.getAddTrialCount + "3"); var data = await DioManager.instance.get(url: Api.getAddTrialCount + "3");
} catch (e) { } catch (e) {
print(e); print(e);
@ -1142,7 +1285,8 @@ class _TIMTextFieldLayoutNarrowState
convID: widget.conversationID, convID: widget.conversationID,
convType: widget.conversationType, convType: widget.conversationType,
inputElement: context); inputElement: context);
addChatRecord('[图片]', msgresult!.data?.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? ''); addChatRecord('[图片]', msgresult!.data?.msgID! ?? '',
msgresult!.data!.timestamp!.toString() ?? '');
DioManager.instance.get(url: Api.getAddTrialCount + "1"); DioManager.instance.get(url: Api.getAddTrialCount + "1");
} catch (e) {} } catch (e) {}
} }
@ -1188,4 +1332,18 @@ class _TIMTextFieldLayoutNarrowState
// } // }
// } // }
} }
void loadUserData() async {
var data = await DioManager.instance.get(
url:
"${Api.getUserInfoTA + widget.conversationID.split('_').last}/home");
var bean = BaseResponse<ResponseBean>.fromJson(
data, (data) => ResponseBean.fromJson(data));
if (bean.isSuccess()) {
userInfoBean = bean.data.user;
unLockWxNum = bean.data.unLockWxNum;
setState(() {});
}
}
} }

View File

@ -42,6 +42,7 @@ class _ChatPageState extends State<ChatPage> {
User? userInfoBean; User? userInfoBean;
var sub; var sub;
var sub1;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
@ -82,6 +83,8 @@ class _ChatPageState extends State<ChatPage> {
sendMessageRes.data?.customElem?.extension; //extension sendMessageRes.data?.customElem?.extension; //extension
} }
}); });
} }
Widget renderCustomStickerPanel({ Widget renderCustomStickerPanel({
@ -244,3 +247,8 @@ class _ChatPageState extends State<ChatPage> {
} }
} }
} }
class ChatLoadUserInfoData {
}

View File

@ -56,8 +56,11 @@ class _WishDialogState extends State<WishDialog> {
tipStr = info['topHours'] != null ? info['topHours'].toString() : ''; tipStr = info['topHours'] != null ? info['topHours'].toString() : '';
} }
} }
if (mounted) {
setState(() {}); setState(() {});
} }
}
} }
giftGridWidget() { giftGridWidget() {

View File

@ -16,8 +16,11 @@ import 'package:flutter_pickers/style/picker_style.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:gradient_borders/gradient_borders.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../common/Widgets/today_people_dialog.dart';
import '../../common/colors/app_color.dart';
import '../select_circle/logic.dart'; import '../select_circle/logic.dart';
import '../userinfo/logic.dart'; import '../userinfo/logic.dart';
import 'logic.dart'; import 'logic.dart';
@ -39,7 +42,6 @@ class _CirclePageState extends State<CirclePage>
int currentIndex = 0; int currentIndex = 0;
final logic = Get.find<CircleLogic>(); final logic = Get.find<CircleLogic>();
final state = Get.find<CircleLogic>().state; final state = Get.find<CircleLogic>().state;
@ -50,15 +52,14 @@ class _CirclePageState extends State<CirclePage>
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
currentIndex = Random().nextInt(3); currentIndex = Random().nextInt(3);
_pageController = PageController(initialPage: currentIndex); _pageController = PageController(initialPage: currentIndex);
_tabController = TabController(length: 3, vsync: this, initialIndex: currentIndex); _tabController =
TabController(length: 3, vsync: this, initialIndex: currentIndex);
_tabController.addListener(_handleTabChange); _tabController.addListener(_handleTabChange);
getContext = context; getContext = context;
} }
@ -71,7 +72,6 @@ class _CirclePageState extends State<CirclePage>
logic.update(); logic.update();
} }
@override @override
void dispose() { void dispose() {
_tabController.removeListener(_handleTabChange); // _tabController.removeListener(_handleTabChange); //
@ -88,7 +88,7 @@ class _CirclePageState extends State<CirclePage>
return Scaffold( return Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: SafeArea( body: SafeArea(
child:Stack( child: Stack(
children: [ children: [
Column(children: [ Column(children: [
Obx(() { Obx(() {
@ -134,9 +134,7 @@ class _CirclePageState extends State<CirclePage>
// ))) // )))
// : Center() // : Center()
], ],
) )),
),
); );
}); });
} }
@ -623,7 +621,8 @@ class _CirclePageState extends State<CirclePage>
), ),
child: Container( child: Container(
margin: EdgeInsets.all(0.6.sp), margin: EdgeInsets.all(0.6.sp),
padding: EdgeInsets.only(left: 6.sp,right: 6.sp,top: 4.sp,bottom: 4.sp), padding: EdgeInsets.only(
left: 6.sp, right: 6.sp, top: 4.sp, bottom: 4.sp),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(17.0),
@ -684,7 +683,7 @@ class _CirclePageState extends State<CirclePage>
TabBar( TabBar(
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
labelPadding: EdgeInsets.symmetric(horizontal: 8.0.sp), labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp),
indicator: UnderlineTabIndicator( indicator: UnderlineTabIndicator(
borderSide: BorderSide( borderSide: BorderSide(
color: const Color(0xFF00FFF4), color: const Color(0xFF00FFF4),
@ -701,7 +700,7 @@ class _CirclePageState extends State<CirclePage>
child: Text( child: Text(
'喜欢', '喜欢',
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 18.sp,
), ),
), ),
), ),
@ -709,7 +708,7 @@ class _CirclePageState extends State<CirclePage>
child: Text( child: Text(
'附近', '附近',
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 18.sp,
), ),
), ),
), ),
@ -717,7 +716,7 @@ class _CirclePageState extends State<CirclePage>
child: Text( child: Text(
'发现', '发现',
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 18.sp,
), ),
), ),
), ),
@ -746,7 +745,6 @@ class _CirclePageState extends State<CirclePage>
], ],
), ),
onTap: (index) { onTap: (index) {
if (currentIndex == index) { if (currentIndex == index) {
if (index == 2) { if (index == 2) {
EventBusManager.fire(DiscovrScrollTap()); EventBusManager.fire(DiscovrScrollTap());
@ -763,7 +761,6 @@ class _CirclePageState extends State<CirclePage>
// duration: const Duration(milliseconds: 300), // // duration: const Duration(milliseconds: 300), //
// curve: Curves.ease, // 线 // curve: Curves.ease, // 线
// ); // );
}, },
), ),
], ],
@ -781,7 +778,23 @@ class _CirclePageState extends State<CirclePage>
width: 75.sp, width: 75.sp,
), ),
) )
: GestureDetector( : Row(
children: [
InkWell(
onTap: () {
Get.bottomSheet(
TodayPeopleDialog(),
isScrollControlled: true,
enableDrag: false,
);
},
child: Image.asset(
getMsgImage('heart_icon'),
width: 24.sp,
),
),
SizedBox(width: 8.sp,),
GestureDetector(
onTap: () { onTap: () {
_showBottomSheet(context); _showBottomSheet(context);
}, },
@ -790,7 +803,8 @@ class _CirclePageState extends State<CirclePage>
width: 30.sp, width: 30.sp,
), ),
), ),
), ],
)),
], ],
), ),
); );
@ -802,14 +816,18 @@ class _CirclePageState extends State<CirclePage>
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (BuildContext context) { builder: (BuildContext context) {
return ScreenBottomSheetDialog( return ScreenBottomSheetDialog(
genderList: _tabController.index == 1 ? logic.genderList : logic.dis_genderList, genderList: _tabController.index == 1
orientationList: _tabController.index == 1 ? logic.orientationList : logic.dis_orientationList, ? logic.genderList
roleList: _tabController.index == 1 ? logic.roleList : logic.dis_roleList, : logic.dis_genderList,
orientationList: _tabController.index == 1
? logic.orientationList
: logic.dis_orientationList,
roleList:
_tabController.index == 1 ? logic.roleList : logic.dis_roleList,
callback: (genderList, orientationList, roleList) { callback: (genderList, orientationList, roleList) {
if (_tabController.index == 1) { if (_tabController.index == 1) {
_onRefresh(); _onRefresh();
} else { } else {
List<String> genders = []; List<String> genders = [];
logic.dis_genderList.forEach((element) { logic.dis_genderList.forEach((element) {
if (element.isSelect) { if (element.isSelect) {
@ -826,7 +844,8 @@ class _CirclePageState extends State<CirclePage>
if (element.isSelect) orientations.add(element.id); if (element.isSelect) orientations.add(element.id);
}); });
EventBusManager.fire(OptionFindclass(genders,roles,orientations)); EventBusManager.fire(
OptionFindclass(genders, roles, orientations));
} }
}, },
); // Use your custom widget here ); // Use your custom widget here
@ -1144,12 +1163,15 @@ class DefaultPickerStyle extends PickerStyle {
} }
class DiscovrScrollTap {} class DiscovrScrollTap {}
class NearScrollTap {} class NearScrollTap {}
class CircleScrollTap {} class CircleScrollTap {}
class OptionFindclass { class OptionFindclass {
List<String>? genderList;List<String>? orientationList;List<String>? roleList; List<String>? genderList;
List<String>? orientationList;
OptionFindclass(this.genderList,this.orientationList,this.roleList); List<String>? roleList;
OptionFindclass(this.genderList, this.orientationList, this.roleList);
} }

View File

@ -17,6 +17,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/utils.dart'; import 'package:get/utils.dart';
import 'package:gradient_borders/gradient_borders.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../../../util/eventBus.dart'; import '../../../../util/eventBus.dart';
@ -312,19 +313,26 @@ class _DiscoverState extends State<Discover>
Container( Container(
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
decoration: BoxDecoration( decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10.sp), color: Colors.black.withOpacity(0.25),
image: DecorationImage( borderRadius: BorderRadius.circular(10.sp),
fit: BoxFit.fill, border: GradientBoxBorder(
image: AssetImage( gradient:
getCircleImage('open_vip_bg'), AppColor.mainVerLinearGradient,
))), width: 1.sp,
),
// image: DecorationImage(
// fit: BoxFit.fill,
// image: AssetImage(
// getCircleImage('open_vip_bg'),
// ))
),
height: screenHeight, height: screenHeight,
width: Get.width, width: Get.width,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(18), borderRadius: BorderRadius.circular(10),
clipBehavior: Clip.hardEdge, // clipBehavior: Clip.hardEdge,
child: Container( child: Container(
padding: EdgeInsets.all(2.sp), // padding: EdgeInsets.all(2.sp),
child: Swiper( child: Swiper(
autoplay: user.images!.length == 1 autoplay: user.images!.length == 1
? false ? false

View File

@ -491,6 +491,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
void _onRefresh() async { void _onRefresh() async {
widget.logic.vicinityPage = 1; widget.logic.vicinityPage = 1;
widget.logic.offset = 0; widget.logic.offset = 0;
widget.logic.getBanner();
widget.logic.getNearByList(); widget.logic.getNearByList();
// logic.refreshController.refreshCompleted(); // logic.refreshController.refreshCompleted();
} }

View File

@ -11,6 +11,7 @@ import 'package:circle_app/app/msg/logic.dart';
import 'package:circle_app/main.dart'; import 'package:circle_app/main.dart';
import 'package:circle_app/network/api.dart'; import 'package:circle_app/network/api.dart';
import 'package:circle_app/network/dio_manager.dart'; import 'package:circle_app/network/dio_manager.dart';
import 'package:circle_app/router/app_routers.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:event_bus/event_bus.dart'; import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -23,6 +24,7 @@ import 'package:tencent_cloud_chat_uikit/data_services/message/message_services.
import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.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/tencent_cloud_chat_uikit.dart';
import '../../common/Widgets/today_people_dialog.dart';
import '../../util/PaymentUtils.dart'; import '../../util/PaymentUtils.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../../util/eventBus.dart'; import '../../util/eventBus.dart';
@ -53,6 +55,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
bool isUpdateVersion = false; bool isUpdateVersion = false;
String accountId = '';
@override @override
void onClose() { void onClose() {
// TODO: implement onClose // TODO: implement onClose
@ -319,8 +323,38 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
if (!coreInstance.isLoginSuccess) { 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) { if (data['code'] == 200) {
loginIM( loginIM(
data['data']['account_id'].toString(), data['data']['user_sig']); data['data']['account_id'].toString(), data['data']['user_sig']);
accountId = data['data']['account_id'].toString();
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
var date = DateTime.now();
var date2 = '${date.year}-${date.month}-${date.day}-${accountId}';
String firspop = 'firspop-${accountId}';
if (sp.preferences!.containsKey(firspop)) {
var lastDate = sp.preferences!.getString(firspop);
if (lastDate != date2) {
Future.delayed(Duration(seconds: 15), () {
if (Get.currentRoute != AppRoutes.Login) {
sp.preferences!.setString(firspop, date2);
Get.bottomSheet(TodayPeopleDialog(), isScrollControlled: true,
enableDrag: false,);
}
});
}
} else {
Future.delayed(Duration(seconds: 15), () {
if (Get.currentRoute != AppRoutes.Login) {
sp.preferences!.setString(firspop, date2);
Get.bottomSheet(TodayPeopleDialog(),isScrollControlled: true,
enableDrag: false,);
}
});
}
} }
} }
} }
@ -349,7 +383,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
sharedPreferences.setString( sharedPreferences.setString(
SharedPreferencesHelper.firstLogin, '1'); SharedPreferencesHelper.firstLogin, '1');
} }
loadMyCircleData() async { loadMyCircleData() async {

View File

@ -646,6 +646,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
// ·TA80 // ·TA80
// ·70 // ·70
// ·260 // ·260
// ·55
// ·50 // ·50
// ·TA40 // ·TA40
// ·TA是乐园优秀圈主哦30 // ·TA是乐园优秀圈主哦30
@ -680,6 +681,12 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
} }
} }
} }
if (titleList.length < 3) {
if (recommendCircleFriendData.containsKey('is_new_user')) {
titleList.add('我刚来到这里哦');
}
}
if (titleList.length < 3) { if (titleList.length < 3) {
if (recommendCircleFriendData['is_wanna_meet']) { if (recommendCircleFriendData['is_wanna_meet']) {
titleList.add('很多圈友都喜欢TA'); titleList.add('很多圈友都喜欢TA');

View File

@ -30,7 +30,7 @@ class Sys_notify_listPage extends StatelessWidget {
child: Scaffold( child: Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: MyAppBar(
centerTitle: "系统通知", centerTitle: "官方通知",
), ),
body: Container( body: Container(
width: Get.width, width: Get.width,

View File

@ -436,7 +436,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
), ),
ClipOval( ClipOval(
child: Image.network( child: Image.network(
info['avatar'], info['avatar_thumb'],
fit: BoxFit.cover, fit: BoxFit.cover,
width: 50.sp, width: 50.sp,
height: 50.sp, height: 50.sp,

View File

@ -213,21 +213,29 @@ class UserinfoLogic extends GetxController {
startCountdown(){ startCountdown(){
timer = Timer.periodic(const Duration(seconds: 1), (t) { timer = Timer.periodic(const Duration(seconds: 1), (t) async {
if (countdown > 0) { if (countdown > 0) {
countdown--; countdown--;
} else { } else {
bool isTip = await checkIsShowTip();
if (isTip) {
showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){ showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){
setLike(); setLike();
}); });
}
timer?.cancel(); // timer?.cancel(); //
} }
}); });
} }
Future<bool> checkIsShowTip() async {
var result = await DioManager.instance.get(
url: Api.popup + userId ,
);
return result['data'];
}
Future<void> fetchMyAlbum(String url) async { Future<void> fetchMyAlbum(String url) async {
var myAlbumData = await DioManager.instance.get(url: url); var myAlbumData = await DioManager.instance.get(url: url);

View File

@ -131,9 +131,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
child: Stack( child: Scaffold(
children: [
Scaffold(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
appBar: MyAppBar( appBar: MyAppBar(
centerTitle: logic.userInfoBean != null centerTitle: logic.userInfoBean != null
@ -261,8 +259,8 @@ class MyTabbedScreenState extends State<UserinfoPage>
toolbarHeight: 0, toolbarHeight: 0,
foregroundColor: Colors.transparent, foregroundColor: Colors.transparent,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
expandedHeight: (!logic.isMe ? 372.sp : 312.sp) + (logic.userInfoBean != null expandedHeight: 374.sp + (logic.userInfoBean != null
? logic.userInfoBean!.wx_num!.isNotEmpty ? logic.userInfoBean!.wx_num!.isNotEmpty && logic.userId.toString().isNotEmpty
? 59.sp : 0 : 0), ? 59.sp : 0 : 0),
bottom: PreferredSize( bottom: PreferredSize(
preferredSize: Size(Get.width,40), preferredSize: Size(Get.width,40),
@ -326,8 +324,6 @@ class MyTabbedScreenState extends State<UserinfoPage>
], ],
), ),
), ),
],
),
); );
} }
@ -534,7 +530,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
fontSize: 12.sp, fontSize: 12.sp,
color: logic.isOnline color: logic.isOnline
? const Color(0xFF00FFF4) ? const Color(0xFF00FFF4)
: const Color(0xFF787575), : const Color(0xFF00FFF4),
), ),
), ),
], ],
@ -564,7 +560,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
logic.userInfoBean!.wx_num, logic.userInfoBean!.wx_num,
logic.userInfoBean!.id.toString(), logic.userInfoBean!.id.toString(),
logic.userInfoBean!.avatar!, logic.userInfoBean!.avatar!,
() {}), () {
logic. fetchUserInfo("${Api.getUserInfoTA + logic.userId}/home");
}),
], ],
)) ))
: Container() : Container()

View File

@ -0,0 +1,564 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:gradient_borders/gradient_borders.dart';
import '../../app/circle/widgets/discover.dart';
import '../../network/api.dart';
import '../../network/dio_manager.dart';
import '../../router/app_routers.dart';
import '../../util/util.dart';
import '../colors/app_color.dart';
class TodayPeopleDialog extends StatefulWidget {
@override
_TodayPeopleDialogState createState() => new _TodayPeopleDialogState();
}
class _TodayPeopleDialogState extends State<TodayPeopleDialog> {
// TODO: add state variables and methods
var recommendCircleFriendData = {};
List<String> chatImIdList = [];
@override
void initState() {
// TODO: implement initState
super.initState();
loadRecommendCircleFriendData();
}
void loadRecommendCircleFriendData() async {
var data = await DioManager.instance.get(
url: Api.chatRecommendFriend,
);
if (data['code'] == 200) {
recommendCircleFriendData = data['data'][0];
setState(() {});
}
}
itemWidget() {
var info = {};
var user = Users.fromJson(recommendCircleFriendData['user']);
// 100
// ·90
// ·TA80
// ·70
// ·260
// ·50
// ·TA40
// ·TA是乐园优秀圈主哦30
var titleList = [];
if (recommendCircleFriendData['is_follow_me']) {
titleList.add('对方喜欢了你');
} else if (recommendCircleFriendData['has_both_friend']) {
titleList.add('你们有共同喜欢的圈友');
} else if (recommendCircleFriendData['has_friend_follow_to']) {
titleList.add('你喜欢的圈友也喜欢TA');
}
if (titleList.length < 3) {
List citys = recommendCircleFriendData['both_cities'];
if (citys.isNotEmpty) {
titleList.add('你们都在${citys.first}留下过足迹');
}
}
if (titleList.length < 3) {
List circles = recommendCircleFriendData['both_interests'];
if (circles.isNotEmpty) {
List<dynamic> both_interests =
recommendCircleFriendData['both_interests'];
List<String> circleList = [];
both_interests.forEach((element) {
circleList.add(element['title']);
});
if (circleList.isNotEmpty) {
titleList
.add('你们有${circleList.length}个共同的圈子:${circleList.join('')}');
}
}
}
if (titleList.length < 3) {
if (recommendCircleFriendData.containsKey('is_new_user')) {
titleList.add('我刚来到这里哦');
}
}
if (titleList.length < 3) {
if (recommendCircleFriendData['is_wanna_meet']) {
titleList.add('很多圈友都喜欢TA');
}
}
if (titleList.length < 3) {
if (recommendCircleFriendData['is_most_fans']) {
titleList.add('可能是你想认识的人');
}
}
if (titleList.length < 3) {
if (recommendCircleFriendData['is_excellent_qz_leader']) {
titleList.add('TA是乐园优秀圈主哦');
}
}
if (titleList.length >= 1) {
info['city'] = titleList.first;
}
if (titleList.length >= 2) {
info['both_interests'] = titleList[1];
}
if (titleList.length >= 3) {
info['desc'] = titleList[2];
}
List circleList = recommendCircleFriendData['interests'];
return Container(
width: Get.width,
// constraints: BoxConstraints(maxHeight: 230.sp),
decoration: BoxDecoration(
gradient:
LinearGradient(colors: [Color(0xFF4C3E5F), Color(0xFF324140)]),
borderRadius: BorderRadius.circular(8.sp),
border: GradientBoxBorder(
gradient: AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp, top: 10.sp),
child: Column(
children: [
GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity, arguments: '');
},
child: Container(
child: Row(
children: [
ClipOval(
child: Image.network(
recommendCircleFriendData['user']['avatar'],
width: 50.sp,
height: 50.sp,
fit: BoxFit.cover,
),
),
SizedBox(
width: 6.sp,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
user.nickname ?? '',
style: TextStyle(
fontSize: 16.sp,
color: Color(0XFFF7FAFA),
fontWeight: FontWeight.bold),
),
SizedBox(
height: 4.sp,
),
Row(
children: [
Container(
alignment: Alignment.center,
height: 18.sp,
padding: EdgeInsets.only(left: 6.sp, right: 6.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(9.sp),
gradient: const LinearGradient(
begin: Alignment(0.25, 0.5),
end: Alignment(0.75, 0.5),
colors: [
Color(0xff8DFFF8),
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(user!.gender ?? 0, user!.age ?? 0,
user!.role ?? 0, user!.orientation ?? 0),
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
),
),
),
if (user.vip! > 0)
Container(
margin: EdgeInsets.only(
left: 4.sp,
),
child: Image.asset(
getCircleImage(
user.vip == 1 ? 'vip' : 'year_vip'),
width: 36.sp,
),
),
],
),
],
)),
GestureDetector(
onTap: () async {
if (!chatImIdList.contains(user.userId.toString())) {
await createCustomMsg(user.userId.toString(),
recommendCircleFriendData['user']['imId']);
}
pushChatPage(
user.userId.toString(),
recommendCircleFriendData['user']['imId'],
user.nickname!);
},
child: Container(
height: 25.sp,
padding: EdgeInsets.only(left: 6.sp, right: 6.sp),
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(12.5.sp)),
alignment: Alignment.center,
child: Text(
'聊一聊',
style: TextStyle(color: Colors.white, fontSize: 15.sp),
),
),
)
],
),
),
),
if (info.containsKey('desc'))
Container(
margin: EdgeInsets.only(top: 10.sp, right: 16.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Expanded(
child: Container(
child: Text(
info['desc'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
)
],
),
),
if (info.containsKey('city'))
info['city'].toString().isNotEmpty
? Container(
margin: EdgeInsets.only(top: 10.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3.sp,
height: 3.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5.sp),
color: Color(0xFF00FFF4)),
),
Expanded(
child: Text(
info['city'],
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
))
],
),
)
: Container(),
if (info.containsKey('both_interests'))
Container(
margin: EdgeInsets.only(top: 10.sp, right: 16.sp),
child: Row(
children: [
Container(
margin: EdgeInsets.only(right: 5.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Expanded(
child: Container(
child: Text(
info['both_interests'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500,
),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
alignment: Alignment.centerLeft,
child:
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
margin: EdgeInsets.only(right: 5.sp, top: 10.sp),
width: 3,
height: 3,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(1.5),
color: Color(0xFF00FFF4)),
),
Expanded(
child: Text(
'交友宣言:' + recommendCircleFriendData['user']['signature'],
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontWeight: FontWeight.w500),
maxLines: 2,
overflow: TextOverflow.ellipsis,
)),
])),
Image.asset(
getCircleImage('line'),
width: Get.width,
fit: BoxFit.fill,
),
if (circleList.isNotEmpty)
Container(
height: 72.sp,
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
width: Get.width,
child: ListView.builder(
itemBuilder: (context, index) {
return circleInfoItem(circleList[index], index);
},
itemCount: circleList.length,
scrollDirection: Axis.horizontal,
),
)
],
),
);
}
circleInfoItem(var bean, int index) {
return GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.Signal_circle_list,
arguments: bean['id'].toString());
},
child: Container(
margin: EdgeInsets.only(right: 10.sp),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
height: 72.sp,
width: 140.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.sp),
border: GradientBoxBorder(
gradient: AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 42.sp,
height: 42.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
gradient: const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF71F3F2),
Color(0xFFF558FF),
],
stops: [0.0365, 0.9427],
),
),
padding: EdgeInsets.all(1.sp),
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: CachedNetworkImage(
imageUrl: bean['image'],
width: 40.sp,
height: 40.sp,
memCacheHeight: 40,
memCacheWidth: 40,
fit: BoxFit.cover),
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
left: 8.sp,
),
// alignment: Alignment.,
height: 72.sp,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
bean['title'],
style: TextStyle(
color: Colors.white,
fontSize: 12.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
height: 4.sp,
),
Text(
// "view_total" -> 21
'${convertToTenThousand(bean['viewTotal'])}人看过',
textAlign: TextAlign.left,
style: TextStyle(
color: const Color(0xff03FEFB),
fontSize: 12.sp,
),
),
],
),
)),
],
),
),
);
}
@override
Widget build(BuildContext context) {
// TODO: add widget build method
return Scaffold(
backgroundColor: Colors.black.withOpacity(0.75),
body: recommendCircleFriendData.isNotEmpty
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(bottom: 16.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
getMsgImage('heart_icon'),
width: 18.sp,
),
SizedBox(
width: 4.sp,
),
ShaderMask(
shaderCallback: (Rect bounds) {
return const LinearGradient(
begin: Alignment(0.0, -1.0),
end: Alignment.bottomCenter,
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
).createShader(Offset.zero & bounds.size);
},
child: Text(
'圈友推荐',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w600,
color: Colors.white,
shadows: [
Shadow(
color: Color(0xffF657FF), offset: Offset(0.0, -1))
]),
),
),
SizedBox(
width: 4.sp,
),
Image.asset(
getMsgImage('heart_icon'),
width: 18.sp,
),
],
),
),
itemWidget(),
Container(
height: 40.sp,
margin: EdgeInsets.only(top: 20.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: Container(
width: 100.sp,
height: 40.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFF392D53),
borderRadius: BorderRadius.circular(20.sp)),
child: Text(
'先不看了',
style: TextStyle(
color: Colors.white, fontSize: 15.sp),
),
),
),
SizedBox(
width: 40.sp,
),
GestureDetector(
onTap: () {
loadRecommendCircleFriendData();
},
child: Container(
width: 100.sp,
height: 40.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
gradient: AppColor.mainHorLinearGradient,
borderRadius: BorderRadius.circular(20.sp)),
child: Text(
'换一位',
style: TextStyle(
color: Colors.white, fontSize: 15.sp),
)),
)
],
),
)
],
)
: Container());
}
}

View File

@ -170,7 +170,7 @@ class _UnlockWxTipState extends State<UnlockWxTip> {
SmartDialog.showLoading(); SmartDialog.showLoading();
String itemId = prices[selectedIndex].itemId!; String itemId = prices[selectedIndex].itemId!;
if (Platform.isIOS ) { if (Platform.isIOS ) {
IOSPayment.instance.iosPay(itemId,itemId,3,userId:widget.userId); IOSPayment.instance.iosPay(itemId, prices[selectedIndex].id.toString(),3,userId:widget.userId);
} else { } else {
unlockingPayment(prices[selectedIndex].id.toString(), (){ unlockingPayment(prices[selectedIndex].id.toString(), (){
Get.back(); Get.back();

View File

@ -24,6 +24,7 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl,
var result = await DioManager() var result = await DioManager()
.post(url: Api.UnlockWx, params: {'targetUserId': userId}); .post(url: Api.UnlockWx, params: {'targetUserId': userId});
if (result['code'] == 200) { if (result['code'] == 200) {
showToast('解锁成功');
callBack(); callBack();
} else { } else {
Get.bottomSheet(UnlockWxTip(userId, avatarUrl), Get.bottomSheet(UnlockWxTip(userId, avatarUrl),
@ -35,8 +36,8 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl,
}); });
} }
} else { } else {
Clipboard.setData(ClipboardData(text: wx)); // Clipboard.setData(ClipboardData(text: wx));
showToast('微信号复制成功'); // showToast('微信号复制成功');
} }
}, },
child: Container( child: Container(

View File

@ -305,4 +305,7 @@ class Api {
// //
static const noticeWxNum = '/user-service/user/updateWxNum/notice/'; static const noticeWxNum = '/user-service/user/updateWxNum/notice/';
//
static const popup = '/user-service/follow/popup/';
} }

View File

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:ui'; import 'dart:ui';
import 'package:circle_app/app/chat/view.dart';
import 'package:circle_app/app/circle/widgets/discover.dart'; import 'package:circle_app/app/circle/widgets/discover.dart';
import 'package:circle_app/app/userinfo/logic.dart'; import 'package:circle_app/app/userinfo/logic.dart';
import 'package:circle_app/common/values/values.dart'; import 'package:circle_app/common/values/values.dart';
@ -17,6 +18,7 @@ import 'package:oktoast/oktoast.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:video_compress/video_compress.dart'; import 'package:video_compress/video_compress.dart';
import '../app/circle/logic.dart'; import '../app/circle/logic.dart';
@ -427,12 +429,17 @@ void navigateToInviteStrategy() {
}); });
} }
void navigateToCustomRoute(BannerItem bannerItem) { void navigateToCustomRoute(BannerItem bannerItem) async {
print(bannerItem.param); print(bannerItem.param);
switch (bannerItem.type) { switch (bannerItem.type) {
case 1: case 1:
if (bannerItem.scene == 'internal') {
Get.toNamed(AppRoutes.WebViewActivity, Get.toNamed(AppRoutes.WebViewActivity,
arguments: {'title': "", "url": bannerItem.param.toString()}); arguments: {'title': "", "url": bannerItem.param.toString()});
} else {
await launch(bannerItem.param.toString(),forceSafariVC: false);
}
break; break;
case 2: case 2:
switch (bannerItem.scene) { switch (bannerItem.scene) {
@ -477,6 +484,9 @@ unLockWxSuccessResult(String userId) {
} else if (currentRoute == AppRoutes.UserInfoActivity) { } else if (currentRoute == AppRoutes.UserInfoActivity) {
var logic = Get.find<UserinfoLogic>(); var logic = Get.find<UserinfoLogic>();
logic.fetchUserInfo("${Api.getUserInfoTA + userId}/home"); logic.fetchUserInfo("${Api.getUserInfoTA + userId}/home");
} else if (currentRoute == AppRoutes.Chat) {
EventBusManager.fire(ChatLoadUserInfoData());
} }
} }

View File

@ -614,6 +614,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.3" version: "1.1.3"
flutter_install_app:
dependency: "direct main"
description:
name: flutter_install_app
sha256: "9b117006d17c900e671c26bcbc9b15c7b8efd15d6f9b4442ad5d576de20fab53"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
flutter_intl: flutter_intl:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -90,7 +90,7 @@ dependencies:
fluwx: ^3.8.1+1 fluwx: ^3.8.1+1
event_bus: ^2.0.0 event_bus: ^2.0.0
#安装apk #安装apk
# flutter_install_app: 1.3.0 flutter_install_app: 1.3.0
#闪屏页 #闪屏页
flutter_native_splash: 2.2.16 flutter_native_splash: 2.2.16
#腾讯离线推送 #腾讯离线推送