代码提交
This commit is contained in:
parent
3639ddf773
commit
e8b365d421
BIN
circle_app/assets/images/circle/circle_selected_bg.png
Normal file
BIN
circle_app/assets/images/circle/circle_selected_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@ -140,6 +140,17 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
String hintText = '用心聊天更容易获得回复哦~';
|
||||
|
||||
List<String> urlList = [
|
||||
'https://iquanpai.com',
|
||||
'https://cdtszn.net',
|
||||
'https://ikuayou.com',
|
||||
'https://leyuan666.com',
|
||||
'https://kuayou666.com',
|
||||
'https://cdts666.com',
|
||||
'https://quanpai666.com',
|
||||
'https://xidi.iquanpai.com'
|
||||
];
|
||||
|
||||
Map<String, V2TimGroupMemberFullInfo> memberInfoMap = {};
|
||||
|
||||
late TextEditingController textEditingController;
|
||||
@ -274,12 +285,11 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
}
|
||||
|
||||
Future checkImStatus() async {
|
||||
List<String> pressionStr =
|
||||
'微信、QQ、加Q、+V、地球号、绿泡泡、公众号、网站、app、视频、手机号、id、企鹅、门槛、收费、加群'.split('、');
|
||||
|
||||
List<
|
||||
String> pressionStr = '微信、QQ、加Q、+V、地球号、绿泡泡、公众号、网站、app、视频、手机号、id、企鹅、门槛、收费、加群'
|
||||
.split('、');
|
||||
|
||||
if (textEditingController.text.isNotEmpty && (userInfoBean?.wx_num?.isEmpty ?? true)) {
|
||||
if (textEditingController.text.isNotEmpty &&
|
||||
(userInfoBean?.wx_num?.isEmpty ?? true)) {
|
||||
bool isContain = false;
|
||||
String sendText = textEditingController.text.toUpperCase();
|
||||
for (String text in pressionStr) {
|
||||
@ -290,25 +300,22 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
if (isContain) {
|
||||
await showAddWxPicker(
|
||||
userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isHidden:
|
||||
userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isHidden: userInfoBean!.wx_num!.isNotEmpty ?? false,
|
||||
isWxHidden: userInfoBean!.hide_wx_num == 1,
|
||||
);
|
||||
imStatusOK = false;
|
||||
return imStatusOK;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.imstate);
|
||||
var data = await DioManager.instance.get(url: Api.imstate);
|
||||
|
||||
int code = data['code'];
|
||||
if (code == 200) {
|
||||
try {
|
||||
var result =
|
||||
await DioManager.instance.get(url: Api.adImstate + widget.conversationID.split('_').last,);
|
||||
var result = await DioManager.instance.get(
|
||||
url: Api.adImstate + widget.conversationID.split('_').last,
|
||||
);
|
||||
if (result['code'] == 21201) {
|
||||
Get.bottomSheet(
|
||||
Scaffold(
|
||||
@ -320,9 +327,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
imStatusOK = false;
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
imStatusOK = true;
|
||||
} else {
|
||||
@ -446,7 +451,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
var data = await DioManager.instance.post(
|
||||
url: '${Api.setBlock + widget.conversationID.split('_').last}/block', params: {'status': '0'});
|
||||
url:
|
||||
'${Api.setBlock + widget.conversationID.split('_').last}/block',
|
||||
params: {'status': '0'});
|
||||
var bean = BaseResponse<dynamic>.fromJson(
|
||||
data,
|
||||
(jsonData) => jsonData,
|
||||
@ -505,7 +512,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (isSending) return;
|
||||
isSending = true;
|
||||
bool isOK = await checkImStatus();
|
||||
@ -515,7 +521,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
lastText = "";
|
||||
String text = textEditingController.text.trim();
|
||||
final convType = widget.conversationType;
|
||||
@ -523,7 +528,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
if (text.isEmpty) {
|
||||
if (hintText.contains('用心聊天更容易获得回复哦~')) {
|
||||
showOKToast('请输入消息内容后发送');
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
isSending = false;
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
if ((widget.currentConversation.lastMessage?.customElem ?? null) !=
|
||||
@ -555,7 +562,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
showOKToast('请输入消息内容后发送');
|
||||
}
|
||||
}
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
isSending = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -570,8 +579,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
atUserIDList: getUserIdFromMemberInfoMap()),
|
||||
context);
|
||||
} else if (memberInfoMap.isNotEmpty) {
|
||||
|
||||
|
||||
widget.model.sendTextAtMessage(
|
||||
text: text,
|
||||
convType: widget.conversationType,
|
||||
@ -580,13 +587,27 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
} else {
|
||||
bool isOK = await loadIsShowSendGiftDialogData();
|
||||
if (!isOK) {
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
isSending = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
var data = await DioManager.instance
|
||||
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
|
||||
|
||||
|
||||
|
||||
bool isContain = false;
|
||||
urlList.forEach((element) {
|
||||
if (text.contains(element)) {
|
||||
isContain = true;
|
||||
}
|
||||
});
|
||||
|
||||
List words = [];
|
||||
|
||||
|
||||
if (!isContain) {
|
||||
var data = await DioManager.instance
|
||||
.post(url: Api.shieldWordCheck, params: {'text': text, 'type': 2});
|
||||
if (data['data']['code'] == 10000) {
|
||||
words = data['data']['words'];
|
||||
if (words.isNotEmpty) {
|
||||
@ -595,7 +616,16 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
}
|
||||
}
|
||||
}
|
||||
Future.delayed(Duration(seconds: 1), () {isSending = false;});
|
||||
if (words.isNotEmpty) {
|
||||
textEditingController.text = text;
|
||||
showOKToast('含违规词汇,无法发送');
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
isSending = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (words.isEmpty) {
|
||||
try {
|
||||
var msgResult = await MessageUtils.handleMessageError(
|
||||
@ -604,23 +634,18 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
convID: widget.conversationID,
|
||||
convType: convType),
|
||||
context);
|
||||
addChatRecord(text, msgResult!.data!.msgID ?? '', msgResult!.data!.timestamp.toString() ?? '');
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
} else {
|
||||
showOKToast('含违规词汇,无法发送');
|
||||
return;
|
||||
addChatRecord(text, msgResult!.data!.msgID ?? '',
|
||||
msgResult!.data!.timestamp.toString() ?? '');
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
textEditingController.clear();
|
||||
currentCursor = null;
|
||||
lastText = "";
|
||||
memberInfoMap = {};
|
||||
|
||||
isSending = false;
|
||||
goDownBottom();
|
||||
_handleSendEditStatus("", false);
|
||||
|
||||
} else {
|
||||
showOKToast('请输入消息内容');
|
||||
isSending = false;
|
||||
@ -629,10 +654,16 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
|
||||
loadIsShowSendGiftDialogData() async {
|
||||
V2TimConversation con = Get.arguments;
|
||||
var data = await DioManager.instance.get(url: Api.isShow_give_gift + widget.conversationID.split('_').last);
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.isShow_give_gift + widget.conversationID.split('_').last);
|
||||
if (data['code'] == 200) {
|
||||
if (data['data']) {
|
||||
Get.bottomSheet(SendGiftDialog(accid: widget.conversationID,title: data['msg'],), isScrollControlled: true,
|
||||
Get.bottomSheet(
|
||||
SendGiftDialog(
|
||||
accid: widget.conversationID,
|
||||
title: data['msg'],
|
||||
),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false);
|
||||
return false;
|
||||
}
|
||||
@ -660,10 +691,9 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
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,
|
||||
@ -1030,7 +1060,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
});
|
||||
}
|
||||
getBlack();
|
||||
|
||||
}
|
||||
|
||||
StreamSubscription? commentBlackEvent = null;
|
||||
@ -1039,7 +1068,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
|
||||
getBlack() async {
|
||||
isBlack = widget.isBlack!;
|
||||
EventBusManager.fire(CommentBlackMoreEvent());
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -1141,7 +1141,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
}
|
||||
|
||||
if (!isVip) {
|
||||
showOKToast(plate== 0 ? '开通会员之后才能发送语音' : '开通会员之后才能发送图片');
|
||||
showOKToast(plate== 5 ? '开通会员之后才能发送语音' : '开通会员之后才能发送图片');
|
||||
Get.bottomSheet(
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
|
||||
@ -55,14 +55,20 @@ class CircleLogic extends GetxController {
|
||||
|
||||
bool isNewPeopleMore = true;
|
||||
|
||||
bool isLoadFail = false;
|
||||
|
||||
bool isNewPeopleRed = false;
|
||||
|
||||
bool isNearLoad = true;
|
||||
|
||||
int flush = 0;
|
||||
bool isMore = true;
|
||||
int myVip = -1;
|
||||
bool isShowCircle = true;
|
||||
String cityName = "";
|
||||
|
||||
Map recommendCircleFriendData = {};
|
||||
List openCallOutIdList = [];
|
||||
List<BannerItem> bannerList = [];
|
||||
|
||||
List<MyConfigData> genderList
|
||||
@ -107,6 +113,7 @@ class CircleLogic extends GetxController {
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
loadRecommendCircleFriendData();
|
||||
loadCircleListData();
|
||||
loadCirclePeopleData();
|
||||
initGerder();
|
||||
@ -375,6 +382,7 @@ class CircleLogic extends GetxController {
|
||||
'flush': flush,
|
||||
"orientations": orientations
|
||||
});
|
||||
isNearLoad = false;
|
||||
var bean = BaseResponse<VicinityBean>.fromJson(
|
||||
data, (data) => VicinityBean.fromJson(data));
|
||||
|
||||
@ -481,6 +489,7 @@ class CircleLogic extends GetxController {
|
||||
}
|
||||
|
||||
getNewPeopleListData() async {
|
||||
isLoadFail = false;
|
||||
List<String> genders = [];
|
||||
new_genderList.forEach((element) {
|
||||
if (element.isSelect) {
|
||||
@ -535,12 +544,36 @@ class CircleLogic extends GetxController {
|
||||
isNewPeopleMore = false;
|
||||
}
|
||||
update();
|
||||
} else if (data['code'] == 404) {
|
||||
isLoadFail = true;
|
||||
update();
|
||||
} else {
|
||||
isNewPeopleMore = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void loadRecommendCircleFriendData() async {
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.chatRecommendFriend,
|
||||
);
|
||||
|
||||
if (data['code'] == 200) {
|
||||
List dataList = data['data'];
|
||||
if (dataList.isNotEmpty) {
|
||||
recommendCircleFriendData = data['data'][0];
|
||||
}
|
||||
update();
|
||||
} else {
|
||||
|
||||
if ((data['code'] == 21201 || data['code'] == 21202) && recommendCircleFriendData.isNotEmpty) {
|
||||
showOKToast(data['msg']);
|
||||
showVipDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void onRefresh() async {
|
||||
pageIndex = 1;
|
||||
newPeopleList.clear();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -683,10 +683,15 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
|
||||
///至尊喊话
|
||||
vipDynamicItem(Lists lists) {
|
||||
Text descText = Text(
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||
maxLines: 2,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
widget.logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
// List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
@ -991,10 +996,15 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
|
||||
///普通图文喊话
|
||||
normalDynamicItem(Lists lists) {
|
||||
Text descText = Text(
|
||||
Widget descText = widget.logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 17.sp),
|
||||
// maxLines: 2,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
widget.logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
double picHeight = 0.0;
|
||||
@ -1035,7 +1045,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: 120.sp + contentHeight(lists.content!) + picHeight,
|
||||
// height: 120.sp + contentHeight(lists.content!) + picHeight,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -1255,7 +1265,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp,),
|
||||
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 10.sp),
|
||||
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 10.sp,bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15.sp),
|
||||
color: Color(0x33000000)),
|
||||
|
||||
@ -24,7 +24,9 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../../common/Widgets/base_tip_widget.dart';
|
||||
import '../../../common/Widgets/tag_widget.dart';
|
||||
import '../../../common/colors/app_color.dart';
|
||||
import '../../../network/api.dart';
|
||||
import '../../circle_list/logic.dart';
|
||||
import '../../msg/recommend_circle_friend_item.dart';
|
||||
|
||||
class LikeView extends StatefulWidget {
|
||||
LikeView({super.key, required this.changeCallback});
|
||||
@ -41,6 +43,7 @@ class _LikeViewState extends State<LikeView>
|
||||
bool get wantKeepAlive => true;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
final RefreshController refreshController = RefreshController();
|
||||
CircleLogic logic = Get.find<CircleLogic>();
|
||||
|
||||
// ListLogic? listsLg;
|
||||
|
||||
@ -253,7 +256,10 @@ class _LikeViewState extends State<LikeView>
|
||||
url: "/up-service/callout/${bean.id}/chat",
|
||||
);
|
||||
if (data["code"] == 200) {
|
||||
pushChatPage(data['data']['account_id'].toString().split("_").last,
|
||||
pushChatPage(data['data']['account_id']
|
||||
.toString()
|
||||
.split("_")
|
||||
.last,
|
||||
data['data']['account_id'], bean.user!.nickname!);
|
||||
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
@ -660,7 +666,8 @@ class _LikeViewState extends State<LikeView>
|
||||
bottomLeft: Radius.circular(12.sp))),
|
||||
child: Text(
|
||||
(lists.user!.city ?? '外星').length > 4
|
||||
? (lists.user!.city ?? '外星').substring(0, 4) + '...'
|
||||
? (lists.user!.city ?? '外星').substring(0, 4) +
|
||||
'...'
|
||||
: (lists.user!.city ?? '外星'),
|
||||
style: TextStyle(color: Colors.white, fontSize: 15.sp),
|
||||
))
|
||||
@ -801,7 +808,7 @@ class _LikeViewState extends State<LikeView>
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex,
|
||||
'userId':lists.user!.id.toString()
|
||||
'userId': lists.user!.id.toString()
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
@ -1018,7 +1025,8 @@ class _LikeViewState extends State<LikeView>
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||
padding: EdgeInsets.only(
|
||||
left: 8.sp, top: 12.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 72.sp,
|
||||
child: Column(
|
||||
@ -1123,7 +1131,8 @@ class _LikeViewState extends State<LikeView>
|
||||
arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex,
|
||||
'userId':lists.user!.id.toString()
|
||||
'userId':
|
||||
lists.user!.id.toString()
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
@ -1218,11 +1227,21 @@ class _LikeViewState extends State<LikeView>
|
||||
|
||||
tipItem() {
|
||||
bool showTitle = lists.isEmpty;
|
||||
return GetBuilder<CircleLogic>(builder: (logic) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: showTitle ? 20.sp : 0, bottom: 10.sp),
|
||||
margin: EdgeInsets.only(top: showTitle ? 10.sp : 0, bottom: 10.sp),
|
||||
// height: 30.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
if (showTitle)
|
||||
logic.recommendCircleFriendData.isNotEmpty
|
||||
? RecommendCircleFriendItem(
|
||||
false,
|
||||
recommendCircleFriendData: logic.recommendCircleFriendData,
|
||||
getDataCallBack: () {
|
||||
logic.loadRecommendCircleFriendData();
|
||||
})
|
||||
: Container(),
|
||||
if (showTitle)
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 8.sp),
|
||||
@ -1286,6 +1305,7 @@ class _LikeViewState extends State<LikeView>
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
circleInfoItem(var bean, Lists list, int index) {
|
||||
@ -1401,8 +1421,6 @@ class _LikeViewState extends State<LikeView>
|
||||
element.interest = element.interest!;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
if (Get.isRegistered<LikeLogic>()) {
|
||||
LikeLogic likeLogic = Get.find<LikeLogic>();
|
||||
|
||||
@ -73,7 +73,9 @@ class _NewPeopleState extends State<NewPeople> {
|
||||
},
|
||||
),
|
||||
)
|
||||
: loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~');
|
||||
: logic.isLoadFail ? noResultWidget(tip: '', callBack: () {
|
||||
logic.onLoading();
|
||||
}) : loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,17 +41,13 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
super.initState();
|
||||
widget.logic.getNearByList();
|
||||
sub = EventBusManager.on<NearScrollTap>().listen((event) {
|
||||
// if (widget.logic.myVip > 0) {
|
||||
try {
|
||||
_scrollController.animateTo(0,
|
||||
duration: const Duration(milliseconds: 300), curve: Curves.easeInOut);
|
||||
// }
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
// _scrollController.addListener(() {
|
||||
// if (maxOff > 0 && widget.logic.myVip == 0 && _scrollController.offset >= maxOff) {
|
||||
// _scrollController.jumpTo(maxOff);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@ -92,17 +88,19 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
// Positioned(
|
||||
// bottom: 0,
|
||||
// child: showVipView())
|
||||
Positioned(top: 10.sp,left: 10.sp,child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.WorldCallOut);
|
||||
},
|
||||
child: Image.asset(
|
||||
getMsgImage('hu_icon'),
|
||||
width: 30.sp,
|
||||
),
|
||||
),)
|
||||
// Positioned(top: 10.sp,left: 10.sp,child: GestureDetector(
|
||||
// onTap: () {
|
||||
// Get.toNamed(AppRoutes.WorldCallOut);
|
||||
// },
|
||||
// child: Image.asset(
|
||||
// getMsgImage('hu_icon'),
|
||||
// width: 30.sp,
|
||||
// ),
|
||||
// ),)
|
||||
],
|
||||
) : loaddingWidget(true);
|
||||
) : widget.logic.isNearLoad ? loaddingWidget(true) : noResultWidget(tip: '',callBack: () {
|
||||
_onLoading();
|
||||
});
|
||||
}
|
||||
|
||||
Widget bannerView(CircleLogic controller) {
|
||||
|
||||
@ -31,11 +31,14 @@ class LikeLogic extends GetxController {
|
||||
|
||||
List<bool> hasNewList = [];
|
||||
List categoriesList = [];
|
||||
List openCallOutIdList = [];
|
||||
|
||||
bool isNewPeople = false;
|
||||
|
||||
bool isLoadNewData = false;
|
||||
|
||||
bool isLoadFial = false;
|
||||
|
||||
Data? homeData;
|
||||
@override
|
||||
void onInit() async {
|
||||
@ -55,6 +58,7 @@ class LikeLogic extends GetxController {
|
||||
}
|
||||
|
||||
loadMyInfo() async {
|
||||
isLoadFial = false;
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
@ -65,6 +69,9 @@ class LikeLogic extends GetxController {
|
||||
isLoadNewData = true;
|
||||
update();
|
||||
}
|
||||
} else if (bean.code == 404) {
|
||||
isLoadFial = true;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,6 +79,7 @@ class LikeLogic extends GetxController {
|
||||
loadInviteData();
|
||||
loadCircleListData();
|
||||
loadMyCircleData();
|
||||
loadCircleTypeData();
|
||||
}
|
||||
|
||||
loadInviteData() async {
|
||||
|
||||
@ -108,7 +108,10 @@ class _CircleListPageState extends State<CircleListPage>
|
||||
logic.update();
|
||||
}
|
||||
|
||||
return logic.isLoad
|
||||
return logic.isLoadFial ? noResultWidget(tip:'',callBack: () {
|
||||
logic.loadMyInfo();
|
||||
logic.loadData();
|
||||
}) : logic.isLoad
|
||||
? loaddingWidget(true)
|
||||
: Container(
|
||||
width: Get.width,
|
||||
@ -667,10 +670,19 @@ class _CircleListPageState extends State<CircleListPage>
|
||||
child: Container(
|
||||
width: 65.sp,
|
||||
height: 65.sp,
|
||||
color: isSelcted ? Colors.white.withOpacity(0.3) : Colors.transparent,
|
||||
// color: isSelcted ? Colors.white.withOpacity(0.3) : Colors.transparent,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
if (isSelcted)
|
||||
OverflowBox(
|
||||
minWidth: 0.0,
|
||||
maxWidth: double.infinity,
|
||||
minHeight: 0.0,
|
||||
maxHeight: double.infinity,
|
||||
child: Image.asset(getCircleImage('circle_selected_bg'),width: 65.sp,),
|
||||
),
|
||||
|
||||
if (text.isEmpty && index == -1)
|
||||
topCicleStatusItem(
|
||||
isSelcted,
|
||||
|
||||
@ -86,6 +86,12 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
unreadSIze.value = '0';
|
||||
tabs.add(CirclePage());
|
||||
tabs.add(CircleListPage());
|
||||
tabs.add(WorldCallOutPage());
|
||||
tabs.add(MsgPage());
|
||||
tabs.add(MinefragmentPage());
|
||||
|
||||
loadEnvTypeData();
|
||||
// 设置网络变化监听
|
||||
connectListener();
|
||||
@ -94,11 +100,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
setFirstData();
|
||||
|
||||
loadMyInfoData();
|
||||
tabs.add(CirclePage());
|
||||
tabs.add(CircleListPage());
|
||||
tabs.add(World_call_outPage());
|
||||
tabs.add(MsgPage());
|
||||
tabs.add(MinefragmentPage());
|
||||
|
||||
|
||||
sub = EventBusManager.on<RefreshUnread>().listen((event) {
|
||||
getUnreadSize();
|
||||
@ -115,6 +117,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void addMsgListener() {
|
||||
msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: (
|
||||
msgID,
|
||||
@ -319,6 +323,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
super.onReady();
|
||||
|
||||
FlutterNativeSplash.remove();
|
||||
updateIndex(1);
|
||||
final logic = Get.find<CircleLogic>();
|
||||
logic.loadCirclePeopleData();
|
||||
|
||||
@ -353,6 +358,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
loginIM(
|
||||
data['data']['account_id'].toString(), data['data']['user_sig']);
|
||||
accountId = data['data']['account_id'].toString();
|
||||
} else {
|
||||
getIMData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ class _HomePageState extends State<HomePage>
|
||||
children: [
|
||||
const CirclePage(),
|
||||
CircleListPage(),
|
||||
World_call_outPage(),
|
||||
WorldCallOutPage(),
|
||||
MsgPage(),
|
||||
MinefragmentPage()
|
||||
],
|
||||
|
||||
@ -92,11 +92,11 @@ class MinefragmentLogic extends GetxController {
|
||||
int likeMeCount = sharedPreferences.getInt(SharedPreferencesHelper.LIKEMECOUNT)??0;
|
||||
int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
|
||||
sharedPreferences.setString(SharedPreferencesHelper.PHOTO, bean.data.phone);
|
||||
like_me_count_new = likeMeCount - like_me_count;
|
||||
like_me_count_new = like_me_count - likeMeCount;
|
||||
print("***************");
|
||||
print("$likeMeCount-$like_me_count=$like_me_count_new");
|
||||
|
||||
recent_visit_count_new = recentVisitCount - recent_visit_count;
|
||||
recent_visit_count_new = recent_visit_count - recentVisitCount;
|
||||
|
||||
// like_me_count_new = recentVisitCount.toInt() - bean.data.likeMeCount.toInt();
|
||||
|
||||
|
||||
@ -488,7 +488,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
||||
itemBuilder: (context, index) {
|
||||
if (index == filteredConversationList.length) {
|
||||
return recommendCircleFriendData.isNotEmpty
|
||||
? RecommendCircleFriendItem(recommendCircleFriendData: recommendCircleFriendData,getDataCallBack: () {
|
||||
? RecommendCircleFriendItem(true,recommendCircleFriendData: recommendCircleFriendData,getDataCallBack: () {
|
||||
loadRecommendCircleFriendData();
|
||||
})
|
||||
: Container();
|
||||
|
||||
@ -11,9 +11,10 @@ import '../../util/util.dart';
|
||||
import '../circle/widgets/discover.dart';
|
||||
|
||||
class RecommendCircleFriendItem extends StatefulWidget {
|
||||
RecommendCircleFriendItem({super.key,required this.recommendCircleFriendData,required this.getDataCallBack});
|
||||
RecommendCircleFriendItem(this.isShowTopLine,{super.key,required this.recommendCircleFriendData,required this.getDataCallBack,});
|
||||
var recommendCircleFriendData;
|
||||
Function getDataCallBack;
|
||||
bool isShowTopLine;
|
||||
@override
|
||||
_RecommendCircleFriendItemState createState() =>
|
||||
_RecommendCircleFriendItemState();
|
||||
@ -56,6 +57,7 @@ class _RecommendCircleFriendItemState extends State<RecommendCircleFriendItem> {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
child: Column(children: [
|
||||
if (widget.isShowTopLine)
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.sp),
|
||||
child: Row(
|
||||
@ -82,7 +84,7 @@ class _RecommendCircleFriendItemState extends State<RecommendCircleFriendItem> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 16.sp),
|
||||
margin: EdgeInsets.only(top: widget.isShowTopLine ? 16.sp : 0),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
|
||||
@ -493,7 +493,7 @@ class _My_circlePageState extends State<My_circlePage>
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text(
|
||||
msg,
|
||||
textAlign: TextAlign.center,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||
),
|
||||
|
||||
@ -8,7 +8,7 @@ import 'state.dart';
|
||||
|
||||
class Signal_circle_listLogic extends GetxController {
|
||||
final Signal_circle_listState state = Signal_circle_listState();
|
||||
|
||||
List openCallOutIdList = [];
|
||||
Circle? circle;
|
||||
|
||||
@override
|
||||
|
||||
@ -93,9 +93,16 @@ class SplashLogic extends GetxController {
|
||||
if (bean.code == 500) {
|
||||
await Future.delayed(Duration(seconds: 5));
|
||||
onInit();
|
||||
} else {
|
||||
SharedPreferencesHelper sp =
|
||||
await SharedPreferencesHelper.getInstance();
|
||||
String token = sp.getString(SharedPreferencesHelper.AUTHORIZATION);
|
||||
if (token.isNotEmpty) {
|
||||
Get.offNamed(AppRoutes.Home);
|
||||
} else {
|
||||
pushLoginPage();
|
||||
}
|
||||
}
|
||||
|
||||
// Get.toNamed(AppRoutes.Home);
|
||||
}
|
||||
|
||||
@ -48,9 +48,14 @@ class UserinfoLogic extends GetxController {
|
||||
|
||||
List recevigiftList = [];
|
||||
|
||||
List openCallOutIdList = [];
|
||||
|
||||
Map toUser = {};
|
||||
|
||||
int unLockWxNum = 0;
|
||||
int likeMeCount = 0;
|
||||
int imageUrgeCount = 0;
|
||||
|
||||
final startTime = DateTime.now();
|
||||
SharedPreferences? sharedPreferences;
|
||||
@override
|
||||
@ -174,6 +179,8 @@ class UserinfoLogic extends GetxController {
|
||||
|
||||
isLikeFoMsg =
|
||||
"${bean.data.likeMeCount}位圈友感兴趣,其中${bean.data.imageUrgeCount}位已催您更新";
|
||||
likeMeCount = bean.data.likeMeCount;
|
||||
imageUrgeCount = bean.data.imageUrgeCount;
|
||||
userInfoBean = bean.data.user;
|
||||
unLockWxNum = userInfoBean!.contact!.contains('*') ? 0 : 1;
|
||||
isVip = userInfoBean?.vip ?? 0;
|
||||
@ -350,6 +357,8 @@ class UserinfoLogic extends GetxController {
|
||||
} catch (e) {}
|
||||
|
||||
update();
|
||||
} else if (bean.code == 21201 || bean.code == 21202) {
|
||||
showVipDialog();
|
||||
}
|
||||
showOKToast(bean.msg);
|
||||
}
|
||||
|
||||
@ -245,7 +245,25 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
],
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
:Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
// width: 200.sp,
|
||||
// color: Colors.red,
|
||||
margin: EdgeInsets.only(left: 5.sp, bottom: 5.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
userWxStatusWidget(
|
||||
!logic.userInfoBean!.contact!.contains('*'),
|
||||
logic.userInfoBean!.contact!,
|
||||
logic.userId.toString(),
|
||||
logic.userInfoBean!.contactType!,
|
||||
logic.userInfoBean!.avatar!, () {
|
||||
logic.fetchUserInfo(
|
||||
"${Api.getUserInfoTA + logic.userId}/home");
|
||||
}),
|
||||
],
|
||||
))
|
||||
: Container())
|
||||
: MyAppBar(
|
||||
centerTitle: logic.userInfoBean != null
|
||||
@ -273,13 +291,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
toolbarHeight: 0,
|
||||
foregroundColor: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
expandedHeight: 352.sp +
|
||||
(logic.userInfoBean != null
|
||||
? logic.userInfoBean!.contact!.isNotEmpty &&
|
||||
logic.userId.toString().isNotEmpty
|
||||
? 42.sp
|
||||
: 0
|
||||
: 0),
|
||||
expandedHeight: 352.sp,
|
||||
// bottom: PreferredSize(
|
||||
// preferredSize: Size(Get.width, 40),
|
||||
// child: titleTab(logic),
|
||||
@ -561,30 +573,30 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
? Container()
|
||||
: _buildInterestsListView(interests),
|
||||
),
|
||||
if (!logic.isMe)
|
||||
logic.userInfoBean != null
|
||||
? logic.userInfoBean!.contact!.isNotEmpty
|
||||
? Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
// width: 200.sp,
|
||||
// color: Colors.red,
|
||||
margin: EdgeInsets.only(left: 5.sp, bottom: 5.sp),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
wxStatusWidget(
|
||||
!logic.userInfoBean!.contact!.contains('*'),
|
||||
logic.userInfoBean!.contact!,
|
||||
logic.userId.toString(),
|
||||
logic.userInfoBean!.contactType!,
|
||||
logic.userInfoBean!.avatar!, () {
|
||||
logic.fetchUserInfo(
|
||||
"${Api.getUserInfoTA + logic.userId}/home");
|
||||
}),
|
||||
],
|
||||
))
|
||||
: Container()
|
||||
: Container(),
|
||||
// if (!logic.isMe)
|
||||
// logic.userInfoBean != null
|
||||
// ? logic.userInfoBean!.contact!.isNotEmpty
|
||||
// ? Container(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// // width: 200.sp,
|
||||
// // color: Colors.red,
|
||||
// margin: EdgeInsets.only(left: 5.sp, bottom: 5.sp),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// wxStatusWidget(
|
||||
// !logic.userInfoBean!.contact!.contains('*'),
|
||||
// logic.userInfoBean!.contact!,
|
||||
// logic.userId.toString(),
|
||||
// logic.userInfoBean!.contactType!,
|
||||
// logic.userInfoBean!.avatar!, () {
|
||||
// logic.fetchUserInfo(
|
||||
// "${Api.getUserInfoTA + logic.userId}/home");
|
||||
// }),
|
||||
// ],
|
||||
// ))
|
||||
// : Container()
|
||||
// : Container(),
|
||||
if (logic.userInfoBean != null && logic.giftList.isNotEmpty)
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
@ -950,10 +962,27 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
if (controller.isMe)
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
||||
child: Text(
|
||||
controller.isLikeFoMsg,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
controller.likeMeCount.toString(),
|
||||
style: TextStyle(color:AppColor.mainColor),
|
||||
),
|
||||
Text(
|
||||
'位圈友感兴趣,其中',
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
),
|
||||
Text(
|
||||
controller.imageUrgeCount.toString(),
|
||||
style: TextStyle(color:AppColor.mainColor),
|
||||
),
|
||||
Text(
|
||||
'位已催您更新',
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
controller.state.imaglist.isEmpty && !controller.isMe
|
||||
? Center(
|
||||
|
||||
@ -12,6 +12,8 @@ import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../common/Widgets/text_more.dart';
|
||||
import '../logic.dart';
|
||||
import '../view.dart';
|
||||
|
||||
class HomeCallOutView extends StatefulWidget {
|
||||
@ -32,6 +34,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
HomeCallOutLogic? listsLg;
|
||||
|
||||
ScrollController scrollController = ScrollController();
|
||||
UserinfoLogic logic = Get.find<UserinfoLogic>();
|
||||
|
||||
bool isEnd = false;
|
||||
var sub;
|
||||
@ -128,10 +131,15 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
|
||||
///至尊喊话
|
||||
vipDynamicItem(Lists lists) {
|
||||
Text descText = Text(
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
maxLines: 2,
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
double picHeight = 0.0;
|
||||
@ -154,9 +162,9 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
}
|
||||
}
|
||||
double titleHeight = textWidth(lists.interest!['title']);
|
||||
double widgetHeight = 115.sp +
|
||||
contentHeight(lists.content!) +
|
||||
(picHeight > 0 ? picHeight + 5 : 0);
|
||||
// double widgetHeight = 115.sp +
|
||||
// contentHeight(lists.content!) +
|
||||
// (picHeight > 0 ? picHeight + 5 : 0);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
@ -171,7 +179,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: widgetHeight,
|
||||
// height: widgetHeight,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -205,10 +213,11 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: widgetHeight,
|
||||
// height: widgetHeight,
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
|
||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp,bottom: 12.sp),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: 72.sp,
|
||||
@ -358,9 +367,10 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
);
|
||||
}),
|
||||
),
|
||||
if (widget.userId.isEmpty)
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
margin: EdgeInsets.only(top: 4.sp,bottom: 5.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@ -379,7 +389,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('delete'),
|
||||
width: 14.sp,
|
||||
width: 20.sp,
|
||||
))
|
||||
],
|
||||
))
|
||||
@ -393,10 +403,15 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
|
||||
///普通图文喊话
|
||||
normalDynamicItem(Lists lists) {
|
||||
Text descText = Text(
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
// maxLines: 2,
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
double picHeight = 0.0;
|
||||
@ -434,9 +449,9 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: picHeight > 0
|
||||
? 105.sp + contentHeight(lists.content!) + picHeight
|
||||
: 100.sp + contentHeight(lists.content!),
|
||||
// height: picHeight > 0
|
||||
// ? 105.sp + contentHeight(lists.content!) + picHeight
|
||||
// : 100.sp + contentHeight(lists.content!),
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -630,9 +645,10 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
);
|
||||
}))
|
||||
: Container(),
|
||||
if (widget.userId.isEmpty)
|
||||
Container(
|
||||
width: Get.width,
|
||||
margin: EdgeInsets.only(top: 4.sp),
|
||||
margin: EdgeInsets.only(top: 4.sp,bottom: 5.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@ -651,7 +667,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('delete'),
|
||||
width: 14.sp,
|
||||
width: 20.sp,
|
||||
))
|
||||
],
|
||||
))
|
||||
|
||||
@ -130,12 +130,18 @@ class _VisitorsFollowItemState extends State<VisitorsFollowItem> {
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
VisitorlistLogic logic = Get.find<VisitorlistLogic>();
|
||||
if (logic.isVip > 0) {
|
||||
List<String> idList = [];
|
||||
widget.users.forEach((element) {
|
||||
var user = UserListItem.fromJson(element).user;
|
||||
idList.add(user.id.toString());
|
||||
});
|
||||
logic.sendAllLike(idList);
|
||||
} else {
|
||||
showOKToast('开通会员可以一键喜欢哦~');
|
||||
showOepnVipDialog();
|
||||
}
|
||||
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 50.sp,right: 50.sp,top: 10.sp),
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:circle_app/app/world_call_out/world_data.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
@ -13,6 +14,7 @@ import '../select_circle/logic.dart';
|
||||
class World_call_outLogic extends GetxController {
|
||||
ScrollController scrollController = ScrollController();
|
||||
TextEditingController inputController = TextEditingController();
|
||||
final RefreshController refreshController = RefreshController();
|
||||
FocusNode focusNode = FocusNode();
|
||||
List<MyConfigData> genderList = [];
|
||||
String myUserId = '';
|
||||
@ -24,6 +26,7 @@ class World_call_outLogic extends GetxController {
|
||||
int total = 0;
|
||||
|
||||
bool isMore = true;
|
||||
bool loadFail = false;
|
||||
|
||||
bool showEmojiPanel = false;
|
||||
bool showKeyboard = false;
|
||||
@ -54,6 +57,7 @@ class World_call_outLogic extends GetxController {
|
||||
}
|
||||
|
||||
void initGerder() async {
|
||||
genderList.clear();
|
||||
var data1 =
|
||||
await DioManager.instance.get(url: Api.getCircleList, params: {});
|
||||
var bean1 = BaseResponse<ConfigBean>.fromJson(
|
||||
@ -96,6 +100,7 @@ class World_call_outLogic extends GetxController {
|
||||
}
|
||||
|
||||
void loadData() async {
|
||||
loadFail = false;
|
||||
Map<String, dynamic> params = {'page': index, 'pageSize': 20};
|
||||
|
||||
List wantMeet = [];
|
||||
@ -119,17 +124,22 @@ class World_call_outLogic extends GetxController {
|
||||
isLoad = false;
|
||||
if (index == 1) {
|
||||
lists = tempLists;
|
||||
|
||||
} else {
|
||||
lists.addAll(tempLists);
|
||||
|
||||
scrollController.jumpTo(scrollController.offset + 20);
|
||||
refreshController.loadComplete();
|
||||
// scrollController.jumpTo(scrollController.offset + 20);
|
||||
}
|
||||
|
||||
index++;
|
||||
} else {
|
||||
isMore = false;
|
||||
refreshController.refreshCompleted();
|
||||
}
|
||||
|
||||
update();
|
||||
} else if (bean1.code == 404) {
|
||||
loadFail = true;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../common/Widgets/circle_share.dart';
|
||||
import '../../common/Widgets/tag_widget.dart';
|
||||
@ -17,14 +18,14 @@ import '../../router/app_routers.dart';
|
||||
import '../circle/widgets/video_item.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class World_call_outPage extends StatefulWidget {
|
||||
World_call_outPage({Key? key}) : super(key: key);
|
||||
class WorldCallOutPage extends StatefulWidget {
|
||||
WorldCallOutPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<World_call_outPage> createState() => _World_call_outPageState();
|
||||
State<WorldCallOutPage> createState() => _WorldCallOutPageState();
|
||||
}
|
||||
|
||||
class _World_call_outPageState extends State<World_call_outPage>
|
||||
class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
with WidgetsBindingObserver {
|
||||
String zeroWidthSpace = '\ufeff';
|
||||
|
||||
@ -145,11 +146,17 @@ class _World_call_outPageState extends State<World_call_outPage>
|
||||
logic.update();
|
||||
// logic.sendTextMessage();
|
||||
},
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
child:
|
||||
SmartRefresher(
|
||||
controller: logic.refreshController,
|
||||
onLoading: () {
|
||||
logic.loadMore();
|
||||
},
|
||||
child: logic.lists.isEmpty
|
||||
enablePullUp: true,
|
||||
child:logic.loadFail ? noResultWidget(tip: '',callBack: () {
|
||||
logic.initGerder();
|
||||
logic.loadData();
|
||||
}) : logic.lists.isEmpty
|
||||
? !logic.isMore
|
||||
? noResultWidget()
|
||||
: loaddingWidget(true)
|
||||
|
||||
@ -343,7 +343,7 @@ class _RechargeScreenDialogState extends State<RechargeScreenDialog> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'充值金额仅限APP使用,充值遇到问题?',
|
||||
'充值遇到问题?',
|
||||
style: TextStyle(
|
||||
color: const Color(0xFFB7BECC), fontSize: 10.0.sp),
|
||||
),
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:circle_app/common/Widgets/add_wx_tip.dart';
|
||||
import 'package:circle_app/common/colors/app_color.dart';
|
||||
import 'package:circle_app/util/paymentUtil.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -32,7 +33,8 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
||||
children: [
|
||||
Container(
|
||||
width: 339.sp,
|
||||
height: 400.sp,
|
||||
height: Platform.isIOS ? 380.sp :420.sp ,
|
||||
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -79,7 +81,7 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
||||
width: 1,
|
||||
)
|
||||
: Positioned(
|
||||
bottom: 108.sp,
|
||||
bottom: 128.sp,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 24.0.sp),
|
||||
child: Row(
|
||||
@ -161,8 +163,10 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 18.sp,
|
||||
child: GestureDetector(
|
||||
bottom: 8.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
if (Platform.isIOS) {
|
||||
@ -187,9 +191,13 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
|
||||
style: TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.sp,),
|
||||
Text('一次解锁 · 永久有效',style: TextStyle(color: AppColor.mainColor,fontSize: 15.sp),)
|
||||
],
|
||||
)),
|
||||
Positioned(
|
||||
bottom: 72.sp,
|
||||
bottom: 90.sp,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
|
||||
@ -5,9 +5,11 @@ import 'package:get/get.dart';
|
||||
import 'package:gradient_borders/gradient_borders.dart';
|
||||
|
||||
import '../../app/circle/widgets/discover.dart';
|
||||
import '../../app/userinfo/logic.dart';
|
||||
import '../../network/api.dart';
|
||||
import '../../network/dio_manager.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../colors/app_color.dart';
|
||||
import 'dart:math' as math;
|
||||
@ -26,20 +28,40 @@ class _TodayPeopleDialogState extends State<TodayPeopleDialog> {
|
||||
List<String> chatImIdList = [];
|
||||
|
||||
bool isLoad = true;
|
||||
|
||||
List<AlbumListItem> imgList = [];
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
fetchMyAlbum(Api.getMyAlbum);
|
||||
// loadRecommendCircleFriendData();
|
||||
}
|
||||
|
||||
|
||||
Future<void> fetchMyAlbum(String url) async {
|
||||
var myAlbumData = await DioManager.instance.get(url: url);
|
||||
var myAlbumBean = BaseResponse<AlbumResponseBean>.fromJson(
|
||||
myAlbumData, (myAlbumData) => AlbumResponseBean.fromJson(myAlbumData));
|
||||
|
||||
if (myAlbumBean.isSuccess()) {
|
||||
imgList.addAll(myAlbumBean.data.lists);
|
||||
}
|
||||
loadRecommendCircleFriendData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void loadRecommendCircleFriendData() async {
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.chatRecommendFriend,
|
||||
);
|
||||
|
||||
if (data['code'] == 200) {
|
||||
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
|
||||
if (await sp.isShowMatch() && imgList.isEmpty) {
|
||||
showOKToast('上传真实头像和形象照后更容易匹配到想认识的人哦~');
|
||||
}
|
||||
isLoad = false;
|
||||
List dataList = data['data'];
|
||||
if (dataList.isNotEmpty) {
|
||||
@ -47,6 +69,8 @@ class _TodayPeopleDialogState extends State<TodayPeopleDialog> {
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
} else {
|
||||
Get.back();
|
||||
}
|
||||
} else {
|
||||
if (widget.isShow) {
|
||||
|
||||
@ -19,6 +19,72 @@ const bgAssetImage = DecorationImage(
|
||||
const bgBoxDecoration = BoxDecoration(image: bgAssetImage);
|
||||
|
||||
|
||||
userWxStatusWidget(bool isUnclock,String wx,String userId,int type,String avatarUrl,Function callBack,{bool isSelf = false}) {
|
||||
double textWidth = boundingTextSize(Get.context!, wx, TextStyle(color: Colors.white, fontSize: 12.sp)).width;
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
if (!isUnclock) {
|
||||
|
||||
var result = await DioManager().post(url: Api.unlockStatus,params: {'targetUserId':userId});
|
||||
if (result['code'] == 200) {
|
||||
int price = result['data']['unlockPrice'];
|
||||
int residueUnlockNum = result['data']['residueUnlockNum'];
|
||||
if (price > 0 && (residueUnlockNum == -1 || residueUnlockNum > 0)) {
|
||||
Get.bottomSheet(UnlockWxTip(userId, avatarUrl,false),isScrollControlled: true,enableDrag: false).then((value) {if (value != null) {
|
||||
callBack();
|
||||
}});
|
||||
} else if (price > 0) {
|
||||
Get.bottomSheet(UnlockWxTip(userId, avatarUrl,true),isScrollControlled: true,enableDrag: false).then((value) {if (value != null) {
|
||||
callBack();
|
||||
}});
|
||||
} else {
|
||||
var result = await DioManager().post(url: Api.unlockWx,params: {'targetUserId':userId});
|
||||
if (result['code'] == 200) {
|
||||
showOKToast('已成功解锁TA的联系方式,快去和TA私聊呗~');
|
||||
callBack();
|
||||
} else {
|
||||
Get.bottomSheet(UnlockWxTip(userId, avatarUrl,true),isScrollControlled: true,enableDrag: false).then((value) {if (value != null) {
|
||||
callBack();
|
||||
}});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isSelf) {
|
||||
// Clipboard.setData(ClipboardData(text: wx));
|
||||
// showToast('联系方式复制成功');
|
||||
} else {
|
||||
showAddWxPicker(wx.isNotEmpty).then((value) {
|
||||
if (value != null) {
|
||||
callBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
child: Container(
|
||||
height: 26.sp,
|
||||
width: (isUnclock ? 32.sp : 43.sp) + textWidth,
|
||||
padding: EdgeInsets.only(left: 5.sp,right: 5.sp),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x66000000),
|
||||
borderRadius: BorderRadius.circular(4.sp)
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(getMineImage(type == 1 ? 'phone_icon' : type == 3 ? 'qq' : 'wx'),width: 14.sp,),
|
||||
SizedBox(width: 2.sp,),
|
||||
Text(wx,style: TextStyle(color: Colors.white,fontSize: 12.sp),),
|
||||
if (!isUnclock)
|
||||
Image.asset(getDisCoverImage('unclock_icon'),width: 16.sp,)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
wxStatusWidget(bool isUnclock,String wx,String userId,int type,String avatarUrl,Function callBack,{bool isSelf = false}) {
|
||||
double textWidth = boundingTextSize(Get.context!, wx, TextStyle(color: Colors.white, fontSize: 14.sp)).width;
|
||||
return GestureDetector(
|
||||
|
||||
@ -371,6 +371,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
duration: const Duration(seconds: 2),
|
||||
child: GetMaterialApp(
|
||||
title: '微乐园',
|
||||
theme: ThemeData(
|
||||
splashColor: Colors.transparent, // 点击时的水波纹颜色设置为透明
|
||||
highlightColor: Colors.transparent, // 点击时的背景高亮颜色设置为透明
|
||||
),
|
||||
initialBinding: SplashBinding(),
|
||||
getPages: AppPages.routes,
|
||||
|
||||
@ -379,7 +383,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
|
||||
RefreshLocalizations.delegate,
|
||||
/// iOS一定要设置,不然报错
|
||||
],
|
||||
locale: const Locale('zh', 'CN'),
|
||||
|
||||
@ -42,8 +42,8 @@ class DioManager {
|
||||
_dio ??= Dio(BaseOptions(
|
||||
// baseUrl2
|
||||
baseUrl:
|
||||
Api.baseUrl2,
|
||||
// Api.baseUrl,
|
||||
// Api.baseUrl2,
|
||||
Api.baseUrl,
|
||||
|
||||
// type == 1 ? Api.baseUrl2 : Api.baseUrl1,
|
||||
// 连接服务器超时时间,单位是毫秒
|
||||
|
||||
@ -21,6 +21,8 @@ class SharedPreferencesHelper {
|
||||
|
||||
static const msgTip = 'msgTip';
|
||||
|
||||
static const FirstMatch = 'FirstMatch';
|
||||
|
||||
static SharedPreferencesHelper? _instance;
|
||||
static SharedPreferences? _preferences;
|
||||
|
||||
@ -81,6 +83,27 @@ class SharedPreferencesHelper {
|
||||
}
|
||||
|
||||
|
||||
Future<bool> isShowMatch() async {
|
||||
String time = await preferences!.getString(FirstMatch) ?? '';
|
||||
if (time.isNotEmpty) {
|
||||
DateTime dateTime = DateTime.parse(time);
|
||||
bool isShow = !isSameDay(dateTime,DateTime.now());
|
||||
if (isShow) {
|
||||
preferences!.setString(FirstMatch, DateTime.now().toString());
|
||||
}
|
||||
return isShow;
|
||||
} else {
|
||||
preferences!.setString(FirstMatch, DateTime.now().toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isSameDay(DateTime time1, DateTime time2) {
|
||||
return time1.year == time2.year &&
|
||||
time1.month == time2.month &&
|
||||
time1.day == time2.day;
|
||||
}
|
||||
|
||||
bool? getBool(String key) {
|
||||
final prefs = preferences;
|
||||
return prefs?.getBool(key);
|
||||
|
||||
@ -74,7 +74,7 @@ class IOSPayment {
|
||||
List<PurchaseDetails> purchaseDetailsList) async {
|
||||
for (final PurchaseDetails purchaseDetails in purchaseDetailsList) {
|
||||
if (purchaseDetails.status == PurchaseStatus.pending) {
|
||||
SmartDialog.showLoading(msg: '正在处理');
|
||||
SmartDialog.showLoading(msg: '请稍等片刻');
|
||||
} else {
|
||||
if (purchaseDetails.status == PurchaseStatus.error) {
|
||||
showOKToast('支付发生错误');
|
||||
|
||||
@ -35,6 +35,7 @@ import '../app/home/logic.dart';
|
||||
import '../app/select_circle/logic.dart';
|
||||
import '../common/Widgets/open_vip_tip/view.dart';
|
||||
import '../common/Widgets/wx_edit_dialog.dart';
|
||||
import '../common/colors/app_color.dart';
|
||||
import '../network/dio_manager.dart';
|
||||
import 'SharedPreferencesHelper.dart';
|
||||
|
||||
@ -108,7 +109,7 @@ loaddingWidget(bool isMore,{String tip = '--到底了--'}) {
|
||||
);
|
||||
}
|
||||
|
||||
noResultWidget({String tip = '正在等待被填充~'}) {
|
||||
noResultWidget({String tip = '正在等待被填充~',Function? callBack, String action = '重新加载'}) {
|
||||
return Container(
|
||||
width: Get.width,
|
||||
child: Column(
|
||||
@ -121,10 +122,31 @@ noResultWidget({String tip = '正在等待被填充~'}) {
|
||||
SizedBox(
|
||||
height: 8.sp,
|
||||
),
|
||||
if (callBack == null || tip.isNotEmpty)
|
||||
Text(
|
||||
tip,
|
||||
style: TextStyle(color: Color(0xffdbdbdb), fontSize: 15.sp),
|
||||
),
|
||||
if (callBack != null)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
callBack();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
height: 42.sp,
|
||||
width: 160.sp,
|
||||
alignment: Alignment.center,
|
||||
// padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.sp),
|
||||
gradient: AppColor.mainVerLinearGradient),
|
||||
child: Text(
|
||||
action,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -45,10 +45,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: app_settings
|
||||
sha256: e6a34735d4ddb24ca9c5fd7e965ec65c8b611cbd3a329152c294f9e9f4bacb33
|
||||
sha256: "2ec421f375d747916c4c0193933567074ea60c4f01c4a68642f07fef1002524e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.3.1"
|
||||
version: "4.0.4"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -630,14 +630,6 @@ 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
|
||||
#腾讯离线推送
|
||||
@ -112,7 +112,7 @@ dependencies:
|
||||
#边框渐变
|
||||
gradient_borders: ^1.0.0
|
||||
#系统设置 安卓4.3.1 苹果4.0.4
|
||||
app_settings: 4.3.1
|
||||
app_settings: 4.0.4
|
||||
#百度定位插件
|
||||
flutter_bmflocation: ^3.6.0
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user