2.1.2代码提交

This commit is contained in:
CYH 2024-05-16 18:20:37 +08:00
parent e8b365d421
commit 3e44662d84
37 changed files with 4438 additions and 1342 deletions

View File

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

View File

@ -383,7 +383,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -534,7 +534,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -579,7 +579,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -116,9 +116,11 @@ class _Call_outPageState extends State<Call_outPage> {
child: Container(
padding: EdgeInsets.only(top: 15.sp),
child: Stack(
children: [
Column(
children: [
SizedBox(
height: 100.sp,
height: 150.sp,
child: TextField(
controller:
controller.textEditingController,
@ -145,20 +147,29 @@ class _Call_outPageState extends State<Call_outPage> {
counter: const Text('')),
),
),
Positioned(
right: 15.sp,
top: 100.sp,
child: Text(
Row(
children: [
Expanded(child: Container()),
Text(
'${controller.textEditingController.text.length}/200',
style: TextStyle(
color: Colors.white, fontSize: 12.sp),
)),
),
SizedBox(width: 15.sp,)
],
)
],
),
// Positioned(
// right: 15.sp,
// top: 100.sp,
// child:),
Container(
margin: EdgeInsets.only(top: 130.sp),
margin: EdgeInsets.only(top: 180.sp),
child: _imageAdapter(controller)),
Container(
margin: EdgeInsets.only(
top: 130.sp, left: 15.sp, right: 15.sp),
top: 180.sp, left: 15.sp, right: 15.sp),
child: _showVideo(controller),
)
],
@ -440,8 +451,8 @@ class _Call_outPageState extends State<Call_outPage> {
),
),
Positioned(
top: 0,
right: 0,
top: 5,
right: 5,
child: GestureDetector(
onTap: () {
// showToast("删除");

View File

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

View File

@ -475,6 +475,8 @@ class CircleLogic extends GetxController {
myVip = 0;
refreshController.loadComplete();
update();
} else if (bean.code == 404) {
showOKToast(bean.msg);
}
update();
}
@ -522,7 +524,7 @@ class CircleLogic extends GetxController {
if (list.isNotEmpty) {
peopleRefreshController.refreshCompleted();
peopleRefreshController.loadComplete();
// "signature" -> "/////////////////"
List info = [];
list.forEach((element) {
bool isContain = false;
@ -546,6 +548,7 @@ class CircleLogic extends GetxController {
update();
} else if (data['code'] == 404) {
isLoadFail = true;
showOKToast('网络不流畅哦,请检查网络情况');
update();
} else {
isNewPeopleMore = false;

View File

@ -108,9 +108,8 @@ class _CirclePageState extends State<CirclePage>
child: Stack(
children: [
Column(children: [
Obx(() {
return navigatorItem(controller.statistics.value);
}),
navigatorItem(controller.statistics.value)
,
// Text(controller.state.msg),
//使
]),

View File

@ -25,6 +25,8 @@ import '../../../../util/eventBus.dart';
import '../../chat/widget/chat_gift_pannel.dart';
import '../../home/logic.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
const String todayAddWxStatus = 'todayAddWxStatus';
class Discover extends StatefulWidget {
@ -262,6 +264,7 @@ class _DiscoverState extends State<Discover>
} else {
loadFail = true;
isMore = false;
showOKToast(data['msg']);
setState(() {
});
@ -295,6 +298,11 @@ class _DiscoverState extends State<Discover>
return list.isEmpty
? loadFail ? noResultWidget(tip: '',callBack: () {
isMore = true;
loadFail = false;
setState(() {
});
refreshData();
}) : isMore
? loaddingWidget(true)
@ -989,13 +997,42 @@ class _FeaturedItemState extends State<FeaturedItem> {
Container(
width: Get.width - 120.sp,
margin: EdgeInsets.only(top: 15.sp, bottom: 15.sp),
child: Text(
user.signature! ?? '',
child: RichText(
overflow: TextOverflow.ellipsis,
maxLines: (user.signature! ?? '').length > 15 ? 2 : 1,
style: TextStyle(
fontSize: 16.sp, color: const Color(0XFFF7FAFA)),
maxLines: 2,
text: TextSpan(
children: [
WidgetSpan(
alignment: ui.PlaceholderAlignment.middle,
// alignment: Rect.fromCenter(center: center, width: width, height: height),
child: Container(
margin: EdgeInsets.only(right: 2.sp,),
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
height: 20.sp,
width: user.city!.length > 4 ? 70.sp : user.city!.contains('km') ? user.city!.length * 13.sp : user.city!.length * 20.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22),
color: AppColor.cityBgColor,
),
child: Text(
user.city!,
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
),
),
TextSpan(
text: user.signature!,
// overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,)),
],
),
)
),
Container(
width: Get.width - 110.sp,
@ -1096,20 +1133,13 @@ class _FeaturedItemState extends State<FeaturedItem> {
margin: EdgeInsets.only(right: 6.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
width: 0.5.sp,
),
color: const Color(0xFF392D53),
),
child: Container(
margin: EdgeInsets.all(0.2.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
),
child: Padding(
padding: EdgeInsets.only(
top: 2.sp,
@ -1128,7 +1158,6 @@ class _FeaturedItemState extends State<FeaturedItem> {
),
),
),
),
);
}

View File

@ -733,12 +733,12 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
}
}
double widgetHeight = 130.sp + contentHeight(lists.content!) + picHeight;
// double widgetHeight = 130.sp + contentHeight(lists.content!) + picHeight;
return Container(
margin: EdgeInsets.only(top: 10.sp),
width: Get.width,
height: widgetHeight,
// height: widgetHeight,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
@ -778,7 +778,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
),
),
Container(
height: widgetHeight,
// height: widgetHeight,
width: Get.width,
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
child: Column(
@ -946,7 +946,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 : 5.sp),
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 5.sp,bottom: 10.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.sp),
color: Color(0x33000000)
@ -1643,6 +1643,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
// logic.update();
}else if(data['code'] == 404){
var logic = Get.put(CircleLogic());
logic.circle.lists.removeAt(logic.state.index);
logic.update();

View File

@ -42,6 +42,8 @@ class _LikeViewState extends State<LikeView>
@override
bool get wantKeepAlive => true;
final ScrollController scrollController = ScrollController();
final ScrollController moreScrollController = ScrollController();
final RefreshController refreshController = RefreshController();
CircleLogic logic = Get.find<CircleLogic>();
@ -56,6 +58,7 @@ class _LikeViewState extends State<LikeView>
var circleId = '';
List<Lists> lists = [];
List<Lists> recomanddlists = [];
List peopleList = [];
@override
void dispose() {
@ -65,7 +68,7 @@ class _LikeViewState extends State<LikeView>
// EventBusManager.cancelSubscription(scroToTop!);
// }
EventBusManager.cancelSubscription(likeRefreshSub!);
moreScrollController.dispose();
scrollController.dispose();
super.dispose();
}
@ -78,7 +81,7 @@ class _LikeViewState extends State<LikeView>
void initState() {
// TODO: implement initState
super.initState();
loadActiveUsersData();
loadLikeListData();
loadRecomdistData();
@ -92,6 +95,23 @@ class _LikeViewState extends State<LikeView>
likeRefreshSub = EventBusManager.on<LikeRefresh>().listen((event) {
refreshData();
});
moreScrollController.addListener(() {
if (moreScrollController.position.maxScrollExtent == moreScrollController.offset) {
Get.toNamed(AppRoutes.FriendsActivity,arguments: 1);
}
});
}
loadActiveUsersData() async {
// if (likeMore) {
var data = await DioManager.instance.get(
url: Api.activeUsers);
if (data["code"] == 200) {
peopleList = data['data'];
setState(() {
});
}
}
loadLikeListData() async {
@ -190,6 +210,7 @@ class _LikeViewState extends State<LikeView>
likeMore = true;
recomandMore = true;
refreshController.resetNoData();
loadActiveUsersData();
loadLikeListData();
loadRecomdistData();
}
@ -350,6 +371,7 @@ class _LikeViewState extends State<LikeView>
if (list.isQueen!) {
return Column(
children: [
vipDynamicItem(list),
GestureDetector(
onTap: () {
@ -377,6 +399,7 @@ class _LikeViewState extends State<LikeView>
} else {
return Column(
children: [
normalDynamicItem(list),
GestureDetector(
onTap: () {
@ -418,9 +441,18 @@ class _LikeViewState extends State<LikeView>
}
}
if (list.isQueen!) {
return vipDynamicItem(list);
return Column(
children: [
if (index == 0 && peopleList.length > 2)
morePeoleListWidget(),
vipDynamicItem(list)
],
);
} else {
return normalDynamicItem(list);
return Column(
children: [
if (index == 0 && peopleList.isNotEmpty)
morePeoleListWidget(),normalDynamicItem(list)]);
}
} else if (lists.length == index &&
recomanddlists.isNotEmpty) {
@ -483,83 +515,146 @@ class _LikeViewState extends State<LikeView>
);
}
void _showTextContentDialog(BuildContext context, String msg, String title) {
showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
backgroundColor: Colors.transparent,
child: Container(
height: 300.sp,
padding: const EdgeInsets.all(1.0),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0),
gradient: const LinearGradient(
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
),
Container(
margin: EdgeInsets.all(1.sp),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0),
gradient: const LinearGradient(
colors: [Color(0xFF4C3E5F), Color(0xFF324140)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
),
Positioned(
top: 15,
left: 0,
right: 0,
child: Center(
child: Text(title,
style: TextStyle(
color: const Color(0xFFF7FAFA), fontSize: 16.sp)),
)),
Container(
margin: EdgeInsets.only(top: 24.sp, bottom: 24.sp),
child: Container(
margin:
EdgeInsets.only(top: 12.sp, left: 14.sp, right: 14.sp),
alignment: Alignment.center,
child: SingleChildScrollView(
child: Text(
msg,
textAlign: TextAlign.center,
style: TextStyle(
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
),
),
),
),
Positioned(
top: 8.sp,
right: 10.sp,
child: GestureDetector(
onTap: () {
Get.back();
morePeoleListWidget() {
return Container(
width: Get.width,
height: 75.sp,
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
child: ListView.builder(
controller: moreScrollController,
scrollDirection: Axis.horizontal,
itemBuilder: (contenxt, index) {
if (index == peopleList.length) {
return MoreItem();
}
return peopleWidget(peopleList[index]);
},
child: Icon(
Icons.close,
color: Colors.white,
size: 20.sp,
itemCount: peopleList.length < 10 ? peopleList.length + 1 : 10,
),
);
}
Widget MoreItem() {
return GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.FriendsActivity,arguments: 1);
},
child: Container(
// width: 68.sp,
margin: EdgeInsets.only(left: 12.sp),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Stack(
children: [
Center(
child: ClipOval(
child: Container(
color: Colors.black,
width: 50.sp,
height: 50.sp,
),
),
),
Center(
child: ClipOval(
child: Image.asset(
getHomeImage("im_more"),
width: 50.sp,
// height: 48.sp,
),
),
),
],
),
SizedBox(height: 4.0.sp),
Center(
child: Text(
"查看更多",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 12.0.sp,
color: Colors.white, // Replace with desired text color
),
),
),
)),
],
),
),
);
}
peopleWidget(Map info) {
return GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,arguments: info['id'].toString());
},
child: Stack(
children: [
Container(
margin: EdgeInsets.only(left: 12.sp),
child: Column(
children: [
Stack(
alignment: Alignment.center,
children: [
Container(
height: 52.sp,
width: 52.sp,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(26.sp)
),
),
ClipOval(
child: Image.network(
info['avatar_thumb'],
fit: BoxFit.cover,
width: 50.sp,
height: 50.sp,
),
),
if ((info['onlineFlag'] ?? '').toString().isNotEmpty)
Positioned(bottom: 0,child: Container(
height: 20.sp,
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(10.sp),
color: AppColor.bgColor,
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
width: 1.sp,
),
),
alignment: Alignment.center,
child: Text(
info['onlineFlag'],
style: TextStyle(
color:
const Color.fromRGBO(247, 250, 250, 1.0),
fontSize: 10.sp,
),
)))
],
),
SizedBox(
height: 4.sp,
),
Text(
info['nickname'] ?? '',
style: TextStyle(color: Colors.white, fontSize: 12.sp),
),
],
),
),
],
),
);
}
@ -610,13 +705,13 @@ class _LikeViewState extends State<LikeView>
picHeight = picWidth;
}
} else {
picHeight = 200.sp;
picHeight = 140.sp;
}
}
}
double widgetHeight =
130.sp + contentHeight(lists.content!) + picHeight + 76.sp;
// double widgetHeight =
// 130.sp + contentHeight(lists.content!) + picHeight + 76.sp;
return GestureDetector(
onTap: () async {
@ -630,9 +725,9 @@ class _LikeViewState extends State<LikeView>
pushHomePage(lists, lists.id.toString());
},
child: Container(
margin: EdgeInsets.only(top: 10.sp),
margin: EdgeInsets.only(bottom: 10.sp),
width: Get.width,
height: widgetHeight,
// height: widgetHeight,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
@ -675,7 +770,7 @@ class _LikeViewState extends State<LikeView>
),
),
Container(
height: widgetHeight,
// height: widgetHeight,
width: Get.width,
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
child: Column(
@ -782,7 +877,9 @@ class _LikeViewState extends State<LikeView>
),
Container(
height: picHeight,
margin: EdgeInsets.only(top: 5.sp),
// color: Colors.red,
margin: EdgeInsets.only(top: 5.sp,),
child: picHeight == 140.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
@ -815,15 +912,6 @@ class _LikeViewState extends State<LikeView>
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,
@ -882,17 +970,16 @@ class _LikeViewState extends State<LikeView>
)
],
),
),
Container(
margin: EdgeInsets.only(bottom: 10.sp,top: 5.sp),
child: circleInfoItem(lists.interest, lists, index),
)
],
),
),
Positioned(
bottom: 2.sp,
left: 2.sp,
child: Container(
width: Get.width - 4.sp - 20.sp - 43.sp,
child: circleInfoItem(lists.interest, lists, index),
))
])),
);
}
@ -918,7 +1005,7 @@ class _LikeViewState extends State<LikeView>
picHeight = picWidth;
}
} else {
picHeight = 200.sp;
picHeight = 140.sp;
}
}
}
@ -957,7 +1044,7 @@ class _LikeViewState extends State<LikeView>
child: Container(
margin: EdgeInsets.only(bottom: 10.sp),
width: Get.width,
height: 120.sp + contentHeight(lists.content!) + picHeight + 76.sp,
// height: 120.sp + contentHeight(lists.content!) + picHeight + 76.sp,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
@ -1093,6 +1180,7 @@ class _LikeViewState extends State<LikeView>
),
picHeight > 0
? Container(
// color: Colors.red,
height: picHeight,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(top: 5.sp),
@ -1210,16 +1298,14 @@ class _LikeViewState extends State<LikeView>
],
),
),
Container(
margin: EdgeInsets.only(bottom: 10.sp,top: 5.sp),
child: circleInfoItem(lists.interest, lists, index),
)
],
),
),
Positioned(
left: 2.sp,
bottom: 2.sp,
child: Container(
width: Get.width - 4.sp - 20.sp - 43.sp,
child: circleInfoItem(lists.interest, lists, index),
))
],
)),
);
@ -1235,12 +1321,15 @@ class _LikeViewState extends State<LikeView>
children: [
if (showTitle)
logic.recommendCircleFriendData.isNotEmpty
? RecommendCircleFriendItem(
false,
? Container(
// color: Colors.red,
child: RecommendCircleFriendItem(
false,0,
recommendCircleFriendData: logic.recommendCircleFriendData,
getDataCallBack: () {
logic.loadRecommendCircleFriendData();
})
}),
)
: Container(),
if (showTitle)
Container(

View File

@ -13,7 +13,7 @@ import '../../../util/eventBus.dart';
import '../../../util/util.dart';
import '../../userinfo/logic.dart';
import '../view.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
class NewPeople extends StatefulWidget {
@override
@ -74,6 +74,8 @@ class _NewPeopleState extends State<NewPeople> {
),
)
: logic.isLoadFail ? noResultWidget(tip: '', callBack: () {
logic.isLoadFail = false;
logic.update();
logic.onLoading();
}) : loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~');
});
@ -229,13 +231,50 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
margin: EdgeInsets.symmetric(horizontal: 8.0,vertical: 10.sp),
child: Align(
alignment: Alignment.centerLeft, //
child: Text(
item.signature ?? '暂时还没有签名哦~',
maxLines: 2,
style:
TextStyle(color: Colors.white, fontSize: 18.sp),
child: RichText(
overflow: TextOverflow.ellipsis,
maxLines: 2,
text: TextSpan(
children: [
WidgetSpan(
alignment: ui.PlaceholderAlignment.middle,
// alignment: Rect.fromCenter(center: center, width: width, height: height),
child: Container(
margin: EdgeInsets.only(right: 2.sp,),
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
height: 20.sp,
width: item.city!.length > 4 ? 70.sp : item.city!.contains('km') ? item.city!.length * 13.sp : item.city!.length * 20.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22),
color: AppColor.cityBgColor,
),
child: Text(
item.city!,
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
),
),
TextSpan(
text: item.signature!,
// overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,)),
],
),
)
// Text(
// item.signature ?? '暂时还没有签名哦~',
// maxLines: 2,
// style:
// TextStyle(color: Colors.white, fontSize: 18.sp),
// overflow: TextOverflow.ellipsis,
// ),
),
),
if (item.interests.isNotEmpty)
@ -339,20 +378,13 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
margin: EdgeInsets.only(right: 11.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
width: 0.5.sp,
),
color: const Color(0xFF392D53),
),
child: Container(
margin: EdgeInsets.all(0.2.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
),
child: Padding(
padding: EdgeInsets.only(
top: 2.sp,
@ -372,7 +404,6 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
),
),
),
),
],
),
),

View File

@ -18,6 +18,8 @@ import '../../../common/Widgets/tag_widget.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import '../../../common/colors/app_color.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
class Vicinity extends StatefulWidget {
CircleLogic logic;
// TODO: add state variables, methods and constructor params
@ -99,6 +101,8 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
// ),)
],
) : widget.logic.isNearLoad ? loaddingWidget(true) : noResultWidget(tip: '',callBack: () {
widget.logic.isNearLoad = true;
widget.logic.update();
_onLoading();
});
}
@ -421,12 +425,42 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
margin: EdgeInsets.symmetric(vertical: 12.0.sp,horizontal: 9.sp),
child: Align(
alignment: Alignment.centerLeft, //
child: Text(
item.signature,
maxLines: 2,
style: TextStyle(color: Colors.white, fontSize: 18.sp),
child: RichText(
overflow: TextOverflow.ellipsis,
maxLines: 2,
text: TextSpan(
children: [
WidgetSpan(
alignment: ui.PlaceholderAlignment.middle,
// alignment: Rect.fromCenter(center: center, width: width, height: height),
child: Container(
margin: EdgeInsets.only(right: 2.sp,),
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
height: 20.sp,
width: item.city!.length > 4 ? 70.sp : item.city!.contains('km') ? item.city!.length * 13.sp : item.city!.length * 20.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22),
color: AppColor.cityBgColor,
),
child: Text(
item.city!,
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
),
),
TextSpan(
text: item.signature!,
// overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,)),
],
),
)
),
),
Container(
@ -504,20 +538,13 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
margin: EdgeInsets.only(right: 11.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
width: 0.5.sp,
),
color: const Color(0xFF392D53),
),
child: Container(
margin: EdgeInsets.all(0.2.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
),
child: Padding(
padding: EdgeInsets.only(
top: 2.sp,
@ -537,7 +564,6 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
),
),
),
),
],
),
),

View File

@ -1,10 +1,9 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:circle_app/app/circle/widgets/play_video_view.dart';
import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:video_player/video_player.dart';
class VideoItemWidget extends StatefulWidget {
String url;
@ -14,50 +13,29 @@ class VideoItemWidget extends StatefulWidget {
}
class _VideoItemWidgetState extends State<VideoItemWidget> {
VideoPlayerController? videoPlayerController;
@override
void initState() {
super.initState();
// ignore: deprecated_member_use
videoPlayerController = VideoPlayerController.network(
widget.url)
..initialize().then((_) {
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
setState(() {});
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
videoPlayerController?.dispose();
}
@override
Widget build(BuildContext context) {
return GestureDetector(
return Row(
children: [
GestureDetector(
onTap: () {
Get.to(PlayVideoView(widget.url));
},
child: AspectRatio(
aspectRatio: videoPlayerController!.value.aspectRatio,
child: Stack(
alignment: Alignment.center,
children: [
VideoPlayer(videoPlayerController!),
Center(
child: videoPlayerController!.value.isPlaying
? Container()
: Image(
ClipRRect(borderRadius: BorderRadius.circular(6.sp),child: CachedNetworkImage(imageUrl:'${widget.url}?vframe/jpg/offset/1',height: 200.sp,fit: BoxFit.cover,)),
Image(
image: AssetImage(getMineImage("icon_play")),
width: 30.sp,
height: 30.sp,
),
),
],
),
),
],
);
}
}

View File

@ -71,6 +71,7 @@ class LikeLogic extends GetxController {
}
} else if (bean.code == 404) {
isLoadFial = true;
showOKToast('网络不流畅哦,请检查网络情况');
update();
}
}

View File

@ -5,6 +5,7 @@ import 'package:circle_app/app/circle/logic.dart';
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
import 'package:circle_app/app/circle/widgets/like_view.dart';
import 'package:circle_app/app/circle_list/widgets/circle_type_item.dart';
import 'package:circle_app/app/circle_list/widgets/right_circle_iten.dart';
import 'package:circle_app/app/select_circle/logic.dart';
import 'package:circle_app/common/Widgets/circle_share.dart';
import 'package:circle_app/common/Widgets/text_more.dart';
@ -109,6 +110,9 @@ class _CircleListPageState extends State<CircleListPage>
}
return logic.isLoadFial ? noResultWidget(tip:'',callBack: () {
logic.isLoadFial = false;
logic.isLoad = true;
logic.update();
logic.loadMyInfo();
logic.loadData();
}) : logic.isLoad
@ -162,14 +166,16 @@ class _CircleListPageState extends State<CircleListPage>
logic.update();
},
)
: InfoListView(
logic.currentIndex,
: RightCircleIten( logic.currentIndex,
logic.mycircle
.lists[logic.currentIndex],
logic,
key: ValueKey(
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),
)))
logic,key: ValueKey(
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),)))
// InfoListView(
// )))
],
),
);

View File

@ -0,0 +1,149 @@
import 'package:circle_app/common/Widgets/base_tip_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:circle_app/app/home/logic.dart';
import 'package:circle_app/common/colors/app_color.dart';
import 'package:circle_app/components/func_widget.dart';
import 'package:circle_app/network/api.dart';
import 'package:circle_app/network/dio_manager.dart';
import 'package:circle_app/util/util.dart';
import 'package:gradient_borders/box_borders/gradient_box_border.dart';
class HugTip extends StatefulWidget {
String circleId;
Function call;
List rewardConfigs;
HugTip(this.circleId,this.rewardConfigs,this.call);
@override
_HugTipState createState() => _HugTipState();
}
class _HugTipState extends State<HugTip> {
// TODO: add state variables and methods
int index = 1;
sendHugCount() async {
// [parameters setValue:self.hugCount forKey:@"hugCount"];
// [parameters setValue:self.objId forKey:@"objId"];
// [parameters setValue:@"2" forKey:@"objType"];
var result = await DioManager.instance.post(url: Api.rewardAgent,params: {'amount':widget.rewardConfigs[index],'interestAgentId':widget.circleId});
if (result['code'] == 200) {
showOKToast('打赏成功');
widget.call();
Get.back();
} else {
showOKToast(result['msg']);
if (result['code'] == 31201) {
showRechargeScreenDialog();
}
}
}
@override
Widget build(BuildContext context) {
// TODO: add widget build method
return Scaffold(
backgroundColor: Colors.transparent,
body: Container(
width: Get.width,
alignment: Alignment.center,
child: Container(
width: Get.width,
margin: EdgeInsets.only(left: 20.sp,right: 20.sp),
height: 248.sp,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(getMineImage('im_neglect')),
fit: BoxFit.fill
)
),
child: Column(
children: [
Container(
// width: 120.sp,
padding: EdgeInsets.only(left: 17.sp, right: 17.sp,top: 30.sp,bottom: 20.sp),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
typeItem(index == 0, widget.rewardConfigs[0],0,),
typeItem(index == 1, widget.rewardConfigs[1],1),
typeItem(index == 2, widget.rewardConfigs[2],2),
],
)),
GestureDetector(
onTap: () {
sendHugCount();
},
child: Container(
width: 232.sp,
height: 42.sp,
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(21.sp)
),
alignment: Alignment.center,
child: Text('打赏小票',style: TextStyle(color: Colors.white,fontSize: 16.sp,fontWeight: FontWeight.w500),),
),
),
SizedBox(height: 15.sp,),
GestureDetector(
onTap: () {
Get.back();
},
child: Container(
child: Text('无情拒绝',style: TextStyle(color: Color(0xFFB7BECC),fontSize: 14.sp),),
),
)
],
),
),
),
);
}
typeItem(bool isSelected, int i,int currentIndex) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (!isSelected) {
index = currentIndex;
setState(() {
});
}
},
child: Container(
width: 88.sp,
height: 100.sp,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.sp),
border: GradientBoxBorder(
gradient:
isSelected ? AppColor.mainVerLinearGradient : AppColor.clearLinearGradient,
width:1.sp,
),
),
child: Column(
children: [
SizedBox(height: 8.sp,),
Image.asset(getMineImage('bi_icon${currentIndex+2}'),width: 48.sp,),
SizedBox(height: 8.sp,),
Text(
'$i小票',
style: TextStyle(
color: Color(0xFFB7BECC),
fontSize: 12.sp),
),
],
),
),
);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -362,13 +362,6 @@ class _FriendslistPageState extends State<FriendslistPage>
Stack(
children: [
ClipOval(
child: GestureDetector(
onTap: () {
var imgList = <String>[];
imgList.add(item.avatar);
Get.toNamed(AppRoutes.Swiper,
arguments: {'imaglist': imgList, 'index': 0});
},
child: CachedNetworkImage(
fit: BoxFit.cover,
imageUrl: item.avatarThumb,
@ -376,7 +369,6 @@ class _FriendslistPageState extends State<FriendslistPage>
height: 53.sp,
),
),
),
Positioned(
right: 0,
left: 0,

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:circle_app/app/chat/widget/svg_dialog.dart';
import 'package:circle_app/app/circle/logic.dart';
import 'package:circle_app/app/minefragment/logic.dart';
@ -38,6 +37,7 @@ import '../invite/logic.dart';
import '../minefragment/view.dart';
import '../msg/view.dart';
import 'state.dart';
import 'package:intl/intl.dart';
class HomeLogic extends GetxController with WidgetsBindingObserver {
late TabController tabController;
@ -63,7 +63,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
bool isUpdateVersion = false;
bool isProd = true;
String accountId = '';
@ -76,8 +75,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
// TODO: implement onClose
super.onClose();
connectivitySub.cancel();
TencentImSDKPlugin.v2TIMManager
.v2TIMMessageManager.removeAdvancedMsgListener();
TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager
.removeAdvancedMsgListener();
WidgetsBinding.instance.removeObserver(this);
sub!.cancel();
}
@ -101,7 +100,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
loadMyInfoData();
sub = EventBusManager.on<RefreshUnread>().listen((event) {
getUnreadSize();
});
@ -114,11 +112,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
loadMyCircleData();
initWxApi();
}
void addMsgListener() {
msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: (
msgID,
@ -132,106 +127,149 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
V2TimUserInfo sender,
String customData,
) {
if (sender.userID == "qpqz_dev_10_10000000000" ||
sender.userID == "qpqz_prod_10_10000000000") {
if(customData.isEmpty){
if (customData.isEmpty) {
return;
}
print("123123123123"+customData);
print("123123123123" + customData);
Map<String, dynamic> jsonData = json.decode(customData);
int event = jsonData['event'];
Map<String, dynamic> content = jsonData['content'];
switch(event) {
case 1://
String ageMsg = "${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
if(content['isFollow']==1){//
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],3,(){
switch (event) {
case 1: //
String ageMsg =
"${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
if (content['isFollow'] == 1) {
//
showFloatingButtonOverlay(Get.context!, content['nickname'],
ageMsg, content['avatarThumb'], 3, () {
pushChatPage(content['id'].toString(), content['imId'],
content['nickname']);
});
}else{
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],1,(){
} else {
showFloatingButtonOverlay(Get.context!, content['nickname'],
ageMsg, content['avatarThumb'], 1, () {
setLike(content['id'].toString());
});
}
break;
case 2://线
case 2: //线
String ageMsg = "${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
String ageMsg =
"${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],2,(){
showFloatingButtonOverlay(Get.context!, content['nickname'], ageMsg,
content['avatarThumb'], 2, () {
pushChatPage(content['id'].toString(), content['imId'],
content['nickname']);
});
break;
case 9://
case 9: //
{
CircleLogic logic = Get.find<CircleLogic>();
logic.isNewPeopleRed = true;
logic.update();
}
break;
case 8://
case 8: //
{
World_call_outLogic logic = Get.find<World_call_outLogic>();
logic.isNewMsg = true;
logic.update();
}
break;
case 10: //访
{
MsgLogic logic = Get.find<MsgLogic>();
logic.getMode();
}
break;
}
}
});
TencentImSDKPlugin.v2TIMManager
.v2TIMMessageManager.addAdvancedMsgListener(
listener: V2TimAdvancedMsgListener(
onRecvNewMessage: (message) {
TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager.addAdvancedMsgListener(
listener: V2TimAdvancedMsgListener(onRecvNewMessage: (message) {
getUnreadSize();
print(message);
if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM) {
if ( message.customElem?.data != null) {
if (message.customElem?.data != null) {
print(message.customElem!.data!);
Map jsonData = jsonDecode(message.customElem!.data!);
if (jsonData.containsKey('event')) {
String event = jsonData['event'].toString();
if (int.parse(event) == 3) {
if (int.parse(event) == 1) {
Map content = jsonData['content'];
String ageMsg =
"${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
if (content['isFollow'] == 1) {
//
showFloatingButtonOverlay(Get.context!, content['nickname'],
ageMsg, content['avatarThumb'], 3, () {
pushChatPage(content['id'].toString(), content['imId'],
content['nickname']);
});
} else {
showFloatingButtonOverlay(Get.context!, content['nickname'],
ageMsg, content['avatarThumb'], 1, () {
setLike(content['id'].toString());
});
}
} else if (int.parse(event) == 2) {
Map content = jsonData['content'];
String ageMsg =
"${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
showFloatingButtonOverlay(Get.context!, content['nickname'],
ageMsg, content['avatarThumb'], 2, () {
pushChatPage(content['id'].toString(), content['imId'],
content['nickname']);
});
} else if (int.parse(event) == 3) {//
showOKToast(message.customElem!.desc!.toString());
EventBusManager.fire(LikeRefresh());
} else if (int.parse(event) == 5) {
} else if (int.parse(event) == 5) {//
// print(jsonData.toString());
var info = jsonDecode(jsonData['content']);
TencentImSDKPlugin.v2TIMManager.v2ConversationManager.pinConversation(conversationID: 'c2c_' + info['fromImId'], isPinned: info['top'] == 1);
TencentImSDKPlugin.v2TIMManager.v2ConversationManager
.pinConversation(
conversationID: 'c2c_' + info['fromImId'],
isPinned: info['top'] == 1);
} else if (int.parse(event) == 9) {//
CircleLogic logic = Get.find<CircleLogic>();
logic.isNewPeopleRed = true;
logic.update();
} else if (int.parse(event) == 8) {//
World_call_outLogic logic = Get.find<World_call_outLogic>();
logic.isNewMsg = true;
logic.update();
} else if (int.parse(event) == 10) {//访
MsgLogic logic = Get.find<MsgLogic>();
logic.getMode();
}
} else if (jsonData.containsKey('type')) {
int type = jsonData['type'];
if (type == 1) {
String giftUrl = jsonData['gifUrl'];
if (giftUrl.isNotEmpty) {
Get.bottomSheet(SvgDialog(url: giftUrl),isScrollControlled: true,
enableDrag: false,isDismissible:false);
}
}
}
Get.bottomSheet(SvgDialog(url: giftUrl),
isScrollControlled: true,
enableDrag: false,
isDismissible: false);
}
}
}
)
);
}
}
}));
_messageService.addSimpleMsgListener(listener: msgListener);
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
switch (state) {
@ -250,9 +288,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
}
}
Future<void> checkVersion() async {
var data = await DioManager.instance.get(url: Api.APP_VERSION);
var bean = BaseResponse<UpdateInfo>.fromJson(
@ -263,9 +298,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
}
setLike(String userId) async {
var data = await DioManager.instance.post(
url: "${Api.setLike + userId}/follow",
params: {'status': "1"});
var data = await DioManager.instance
.post(url: "${Api.setLike + userId}/follow", params: {'status': "1"});
var bean = BaseResponse<dynamic>.fromJson(
data,
(jsonData) => jsonData,
@ -275,6 +309,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
}
showOKToast(bean.msg);
}
getUnreadSize() async {
if (coreInstance.isLoginSuccess) {
try {
@ -290,15 +325,13 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
getTotalUnreadMessageCountRes.data.toString());
if (getTotalUnreadMessageCountRes.code == 0) {
if (getTotalUnreadMessageCountRes.data.toString() != unreadSIze.value) {
if (getTotalUnreadMessageCountRes.data.toString() !=
unreadSIze.value) {
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
}
}
} catch (e) {}
}
}
@override
@ -323,11 +356,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
super.onReady();
FlutterNativeSplash.remove();
updateIndex(1);
final logic = Get.find<CircleLogic>();
logic.loadCirclePeopleData();
}
addBadge() {
@ -354,7 +384,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
if (!coreInstance.isLoginSuccess) {
var data = await DioManager.instance.get(url: Api.getIMInfo);
if (data['code'] == 200) {
loginIM(
data['data']['account_id'].toString(), data['data']['user_sig']);
accountId = data['data']['account_id'].toString();
@ -383,20 +412,18 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
final logic = Get.find<MsgLogic>();
EventBusManager.fire(MsgRecommendCardRefresh());
logic.loadChatData();
logic.getVisitorMsgData();
}
update();
}
void setFirstData() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
sharedPreferences.setString(
SharedPreferencesHelper.firstLogin, '1');
sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1');
}
loadMyCircleData() async {
var data = await DioManager.instance
.get(url: Api.getMyCircleAll);
var data = await DioManager.instance.get(url: Api.getMyCircleAll);
// var bean = BaseResponse<InterestsBean>.fromJson(
// data, (data) => InterestsBean.fromJson(data));
@ -411,7 +438,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
});
mycircle.lists = infoList;
if (currentIndex >= mycircle.lists.length - 1) {
currentIndex = mycircle.lists.length -1;
currentIndex = mycircle.lists.length - 1;
}
loadCalloutsNew();
@ -424,9 +451,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
mycircle.lists.forEach((element) {
idList.add(element.id.toString());
});
var data = await DioManager.instance.post(
url:Api.calloutsNew,
params: {"interestIds":idList});
var data = await DioManager.instance
.post(url: Api.calloutsNew, params: {"interestIds": idList});
if (data['code'] == 200) {
List infoList = data['data'];
@ -444,7 +470,9 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
///
connectListener() {
connectivitySub = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
connectivitySub = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
if (result == ConnectivityResult.none) {
if (currentIndex == 0) {
var logic = Get.put(CircleLogic());
@ -459,7 +487,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
var logic = Get.put(MinefragmentLogic());
logic.loadData();
}
}});
}
});
}
void loadEnvTypeData() async {
@ -482,25 +511,45 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
inviteCode = info.data!.inviteCode!;
link = info.data!.link!;
}
currentIndex = bean.data.isNewUser ? 1 : 0;
bool isGreaterThan30Days = isDifferenceGreaterThan30Days(
(model!.createTime?.isNotEmpty ?? false)
? model!.createTime!
: DateTime.now().toString());
if (isGreaterThan30Days) {
currentIndex = 0;
} else {
currentIndex = 1;
}
updateIndex(currentIndex);
update();
}
}
bool isDifferenceGreaterThan30Days(String dateString) {
//
DateTime now = DateTime.now();
// 使
DateFormat format = DateFormat("yyyy-MM-dd");
DateTime date = format.parse(dateString);
//
Duration difference = now.difference(date);
// 30
if (difference.inDays.abs() > 30) {
return true;
} else {
return false;
}
}
}
class conTop {
bool isTop;
String conId;
conTop(this.isTop,this.conId);
conTop(this.isTop, this.conId);
}
class MsgRecommendCardRefresh {
}
class MsgRecommendCardRefresh {}

View File

@ -334,13 +334,6 @@ class _LikelistPageState extends State<LikelistPage> with RouteAware {
Stack(
children: [
ClipOval(
child: GestureDetector(
onTap: () {
var imgList = <String>[];
imgList.add(item.user.avatar);
Get.toNamed(AppRoutes.Swiper,
arguments: {'imaglist': imgList, 'index': 0});
},
child: CachedNetworkImage(
fit: BoxFit.cover,
imageUrl: item.user.avatarThumb,
@ -348,7 +341,6 @@ class _LikelistPageState extends State<LikelistPage> with RouteAware {
height: 53.sp,
),
),
),
Positioned(
right: 0.sp,
left: 0.sp,

View File

@ -71,6 +71,15 @@ class MinefragmentLogic extends GetxController {
}
}
getVisitorMsgData() async {
var data =
await DioManager.instance.get(url: Api.getVisitorMsg,);
if (data['code'] == 200) {
recent_visit_count_new = data['data']['unreadCount'] ?? 0;
}
update();
}
getMode() async {
var data = await DioManager.instance.get(url: Api.getUserMine);
var bean = BaseResponse<MineResponseBean>.fromJson(
@ -82,21 +91,23 @@ class MinefragmentLogic extends GetxController {
joinedCircle = "${"加入了${bean.data.joininterestcount}"}";
enterHomeInfoMsg = bean.data.mainGuideText;
has_pwd = bean.data.has_pwd;
SharedPreferences sharedPreferences =
await SharedPreferences.getInstance();
if(bean.data.user.vip>0){
vipMsg = "会员时长剩余${bean.data.vipExpireDays}";
} else if (bean.data.last_vip_expire_date != '') {
vipMsg = "会员已于${bean.data.last_vip_expire_date.toString().split(' ').first}到期";
}
int likeMeCount = sharedPreferences.getInt(SharedPreferencesHelper.LIKEMECOUNT)??0;
int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
// int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
sharedPreferences.setString(SharedPreferencesHelper.PHOTO, bean.data.phone);
like_me_count_new = like_me_count - likeMeCount;
print("***************");
print("$likeMeCount-$like_me_count=$like_me_count_new");
recent_visit_count_new = recent_visit_count - recentVisitCount;
// like_me_count_new = recentVisitCount.toInt() - bean.data.likeMeCount.toInt();
@ -121,7 +132,7 @@ class MinefragmentLogic extends GetxController {
ageMsg = getAgeCOntent(gender, age, role, orientation);
}
getVisitorMsgData();
update();
} else {
showOKToast(bean.msg);
@ -154,7 +165,7 @@ class User {
double lat;
String city;
String avatarThumb;
String? createTime;
User({
required this.id,
required this.has_pwd,
@ -172,6 +183,7 @@ class User {
required this.lat,
required this.city,
required this.avatarThumb,
this.createTime,
});
factory User.fromJson(Map<String, dynamic> json) {
@ -179,6 +191,7 @@ class User {
id: json['id'],
mark: json['mark'] ?? 0,
has_pwd: json['has_pwd'] ?? false,
createTime: json['createTime'] ?? '',
nickname: json['nickname'],
avatar: json['avatar'],
signature: json['signature'],
@ -202,6 +215,8 @@ class MineResponseBean {
int likeMeCount;
int recentVisitCount;
String? vipExpireDate;
// "createTime" -> "2023-10-09T09:07:20.000+00:00"
String? last_vip_expire_date;
int? vipExpireDays;
bool? has_pwd;
bool isNewUser;
@ -216,6 +231,7 @@ class MineResponseBean {
required this.recentVisitCount,
this.vipExpireDate,
required this.isNewUser,
required this.last_vip_expire_date,
this.vipExpireDays,
required this.phone,
required this.has_pwd,
@ -226,6 +242,7 @@ class MineResponseBean {
return MineResponseBean(
user: User.fromJson(json['user']),
likeCount: json['like_count'],
last_vip_expire_date: json['last_vip_expire_date'] ?? '',
has_pwd: json['has_pwd'],
isNewUser : json['isNewUser'] ?? false,
phone: json['phone'],

View File

@ -20,6 +20,7 @@ import '../../common/colors/app_color.dart';
import '../../main.dart';
import '../../util/SharedPreferencesHelper.dart';
import '../../util/util.dart';
import '../msg/logic.dart';
import 'logic.dart';
const vipIcon = 'assets/images/home/icon_vip_more.png';
@ -144,7 +145,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
),
),
if (!logic.isProxy)
Image.asset(getHomeImage(logic.isVip.value == 0 ? 'open_vip' : 'pay_vip'),height: 28.sp,),
Image.asset(getHomeImage(logic.vipMsg.contains('十几种') ? 'open_vip' : 'pay_vip'),height: 28.sp,),
],
),
)),
@ -669,7 +670,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
),
Positioned(
right: 0.sp,
top: 15.sp,
top: 6.sp,
child: Text(
logic.like_me_count_new>0 ? "+${logic.like_me_count_new}":"",
style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
@ -685,6 +686,9 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, logic.recent_visit_count);
});
MsgLogic msgLogic = Get.find<MsgLogic>();
msgLogic.updateVisitCount();
Get.toNamed(AppRoutes.VisitorListActivity);
},
child: Stack(
@ -725,7 +729,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
),
Positioned(
right: 0.sp,
top: 15.sp,
top: 6.sp,
child: Text(
logic.recent_visit_count_new>0 ? "+${logic.recent_visit_count_new}":"",
style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),

View File

@ -30,6 +30,7 @@ import '../../../router/app_routers.dart';
import '../../../util/eventBus.dart';
import '../../../util/util.dart';
import '../../circle/widgets/discover.dart';
import '../logic.dart';
import '../recommend_circle_friend_item.dart';
import 'tim_uikit_conversation_item.dart';
@ -38,7 +39,7 @@ typedef TIMConversationItemBuilder = Widget Function(
[V2TimUserStatus? onlineStatus]);
typedef ConversationItemSlideBuilder = List<ConversationItemSlidePanel>
Function(V2TimConversation conversationItem);
Function(V2TimConversation conversationItem);
typedef ConversationItemSecondaryMenuBuilder = Widget Function(
V2TimConversation conversationItem, VoidCallback onClose);
@ -84,8 +85,7 @@ class TIMConversation extends StatefulWidget {
/// to meet the identifier shows here.
final bool isShowDraft;
const TIMConversation(
{Key? key,
const TIMConversation({Key? key,
this.lifeCycle,
this.onTapItem,
this.controller,
@ -118,7 +118,8 @@ class ConversationItemSlidePanel extends TIMUIKitStatelessWidget {
this.icon,
this.spacing = 4,
this.label,
}) : assert(flex > 0),
})
: assert(flex > 0),
assert(icon != null || label != null),
super(key: key);
@ -163,10 +164,12 @@ class ConversationItemSlidePanel extends TIMUIKitStatelessWidget {
}
class _TIMConversationState extends TIMUIKitState<TIMConversation> {
MsgLogic logic = Get.find<MsgLogic>();
final TUIConversationViewModel model =
serviceLocator<TUIConversationViewModel>();
late TIMUIKitConversationController _timuiKitConversationController;
final TUIThemeViewModel themeViewModel = serviceLocator<TUIThemeViewModel>();
// final TUIFriendShipViewModel friendShipViewModel =
// serviceLocator<TUIFriendShipViewModel>();
bool hasMore = true;
@ -174,6 +177,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
List<String> chatImIdList = [];
Map recommendCircleFriendData = {};
@override
void initState() {
super.initState();
@ -276,8 +280,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
}
}
Widget _defaultSecondaryMenu(
V2TimConversation conversationItem, VoidCallback onClose) {
Widget _defaultSecondaryMenu(V2TimConversation conversationItem,
VoidCallback onClose) {
return TUIKitColumnMenu(data: [
if (!PlatformUtils().isWeb)
ColumnMenuItem(
@ -309,8 +313,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
}
List<ConversationItemSlidePanel> _defaultSlideBuilder(
V2TimConversation conversationItem,
) {
V2TimConversation conversationItem,) {
final theme = themeViewModel.theme;
return [
if (!PlatformUtils().isWeb)
@ -346,8 +349,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
];
}
Widget _getSecondaryMenu(
V2TimConversation conversation, VoidCallback onClose) {
Widget _getSecondaryMenu(V2TimConversation conversation,
VoidCallback onClose) {
if (widget.itemSecondaryMenuBuilder != null) {
return widget.itemSecondaryMenuBuilder!(conversation, onClose);
}
@ -360,7 +363,6 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
Future<List<V2TimUserFullInfo>> getUserListInfo(
List<String> userIdList) async {
V2TimValueCallback<String> getLoginUserRes =
await TencentImSDKPlugin.v2TIMManager.getLoginUser();
if (getLoginUserRes.code == 0) {
@ -378,18 +380,20 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
if (count > size) {
for (int i = 0; i <= size; i++) {
List<V2TimUserFullInfo> dataList = await getUserListData(userIdList.sublist(i + i * 100, i == size ? userIdList.length : (i + 1) * 100));
List<V2TimUserFullInfo> dataList = await getUserListData(
userIdList.sublist(
i + i * 100, i == size ? userIdList.length : (i + 1) * 100));
list.addAll(dataList);
}
} else {
for (int i = 0; i < size; i++) {
List<V2TimUserFullInfo> dataList = await getUserListData(userIdList.sublist(i + i * 100,(i + 1) * 100 ));
List<V2TimUserFullInfo> dataList = await getUserListData(
userIdList.sublist(i + i * 100, (i + 1) * 100));
list.addAll(dataList);
}
}
return list;
} else {
//
V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
await TencentImSDKPlugin.v2TIMManager
@ -482,13 +486,16 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
return ListView.builder(
controller: widget.scrollController!,
// shrinkWrap: true,
itemCount: recommendCircleFriendData.isNotEmpty && filteredConversationList.length < 15
itemCount: recommendCircleFriendData.isNotEmpty &&
filteredConversationList.length < 15
? filteredConversationList.length + 1
: filteredConversationList.length,
itemBuilder: (context, index) {
if (index == filteredConversationList.length) {
return recommendCircleFriendData.isNotEmpty
? RecommendCircleFriendItem(true,recommendCircleFriendData: recommendCircleFriendData,getDataCallBack: () {
? RecommendCircleFriendItem(true,15.sp,
recommendCircleFriendData: recommendCircleFriendData,
getDataCallBack: () {
loadRecommendCircleFriendData();
})
: Container();
@ -586,7 +593,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
color: Colors.transparent,
child: InkWell(
child: TIMConversationItem(
mark:mark,
mark: mark,
isSameCity: isSameCity,
isOfficial: isOfficial,
isCurrent: isCurrent,
@ -620,7 +627,65 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
);
}
return TUIKitScreenUtils.getDeviceWidget(
return index == 0 ? Column(
children: [
GetBuilder<MsgLogic>(builder: (
logic) {
return GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.VisitorListActivity)!.then((value) => logic.getVisitorMsgData());
},
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
const Color(0x0F4B3E5E),
const Color(0xaF334141)
])),
padding: const EdgeInsets.only(
top: 6, bottom: 6, left: 16, right: 16),
child: Row(
children: [
ClipOval(child: Image.network(
'https://qiniuyun.ikuayou.com/dW5kZWZpbmVkLzE3MTU3ODAxNjM1MDNf5LyB5Lia5b6u5L-h5oiq5Zu-XzNkMzI0MjJkLTJmYWUtNGRmZC04MDQxLTUyZGE2NzBlNzVjMQ==',
width: 40.sp,
height: 40.sp,
fit: BoxFit.cover,)),
SizedBox(width: 10,),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
children: [
Text('最近来访', style: TextStyle(
color: Colors.white,
fontSize: 16.sp),),
SizedBox(width: 4.sp,),
Text(
logic.recent_visit_count_new > 0
? "+${logic
.recent_visit_count_new}"
: "",
style: const TextStyle(
color: Color.fromRGBO(
0, 255, 210, 1.0)),
),
],
),
SizedBox(height: 6,),
Text(logic.tip, style: TextStyle(
color: Colors.white.withOpacity(
0.5), fontSize: 14.sp),),
],
))
],
),
),
);
}),
TUIKitScreenUtils.getDeviceWidget(
desktopWidget: AutoScrollTag(
key:
ValueKey(conversationItem.conversationID),
@ -639,17 +704,74 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
offset: Offset(
min(
details.globalPosition.dx,
MediaQuery.of(context)
MediaQuery
.of(context)
.size
.width -
80),
min(
details.globalPosition.dy,
MediaQuery.of(context)
MediaQuery
.of(context)
.size
.height -
130)),
child: (onClose) => _getSecondaryMenu(
child: (onClose) =>
_getSecondaryMenu(
conversationItem, onClose));
},
child: conversationLineItem(),
),
),
defaultWidget: AutoScrollTag(
key:
ValueKey(conversationItem.conversationID),
controller: widget.autoScrollController!,
index: index,
child: Slidable(
groupTag: 'conversation-list',
child: conversationLineItem(),
endActionPane: ActionPane(
extentRatio: slideChildren.length > 2
? 0.77
: 0.5,
motion: const DrawerMotion(),
children: slideChildren)),
))
],
) : TUIKitScreenUtils.getDeviceWidget(
desktopWidget: AutoScrollTag(
key:
ValueKey(conversationItem.conversationID),
controller: widget.autoScrollController!,
index: index,
child: GestureDetector(
onSecondaryTapDown: (details) {
TUIKitWidePopup.showPopupWindow(
operationKey:
TUIKitWideModalOperationKey
.conversationSecondaryMenu,
isDarkBackground: false,
borderRadius: const BorderRadius.all(
Radius.circular(4)),
context: context,
offset: Offset(
min(
details.globalPosition.dx,
MediaQuery
.of(context)
.size
.width -
80),
min(
details.globalPosition.dy,
MediaQuery
.of(context)
.size
.height -
130)),
child: (onClose) =>
_getSecondaryMenu(
conversationItem, onClose));
},
child: conversationLineItem(),
@ -771,7 +893,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
color: Colors.white,
shadows: [
Shadow(
color: Color(0xffF657FF), offset: Offset(0.0, -1))
color: Color(0xffF657FF), offset: Offset(
0.0, -1))
]),
),
),
@ -823,12 +946,13 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
// width: 0.sp,
// ),
),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp,top: 10.sp),
padding: EdgeInsets.only(left: 12.sp, right: 12.sp, top: 10.sp),
child: Column(
children: [
GestureDetector(
onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,arguments: user.userId.toString());
Get.toNamed(AppRoutes.UserInfoActivity,
arguments: user.userId.toString());
},
child: Container(
child: Row(
@ -859,18 +983,25 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
),
SizedBox(width: 8.sp,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment
.start,
children: [
ShaderMask(
shaderCallback: (Rect bounds) {
return const LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [Color(0xff71F3F2), Color(0xffF657FF)],
).createShader(Offset.zero & bounds.size);
colors: [
Color(0xff71F3F2),
Color(0xffF657FF)
],
).createShader(
Offset.zero & bounds.size);
},
child: Text(
'匹配度' + (recommendCircleFriendData['recommend_score'].toString() ?? '') + '%',
'匹配度' +
(recommendCircleFriendData['recommend_score']
.toString() ?? '') + '%',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w600,
@ -888,9 +1019,11 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
alignment: Alignment.center,
height: 18.sp,
padding:
EdgeInsets.only(left: 6.sp, right: 6.sp),
EdgeInsets.only(
left: 6.sp, right: 6.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(9.sp),
borderRadius: BorderRadius.circular(
9.sp),
gradient: const LinearGradient(
begin: Alignment(0.25, 0.5),
end: Alignment(0.75, 0.5),
@ -917,7 +1050,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
),
child: Image.asset(
getCircleImage(
user.vip == 1 ? 'vip' : 'year_vip'),
user.vip == 1
? 'vip'
: 'year_vip'),
width: 36.sp,
),
),
@ -927,15 +1062,19 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
)),
GestureDetector(
onTap: () async {
if (!chatImIdList.contains(user.userId.toString())) {
await createCustomMsg(user.userId.toString(), recommendCircleFriendData['user']['imId']);
if (!chatImIdList.contains(
user.userId.toString())) {
await createCustomMsg(user.userId.toString(),
recommendCircleFriendData['user']['imId']);
}
pushChatPage(user.userId.toString(), recommendCircleFriendData['user']['imId'], user.nickname!);
pushChatPage(user.userId.toString(),
recommendCircleFriendData['user']['imId'],
user.nickname!);
},
child: Container(
height: 25.sp,
padding: EdgeInsets.only(left: 6.sp,right: 6.sp),
padding: EdgeInsets.only(left: 6.sp, right: 6.sp),
decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(12.5.sp)),
@ -982,7 +1121,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
),
),
if (info.containsKey('city'))
info['city'].toString().isNotEmpty
info['city']
.toString()
.isNotEmpty
? Container(
margin: EdgeInsets.only(top: 10.sp),
child: Row(
@ -1073,11 +1214,13 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
if (circleList.isNotEmpty)
Container(
height: 72.sp,
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
width: Get.width,
child: ListView.builder(itemBuilder: (context,index) {
child: ListView.builder(itemBuilder: (context, index) {
return circleInfoItem(circleList[index], index);
},itemCount: circleList.length,scrollDirection: Axis.horizontal,),
},
itemCount: circleList.length,
scrollDirection: Axis.horizontal,),
)
],
),
@ -1139,7 +1282,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 8.sp, ),
padding: EdgeInsets.only(left: 8.sp,),
// alignment: Alignment.,
height: 72.sp,
child: Column(
@ -1186,8 +1329,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
setState(() {});
}
} else {
if ((data['code'] == 21201 || data['code'] == 21202) && recommendCircleFriendData.isNotEmpty) {
if ((data['code'] == 21201 || data['code'] == 21202) &&
recommendCircleFriendData.isNotEmpty) {
showOKToast(data['msg']);
showVipDialog();
}

View File

@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../common/Widgets/base_tip_widget.dart';
import '../../util/SharedPreferencesHelper.dart';
import '../circle/logic.dart';
@ -22,6 +23,9 @@ class MsgLogic extends GetxController {
int total = 0;
bool isStart = false;
String tip = '';
int recent_visit_count_new = 0;
@override
void onInit() {
@ -31,6 +35,7 @@ class MsgLogic extends GetxController {
loadChatData();
loadLikeData();
loadStatusData();
getMode();
}
loadData() {
@ -54,6 +59,33 @@ class MsgLogic extends GetxController {
update();
}
getMode() async {
var data = await DioManager.instance.get(url: Api.getUserMine);
var bean = BaseResponse<MineResponseBean>.fromJson(
data, (data) => MineResponseBean.fromJson(data));
if (bean.isSuccess()) {
int recent_visit_count = bean.data.recentVisitCount ?? 0;
SharedPreferences sharedPreferences =
await SharedPreferences.getInstance();
int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
recent_visit_count_new = recent_visit_count - recentVisitCount;
getVisitorMsgData();
}
}
updateVisitCount() async {
if (recent_visit_count_new > 0) {
SharedPreferences sharedPreferences =
await SharedPreferences.getInstance();
sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, recent_visit_count_new);
}
getMode();
update();
}
void loadChatData() async {
var data =
await DioManager.instance.post(url: Api.recommendQuickChatUser, params: {
@ -63,6 +95,8 @@ class MsgLogic extends GetxController {
if (data['code'] == 200) {
total = data['data']['total'];
chatList = data['data']['lists'];
} else if (data['code'] == 404) {
showOKToast('网络不流畅哦,请检查网络情况');
}
// vicinityList = bean.data.lists;
@ -70,6 +104,16 @@ class MsgLogic extends GetxController {
}
getVisitorMsgData() async {
var data =
await DioManager.instance.get(url: Api.getVisitorMsg,);
if (data['code'] == 200) {
tip = data['data']['lastMsg'];
recent_visit_count_new = data['data']['unreadCount'] ?? 0;
}
update();
}
Future<bool> queryQuickStart() async {
var data =
await DioManager.getInstance().get(url: Api.queryQuickStart);

View File

@ -11,10 +11,11 @@ import '../../util/util.dart';
import '../circle/widgets/discover.dart';
class RecommendCircleFriendItem extends StatefulWidget {
RecommendCircleFriendItem(this.isShowTopLine,{super.key,required this.recommendCircleFriendData,required this.getDataCallBack,});
RecommendCircleFriendItem(this.isShowTopLine,this.padding,{super.key,required this.recommendCircleFriendData,required this.getDataCallBack,});
var recommendCircleFriendData;
Function getDataCallBack;
bool isShowTopLine;
double padding;
@override
_RecommendCircleFriendItemState createState() =>
_RecommendCircleFriendItemState();
@ -55,7 +56,7 @@ class _RecommendCircleFriendItemState extends State<RecommendCircleFriendItem> {
List circleList = recommendCircleFriendData['interests'] ?? [];
return Container(
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
padding: EdgeInsets.only(left: widget.padding, right: widget.padding),
child: Column(children: [
if (widget.isShowTopLine)
Container(

View File

@ -15,6 +15,7 @@ import '../../util/util.dart';
import '../circle/logic.dart';
import '../userinfo/logic.dart';
import 'logic.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
class QuickPage extends StatelessWidget {
QuickPage({Key? key}) : super(key: key);
@ -316,13 +317,42 @@ class QuickPage extends StatelessWidget {
child: Align(
alignment: Alignment.centerLeft, //
child: Text(
item.signature ?? '暂时还没有签名哦~',
maxLines: 2,
style:
TextStyle(color: Colors.white, fontSize: 18.sp),
child: RichText(
overflow: TextOverflow.ellipsis,
maxLines: 2,
text: TextSpan(
children: [
WidgetSpan(
alignment: ui.PlaceholderAlignment.middle,
// alignment: Rect.fromCenter(center: center, width: width, height: height),
child: Container(
margin: EdgeInsets.only(right: 2.sp,),
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
height: 20.sp,
width: item.city!.length > 4 ? 70.sp : item.city!.contains('km') ? item.city!.length * 13.sp : item.city!.length * 20.sp,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22),
color: AppColor.cityBgColor,
),
child: Text(
item.city!,
style: TextStyle(
color: Colors.white,
fontSize: 11.sp,
fontWeight: FontWeight.w600),
),
),
),
TextSpan(
text: item.signature ?? '暂时还没有签名哦~',
// overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,)),
],
),
)
),
),
if (item.interests.isNotEmpty)
@ -427,20 +457,13 @@ class QuickPage extends StatelessWidget {
margin: EdgeInsets.only(right: 11.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient(
colors: [
Color(0xFF06F9FA),
Color(0xFFDC5BFD),
],
border: GradientBoxBorder(
gradient:
AppColor.mainVerLinearGradient,
width: 0.5.sp,
),
color: const Color(0xFF392D53),
),
child: Container(
margin: EdgeInsets.all(0.2.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0),
color: const Color(0xFF392D53),
),
child: Padding(
padding: EdgeInsets.only(
top: 2.sp,
@ -460,7 +483,6 @@ class QuickPage extends StatelessWidget {
),
),
),
),
],
),
),

View File

@ -291,7 +291,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
toolbarHeight: 0,
foregroundColor: Colors.transparent,
backgroundColor: Colors.transparent,
expandedHeight: 352.sp,
expandedHeight: 362.sp,
// bottom: PreferredSize(
// preferredSize: Size(Get.width, 40),
// child: titleTab(logic),
@ -479,7 +479,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
child: Column(
children: [
Container(
height: 58.sp,
height: 68.sp,
padding: EdgeInsets.symmetric(horizontal: 15.sp),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -134,7 +134,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
lists.content!,
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: () {
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
logic.openCallOutIdList.add(lists.id);
setState(() {
@ -151,13 +151,16 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
type = info.type!;
if (info.type == 1) {
if (lists.album!.length > 3) {
picHeight = 218.sp;
} else {
picHeight = 109.sp;
picHeight = 140.sp;
if (info.type == 1) {
if (lists.album!.length > 3 && lists.album!.length < 7) {
picHeight = picHeight * 2;
} else if (lists.album!.length >= 7) {
picHeight = picHeight * 3;
}
}
} else {
picHeight = 140.sp;
picHeight = 200.sp;
}
}
}
@ -327,7 +330,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
Container(
height: picHeight,
margin: EdgeInsets.only(top: 5.sp),
child: picHeight == 140.sp
child: picHeight == 200.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(lists.album![0]!.url!))
@ -340,7 +343,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
crossAxisCount: 3, //widget
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio: 1.0 //1widget
childAspectRatio: 0.8 //1widget
),
itemBuilder: (contentxt, currentIndex) {
Album album = lists.album![currentIndex];
@ -406,7 +409,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
lists.content!,
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: () {
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
logic.openCallOutIdList.add(lists.id);
setState(() {
@ -423,13 +426,16 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
type = info.type!;
if (info.type == 1) {
if (lists.album!.length > 3) {
picHeight = 218.sp;
} else {
picHeight = 109.sp;
picHeight = 140.sp;
if (info.type == 1) {
if (lists.album!.length > 3 && lists.album!.length < 7) {
picHeight = picHeight * 2;
} else if (lists.album!.length >= 7) {
picHeight = picHeight * 3;
}
}
} else {
picHeight = 140.sp;
picHeight = 200.sp;
}
}
}
@ -587,19 +593,20 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
// margin: EdgeInsets.only(top: 4.sp),
child: descText,
),
SizedBox(height: picHeight > 0 ? 5.sp : 10.sp,),
picHeight > 0
? Container(
height: picHeight,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(top: 5.sp),
child: picHeight == 140.sp
// alignment: Alignment.centerLeft,
margin: EdgeInsets.only(bottom: 10.sp),
child: picHeight == 200.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child:
VideoItemWidget(lists.album![0].url!))
: GridView.builder(
controller: scrollController,
shrinkWrap: true,
// shrinkWrap: true,
itemCount: lists.album!.length,
physics:
const NeverScrollableScrollPhysics(),
@ -609,16 +616,10 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
crossAxisSpacing: 8.sp,
mainAxisSpacing: 8.sp,
childAspectRatio:
1.0 //1widget
0.8 //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>[];
@ -636,9 +637,6 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
BorderRadius.circular(6.sp),
child: CachedNetworkImage(
imageUrl: album.url!,
errorWidget:
(context, url, error) =>
Icon(Icons.error),
fit: BoxFit.cover,
),
),

View File

@ -322,15 +322,6 @@ class VisitorlistPage extends StatelessWidget {
Stack(
children: [
ClipOval(
child: GestureDetector(
onTap: () {
if (logic.isVip > 0 || index < 3) {
var imgList = <String>[];
imgList.add(item.user.avatar);
Get.toNamed(AppRoutes.Swiper,
arguments: {'imaglist': imgList, 'index': 0});
}
},
child: CachedNetworkImage(
fit: BoxFit.cover,
imageUrl: item.user.avatarThumb,
@ -338,7 +329,6 @@ class VisitorlistPage extends StatelessWidget {
height: 53.sp,
),
),
),
Positioned(
right: 0.sp,
left: 0.sp,

View File

@ -21,6 +21,7 @@ class World_call_outLogic extends GetxController {
bool isLoad = true;
List<WorldLists> lists = [];
List<String> wantMeet = [];
List openCallOutIdList = [];
int index = 1;
int total = 0;
@ -123,6 +124,7 @@ class World_call_outLogic extends GetxController {
if (tempLists.isNotEmpty) {
isLoad = false;
if (index == 1) {
refreshController.refreshCompleted();
lists = tempLists;
} else {
@ -139,6 +141,7 @@ class World_call_outLogic extends GetxController {
update();
} else if (bean1.code == 404) {
showOKToast('网络不流畅哦,请检查网络情况');
loadFail = true;
update();
}

View File

@ -13,6 +13,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import '../../common/Widgets/circle_share.dart';
import '../../common/Widgets/tag_widget.dart';
import '../../common/Widgets/text_more.dart';
import '../../common/colors/app_color.dart';
import '../../router/app_routers.dart';
import '../circle/widgets/video_item.dart';
@ -152,8 +153,19 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
onLoading: () {
logic.loadMore();
},
onRefresh: () {
logic.isNewMsg = false;
logic.index = 1;
logic.lists.clear();
logic.update();
logic.loadData();
},
enablePullUp: true,
enablePullDown: true,
child:logic.loadFail ? noResultWidget(tip: '',callBack: () {
logic.loadFail = false;
logic.isMore = true;
logic.update();
logic.initGerder();
logic.loadData();
}) : logic.lists.isEmpty
@ -222,175 +234,6 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
),
),
)),
// Positioned(
// bottom: 0,
// child: Container(
// width: Get.width,
// height: max(getBottomHeight(context), 0.0),
// child: AnimatedContainer(
// duration: Duration(
// milliseconds:
// (logic.showKeyboard && PlatformUtils().isAndroid)
// ? 200
// : 340),
// curve: Curves.fastOutSlowIn,
// width: Get.width,
// height: max(getBottomHeight(context), 0.0),
// child: ListView(
// physics: const NeverScrollableScrollPhysics(),
// children: [
// Container(
// width: MediaQuery.of(context).size.width,
// decoration: const BoxDecoration(
// color: Color(0xFF423055),
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(16),
// topRight: Radius.circular(16))),
// child: Container(
// // constraints: const BoxConstraints(
// // maxHeight: 60,
// // minHeight: 30,
// // ),
// padding: const EdgeInsets.symmetric(
// horizontal: 7.0, vertical: 7.0),
// child: Row(
// children: [
// SizedBox(
// width: 6,
// ),
// Transform.scale(
// scale: 0.8,
// child: CupertinoSwitch(
// activeColor: AppColor.mainColor,
// value: logic.isOpenVip,
// onChanged: (bool value) async {
// // if (logic.vip == 3) {
// // showToast('「年合伙人」专属特权「至尊喊话」,开启后可以闪亮全场哦');
// // _isOpenVip = value;
// // setState(() {});
// // } else {
// // showToast('成为「年合伙人」才能使用「至尊喊话」,可以闪亮全场哦');
// // showRechargeDialog('super_callout')
// // .then((value) {
// // logic.loadMyuserId();
// // });
// // }
// },
// ),
// ),
// Expanded(
// child: Stack(
// alignment: Alignment.centerLeft,
// children: [
// Container(
// constraints: const BoxConstraints(
// maxHeight: 60,
// minHeight: 30,
// ),
// width: Get.width,
// child: ExtendedTextField(
// controller: logic.inputController,
// focusNode: logic.focusNode,
// keyboardType:
// TextInputType.multiline,
// maxLength: 30,
// onTap: () {
// logic.showKeyboard = true;
// logic.inputController.value = TextEditingValue(
// /// controller.text = "0000"
// text: logic.inputController.text,
// ///
// selection: TextSelection.fromPosition(
// ///
// TextPosition(
// affinity: TextAffinity.downstream,
// ///
// offset: logic.inputController.text.length),),);
// logic.update();
// },
// decoration: InputDecoration(
// counterText: '',
// contentPadding: EdgeInsets.only(
// left: 10,
// right: 35,
// top: 10,
// bottom: 0),
// fillColor: Color(0x1AFFFFFF),
// filled: true,
// border: OutlineInputBorder(
// borderRadius:
// BorderRadius.circular(
// 15),
// borderSide:
// BorderSide.none),
// isDense: true,
// hintText: '发个喊话跟大家一起聊聊呗~',
// hintStyle: const TextStyle(
// color: Color(0xB3FFFFFF),
// fontSize: 14),
// enabled: false),
// maxLines: null,
// style: const TextStyle(
// color: Colors.white,
// fontSize: 14),
// textInputAction:
// TextInputAction.send,
// onChanged: (value) {},
// onEditingComplete: () {
// logic.focusNode.unfocus();
// logic.showKeyboard = false;
// logic.showEmojiPanel = false;
// logic.sendTextMessage();
// },
// enabled: true,
// specialTextSpanBuilder:
// DefaultSpecialTextSpanBuilder(
// isUseDefaultEmoji: true,
// customEmojiStickerList:
// ConstData.emojiList,
// showAtBackground: true,
// )),
// ),
// Positioned(
// right: 10,
// child: GestureDetector(
// onTap: () {
// logic.focusNode.unfocus();
// logic.showKeyboard = false;
// logic.showEmojiPanel = true;
// logic.update();
// },
// child: Image.asset(
// getMsgImage('emoji'),
// width: 24,
// ),
// ),
// ),
// ],
// )),
// SizedBox(
// width: 6,
// ),
// GestureDetector(
// onTap: () {
// logic.focusNode.unfocus();
// logic.showKeyboard = false;
// logic.showEmojiPanel = false;
// logic.sendTextMessage();
// },
// child: Image.asset(
// getMsgImage('send'),
// width: 24,
// )),
// ],
// ),
// ),
// ),
// getBottomContainer()
// ],
// ),
// ),
// )),
],
));
});
@ -623,12 +466,10 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
return picHeight > 0
? Container(
height: picHeight,
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
alignment: Alignment.topLeft,
margin: EdgeInsets.only(left: 10.sp, right: 10.sp,bottom: 5.sp),
child: picHeight == 200.sp
? ClipRRect(
borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(list.album![0].url!))
? VideoItemWidget(list.album![0].url!)
: GridView.builder(
itemCount: list.album!.length,
physics: const NeverScrollableScrollPhysics(),
@ -691,9 +532,30 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
}
}
Widget descText = logic.openCallOutIdList.contains(list.id)
? Text(
list.content!,
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 14.sp),
)
: Container(
// color: Colors.red,
child: HideText(
text: list.content!,
maxWidth: Get.width - 90.sp,
additionText: '查看更多',
maxLines: 15,
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 14.sp),
additionStyle:
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),
onTap: () {
logic.openCallOutIdList.add(list.id!);
setState(() {});
},
),
);
return Container(
margin: EdgeInsets.only(top: 20.sp),
// alignment: index % 2 == 0 ? Alignment.centerRight : Alignment.centerLeft,
margin: EdgeInsets.only(top: 10.sp,bottom:10.sp),
width: Get.width,
padding: EdgeInsets.only(left: 5.sp, right: 5.sp),
// height: widgetAllHeight + wordsHeight,
@ -795,7 +657,8 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
margin: EdgeInsets.only(
top: 10.sp, bottom: 10.sp, left: 10.sp, right: 10.sp),
alignment: Alignment.centerLeft,
child: Text.rich(TextSpan(children: <InlineSpan>[
child:
(list!.isQueen!) ? Text.rich(TextSpan(children: <InlineSpan>[
if (list!.isQueen!)
WidgetSpan(
child: Container(
@ -825,11 +688,14 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
),
)),
),
// WidgetSpan(
// child:descText)
TextSpan(
text: list.content!,
style: TextStyle(
color: Color(0xFFF7FAFA), fontSize: 14.sp)),
])),
])
) : descText,
),
if (picHeight > 0) picOrVideoItem(picHeight, list),
circleInfoItem(list)
@ -1035,6 +901,7 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
)
],
),
if (isSelf)
GestureDetector(
onTap: () {

View File

@ -116,19 +116,18 @@ class _AddWxTipState extends State<AddWxTip> {
GestureDetector(
onTap: () async {
if (widget.isHidden) {
var result = await DioManager().post(
url: Api.confset ,params: {'hideContact':widget.isWxHidden ? 0 : 1}
);
var result = await DioManager()
.post(url: Api.confset, params: {
'hideContact': widget.isWxHidden ? 0 : 1
});
if (result['code'] == 200) {
showOKToast('操作成功');
}
Get.back();
} else {
showOKToast('为了维护站内的社交环境,联系信息填写必须真实哦~');
Get.back();
showUpdateWxPicker(phone: '1');
}
},
child: Container(
@ -168,7 +167,9 @@ class _AddWxTipState extends State<AddWxTip> {
borderRadius:
BorderRadius.circular(4.sp)),
child: Text(
widget.isHaveWx ? ' 更新联系方式 ':' 填写联系方式 ',
widget.isHaveWx
? ' 更新联系方式 '
: ' 填写联系方式 ',
style: TextStyle(
color: Colors.white, fontSize: 14.sp),
),

View File

@ -3,6 +3,7 @@ import 'package:circle_app/util/util.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import '../../../app/minefragment/logic.dart';
import '../../../network/api.dart';
import '../../../network/dio_manager.dart';
import '../../../util/PaymentUtils.dart';
@ -16,12 +17,24 @@ class Open_vip_tipLogic extends GetxController {
bool isYean = false;
bool isShowInviteTip = false;
bool isVip = false;
@override
void onInit() {
super.onInit();
}
getMode() async {
var data = await DioManager.instance.get(url: Api.getUserMine);
var bean = BaseResponse<MineResponseBean>.fromJson(
data, (data) => MineResponseBean.fromJson(data));
if (bean.isSuccess()) {
if(bean.data.user.vip>0){
isVip = true;
} else if (bean.data.last_vip_expire_date != '') {
isVip = true;
}
}}
loadData() async {
var data = await DioManager.instance.get(url: Api.getVipPrice, params: {});

View File

@ -29,8 +29,6 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
final state = Get.find<Open_vip_tipLogic>().state;
bool isVip = false;
Map<String,String> vipImgMap = {
"身份标识" : 'vip_fun_1',
"专属客服": 'vip_fun_2',
@ -53,22 +51,10 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
// TODO: implement initState
super.initState();
logic.loadData();
logic.getMode();
logic.isShowInvite();
}
getMode() async {
var data = await DioManager.instance.get(url: Api.getUserMine);
var bean = BaseResponse<MineResponseBean>.fromJson(
data, (data) => MineResponseBean.fromJson(data));
if (bean.isSuccess()) {
User userInfoBean = bean.data.user;
isVip = userInfoBean!.vip! > 0;
setState(() {
});
}
}
@override
Widget build(BuildContext context) {
List vipFuncList = [
@ -299,7 +285,7 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
Color(0xffD739EA)
])),
child: Text(
isVip ? '续费特权' : '领取特权',
logic.isVip ? '续费特权' : '领取特权',
style:
TextStyle(color: Colors.white, fontSize: 16.sp),
),

View File

@ -7,6 +7,8 @@ class AppColor {
static Color bgColor = Color(0xFF120D29);
static Color mainBgColor = Color(0XFF392D53);
static Color cityBgColor = Color.fromRGBO(52, 41, 67, 1);
static Gradient mainVerLinearGradient = const LinearGradient(
colors: [
Color(0xFF06F9FA),
@ -54,5 +56,14 @@ class AppColor {
end: Alignment.centerRight,
);
static Gradient clearLinearGradient = LinearGradient(
colors: [
mainColor.withOpacity(0),
mainColor.withOpacity(0),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
);
}

View File

@ -71,6 +71,12 @@ class Api {
//mine
static const getUserMine = 'user-service/my/main';
//
static const activeUsers = '/user-service/follow/activeUsers';
//访
static const getVisitorMsg = '/user-service/visit/getVisitorMsg';
//vip弹窗
static const getIsVips = 'mall-service/vips/show/';
@ -99,6 +105,15 @@ class Api {
//
static const setBlock = 'user-service/user/';
//
static const interestAgent = '/up-service/interest/agent/';
//
static const applyToAgent = '/up-service/interest/applyToAgent/';
//
static const rewardAgent = '/up-service/interest/agent/reward';
//
static const setLike = 'user-service/user/';
@ -238,7 +253,7 @@ class Api {
static const UnlockWx = 'user-service/wxNum/unlock';
//
static const popWxNumStr = 'user-service/content/popup/wxNum';
static const popWxNumStr = 'user-service/content/popup/contact';
//
static const updateWxNum = 'user-service/updateWxNum';
@ -422,4 +437,7 @@ class Api {
//
static const categoriesList = '/up-service/interest/categories';
//good认证发送
static const goodAuth = '/user-service/user/goodAuth';
}

View File

@ -43,9 +43,9 @@ class DioManager {
// baseUrl2
baseUrl:
// Api.baseUrl2,
Api.baseUrl,
// Api.baseUrl,
// type == 1 ? Api.baseUrl2 : Api.baseUrl1,
type == 1 ? Api.baseUrl2 : Api.baseUrl1,
//
connectTimeout: const Duration(seconds: 30),
//
@ -197,7 +197,7 @@ class DioManager {
var connectivityResult = await Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) {
// showToast("");
// showOKToast("网络不流畅哦,请检查网络情况");
return {'code': 404, 'msg': '网络不流畅哦,请检查网络情况'};
}
@ -285,7 +285,7 @@ class DioManager {
pushLoginPage();
break;
}
if (responseMap["code"] != 200 && responseMap["code"] != 10000 && !url.contains(Api.checkWxNumState) && responseMap["code"] != 21201 && responseMap['code'] != 404) {
if (responseMap["code"] != 200 && responseMap["code"] != 10000 && !url.contains(Api.checkWxNumState) && responseMap["code"] != 21201 && responseMap['code'] != 32104) {
showOKToast(responseMap['msg']);
}
}
@ -295,20 +295,13 @@ class DioManager {
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
return {'code': 500, 'msg': ''};
}
// // DioError是指返回值不为200的情况
// logger.shout('DioError报错${e.type}:${e.error.toString()}');
// //
// onErrorInterceptor(e);
// //
// String? errorMsg = isNetworkConnected
// ? e.requestOptions.extra["errorMsg"]
// : "网络连接断开,请检查网络设置";
return {'code': 500, 'msg': '服务器开小差了,请重试'};
} catch (e) {
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
return {'code': 500, 'msg': ''};
}
//
return {'code': 500, 'msg': '加载中...'};
}

View File

@ -86,7 +86,7 @@ showOKToast(String msg) {
msg,
duration: Duration(seconds: msg.length > 15 ? 5 : msg.length > 10 ? 3 : 2),
position: ToastPosition.center,
backgroundColor: Colors.black.withOpacity(0.8),
backgroundColor: Colors.black,
radius: 13.0,
textStyle: const TextStyle(fontSize: 16.0,color: Colors.white),
);
@ -1099,6 +1099,8 @@ pushPage(String action,String param,{String name = ''}) {
// public final static String GOOD_RATE = "good_rate";//
// public final static String BUY_VIP = "buy_vip";//
// public final static String RECHARGE = "recharge";//
// public final static String INTEREST = "interest";//
// public final static String GOOD_AUTH = "good_auth";//good认证
if (action == 'my_main') {
Get.until((route) => route.settings.name == '/home');
final homeLogic = Get.put(HomeLogic());
@ -1149,10 +1151,142 @@ pushPage(String action,String param,{String name = ''}) {
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
}
Get.toNamed(AppRoutes.Chat, arguments: con);
} else if(action == 'interest') {
Get.toNamed(AppRoutes.Signal_circle_list,arguments: param);
} else if(action == 'good_auth') {
var con;
if(kDebugMode){
con = V2TimConversation(
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
}else{
con = V2TimConversation(
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
}
Get.toNamed(AppRoutes.Chat, arguments: con);
DioManager.instance.post(url: Api.goodAuth);
} else if (action == 'apply_interest_agent') {
sendApplyToAgentData(param);
}
}
void sendApplyToAgentData(var circleId) async {
var data = await DioManager.instance
.post(url: Api.applyToAgent + '$circleId');
if (data['code'] == 200) {
var con;
if(kDebugMode){
con = V2TimConversation(
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
}else{
con = V2TimConversation(
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
}
Get.toNamed(AppRoutes.Chat, arguments: con);
} else if (data['code'] == 32104) {
showReportDialog(Get.context!,data['msg']);
}
}
void showReportDialog(BuildContext context,String msg) {
showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
backgroundColor: Colors.transparent,
child: Container(
height: 200.sp,
padding: const EdgeInsets.all(1.0),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: AppColor.bgColor,
borderRadius: BorderRadius.circular(12.0.sp),
// gradient: const LinearGradient(
// colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// ),
),
),
// Container(
// margin: EdgeInsets.all(1.sp),
// child: Image.asset(getMineImage("im_neglect"),fit: BoxFit.fill,),
// ),
Container(
margin: EdgeInsets.only(top: 12.sp),
child: Column(
children: [
Center(
child: Text(
"申请代理提示",
style:
TextStyle(color: Colors.white, fontSize: 16.sp),
),
),
Container(
margin: EdgeInsets.only(
top: 12.sp, left: 14.sp, right: 14.sp),
alignment: Alignment.center,
child: Text(
msg,
textAlign: TextAlign.left,
style: TextStyle(
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Get.back();
Get.toNamed(AppRoutes.Invite);
},
child: Container(
margin: EdgeInsets.only(top: 16.sp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17),
gradient: const LinearGradient(
colors: [
Color(0x26FFFFFF),
Color(0x26FFFFFF),
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
padding: EdgeInsets.only(
top: 10.sp,
bottom: 10.sp,
left: 52.sp,
right: 52.sp),
child: const Text(
"前往邀请",
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
),
),
)
],
)
],
),
)
],
),
),
);
},
);
}
Future<Position> getCurrentPosition() async {
return await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);