1.3.7代码提交
This commit is contained in:
parent
dbb58ccaa6
commit
0751408802
@ -71,8 +71,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 28
|
||||
versionName "1.3.6"
|
||||
versionCode 29
|
||||
versionName "1.3.7"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
|
||||
BIN
circle_app/assets/images/msg/keyboard.png
Normal file
BIN
circle_app/assets/images/msg/keyboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
@ -450,9 +450,10 @@ class _TIMUIKItHistoryMessageListItemState
|
||||
String title = '';
|
||||
|
||||
if (info.containsKey('title')) {
|
||||
var recommendCircleFriendData= info['title'];
|
||||
|
||||
Map recommendCircleFriendData= info['title'];
|
||||
|
||||
|
||||
|
||||
if (recommendCircleFriendData['is_follow_me'] && isFromSelf) {
|
||||
title = '对方喜欢了你';
|
||||
} else if (recommendCircleFriendData['is_follow_to'] && !isFromSelf) {
|
||||
@ -461,16 +462,17 @@ class _TIMUIKItHistoryMessageListItemState
|
||||
title = '你喜欢了TA';
|
||||
} else if (recommendCircleFriendData['has_both_friend']) {
|
||||
title = '你们有共同喜欢的圈友';
|
||||
} else if (recommendCircleFriendData['has_friend_follow_to'] && isFromSelf) {
|
||||
} else if (recommendCircleFriendData.containsKey('is_new_user') && !isFromSelf) {
|
||||
title = '我刚来到这里哦';
|
||||
} else if (recommendCircleFriendData['has_friend_follow_to'] && isFromSelf) {
|
||||
title = '你喜欢的圈友也喜欢TA';
|
||||
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) {
|
||||
title = '很多圈友都喜欢TA';
|
||||
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) {
|
||||
} else if (recommendCircleFriendData['is_excellent_qz_leader'] && isFromSelf) {
|
||||
title = 'TA是乐园优秀圈主哦~';
|
||||
} else if (recommendCircleFriendData['is_wanna_meet'] && isFromSelf) {
|
||||
} else if (recommendCircleFriendData['is_most_fans'] && isFromSelf) {
|
||||
title = '可能是你想认识的人';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -291,15 +291,14 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
bool isSendLoging = false;
|
||||
onSubmitted() async {
|
||||
if (isSendLoging) {
|
||||
return;
|
||||
}
|
||||
if (isBlack) {
|
||||
showOKToast("您已将对方拉黑,请移除黑名单后在发送消息~");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (isSending) return;
|
||||
isSending = true;
|
||||
bool isOK = await checkImStatus();
|
||||
|
||||
if (!isOK) {
|
||||
@ -314,6 +313,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
if (text.isEmpty) {
|
||||
if (hintText.contains('说些什么吧~')) {
|
||||
showOKToast('请输入消息内容后发送');
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
return;
|
||||
} else {
|
||||
if ((widget.currentConversation.lastMessage?.customElem ?? null) !=
|
||||
@ -321,6 +321,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
if (widget.currentConversation.lastMessage?.customElem!.extension ==
|
||||
'cardData') {
|
||||
sendHiText();
|
||||
isSending = false;
|
||||
}
|
||||
} else {
|
||||
var result = await TencentImSDKPlugin.v2TIMManager
|
||||
@ -344,7 +345,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
showOKToast('请输入消息内容后发送');
|
||||
}
|
||||
}
|
||||
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -369,12 +370,12 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
} else {
|
||||
bool isOK = await loadIsShowSendGiftDialogData();
|
||||
if (!isOK) {
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
return;
|
||||
}
|
||||
isSendLoging = true;
|
||||
var data = await DioManager.instance
|
||||
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
|
||||
isSendLoging = false;
|
||||
|
||||
List words = [];
|
||||
if (data['data']['code'] == 10000) {
|
||||
words = data['data']['words'];
|
||||
@ -384,7 +385,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
if (words.isEmpty) {
|
||||
var msgResult = await MessageUtils.handleMessageError(
|
||||
widget.model.sendTextMessage(
|
||||
@ -395,7 +396,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
addChatRecord(text, msgResult!.data!.msgID! ?? '', msgResult!.data!.timestamp!.toString() ?? '');
|
||||
} else {
|
||||
textEditingController.text = text;
|
||||
showOKToast('含违规词汇,无法发送');
|
||||
return;
|
||||
}
|
||||
@ -407,8 +407,10 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
goDownBottom();
|
||||
_handleSendEditStatus("", false);
|
||||
|
||||
} else {
|
||||
showOKToast('请输入消息内容');
|
||||
isSending = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,6 +456,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
"sendTime": str,
|
||||
"to": widget.conversationID.split('_').last
|
||||
});
|
||||
isSending = false;
|
||||
}
|
||||
|
||||
void goDownBottom() {
|
||||
@ -818,7 +821,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
StreamSubscription? commentBlackEvent = null;
|
||||
bool isBlack = false;
|
||||
|
||||
bool isSending = false;
|
||||
getBlack() async {
|
||||
final FriendshipServices _friendshipServices =
|
||||
serviceLocator<FriendshipServices>();
|
||||
|
||||
@ -19,6 +19,7 @@ import 'package:flutter_svg/svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.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_state.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_thumbnail/video_thumbnail.dart';
|
||||
|
||||
import '../../../../../common/Widgets/unlock_wx_tip.dart';
|
||||
import '../../../../../util/eventBus.dart';
|
||||
import '../../../../call_out/logic.dart';
|
||||
import '../../../../userinfo/logic.dart';
|
||||
import '../../../view.dart';
|
||||
import '../../../widget/chat_circle_share_dialog.dart';
|
||||
import '../../../widget/chat_gift_pannel.dart';
|
||||
|
||||
@ -176,10 +180,16 @@ class _TIMTextFieldLayoutNarrowState
|
||||
bool showKeyboard = false;
|
||||
Function? setKeyboardHeight;
|
||||
double? bottomPadding;
|
||||
UserBean? userInfoBean;
|
||||
|
||||
int unLockWxNum = 0;
|
||||
var sub1;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
sub1 = EventBusManager.on<ChatLoadUserInfoData>().listen((event) {
|
||||
loadUserData();
|
||||
});
|
||||
if (widget.controller != null) {
|
||||
widget.controller?.addListener(() {
|
||||
final actionType = widget.controller?.actionType;
|
||||
@ -196,7 +206,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadUserData();
|
||||
getBlack();
|
||||
}
|
||||
|
||||
@ -204,6 +214,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
sub1.cancel();
|
||||
print("TIMTextFieldLayoutNarrow解绑");
|
||||
if (null != commentBlackEvent) {
|
||||
EventBusManager.cancelSubscription(commentBlackEvent!);
|
||||
@ -314,7 +325,8 @@ class _TIMTextFieldLayoutNarrowState
|
||||
|
||||
double _getBottomHeight() {
|
||||
if (showKeyboard) {
|
||||
final currentKeyboardHeight = MediaQuery.of(context).viewInsets.bottom;
|
||||
final currentKeyboardHeight =
|
||||
MediaQuery.of(context).viewInsets.bottom + 10.sp;
|
||||
double originHeight = settingModel.keyboardHeight;
|
||||
if (currentKeyboardHeight != 0) {
|
||||
if (currentKeyboardHeight >= originHeight) {
|
||||
@ -639,7 +651,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
: TextInputAction
|
||||
.send,
|
||||
onEditingComplete: () {
|
||||
widget.onSubmitted();
|
||||
widget.onSubmitted();
|
||||
if (showKeyboard) {
|
||||
widget.focusNode
|
||||
.requestFocus();
|
||||
@ -704,7 +716,9 @@ class _TIMTextFieldLayoutNarrowState
|
||||
widget.goDownBottom();
|
||||
},
|
||||
child: Image.asset(
|
||||
getMsgImage('emoji'),
|
||||
!showEmojiPanel
|
||||
? getMsgImage('emoji')
|
||||
: getMsgImage('keyboard'),
|
||||
height: 24.sp,
|
||||
width: 24.sp,
|
||||
),
|
||||
@ -844,18 +858,24 @@ class _TIMTextFieldLayoutNarrowState
|
||||
),
|
||||
if (!showKeyboard && !showEmojiPanel)
|
||||
Positioned(
|
||||
top: 0,
|
||||
top: 10.sp,
|
||||
child: Container(
|
||||
// margin: EdgeInsets.only(bottom: 5.sp),
|
||||
padding: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
height: 50.sp,
|
||||
height: 28.sp,
|
||||
// color: Colors.red,
|
||||
width: Get.width,
|
||||
child: Row(
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
chatActionWidget('hello', '打招呼', () async {
|
||||
var reulst = await DioManager.instance.get(url: Api.msgRandOne);
|
||||
String text = reulst['data'];
|
||||
var reulst =
|
||||
await DioManager.instance.get(url: Api.msgRandOne);
|
||||
String text = reulst['data'];
|
||||
var result = await widget.model.sendTextMessage(
|
||||
text: text, convID: widget.conversationID, convType: ConvType.c2c);
|
||||
text: text,
|
||||
convID: widget.conversationID,
|
||||
convType: ConvType.c2c);
|
||||
}),
|
||||
chatActionWidget('wish', '许个愿', () {
|
||||
Get.bottomSheet(
|
||||
@ -873,6 +893,8 @@ class _TIMTextFieldLayoutNarrowState
|
||||
isScrollControlled: true,
|
||||
enableDrag: false);
|
||||
}),
|
||||
if (userInfoBean != null)
|
||||
userInfoBean!.wx_num.isNotEmpty ? chatWxActionWidget() : chatWantWxActionWidget()
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -903,8 +925,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getMsgImage(img),
|
||||
Image.asset( getMsgImage(img),
|
||||
width: 20.sp,
|
||||
),
|
||||
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 {
|
||||
imStatusOK = await loadIsShowSendGiftDialogData();
|
||||
if (imStatusOK == false) {
|
||||
@ -947,12 +1085,17 @@ class _TIMTextFieldLayoutNarrowState
|
||||
return imStatusOK;
|
||||
}
|
||||
|
||||
loadIsShowSendGiftDialogData() async {
|
||||
|
||||
var data = await DioManager.instance.get(url: Api.isShow_give_gift +widget.userId!.split('_').last);
|
||||
loadIsShowSendGiftDialogData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.isShow_give_gift + widget.userId!.split('_').last);
|
||||
if (data['code'] == 200) {
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
@ -984,13 +1127,10 @@ class _TIMTextFieldLayoutNarrowState
|
||||
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;
|
||||
|
||||
var data =
|
||||
await DioManager.instance.post(url: Api.chatRecord, params: {
|
||||
var data = await DioManager.instance.post(url: Api.chatRecord, params: {
|
||||
"content": msgContent,
|
||||
"msgId": msgId,
|
||||
"sendTime": str,
|
||||
@ -1041,7 +1181,8 @@ class _TIMTextFieldLayoutNarrowState
|
||||
final Duration videoDuration = videoPlayerController!.value.duration;
|
||||
final double durationInSeconds = videoDuration.inSeconds.toDouble();
|
||||
|
||||
V2TimValueCallback<V2TimMessage>? msgresult = await widget.model.sendVideoMessage(
|
||||
V2TimValueCallback<V2TimMessage>? msgresult =
|
||||
await widget.model.sendVideoMessage(
|
||||
videoPath: pickedFile.path,
|
||||
snapshotPath: thumbnailPath,
|
||||
// 在此处可用
|
||||
@ -1051,7 +1192,8 @@ class _TIMTextFieldLayoutNarrowState
|
||||
inputElement: context,
|
||||
);
|
||||
|
||||
addChatRecord('[视频]', msgresult!.data!.msgID! ?? '', msgresult!.data!.timestamp!.toString() ?? '');
|
||||
addChatRecord('[视频]', msgresult!.data!.msgID! ?? '',
|
||||
msgresult!.data!.timestamp!.toString() ?? '');
|
||||
|
||||
if (imageSource == ImageSource.camera) {
|
||||
DioManager.instance.get(url: Api.getAddTrialCount + "2");
|
||||
@ -1103,13 +1245,14 @@ class _TIMTextFieldLayoutNarrowState
|
||||
final XFile? pickedFile = await _picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
);
|
||||
var msgresult = await widget.model.sendImageMessage(
|
||||
var msgresult = await widget.model.sendImageMessage(
|
||||
imagePath: pickedFile!.path,
|
||||
convID: widget.conversationID,
|
||||
convType: widget.conversationType,
|
||||
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");
|
||||
} catch (e) {
|
||||
print(e);
|
||||
@ -1137,12 +1280,13 @@ class _TIMTextFieldLayoutNarrowState
|
||||
if (null == pickedFile) {
|
||||
return;
|
||||
}
|
||||
var msgresult = await widget.model.sendImageMessage(
|
||||
var msgresult = await widget.model.sendImageMessage(
|
||||
imagePath: pickedFile.path,
|
||||
convID: widget.conversationID,
|
||||
convType: widget.conversationType,
|
||||
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");
|
||||
} 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(() {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
|
||||
User? userInfoBean;
|
||||
var sub;
|
||||
var sub1;
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
@ -82,6 +83,8 @@ class _ChatPageState extends State<ChatPage> {
|
||||
sendMessageRes.data?.customElem?.extension; //自定义extension
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
Widget renderCustomStickerPanel({
|
||||
@ -244,3 +247,8 @@ class _ChatPageState extends State<ChatPage> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ChatLoadUserInfoData {
|
||||
|
||||
}
|
||||
@ -56,7 +56,10 @@ class _WishDialogState extends State<WishDialog> {
|
||||
tipStr = info['topHours'] != null ? info['topHours'].toString() : '';
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -16,8 +16,11 @@ import 'package:flutter_pickers/style/picker_style.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gradient_borders/gradient_borders.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 '../userinfo/logic.dart';
|
||||
import 'logic.dart';
|
||||
@ -39,7 +42,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
|
||||
int currentIndex = 0;
|
||||
|
||||
|
||||
final logic = Get.find<CircleLogic>();
|
||||
|
||||
final state = Get.find<CircleLogic>().state;
|
||||
@ -50,15 +52,14 @@ class _CirclePageState extends State<CirclePage>
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
currentIndex = Random().nextInt(3);
|
||||
_pageController = PageController(initialPage: currentIndex);
|
||||
_tabController = TabController(length: 3, vsync: this, initialIndex: currentIndex);
|
||||
_tabController =
|
||||
TabController(length: 3, vsync: this, initialIndex: currentIndex);
|
||||
_tabController.addListener(_handleTabChange);
|
||||
getContext = context;
|
||||
}
|
||||
@ -71,7 +72,6 @@ class _CirclePageState extends State<CirclePage>
|
||||
logic.update();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController.removeListener(_handleTabChange); // 移除监听
|
||||
@ -88,55 +88,53 @@ class _CirclePageState extends State<CirclePage>
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
child:Stack(
|
||||
children: [
|
||||
Column(children: [
|
||||
Obx(() {
|
||||
return navigatorItem(controller.statistics.value);
|
||||
}),
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
]),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 45.sp),
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
// controller: _pageController,
|
||||
// onPageChanged: (index) {
|
||||
// _tabController.animateTo(index);
|
||||
// print("index=" + index.toString());
|
||||
// },
|
||||
children: [
|
||||
LikeView(),
|
||||
// circleList(controller),
|
||||
Vicinity(controller),
|
||||
Discover(0)
|
||||
],
|
||||
),
|
||||
),
|
||||
// _tabController.index == 0
|
||||
// ? Positioned(
|
||||
// bottom: 36.sp,
|
||||
// right: 10.sp,
|
||||
// child: GestureDetector(
|
||||
// onTap: () async {
|
||||
// List<MyConfigData> numbers = [];
|
||||
// numbers.add(MyConfigData(
|
||||
// logic.getCircleIndex().id.toString(),
|
||||
// logic.getCircleIndex().title!,
|
||||
// false));
|
||||
// var data = await Get.toNamed(AppRoutes.Call_out,
|
||||
// arguments: {'numbers': numbers});
|
||||
// },
|
||||
// child: Image.asset(
|
||||
// getCircleImage('send_msg'),
|
||||
// width: 60.sp,
|
||||
// )))
|
||||
// : Center()
|
||||
],
|
||||
)
|
||||
),
|
||||
|
||||
child: Stack(
|
||||
children: [
|
||||
Column(children: [
|
||||
Obx(() {
|
||||
return navigatorItem(controller.statistics.value);
|
||||
}),
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
]),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 45.sp),
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
// controller: _pageController,
|
||||
// onPageChanged: (index) {
|
||||
// _tabController.animateTo(index);
|
||||
// print("index=" + index.toString());
|
||||
// },
|
||||
children: [
|
||||
LikeView(),
|
||||
// circleList(controller),
|
||||
Vicinity(controller),
|
||||
Discover(0)
|
||||
],
|
||||
),
|
||||
),
|
||||
// _tabController.index == 0
|
||||
// ? Positioned(
|
||||
// bottom: 36.sp,
|
||||
// right: 10.sp,
|
||||
// child: GestureDetector(
|
||||
// onTap: () async {
|
||||
// List<MyConfigData> numbers = [];
|
||||
// numbers.add(MyConfigData(
|
||||
// logic.getCircleIndex().id.toString(),
|
||||
// logic.getCircleIndex().title!,
|
||||
// false));
|
||||
// var data = await Get.toNamed(AppRoutes.Call_out,
|
||||
// arguments: {'numbers': numbers});
|
||||
// },
|
||||
// child: Image.asset(
|
||||
// getCircleImage('send_msg'),
|
||||
// width: 60.sp,
|
||||
// )))
|
||||
// : Center()
|
||||
],
|
||||
)),
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -550,7 +548,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
} else if (index == 0) {
|
||||
showOKToast('小主,换个方向滑动呗~');
|
||||
}
|
||||
|
||||
|
||||
print(index.toString());
|
||||
},
|
||||
index: controller.state.index,
|
||||
@ -623,7 +621,8 @@ class _CirclePageState extends State<CirclePage>
|
||||
),
|
||||
child: Container(
|
||||
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,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
@ -684,7 +683,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 8.0.sp),
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 4.0.sp),
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
color: const Color(0xFF00FFF4),
|
||||
@ -701,7 +700,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: Text(
|
||||
'喜欢',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -709,7 +708,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: Text(
|
||||
'附近',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -717,7 +716,7 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: Text(
|
||||
'发现',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -746,13 +745,12 @@ class _CirclePageState extends State<CirclePage>
|
||||
],
|
||||
),
|
||||
onTap: (index) {
|
||||
|
||||
if (currentIndex == index) {
|
||||
if (index == 2) {
|
||||
EventBusManager.fire(DiscovrScrollTap());
|
||||
} else if (index == 1) {
|
||||
EventBusManager.fire(NearScrollTap());
|
||||
} else if (index == 0) {
|
||||
} else if (index == 0) {
|
||||
EventBusManager.fire(ScrollToTop());
|
||||
}
|
||||
return;
|
||||
@ -763,34 +761,50 @@ class _CirclePageState extends State<CirclePage>
|
||||
// duration: const Duration(milliseconds: 300), // 动画时长
|
||||
// curve: Curves.ease, // 动画曲线
|
||||
// );
|
||||
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
child: _tabController.index == 0
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Call_out);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('callout_icon'),
|
||||
width: 75.sp,
|
||||
),
|
||||
)
|
||||
: GestureDetector(
|
||||
onTap: () {
|
||||
_showBottomSheet(context);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('icon_screen'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
right: 0,
|
||||
child: _tabController.index == 0
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.Call_out);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('callout_icon'),
|
||||
width: 75.sp,
|
||||
),
|
||||
)
|
||||
: 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: () {
|
||||
_showBottomSheet(context);
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('icon_screen'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -802,14 +816,18 @@ class _CirclePageState extends State<CirclePage>
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (BuildContext context) {
|
||||
return ScreenBottomSheetDialog(
|
||||
genderList: _tabController.index == 1 ? logic.genderList : logic.dis_genderList,
|
||||
orientationList: _tabController.index == 1 ? logic.orientationList : logic.dis_orientationList,
|
||||
roleList: _tabController.index == 1 ? logic.roleList : logic.dis_roleList,
|
||||
genderList: _tabController.index == 1
|
||||
? logic.genderList
|
||||
: 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) {
|
||||
if (_tabController.index == 1) {
|
||||
_onRefresh();
|
||||
} else {
|
||||
|
||||
List<String> genders = [];
|
||||
logic.dis_genderList.forEach((element) {
|
||||
if (element.isSelect) {
|
||||
@ -826,7 +844,8 @@ class _CirclePageState extends State<CirclePage>
|
||||
if (element.isSelect) orientations.add(element.id);
|
||||
});
|
||||
|
||||
EventBusManager.fire(OptionFindclass(genders,roles,orientations));
|
||||
EventBusManager.fire(
|
||||
OptionFindclass(genders, roles, orientations));
|
||||
}
|
||||
},
|
||||
); // Use your custom widget here
|
||||
@ -1144,12 +1163,15 @@ class DefaultPickerStyle extends PickerStyle {
|
||||
}
|
||||
|
||||
class DiscovrScrollTap {}
|
||||
|
||||
class NearScrollTap {}
|
||||
|
||||
class CircleScrollTap {}
|
||||
|
||||
class OptionFindclass {
|
||||
List<String>? genderList;List<String>? orientationList;List<String>? roleList;
|
||||
|
||||
OptionFindclass(this.genderList,this.orientationList,this.roleList);
|
||||
List<String>? genderList;
|
||||
List<String>? orientationList;
|
||||
List<String>? roleList;
|
||||
|
||||
OptionFindclass(this.genderList, this.orientationList, this.roleList);
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_swiper/flutter_swiper.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/utils.dart';
|
||||
import 'package:gradient_borders/gradient_borders.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import '../../../../util/eventBus.dart';
|
||||
@ -312,19 +313,26 @@ class _DiscoverState extends State<Discover>
|
||||
Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(10.sp),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(
|
||||
getCircleImage('open_vip_bg'),
|
||||
))),
|
||||
color: Colors.black.withOpacity(0.25),
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
border: GradientBoxBorder(
|
||||
gradient:
|
||||
AppColor.mainVerLinearGradient,
|
||||
width: 1.sp,
|
||||
),
|
||||
// image: DecorationImage(
|
||||
// fit: BoxFit.fill,
|
||||
// image: AssetImage(
|
||||
// getCircleImage('open_vip_bg'),
|
||||
// ))
|
||||
),
|
||||
height: screenHeight,
|
||||
width: Get.width,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
// clipBehavior: Clip.hardEdge,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(2.sp),
|
||||
// padding: EdgeInsets.all(2.sp),
|
||||
child: Swiper(
|
||||
autoplay: user.images!.length == 1
|
||||
? false
|
||||
|
||||
@ -491,6 +491,7 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
void _onRefresh() async {
|
||||
widget.logic.vicinityPage = 1;
|
||||
widget.logic.offset = 0;
|
||||
widget.logic.getBanner();
|
||||
widget.logic.getNearByList();
|
||||
// logic.refreshController.refreshCompleted();
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import 'package:circle_app/app/msg/logic.dart';
|
||||
import 'package:circle_app/main.dart';
|
||||
import 'package:circle_app/network/api.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:event_bus/event_bus.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/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import '../../common/Widgets/today_people_dialog.dart';
|
||||
import '../../util/PaymentUtils.dart';
|
||||
import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/eventBus.dart';
|
||||
@ -53,6 +55,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
|
||||
bool isUpdateVersion = false;
|
||||
|
||||
|
||||
String accountId = '';
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
@ -319,8 +323,38 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
if (!coreInstance.isLoginSuccess) {
|
||||
var data = await DioManager.instance.get(url: Api.getIMInfo);
|
||||
if (data['code'] == 200) {
|
||||
|
||||
loginIM(
|
||||
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(
|
||||
SharedPreferencesHelper.firstLogin, '1');
|
||||
|
||||
|
||||
}
|
||||
|
||||
loadMyCircleData() async {
|
||||
|
||||
@ -646,6 +646,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
// ·你喜欢的圈友也喜欢TA80
|
||||
// ·你们都在深圳留下过足迹70
|
||||
// ·你们有2个共同的圈子:圈子名称、圈子名称60
|
||||
// ·我刚来到这里哦55
|
||||
// ·可能是你想认识的人50
|
||||
// ·很多圈友都喜欢TA40
|
||||
// ·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 (recommendCircleFriendData['is_wanna_meet']) {
|
||||
titleList.add('很多圈友都喜欢TA');
|
||||
|
||||
@ -30,7 +30,7 @@ class Sys_notify_listPage extends StatelessWidget {
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: "系统通知",
|
||||
centerTitle: "官方通知",
|
||||
),
|
||||
body: Container(
|
||||
width: Get.width,
|
||||
|
||||
@ -436,7 +436,7 @@ class _MsgPageState extends State<MsgPage> with AutomaticKeepAliveClientMixin {
|
||||
),
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
info['avatar'],
|
||||
info['avatar_thumb'],
|
||||
fit: BoxFit.cover,
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
|
||||
@ -213,21 +213,29 @@ class UserinfoLogic extends GetxController {
|
||||
|
||||
startCountdown(){
|
||||
|
||||
timer = Timer.periodic(const Duration(seconds: 1), (t) {
|
||||
timer = Timer.periodic(const Duration(seconds: 1), (t) async {
|
||||
if (countdown > 0) {
|
||||
countdown--;
|
||||
} else {
|
||||
showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){
|
||||
setLike();
|
||||
});
|
||||
|
||||
bool isTip = await checkIsShowTip();
|
||||
if (isTip) {
|
||||
showFloatingButtonOverlay(Get.context!,userInfoBean!.nickname!,ageMsg,userInfoBean!.avatarThumb,0,(){
|
||||
setLike();
|
||||
});
|
||||
}
|
||||
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 {
|
||||
var myAlbumData = await DioManager.instance.get(url: url);
|
||||
|
||||
@ -131,202 +131,198 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: logic.userInfoBean != null
|
||||
? "${logic.userInfoBean!.nickname}"
|
||||
: "个人主页",
|
||||
actionWdiget: logic.isMe
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
await showAddWxPicker(
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: MyAppBar(
|
||||
centerTitle: logic.userInfoBean != null
|
||||
? "${logic.userInfoBean!.nickname}"
|
||||
: "个人主页",
|
||||
actionWdiget: logic.isMe
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
await showAddWxPicker(
|
||||
logic.userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isHidden:
|
||||
logic.userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isHidden:
|
||||
logic.userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isWxHidden: logic.userInfoBean!.hide_wx_num == 1,
|
||||
);
|
||||
logic.fetchUserInfo(Api.getUserInfo);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 101.sp,
|
||||
height: 26.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF30FFD9),
|
||||
Color(0xFFDD3DF4)
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
isWxHidden: logic.userInfoBean!.hide_wx_num == 1,
|
||||
);
|
||||
logic.fetchUserInfo(Api.getUserInfo);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 101.sp,
|
||||
height: 26.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF30FFD9),
|
||||
Color(0xFFDD3DF4)
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
Container(
|
||||
width: 100.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(11.sp),
|
||||
color: Color(0xFF240F3B)),
|
||||
alignment: Alignment.center,
|
||||
height: 24.sp,
|
||||
child: Text(
|
||||
'填写微信号',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
// Container(
|
||||
// alignment: Alignment.center,
|
||||
// // width: 90.sp,
|
||||
// height: 24.sp,
|
||||
// padding:
|
||||
// EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.mainColor,
|
||||
// borderRadius:
|
||||
// BorderRadiusDirectional.circular(
|
||||
// 11.sp)),
|
||||
// child: Text(
|
||||
// '填写微信号',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white, fontSize: 13.sp),
|
||||
// ),
|
||||
// ),
|
||||
)
|
||||
: logic.userInfoBean!= null ? logic.userInfoBean!.wx_num.isEmpty ? GestureDetector(
|
||||
onTap: () {
|
||||
logic.sendWhatToWx();
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 101.sp,
|
||||
height: 26.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF30FFD9),
|
||||
Color(0xFFDD3DF4)
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(11.sp),
|
||||
color: Color(0xFF240F3B)),
|
||||
alignment: Alignment.center,
|
||||
height: 24.sp,
|
||||
child: Text(
|
||||
'想要微信号',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
) : Container() : Container()),
|
||||
body: Stack(
|
||||
// fit: StackFit.expand,
|
||||
Container(
|
||||
width: 100.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(11.sp),
|
||||
color: Color(0xFF240F3B)),
|
||||
alignment: Alignment.center,
|
||||
height: 24.sp,
|
||||
child: Text(
|
||||
'填写微信号',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
// Container(
|
||||
// alignment: Alignment.center,
|
||||
// // width: 90.sp,
|
||||
// height: 24.sp,
|
||||
// padding:
|
||||
// EdgeInsets.only(left: 6.sp, right: 6.sp),
|
||||
// decoration: BoxDecoration(
|
||||
// color: AppColor.mainColor,
|
||||
// borderRadius:
|
||||
// BorderRadiusDirectional.circular(
|
||||
// 11.sp)),
|
||||
// child: Text(
|
||||
// '填写微信号',
|
||||
// style: TextStyle(
|
||||
// color: Colors.white, fontSize: 13.sp),
|
||||
// ),
|
||||
// ),
|
||||
)
|
||||
: logic.userInfoBean!= null ? logic.userInfoBean!.wx_num.isEmpty ? GestureDetector(
|
||||
onTap: () {
|
||||
logic.sendWhatToWx();
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: Get.height,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
child:
|
||||
NestedScrollView(
|
||||
controller: scrollController,
|
||||
headerSliverBuilder: (context,isScrolled) {
|
||||
return [
|
||||
SliverAppBar(
|
||||
stretch: false,
|
||||
elevation: 0,
|
||||
primary: true,
|
||||
pinned: true,
|
||||
floating: true,
|
||||
forceElevated: false,
|
||||
toolbarHeight: 0,
|
||||
foregroundColor: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
expandedHeight: (!logic.isMe ? 372.sp : 312.sp) + (logic.userInfoBean != null
|
||||
? logic.userInfoBean!.wx_num!.isNotEmpty
|
||||
? 59.sp : 0 : 0),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size(Get.width,40),
|
||||
child: titleTab(logic),
|
||||
),
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
expandedTitleScale: 1.0,
|
||||
centerTitle: true,
|
||||
title: buildContent(logic),
|
||||
),
|
||||
)
|
||||
];
|
||||
},
|
||||
body: contentWidget(logic),
|
||||
// slivers: [
|
||||
// SliverAppBar(
|
||||
// leadingWidth: 0,
|
||||
// titleSpacing: 0,
|
||||
// title: buildContent(logic),
|
||||
// toolbarHeight: 500.sp,
|
||||
// backgroundColor: Colors.transparent,
|
||||
// ),
|
||||
// SliverPadding(
|
||||
// padding: EdgeInsets.zero,
|
||||
// sliver: SliverList(delegate:
|
||||
// SliverChildBuilderDelegate((context, index) {
|
||||
// // if (index == 0) {
|
||||
// // return buildContent(logic);
|
||||
// // }
|
||||
// return contentWidget(logic);
|
||||
// },childCount: 1),))
|
||||
//
|
||||
// // (delegate: (BuildContext context, int index) {
|
||||
// // return contentWidget(logic);
|
||||
// // }),
|
||||
//
|
||||
// // buildContent(logic),
|
||||
// ]
|
||||
)),
|
||||
Positioned(
|
||||
bottom: 27.sp,
|
||||
width: Get.width,
|
||||
child: _meInfoButton(logic),
|
||||
),
|
||||
!logic.isShowAlbum && logic.isMe
|
||||
? Positioned(
|
||||
bottom: 36.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
List<MyConfigData> numbers = [];
|
||||
|
||||
var data = await Get.toNamed(AppRoutes.Call_out,
|
||||
arguments: {'numbers': numbers});
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('send_msg'),
|
||||
width: 60.sp,
|
||||
)))
|
||||
: Container()
|
||||
Container(
|
||||
width: 101.sp,
|
||||
height: 26.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12.sp),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF30FFD9),
|
||||
Color(0xFFDD3DF4)
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 100.sp,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(11.sp),
|
||||
color: Color(0xFF240F3B)),
|
||||
alignment: Alignment.center,
|
||||
height: 24.sp,
|
||||
child: Text(
|
||||
'想要微信号',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
) : Container() : Container()),
|
||||
body: Stack(
|
||||
// fit: StackFit.expand,
|
||||
children: [
|
||||
Container(
|
||||
height: Get.height,
|
||||
width: Get.width,
|
||||
// color: Colors.red,
|
||||
child:
|
||||
NestedScrollView(
|
||||
controller: scrollController,
|
||||
headerSliverBuilder: (context,isScrolled) {
|
||||
return [
|
||||
SliverAppBar(
|
||||
stretch: false,
|
||||
elevation: 0,
|
||||
primary: true,
|
||||
pinned: true,
|
||||
floating: true,
|
||||
forceElevated: false,
|
||||
toolbarHeight: 0,
|
||||
foregroundColor: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
expandedHeight: 374.sp + (logic.userInfoBean != null
|
||||
? logic.userInfoBean!.wx_num!.isNotEmpty && logic.userId.toString().isNotEmpty
|
||||
? 59.sp : 0 : 0),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size(Get.width,40),
|
||||
child: titleTab(logic),
|
||||
),
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
expandedTitleScale: 1.0,
|
||||
centerTitle: true,
|
||||
title: buildContent(logic),
|
||||
),
|
||||
)
|
||||
];
|
||||
},
|
||||
body: contentWidget(logic),
|
||||
// slivers: [
|
||||
// SliverAppBar(
|
||||
// leadingWidth: 0,
|
||||
// titleSpacing: 0,
|
||||
// title: buildContent(logic),
|
||||
// toolbarHeight: 500.sp,
|
||||
// backgroundColor: Colors.transparent,
|
||||
// ),
|
||||
// SliverPadding(
|
||||
// padding: EdgeInsets.zero,
|
||||
// sliver: SliverList(delegate:
|
||||
// SliverChildBuilderDelegate((context, index) {
|
||||
// // if (index == 0) {
|
||||
// // return buildContent(logic);
|
||||
// // }
|
||||
// return contentWidget(logic);
|
||||
// },childCount: 1),))
|
||||
//
|
||||
// // (delegate: (BuildContext context, int index) {
|
||||
// // return contentWidget(logic);
|
||||
// // }),
|
||||
//
|
||||
// // buildContent(logic),
|
||||
// ]
|
||||
)),
|
||||
Positioned(
|
||||
bottom: 27.sp,
|
||||
width: Get.width,
|
||||
child: _meInfoButton(logic),
|
||||
),
|
||||
!logic.isShowAlbum && logic.isMe
|
||||
? Positioned(
|
||||
bottom: 36.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
List<MyConfigData> numbers = [];
|
||||
|
||||
var data = await Get.toNamed(AppRoutes.Call_out,
|
||||
arguments: {'numbers': numbers});
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('send_msg'),
|
||||
width: 60.sp,
|
||||
)))
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -534,7 +530,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
fontSize: 12.sp,
|
||||
color: logic.isOnline
|
||||
? const Color(0xFF00FFF4)
|
||||
: const Color(0xFF787575),
|
||||
: const Color(0xFF00FFF4),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -564,7 +560,9 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
logic.userInfoBean!.wx_num,
|
||||
logic.userInfoBean!.id.toString(),
|
||||
logic.userInfoBean!.avatar!,
|
||||
() {}),
|
||||
() {
|
||||
logic. fetchUserInfo("${Api.getUserInfoTA + logic.userId}/home");
|
||||
}),
|
||||
],
|
||||
))
|
||||
: Container()
|
||||
|
||||
564
circle_app/lib/common/Widgets/today_people_dialog.dart
Normal file
564
circle_app/lib/common/Widgets/today_people_dialog.dart
Normal 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
|
||||
// ·你们有2个共同的圈子:圈子名称、圈子名称60
|
||||
// ·可能是你想认识的人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());
|
||||
}
|
||||
}
|
||||
@ -170,7 +170,7 @@ class _UnlockWxTipState extends State<UnlockWxTip> {
|
||||
SmartDialog.showLoading();
|
||||
String itemId = prices[selectedIndex].itemId!;
|
||||
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 {
|
||||
unlockingPayment(prices[selectedIndex].id.toString(), (){
|
||||
Get.back();
|
||||
|
||||
@ -24,6 +24,7 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl,
|
||||
var result = await DioManager()
|
||||
.post(url: Api.UnlockWx, params: {'targetUserId': userId});
|
||||
if (result['code'] == 200) {
|
||||
showToast('解锁成功');
|
||||
callBack();
|
||||
} else {
|
||||
Get.bottomSheet(UnlockWxTip(userId, avatarUrl),
|
||||
@ -35,8 +36,8 @@ wxStatusWidget(bool isUnclock, String wx, String userId, String avatarUrl,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Clipboard.setData(ClipboardData(text: wx));
|
||||
showToast('微信号复制成功');
|
||||
// Clipboard.setData(ClipboardData(text: wx));
|
||||
// showToast('微信号复制成功');
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@ -305,4 +305,7 @@ class Api {
|
||||
|
||||
//想要微信
|
||||
static const noticeWxNum = '/user-service/user/updateWxNum/notice/';
|
||||
|
||||
//是否弹窗
|
||||
static const popup = '/user-service/follow/popup/';
|
||||
}
|
||||
@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
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/userinfo/logic.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:pull_to_refresh/pull_to_refresh.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 '../app/circle/logic.dart';
|
||||
@ -427,12 +429,17 @@ void navigateToInviteStrategy() {
|
||||
});
|
||||
}
|
||||
|
||||
void navigateToCustomRoute(BannerItem bannerItem) {
|
||||
void navigateToCustomRoute(BannerItem bannerItem) async {
|
||||
print(bannerItem.param);
|
||||
switch (bannerItem.type) {
|
||||
case 1:
|
||||
Get.toNamed(AppRoutes.WebViewActivity,
|
||||
arguments: {'title': "", "url": bannerItem.param.toString()});
|
||||
if (bannerItem.scene == 'internal') {
|
||||
Get.toNamed(AppRoutes.WebViewActivity,
|
||||
arguments: {'title': "", "url": bannerItem.param.toString()});
|
||||
} else {
|
||||
await launch(bannerItem.param.toString(),forceSafariVC: false);
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
switch (bannerItem.scene) {
|
||||
@ -477,6 +484,9 @@ unLockWxSuccessResult(String userId) {
|
||||
} else if (currentRoute == AppRoutes.UserInfoActivity) {
|
||||
var logic = Get.find<UserinfoLogic>();
|
||||
logic.fetchUserInfo("${Api.getUserInfoTA + userId}/home");
|
||||
} else if (currentRoute == AppRoutes.Chat) {
|
||||
EventBusManager.fire(ChatLoadUserInfoData());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -614,6 +614,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@ -90,7 +90,7 @@ dependencies:
|
||||
fluwx: ^3.8.1+1
|
||||
event_bus: ^2.0.0
|
||||
#安装apk
|
||||
# flutter_install_app: 1.3.0
|
||||
flutter_install_app: 1.3.0
|
||||
#闪屏页
|
||||
flutter_native_splash: 2.2.16
|
||||
#腾讯离线推送
|
||||
|
||||
Loading…
Reference in New Issue
Block a user