代码提交

This commit is contained in:
CYH 2024-05-14 15:14:52 +08:00
parent 3639ddf773
commit e8b365d421
36 changed files with 1642 additions and 1061 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -102,7 +102,7 @@ class TIMInputTextField extends StatefulWidget {
required this.conversationID,
required this.conversationType,
this.initText,
required this.isBlack,
required this.isBlack,
required this.hintText,
this.scrollController,
this.morePanelConfig,
@ -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 {
@ -383,7 +388,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
child: Text(
"是否解除拉黑",
style:
TextStyle(color: Colors.white, fontSize: 16.sp),
TextStyle(color: Colors.white, fontSize: 16.sp),
),
),
Container(
@ -446,14 +451,16 @@ 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,
(jsonData) => jsonData,
);
if (bean.isSuccess()) {
final FriendshipServices _friendshipServices =
serviceLocator<FriendshipServices>();
serviceLocator<FriendshipServices>();
isBlack = false;
}
showOKToast(bean.msg);
@ -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,47 +587,65 @@ 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 (data['data']['code'] == 10000) {
words = data['data']['words'];
if (words.isNotEmpty) {
for (int i = 0; i < words.length; i++) {
text = text.replaceAll(words[i], '*');
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) {
for (int i = 0; i < words.length; i++) {
text = text.replaceAll(words[i], '*');
}
}
}
if (words.isNotEmpty) {
textEditingController.text = text;
showOKToast('含违规词汇,无法发送');
Future.delayed(Duration(seconds: 1), () {
isSending = false;
});
return;
}
}
Future.delayed(Duration(seconds: 1), () {isSending = false;});
if (words.isEmpty) {
try {
var msgResult = await MessageUtils.handleMessageError(
widget.model.sendTextMessage(
text: text,
convID: widget.conversationID,
convType: convType),
context);
addChatRecord(text, msgResult!.data!.msgID ?? '', msgResult!.data!.timestamp.toString() ?? '');
} catch (e) {
}
} else {
showOKToast('含违规词汇,无法发送');
return;
if (words.isEmpty) {
try {
var msgResult = await MessageUtils.handleMessageError(
widget.model.sendTextMessage(
text: text,
convID: widget.conversationID,
convType: convType),
context);
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,
@ -1024,22 +1054,20 @@ class _InputTextFieldState extends TIMUIKitState<TIMInputTextField> {
if (null == commentBlackEvent) {
commentBlackEvent =
EventBusManager.on<CommentBlackEvent>().listen((event) {
if (event.userId == widget.currentConversation.userID!) {
isBlack = event.isBlack;
}
});
if (event.userId == widget.currentConversation.userID!) {
isBlack = event.isBlack;
}
});
}
getBlack();
}
StreamSubscription? commentBlackEvent = null;
bool isBlack = false;
bool isSending = false;
getBlack() async {
isBlack = widget.isBlack!;
EventBusManager.fire(CommentBlackMoreEvent());
isBlack = widget.isBlack!;
EventBusManager.fire(CommentBlackMoreEvent());
}
@override

View File

@ -1141,7 +1141,7 @@ class _TIMTextFieldLayoutNarrowState
}
if (!isVip) {
showOKToast(plate== 0 ? '开通会员之后才能发送语音' : '开通会员之后才能发送图片');
showOKToast(plate== 5 ? '开通会员之后才能发送语音' : '开通会员之后才能发送图片');
Get.bottomSheet(
Scaffold(
backgroundColor: Colors.transparent,

View File

@ -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

View File

@ -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)),

View File

@ -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,12 +256,15 @@ 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));
SharedPreferences sharedPreferences =
await SharedPreferences.getInstance();
await SharedPreferences.getInstance();
// SharedPreferencesHelper.getInstance().then((sharedPreferences) {
int userId =
sharedPreferences.getInt(SharedPreferencesHelper.USERID) ?? 0;
@ -357,7 +363,7 @@ class _LikeViewState extends State<LikeView>
decoration: BoxDecoration(
color: AppColor.bgColor,
borderRadius:
BorderRadius.circular(5.sp)),
BorderRadius.circular(5.sp)),
child: Text(
' 展开更早发布的喊话 ↓ ',
style: TextStyle(
@ -385,16 +391,16 @@ class _LikeViewState extends State<LikeView>
decoration: BoxDecoration(
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
AppColor.mainVerLinearGradient,
width: 1.sp,
),
borderRadius:
BorderRadius.circular(5.sp)),
BorderRadius.circular(5.sp)),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
MainAxisAlignment.center,
children: [
Text(
' 展开更早发布的喊话 ↓ ',
@ -429,32 +435,32 @@ class _LikeViewState extends State<LikeView>
} else {
return Container(
margin:
EdgeInsets.only(top: recomandMore ? 0 : 10.sp),
EdgeInsets.only(top: recomandMore ? 0 : 10.sp),
child: recomandMore
? loaddingWidget(recomandMore)
: GestureDetector(
onTap: () {
widget.changeCallback();
},
child: Container(
margin: EdgeInsets.only(bottom: 10.sp),
child: Stack(
alignment: Alignment.center,
children: [
Image.asset(
getLoginImage('start_bg'),
width: 180.sp,
),
Text(
'查看更多圈子',
style: TextStyle(
color: Colors.white,
fontSize: 18.sp),
)
],
),
onTap: () {
widget.changeCallback();
},
child: Container(
margin: EdgeInsets.only(bottom: 10.sp),
child: Stack(
alignment: Alignment.center,
children: [
Image.asset(
getLoginImage('start_bg'),
width: 180.sp,
),
));
Text(
'查看更多圈子',
style: TextStyle(
color: Colors.white,
fontSize: 18.sp),
)
],
),
),
));
}
}),
),
@ -524,7 +530,7 @@ class _LikeViewState extends State<LikeView>
margin: EdgeInsets.only(top: 24.sp, bottom: 24.sp),
child: Container(
margin:
EdgeInsets.only(top: 12.sp, left: 14.sp, right: 14.sp),
EdgeInsets.only(top: 12.sp, left: 14.sp, right: 14.sp),
alignment: Alignment.center,
child: SingleChildScrollView(
child: Text(
@ -576,7 +582,7 @@ class _LikeViewState extends State<LikeView>
// pushOtherPeopleHomePage(element.id.toString());
},
child:
circleWidget(element.avatar!, element.id.toString(), width: 24),
circleWidget(element.avatar!, element.id.toString(), width: 24),
),
));
index++;
@ -647,7 +653,7 @@ class _LikeViewState extends State<LikeView>
alignment: Alignment.center,
children: [
Container(
// margin: EdgeInsets.only(top: 5.sp,right: 5.sp),
// margin: EdgeInsets.only(top: 5.sp,right: 5.sp),
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
alignment: Alignment.center,
height: 28.sp,
@ -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),
))
@ -698,73 +705,73 @@ class _LikeViewState extends State<LikeView>
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
alignment: Alignment.centerLeft,
height: 72.sp,
child: Column(
children: [
Row(
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
alignment: Alignment.centerLeft,
height: 72.sp,
child: Column(
children: [
Text(
lists.user!.nickname!,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.w600),
Row(
children: [
Text(
lists.user!.nickname!,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 8.sp,
),
UserTagWidget(lists.user!.mark!),
// lists.user?.vip != null &&
// lists.user!.vip == 0
// ? Container()
// : Image.asset(
// getCircleImage(lists.user!.vip == 1
// ? 'vip'
// : 'year_vip'),
// width: 36.sp,
// )
],
),
SizedBox(
width: 8.sp,
height: 4.sp,
),
UserTagWidget(lists.user!.mark!),
// lists.user?.vip != null &&
// lists.user!.vip == 0
// ? Container()
// : Image.asset(
// getCircleImage(lists.user!.vip == 1
// ? 'vip'
// : 'year_vip'),
// width: 36.sp,
// )
],
),
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:
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(
lists.user!.gender ?? 0,
lists.user!.age ?? 0,
lists.user!.role ?? 0,
lists.user!.orientation ?? 0),
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
),
),
)
gradient: const LinearGradient(
begin: Alignment(0.25, 0.5),
end: Alignment(0.75, 0.5),
colors: [
Color(0xff8DFFF8),
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(
lists.user!.gender ?? 0,
lists.user!.age ?? 0,
lists.user!.role ?? 0,
lists.user!.orientation ?? 0),
// '${genderList[lists.user!.gender!]}.${lists.user!.age}.${roleList[lists.user!.role!]}.${orientationList[lists.user!.orientation!]}',
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
),
),
)
],
),
],
),
],
),
)),
)),
],
),
),
@ -778,52 +785,52 @@ class _LikeViewState extends State<LikeView>
margin: EdgeInsets.only(top: 5.sp),
child: picHeight == 140.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(lists.album![0].url!))
borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(lists.album![0].url!))
: GridView.builder(
itemCount: lists.album!.length,
physics: const NeverScrollableScrollPhysics(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio: 0.7 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
return GestureDetector(
onTap: () {
var imgList = <String>[];
for (var element in lists.album!) {
imgList.add(element.url!);
}
Get.toNamed(AppRoutes.Swiper, arguments: {
'imaglist': imgList,
'index': currentIndex,
'userId':lists.user!.id.toString()
});
},
child: ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child: CachedNetworkImage(
imageUrl: album.url!,
// placeholder: (context, url) =>
// SizedBox(
// width: 30.sp,
// height: 30.sp,
// child: CircularProgressIndicator(
// color: Color(0xFF07FAFB),
// strokeWidth: 2.sp,
// ),
// ),
errorWidget: (context, url, error) =>
const Icon(Icons.error),
fit: BoxFit.cover,
),
),
);
}),
itemCount: lists.album!.length,
physics: const NeverScrollableScrollPhysics(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio: 0.7 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
return GestureDetector(
onTap: () {
var imgList = <String>[];
for (var element in lists.album!) {
imgList.add(element.url!);
}
Get.toNamed(AppRoutes.Swiper, arguments: {
'imaglist': imgList,
'index': currentIndex,
'userId': lists.user!.id.toString()
});
},
child: ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child: CachedNetworkImage(
imageUrl: album.url!,
// placeholder: (context, url) =>
// SizedBox(
// width: 30.sp,
// height: 30.sp,
// child: CircularProgressIndicator(
// color: Color(0xFF07FAFB),
// strokeWidth: 2.sp,
// ),
// ),
errorWidget: (context, url, error) =>
const Icon(Icons.error),
fit: BoxFit.cover,
),
),
);
}),
),
Container(
height: 30.sp,
@ -836,29 +843,29 @@ class _LikeViewState extends State<LikeView>
children: [
widgets.isNotEmpty
? SizedBox(
width: 24 + 12.sp * widgets.length - 8.sp,
height: 24.sp,
child: Stack(children: widgets),
)
width: 24 + 12.sp * widgets.length - 8.sp,
height: 24.sp,
child: Stack(children: widgets),
)
: Container(),
SizedBox(
width: 4.sp,
),
widgets.isNotEmpty
? Expanded(
child: Text(
'${lists.chat!.count!}位圈友已私聊',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
))
child: Text(
'${lists.chat!.count!}位圈友已私聊',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
))
: Expanded(
child: Text(
'赶紧成为第一位私聊ta的圈友吧',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
)),
child: Text(
'赶紧成为第一位私聊ta的圈友吧',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
)),
GestureDetector(
onTap: () {
pushMsgPage(
@ -924,7 +931,7 @@ class _LikeViewState extends State<LikeView>
child: GestureDetector(
onTap: () {},
child:
circleWidget(element.avatar!, element.id.toString(), width: 24),
circleWidget(element.avatar!, element.id.toString(), width: 24),
),
));
index++;
@ -966,7 +973,7 @@ class _LikeViewState extends State<LikeView>
alignment: Alignment.center,
children: [
Container(
// margin: EdgeInsets.only(top: 5.sp,right: 5.sp),
// margin: EdgeInsets.only(top: 5.sp,right: 5.sp),
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
alignment: Alignment.center,
height: 28.sp,
@ -980,10 +987,10 @@ class _LikeViewState extends State<LikeView>
child: Text(
(lists.user!.city ?? '外星').length > 4
? (lists.user!.city ?? '外星').substring(0, 4) +
'...'
'...'
: (lists.user!.city ?? '外星'),
style:
TextStyle(color: Colors.white, fontSize: 15.sp),
TextStyle(color: Colors.white, fontSize: 15.sp),
))
],
),
@ -1018,63 +1025,64 @@ class _LikeViewState extends State<LikeView>
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
alignment: Alignment.centerLeft,
height: 72.sp,
child: Column(
children: [
Row(
padding: EdgeInsets.only(
left: 8.sp, top: 12.sp),
alignment: Alignment.centerLeft,
height: 72.sp,
child: Column(
children: [
Text(
lists.user!.nickname!,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.w600),
Row(
children: [
Text(
lists.user!.nickname!,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
width: 8.sp,
),
UserTagWidget(lists.user!.mark!),
],
),
SizedBox(
width: 8.sp,
height: 4.sp,
),
UserTagWidget(lists.user!.mark!),
],
),
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:
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(
lists.user!.gender ?? 0,
lists.user!.age ?? 0,
lists.user!.role ?? 0,
lists.user!.orientation ?? 0),
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
),
),
)
gradient: const LinearGradient(
begin: Alignment(0.25, 0.5),
end: Alignment(0.75, 0.5),
colors: [
Color(0xff8DFFF8),
Color(0xffB5D3FF)
])),
child: Text(
getAgeCOntent(
lists.user!.gender ?? 0,
lists.user!.age ?? 0,
lists.user!.role ?? 0,
lists.user!.orientation ?? 0),
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
),
),
)
],
),
],
),
],
),
)),
)),
],
),
),
@ -1085,69 +1093,70 @@ class _LikeViewState extends State<LikeView>
),
picHeight > 0
? Container(
height: picHeight,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(top: 5.sp),
child: picHeight == 140.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child:
VideoItemWidget(lists.album![0].url!))
: GridView.builder(
itemCount: lists.album!.length,
physics:
const NeverScrollableScrollPhysics(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio:
0.7 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
if (album.type == 2) {
return ClipRRect(
borderRadius:
BorderRadius.circular(6.sp),
child: VideoItemWidget(album.url!));
}
return GestureDetector(
onTap: () {
var imgList = <String>[];
for (var element in lists.album!) {
imgList.add(element.url!);
}
Get.toNamed(AppRoutes.Swiper,
arguments: {
'imaglist': imgList,
'index': currentIndex,
'userId':lists.user!.id.toString()
});
},
child: ClipRRect(
borderRadius:
BorderRadius.circular(6.sp),
child: CachedNetworkImage(
imageUrl: album.url!,
// placeholder: (context, url) =>
// SizedBox(
// width: 30.sp,
// height: 30.sp,
// child: CircularProgressIndicator(
// color: Color(0xFF07FAFB),
// strokeWidth: 2.sp,
// ),
// ),
errorWidget:
(context, url, error) =>
const Icon(Icons.error),
fit: BoxFit.cover,
),
),
);
}))
height: picHeight,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(top: 5.sp),
child: picHeight == 140.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child:
VideoItemWidget(lists.album![0].url!))
: GridView.builder(
itemCount: lists.album!.length,
physics:
const NeverScrollableScrollPhysics(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio:
0.7 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
if (album.type == 2) {
return ClipRRect(
borderRadius:
BorderRadius.circular(6.sp),
child: VideoItemWidget(album.url!));
}
return GestureDetector(
onTap: () {
var imgList = <String>[];
for (var element in lists.album!) {
imgList.add(element.url!);
}
Get.toNamed(AppRoutes.Swiper,
arguments: {
'imaglist': imgList,
'index': currentIndex,
'userId':
lists.user!.id.toString()
});
},
child: ClipRRect(
borderRadius:
BorderRadius.circular(6.sp),
child: CachedNetworkImage(
imageUrl: album.url!,
// placeholder: (context, url) =>
// SizedBox(
// width: 30.sp,
// height: 30.sp,
// child: CircularProgressIndicator(
// color: Color(0xFF07FAFB),
// strokeWidth: 2.sp,
// ),
// ),
errorWidget:
(context, url, error) =>
const Icon(Icons.error),
fit: BoxFit.cover,
),
),
);
}))
: Container(),
Container(
height: 30.sp,
@ -1156,7 +1165,7 @@ class _LikeViewState extends State<LikeView>
right: 10.sp,
),
margin:
EdgeInsets.only(top: picHeight == 0 ? 15.sp : 5.sp),
EdgeInsets.only(top: picHeight == 0 ? 15.sp : 5.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.sp),
color: Color(0x33000000)),
@ -1164,29 +1173,29 @@ class _LikeViewState extends State<LikeView>
children: [
widgets.isNotEmpty
? SizedBox(
width: 24 + 12.sp * widgets.length - 8.sp,
height: 24.sp,
child: Stack(children: widgets),
)
width: 24 + 12.sp * widgets.length - 8.sp,
height: 24.sp,
child: Stack(children: widgets),
)
: Container(),
SizedBox(
width: 4.sp,
),
widgets.isNotEmpty
? Expanded(
child: Text(
'${lists.chat!.count!}位圈友已私聊',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
))
child: Text(
'${lists.chat!.count!}位圈友已私聊',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
))
: Expanded(
child: Text(
'赶紧成为第一位私聊ta的圈友吧',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
)),
child: Text(
'赶紧成为第一位私聊ta的圈友吧',
style: TextStyle(
color: Colors.white.withOpacity(0.75),
fontSize: 14.sp),
)),
GestureDetector(
onTap: () async {
pushMsgPage(
@ -1218,74 +1227,85 @@ class _LikeViewState extends State<LikeView>
tipItem() {
bool showTitle = lists.isEmpty;
return Container(
margin: EdgeInsets.only(top: showTitle ? 20.sp : 0, bottom: 10.sp),
// height: 30.sp,
child: Column(
children: [
if (showTitle)
Container(
margin: EdgeInsets.only(bottom: 8.sp),
child: Image.asset(
getBaseImage('no_result'),
width: 200.sp,
return GetBuilder<CircleLogic>(builder: (logic) {
return Container(
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),
child: Image.asset(
getBaseImage('no_result'),
width: 200.sp,
),
),
),
if (showTitle)
Text(
'还没有您喜欢的圈友发布喊话哦~',
style: TextStyle(color: Colors.white, fontSize: 16.sp),
),
Container(
margin: EdgeInsets.only(top: 20.sp),
padding: EdgeInsets.only(left: 30.sp, right: 30.sp),
child: Row(
children: [
Expanded(
child: Container(
height: 2.sp,
color: Colors.white.withOpacity(0.5),
)),
Container(
margin: EdgeInsets.only(left: 8.sp, right: 8.sp),
height: 2.sp,
width: 2.sp,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(1.sp)),
),
ShaderMask(
shaderCallback: (Rect bounds) {
return const LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
).createShader(Offset.zero & bounds.size);
},
child: Text(
'喊话推荐',
style: TextStyle(color: Colors.white, fontSize: 17.sp),
if (showTitle)
Text(
'还没有您喜欢的圈友发布喊话哦~',
style: TextStyle(color: Colors.white, fontSize: 16.sp),
),
Container(
margin: EdgeInsets.only(top: 20.sp),
padding: EdgeInsets.only(left: 30.sp, right: 30.sp),
child: Row(
children: [
Expanded(
child: Container(
height: 2.sp,
color: Colors.white.withOpacity(0.5),
)),
Container(
margin: EdgeInsets.only(left: 8.sp, right: 8.sp),
height: 2.sp,
width: 2.sp,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(1.sp)),
),
),
Container(
margin: EdgeInsets.only(left: 8.sp, right: 8.sp),
height: 2.sp,
width: 2.sp,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(1.sp)),
),
Expanded(
child: Container(
height: 2.sp,
color: Colors.white.withOpacity(0.5),
)),
],
),
)
],
),
);
ShaderMask(
shaderCallback: (Rect bounds) {
return const LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
).createShader(Offset.zero & bounds.size);
},
child: Text(
'喊话推荐',
style: TextStyle(color: Colors.white, fontSize: 17.sp),
),
),
Container(
margin: EdgeInsets.only(left: 8.sp, right: 8.sp),
height: 2.sp,
width: 2.sp,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(1.sp)),
),
Expanded(
child: Container(
height: 2.sp,
color: Colors.white.withOpacity(0.5),
)),
],
),
)
],
),
);
});
}
circleInfoItem(var bean, Lists list, int index) {
@ -1333,41 +1353,41 @@ class _LikeViewState extends State<LikeView>
),
Expanded(
child: Container(
padding: EdgeInsets.only(
left: 8.sp,
top: 12.sp,
),
// alignment: Alignment.,
height: 72.sp,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
bean['title'],
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.w600),
padding: EdgeInsets.only(
left: 8.sp,
top: 12.sp,
),
SizedBox(
height: 4.sp,
// alignment: Alignment.,
height: 72.sp,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
bean['title'],
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontWeight: FontWeight.w600),
),
SizedBox(
height: 4.sp,
),
Text(
// "view_total" -> 21
'${convertToTenThousand(bean['view_total'])}人看过',
textAlign: TextAlign.left,
style: TextStyle(
color: const Color(0xff03FEFB),
fontSize: 12.sp,
),
),
],
),
Text(
// "view_total" -> 21
'${convertToTenThousand(bean['view_total'])}人看过',
textAlign: TextAlign.left,
style: TextStyle(
color: const Color(0xff03FEFB),
fontSize: 12.sp,
),
),
],
),
)),
)),
Container(
margin: EdgeInsets.only(right: 8.sp),
child: GestureDetector(
//
//
onTap: () async {
CircleLogic cLogic = Get.find<CircleLogic>();
if (bean['is_join']) {
@ -1401,8 +1421,6 @@ class _LikeViewState extends State<LikeView>
element.interest = element.interest!;
}
});
}
if (Get.isRegistered<LikeLogic>()) {
LikeLogic likeLogic = Get.find<LikeLogic>();
@ -1424,7 +1442,7 @@ class _LikeViewState extends State<LikeView>
Text(
!bean['is_join'] ? '申请加入' : '分享有奖',
style:
TextStyle(color: Colors.white, fontSize: 12.sp),
TextStyle(color: Colors.white, fontSize: 12.sp),
)
],
)),
@ -1502,7 +1520,7 @@ class _LikeViewState extends State<LikeView>
child: Text(
"提示",
style:
TextStyle(color: Colors.white, fontSize: 16.sp),
TextStyle(color: Colors.white, fontSize: 16.sp),
),
),
Container(

View File

@ -73,7 +73,9 @@ class _NewPeopleState extends State<NewPeople> {
},
),
)
: loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~');
: logic.isLoadFail ? noResultWidget(tip: '', callBack: () {
logic.onLoading();
}) : loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~');
});
}
}

View File

@ -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) {

View File

@ -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 {

View File

@ -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,
@ -628,7 +631,7 @@ class _CircleListPageState extends State<CircleListPage>
));
}
leftItem(String text, bool isSelcted, bool isUnread, int index) {
leftItem(String text, bool isSelcted, bool isUnread, int index) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
@ -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,

View File

@ -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();
}
}
}

View File

@ -116,7 +116,7 @@ class _HomePageState extends State<HomePage>
children: [
const CirclePage(),
CircleListPage(),
World_call_outPage(),
WorldCallOutPage(),
MsgPage(),
MinefragmentPage()
],

View File

@ -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();

View File

@ -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();

View File

@ -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(

View File

@ -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),
),

View File

@ -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

View File

@ -94,7 +94,14 @@ class SplashLogic extends GetxController {
await Future.delayed(Duration(seconds: 5));
onInit();
} else {
pushLoginPage();
SharedPreferencesHelper sp =
await SharedPreferencesHelper.getInstance();
String token = sp.getString(SharedPreferencesHelper.AUTHORIZATION);
if (token.isNotEmpty) {
Get.offNamed(AppRoutes.Home);
} else {
pushLoginPage();
}
}
// Get.toNamed(AppRoutes.Home);

View File

@ -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);
}

View File

@ -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,9 +962,26 @@ class MyTabbedScreenState extends State<UserinfoPage>
if (controller.isMe)
Container(
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
child: Text(
controller.isLikeFoMsg,
style: const TextStyle(color: Colors.white30),
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

View File

@ -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,
))
],
))

View File

@ -130,12 +130,18 @@ class _VisitorsFollowItemState extends State<VisitorsFollowItem> {
GestureDetector(
onTap: () {
VisitorlistLogic logic = Get.find<VisitorlistLogic>();
List<String> idList = [];
widget.users.forEach((element) {
var user = UserListItem.fromJson(element).user;
idList.add(user.id.toString());
});
logic.sendAllLike(idList);
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),

View File

@ -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();
}
}

View File

@ -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 {
logic.loadMore();
},
child: logic.lists.isEmpty
child:
SmartRefresher(
controller: logic.refreshController,
onLoading: () {
logic.loadMore();
},
enablePullUp: true,
child:logic.loadFail ? noResultWidget(tip: '',callBack: () {
logic.initGerder();
logic.loadData();
}) : logic.lists.isEmpty
? !logic.isMore
? noResultWidget()
: loaddingWidget(true)

View File

@ -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),
),

View File

@ -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,
@ -73,13 +75,13 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
color: const Color.fromRGBO(247, 250, 250, 0.8),
fontSize: 14.sp)),
)),
Platform.isIOS
Platform.isIOS
? Container(
height: 1,
width: 1,
)
: Positioned(
bottom: 108.sp,
bottom: 128.sp,
child: Container(
margin: EdgeInsets.only(top: 24.0.sp),
child: Row(
@ -161,35 +163,41 @@ joiinCircileTipWdiget(String cicleId, String pirce, String oldPrice,
),
),
Positioned(
bottom: 18.sp,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (Platform.isIOS) {
IOSPayment.instance.iosPay(iosItem, cicleId, 1);
} else {
unlockingPayment(cicleId, myCallback);
bottom: 8.sp,
child: Column(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (Platform.isIOS) {
IOSPayment.instance.iosPay(iosItem, cicleId, 1);
} else {
unlockingPayment(cicleId, myCallback);
}
},
child: Container(
width: 168.sp,
height: 42.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
gradient: const LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xff0AFCFF), Color(0xffD739EA)])),
child: Text(
'立即解锁',
style: TextStyle(color: Colors.white, fontSize: 16.sp),
}
},
child: Container(
width: 168.sp,
height: 42.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.sp),
gradient: const LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xff0AFCFF), Color(0xffD739EA)])),
child: Text(
'立即解锁',
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(

View File

@ -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) {

View File

@ -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(

View File

@ -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'),

View File

@ -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,
//

View File

@ -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);

View File

@ -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('支付发生错误');

View File

@ -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),
),
),
)
],
),
);

View File

@ -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:

View File

@ -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