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. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21 minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode 62 versionCode 63
versionName "2.1.2" versionName "2.1.3"
manifestPlaceholders = [ manifestPlaceholders = [
vivo_APPID: "105669716", vivo_APPID: "105669716",
vivo_APPKEY:"84f750207787376b310ca5b0d5969122", vivo_APPKEY:"84f750207787376b310ca5b0d5969122",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,6 +25,8 @@ import '../../../../util/eventBus.dart';
import '../../chat/widget/chat_gift_pannel.dart'; import '../../chat/widget/chat_gift_pannel.dart';
import '../../home/logic.dart'; import '../../home/logic.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
const String todayAddWxStatus = 'todayAddWxStatus'; const String todayAddWxStatus = 'todayAddWxStatus';
class Discover extends StatefulWidget { class Discover extends StatefulWidget {
@ -262,6 +264,7 @@ class _DiscoverState extends State<Discover>
} else { } else {
loadFail = true; loadFail = true;
isMore = false; isMore = false;
showOKToast(data['msg']);
setState(() { setState(() {
}); });
@ -295,6 +298,11 @@ class _DiscoverState extends State<Discover>
return list.isEmpty return list.isEmpty
? loadFail ? noResultWidget(tip: '',callBack: () { ? loadFail ? noResultWidget(tip: '',callBack: () {
isMore = true;
loadFail = false;
setState(() {
});
refreshData(); refreshData();
}) : isMore }) : isMore
? loaddingWidget(true) ? loaddingWidget(true)
@ -989,13 +997,42 @@ class _FeaturedItemState extends State<FeaturedItem> {
Container( Container(
width: Get.width - 120.sp, width: Get.width - 120.sp,
margin: EdgeInsets.only(top: 15.sp, bottom: 15.sp), margin: EdgeInsets.only(top: 15.sp, bottom: 15.sp),
child: Text( child: RichText(
user.signature! ?? '',
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: (user.signature! ?? '').length > 15 ? 2 : 1, maxLines: 2,
style: TextStyle( text: TextSpan(
fontSize: 16.sp, color: const Color(0XFFF7FAFA)), 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( Container(
width: Get.width - 110.sp, width: Get.width - 110.sp,
@ -1096,20 +1133,13 @@ class _FeaturedItemState extends State<FeaturedItem> {
margin: EdgeInsets.only(right: 6.sp), margin: EdgeInsets.only(right: 6.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient( border: GradientBoxBorder(
colors: [ gradient:
Color(0xFF06F9FA), AppColor.mainVerLinearGradient,
Color(0xFFDC5BFD), width: 0.5.sp,
],
), ),
color: const Color(0xFF392D53), 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( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 2.sp, 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( return Container(
margin: EdgeInsets.only(top: 10.sp), margin: EdgeInsets.only(top: 10.sp),
width: Get.width, width: Get.width,
height: widgetHeight, // height: widgetHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
@ -778,7 +778,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
), ),
), ),
Container( Container(
height: widgetHeight, // height: widgetHeight,
width: Get.width, 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),
child: Column( child: Column(
@ -946,7 +946,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
Container( Container(
height: 30.sp, height: 30.sp,
padding: EdgeInsets.only(left: 5.sp, right: 10.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( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.sp), borderRadius: BorderRadius.circular(15.sp),
color: Color(0x33000000) color: Color(0x33000000)
@ -1643,6 +1643,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
// logic.update(); // logic.update();
}else if(data['code'] == 404){ }else if(data['code'] == 404){
var logic = Get.put(CircleLogic()); var logic = Get.put(CircleLogic());
logic.circle.lists.removeAt(logic.state.index); logic.circle.lists.removeAt(logic.state.index);
logic.update(); logic.update();

View File

@ -42,6 +42,8 @@ class _LikeViewState extends State<LikeView>
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
final ScrollController moreScrollController = ScrollController();
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
CircleLogic logic = Get.find<CircleLogic>(); CircleLogic logic = Get.find<CircleLogic>();
@ -56,6 +58,7 @@ class _LikeViewState extends State<LikeView>
var circleId = ''; var circleId = '';
List<Lists> lists = []; List<Lists> lists = [];
List<Lists> recomanddlists = []; List<Lists> recomanddlists = [];
List peopleList = [];
@override @override
void dispose() { void dispose() {
@ -65,7 +68,7 @@ class _LikeViewState extends State<LikeView>
// EventBusManager.cancelSubscription(scroToTop!); // EventBusManager.cancelSubscription(scroToTop!);
// } // }
EventBusManager.cancelSubscription(likeRefreshSub!); EventBusManager.cancelSubscription(likeRefreshSub!);
moreScrollController.dispose();
scrollController.dispose(); scrollController.dispose();
super.dispose(); super.dispose();
} }
@ -78,7 +81,7 @@ class _LikeViewState extends State<LikeView>
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
loadActiveUsersData();
loadLikeListData(); loadLikeListData();
loadRecomdistData(); loadRecomdistData();
@ -92,6 +95,23 @@ class _LikeViewState extends State<LikeView>
likeRefreshSub = EventBusManager.on<LikeRefresh>().listen((event) { likeRefreshSub = EventBusManager.on<LikeRefresh>().listen((event) {
refreshData(); 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 { loadLikeListData() async {
@ -190,6 +210,7 @@ class _LikeViewState extends State<LikeView>
likeMore = true; likeMore = true;
recomandMore = true; recomandMore = true;
refreshController.resetNoData(); refreshController.resetNoData();
loadActiveUsersData();
loadLikeListData(); loadLikeListData();
loadRecomdistData(); loadRecomdistData();
} }
@ -350,6 +371,7 @@ class _LikeViewState extends State<LikeView>
if (list.isQueen!) { if (list.isQueen!) {
return Column( return Column(
children: [ children: [
vipDynamicItem(list), vipDynamicItem(list),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -377,6 +399,7 @@ class _LikeViewState extends State<LikeView>
} else { } else {
return Column( return Column(
children: [ children: [
normalDynamicItem(list), normalDynamicItem(list),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -418,9 +441,18 @@ class _LikeViewState extends State<LikeView>
} }
} }
if (list.isQueen!) { if (list.isQueen!) {
return vipDynamicItem(list); return Column(
children: [
if (index == 0 && peopleList.length > 2)
morePeoleListWidget(),
vipDynamicItem(list)
],
);
} else { } else {
return normalDynamicItem(list); return Column(
children: [
if (index == 0 && peopleList.isNotEmpty)
morePeoleListWidget(),normalDynamicItem(list)]);
} }
} else if (lists.length == index && } else if (lists.length == index &&
recomanddlists.isNotEmpty) { recomanddlists.isNotEmpty) {
@ -483,83 +515,146 @@ class _LikeViewState extends State<LikeView>
); );
} }
void _showTextContentDialog(BuildContext context, String msg, String title) { morePeoleListWidget() {
showDialog( return Container(
context: context, width: Get.width,
builder: (BuildContext context) { height: 75.sp,
return Dialog( margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
backgroundColor: Colors.transparent, child: ListView.builder(
child: Container( controller: moreScrollController,
height: 300.sp, scrollDirection: Axis.horizontal,
padding: const EdgeInsets.all(1.0), itemBuilder: (contenxt, index) {
child: Stack( if (index == peopleList.length) {
children: [ return MoreItem();
Container( }
decoration: BoxDecoration( return peopleWidget(peopleList[index]);
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();
}, },
child: Icon( itemCount: peopleList.length < 10 ? peopleList.length + 1 : 10,
Icons.close, ),
color: Colors.white, );
size: 20.sp, }
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; picHeight = picWidth;
} }
} else { } else {
picHeight = 200.sp; picHeight = 140.sp;
} }
} }
} }
double widgetHeight = // double widgetHeight =
130.sp + contentHeight(lists.content!) + picHeight + 76.sp; // 130.sp + contentHeight(lists.content!) + picHeight + 76.sp;
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
@ -630,9 +725,9 @@ class _LikeViewState extends State<LikeView>
pushHomePage(lists, lists.id.toString()); pushHomePage(lists, lists.id.toString());
}, },
child: Container( child: Container(
margin: EdgeInsets.only(top: 10.sp), margin: EdgeInsets.only(bottom: 10.sp),
width: Get.width, width: Get.width,
height: widgetHeight, // height: widgetHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
@ -675,7 +770,7 @@ class _LikeViewState extends State<LikeView>
), ),
), ),
Container( Container(
height: widgetHeight, // height: widgetHeight,
width: Get.width, 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),
child: Column( child: Column(
@ -782,7 +877,9 @@ class _LikeViewState extends State<LikeView>
), ),
Container( Container(
height: picHeight, height: picHeight,
margin: EdgeInsets.only(top: 5.sp),
// color: Colors.red,
margin: EdgeInsets.only(top: 5.sp,),
child: picHeight == 140.sp child: picHeight == 140.sp
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(6.sp), borderRadius: BorderRadius.circular(6.sp),
@ -815,15 +912,6 @@ class _LikeViewState extends State<LikeView>
borderRadius: BorderRadius.circular(6.sp), borderRadius: BorderRadius.circular(6.sp),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: album.url!, 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) => errorWidget: (context, url, error) =>
const Icon(Icons.error), const Icon(Icons.error),
fit: BoxFit.cover, 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; picHeight = picWidth;
} }
} else { } else {
picHeight = 200.sp; picHeight = 140.sp;
} }
} }
} }
@ -957,7 +1044,7 @@ class _LikeViewState extends State<LikeView>
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 10.sp), margin: EdgeInsets.only(bottom: 10.sp),
width: Get.width, width: Get.width,
height: 120.sp + contentHeight(lists.content!) + picHeight + 76.sp, // height: 120.sp + contentHeight(lists.content!) + picHeight + 76.sp,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
@ -1093,6 +1180,7 @@ class _LikeViewState extends State<LikeView>
), ),
picHeight > 0 picHeight > 0
? Container( ? Container(
// color: Colors.red,
height: picHeight, height: picHeight,
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
margin: EdgeInsets.only(top: 5.sp), 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: [ children: [
if (showTitle) if (showTitle)
logic.recommendCircleFriendData.isNotEmpty logic.recommendCircleFriendData.isNotEmpty
? RecommendCircleFriendItem( ? Container(
false, // color: Colors.red,
child: RecommendCircleFriendItem(
false,0,
recommendCircleFriendData: logic.recommendCircleFriendData, recommendCircleFriendData: logic.recommendCircleFriendData,
getDataCallBack: () { getDataCallBack: () {
logic.loadRecommendCircleFriendData(); logic.loadRecommendCircleFriendData();
}) }),
)
: Container(), : Container(),
if (showTitle) if (showTitle)
Container( Container(

View File

@ -13,7 +13,7 @@ import '../../../util/eventBus.dart';
import '../../../util/util.dart'; import '../../../util/util.dart';
import '../../userinfo/logic.dart'; import '../../userinfo/logic.dart';
import '../view.dart'; import '../view.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
class NewPeople extends StatefulWidget { class NewPeople extends StatefulWidget {
@override @override
@ -74,6 +74,8 @@ class _NewPeopleState extends State<NewPeople> {
), ),
) )
: logic.isLoadFail ? noResultWidget(tip: '', callBack: () { : logic.isLoadFail ? noResultWidget(tip: '', callBack: () {
logic.isLoadFail = false;
logic.update();
logic.onLoading(); logic.onLoading();
}) : loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~'); }) : loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~');
}); });
@ -229,13 +231,50 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
margin: EdgeInsets.symmetric(horizontal: 8.0,vertical: 10.sp), margin: EdgeInsets.symmetric(horizontal: 8.0,vertical: 10.sp),
child: Align( child: Align(
alignment: Alignment.centerLeft, // alignment: Alignment.centerLeft, //
child: Text( child: RichText(
item.signature ?? '暂时还没有签名哦~',
maxLines: 2,
style:
TextStyle(color: Colors.white, fontSize: 18.sp),
overflow: TextOverflow.ellipsis, 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) if (item.interests.isNotEmpty)
@ -339,20 +378,13 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
margin: EdgeInsets.only(right: 11.sp), margin: EdgeInsets.only(right: 11.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient( border: GradientBoxBorder(
colors: [ gradient:
Color(0xFF06F9FA), AppColor.mainVerLinearGradient,
Color(0xFFDC5BFD), width: 0.5.sp,
],
), ),
color: const Color(0xFF392D53), 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( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 2.sp, 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 'package:flutter_bmflocation/flutter_bmflocation.dart';
import '../../../common/colors/app_color.dart'; import '../../../common/colors/app_color.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
class Vicinity extends StatefulWidget { class Vicinity extends StatefulWidget {
CircleLogic logic; CircleLogic logic;
// TODO: add state variables, methods and constructor params // 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 ? loaddingWidget(true) : noResultWidget(tip: '',callBack: () {
widget.logic.isNearLoad = true;
widget.logic.update();
_onLoading(); _onLoading();
}); });
} }
@ -421,12 +425,42 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
margin: EdgeInsets.symmetric(vertical: 12.0.sp,horizontal: 9.sp), margin: EdgeInsets.symmetric(vertical: 12.0.sp,horizontal: 9.sp),
child: Align( child: Align(
alignment: Alignment.centerLeft, // alignment: Alignment.centerLeft, //
child: Text( child: RichText(
item.signature,
maxLines: 2,
style: TextStyle(color: Colors.white, fontSize: 18.sp),
overflow: TextOverflow.ellipsis, 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( Container(
@ -504,20 +538,13 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
margin: EdgeInsets.only(right: 11.sp), margin: EdgeInsets.only(right: 11.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient( border: GradientBoxBorder(
colors: [ gradient:
Color(0xFF06F9FA), AppColor.mainVerLinearGradient,
Color(0xFFDC5BFD), width: 0.5.sp,
],
), ),
color: const Color(0xFF392D53), 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( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 2.sp, 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/app/circle/widgets/play_video_view.dart';
import 'package:circle_app/util/util.dart'; import 'package:circle_app/util/util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:video_player/video_player.dart';
class VideoItemWidget extends StatefulWidget { class VideoItemWidget extends StatefulWidget {
String url; String url;
@ -14,50 +13,29 @@ class VideoItemWidget extends StatefulWidget {
} }
class _VideoItemWidgetState extends State<VideoItemWidget> { 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return Row(
children: [
GestureDetector(
onTap: () { onTap: () {
Get.to(PlayVideoView(widget.url)); Get.to(PlayVideoView(widget.url));
}, },
child: AspectRatio(
aspectRatio: videoPlayerController!.value.aspectRatio,
child: Stack( child: Stack(
alignment: Alignment.center,
children: [ children: [
VideoPlayer(videoPlayerController!), ClipRRect(borderRadius: BorderRadius.circular(6.sp),child: CachedNetworkImage(imageUrl:'${widget.url}?vframe/jpg/offset/1',height: 200.sp,fit: BoxFit.cover,)),
Center( Image(
child: videoPlayerController!.value.isPlaying
? Container()
: Image(
image: AssetImage(getMineImage("icon_play")), image: AssetImage(getMineImage("icon_play")),
width: 30.sp, width: 30.sp,
height: 30.sp, height: 30.sp,
), ),
),
], ],
), ),
), ),
],
); );
} }
} }

View File

@ -71,6 +71,7 @@ class LikeLogic extends GetxController {
} }
} else if (bean.code == 404) { } else if (bean.code == 404) {
isLoadFial = true; isLoadFial = true;
showOKToast('网络不流畅哦,请检查网络情况');
update(); 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/info_list_view.dart';
import 'package:circle_app/app/circle/widgets/like_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/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/app/select_circle/logic.dart';
import 'package:circle_app/common/Widgets/circle_share.dart'; import 'package:circle_app/common/Widgets/circle_share.dart';
import 'package:circle_app/common/Widgets/text_more.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: () { return logic.isLoadFial ? noResultWidget(tip:'',callBack: () {
logic.isLoadFial = false;
logic.isLoad = true;
logic.update();
logic.loadMyInfo(); logic.loadMyInfo();
logic.loadData(); logic.loadData();
}) : logic.isLoad }) : logic.isLoad
@ -162,14 +166,16 @@ class _CircleListPageState extends State<CircleListPage>
logic.update(); logic.update();
}, },
) )
: InfoListView( : RightCircleIten( logic.currentIndex,
logic.currentIndex,
logic.mycircle logic.mycircle
.lists[logic.currentIndex], .lists[logic.currentIndex],
logic, logic,key: ValueKey(
key: ValueKey( '${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),)))
'${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( Stack(
children: [ children: [
ClipOval( ClipOval(
child: GestureDetector(
onTap: () {
var imgList = <String>[];
imgList.add(item.avatar);
Get.toNamed(AppRoutes.Swiper,
arguments: {'imaglist': imgList, 'index': 0});
},
child: CachedNetworkImage( child: CachedNetworkImage(
fit: BoxFit.cover, fit: BoxFit.cover,
imageUrl: item.avatarThumb, imageUrl: item.avatarThumb,
@ -376,7 +369,6 @@ class _FriendslistPageState extends State<FriendslistPage>
height: 53.sp, height: 53.sp,
), ),
), ),
),
Positioned( Positioned(
right: 0, right: 0,
left: 0, left: 0,

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:circle_app/app/chat/widget/svg_dialog.dart'; import 'package:circle_app/app/chat/widget/svg_dialog.dart';
import 'package:circle_app/app/circle/logic.dart'; import 'package:circle_app/app/circle/logic.dart';
import 'package:circle_app/app/minefragment/logic.dart'; import 'package:circle_app/app/minefragment/logic.dart';
@ -38,6 +37,7 @@ import '../invite/logic.dart';
import '../minefragment/view.dart'; import '../minefragment/view.dart';
import '../msg/view.dart'; import '../msg/view.dart';
import 'state.dart'; import 'state.dart';
import 'package:intl/intl.dart';
class HomeLogic extends GetxController with WidgetsBindingObserver { class HomeLogic extends GetxController with WidgetsBindingObserver {
late TabController tabController; late TabController tabController;
@ -63,7 +63,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
bool isUpdateVersion = false; bool isUpdateVersion = false;
bool isProd = true; bool isProd = true;
String accountId = ''; String accountId = '';
@ -76,8 +75,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
// TODO: implement onClose // TODO: implement onClose
super.onClose(); super.onClose();
connectivitySub.cancel(); connectivitySub.cancel();
TencentImSDKPlugin.v2TIMManager TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager
.v2TIMMessageManager.removeAdvancedMsgListener(); .removeAdvancedMsgListener();
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
sub!.cancel(); sub!.cancel();
} }
@ -101,7 +100,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
loadMyInfoData(); loadMyInfoData();
sub = EventBusManager.on<RefreshUnread>().listen((event) { sub = EventBusManager.on<RefreshUnread>().listen((event) {
getUnreadSize(); getUnreadSize();
}); });
@ -114,11 +112,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
loadMyCircleData(); loadMyCircleData();
initWxApi(); initWxApi();
} }
void addMsgListener() { void addMsgListener() {
msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: ( msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: (
msgID, msgID,
@ -132,106 +127,149 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
V2TimUserInfo sender, V2TimUserInfo sender,
String customData, String customData,
) { ) {
if (sender.userID == "qpqz_dev_10_10000000000" || if (sender.userID == "qpqz_dev_10_10000000000" ||
sender.userID == "qpqz_prod_10_10000000000") { sender.userID == "qpqz_prod_10_10000000000") {
if(customData.isEmpty){ if (customData.isEmpty) {
return; return;
} }
print("123123123123"+customData); print("123123123123" + customData);
Map<String, dynamic> jsonData = json.decode(customData); Map<String, dynamic> jsonData = json.decode(customData);
int event = jsonData['event']; int event = jsonData['event'];
Map<String, dynamic> content = jsonData['content']; Map<String, dynamic> content = jsonData['content'];
switch(event) { switch (event) {
case 1:// case 1: //
String ageMsg = "${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}"; String ageMsg =
if(content['isFollow']==1){// "${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],3,(){ if (content['isFollow'] == 1) {
//
showFloatingButtonOverlay(Get.context!, content['nickname'],
ageMsg, content['avatarThumb'], 3, () {
pushChatPage(content['id'].toString(), content['imId'], pushChatPage(content['id'].toString(), content['imId'],
content['nickname']); content['nickname']);
}); });
}else{ } else {
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],1,(){ showFloatingButtonOverlay(Get.context!, content['nickname'],
ageMsg, content['avatarThumb'], 1, () {
setLike(content['id'].toString()); setLike(content['id'].toString());
}); });
} }
break; 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'], pushChatPage(content['id'].toString(), content['imId'],
content['nickname']); content['nickname']);
}); });
break; break;
case 9:// case 9: //
{ {
CircleLogic logic = Get.find<CircleLogic>(); CircleLogic logic = Get.find<CircleLogic>();
logic.isNewPeopleRed = true; logic.isNewPeopleRed = true;
logic.update(); logic.update();
} }
break; break;
case 8:// case 8: //
{ {
World_call_outLogic logic = Get.find<World_call_outLogic>(); World_call_outLogic logic = Get.find<World_call_outLogic>();
logic.isNewMsg = true; logic.isNewMsg = true;
logic.update(); logic.update();
} }
break; break;
case 10: //访
{
MsgLogic logic = Get.find<MsgLogic>();
logic.getMode();
}
break;
} }
} }
}); });
TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager.addAdvancedMsgListener(
TencentImSDKPlugin.v2TIMManager listener: V2TimAdvancedMsgListener(onRecvNewMessage: (message) {
.v2TIMMessageManager.addAdvancedMsgListener(
listener: V2TimAdvancedMsgListener(
onRecvNewMessage: (message) {
getUnreadSize(); getUnreadSize();
print(message); print(message);
if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM) { if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM) {
if ( message.customElem?.data != null) { if (message.customElem?.data != null) {
print(message.customElem!.data!); print(message.customElem!.data!);
Map jsonData = jsonDecode(message.customElem!.data!); Map jsonData = jsonDecode(message.customElem!.data!);
if (jsonData.containsKey('event')) { if (jsonData.containsKey('event')) {
String event = jsonData['event'].toString(); 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()); showOKToast(message.customElem!.desc!.toString());
EventBusManager.fire(LikeRefresh()); EventBusManager.fire(LikeRefresh());
} else if (int.parse(event) == 5) { } else if (int.parse(event) == 5) {//
// print(jsonData.toString()); // print(jsonData.toString());
var info = jsonDecode(jsonData['content']); 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')) { } else if (jsonData.containsKey('type')) {
int type = jsonData['type']; int type = jsonData['type'];
if (type == 1) { if (type == 1) {
String giftUrl = jsonData['gifUrl']; String giftUrl = jsonData['gifUrl'];
if (giftUrl.isNotEmpty) { if (giftUrl.isNotEmpty) {
Get.bottomSheet(SvgDialog(url: giftUrl),isScrollControlled: true, Get.bottomSheet(SvgDialog(url: giftUrl),
enableDrag: false,isDismissible:false); isScrollControlled: true,
} enableDrag: false,
isDismissible: false);
}
}
} }
} }
} }
) }
); }
}));
_messageService.addSimpleMsgListener(listener: msgListener); _messageService.addSimpleMsgListener(listener: msgListener);
} }
@override @override
void didChangeAppLifecycleState(AppLifecycleState state) { void didChangeAppLifecycleState(AppLifecycleState state) {
switch (state) { switch (state) {
@ -250,9 +288,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
} }
} }
Future<void> checkVersion() async { Future<void> checkVersion() async {
var data = await DioManager.instance.get(url: Api.APP_VERSION); var data = await DioManager.instance.get(url: Api.APP_VERSION);
var bean = BaseResponse<UpdateInfo>.fromJson( var bean = BaseResponse<UpdateInfo>.fromJson(
@ -263,9 +298,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
} }
setLike(String userId) async { setLike(String userId) async {
var data = await DioManager.instance.post( var data = await DioManager.instance
url: "${Api.setLike + userId}/follow", .post(url: "${Api.setLike + userId}/follow", params: {'status': "1"});
params: {'status': "1"});
var bean = BaseResponse<dynamic>.fromJson( var bean = BaseResponse<dynamic>.fromJson(
data, data,
(jsonData) => jsonData, (jsonData) => jsonData,
@ -275,6 +309,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
} }
showOKToast(bean.msg); showOKToast(bean.msg);
} }
getUnreadSize() async { getUnreadSize() async {
if (coreInstance.isLoginSuccess) { if (coreInstance.isLoginSuccess) {
try { try {
@ -290,15 +325,13 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
getTotalUnreadMessageCountRes.data.toString()); getTotalUnreadMessageCountRes.data.toString());
if (getTotalUnreadMessageCountRes.code == 0) { if (getTotalUnreadMessageCountRes.code == 0) {
if (getTotalUnreadMessageCountRes.data.toString() != unreadSIze.value) { if (getTotalUnreadMessageCountRes.data.toString() !=
unreadSIze.value) {
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString(); unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
} }
} }
} catch (e) {} } catch (e) {}
} }
} }
@override @override
@ -323,11 +356,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
super.onReady(); super.onReady();
FlutterNativeSplash.remove(); FlutterNativeSplash.remove();
updateIndex(1);
final logic = Get.find<CircleLogic>(); final logic = Get.find<CircleLogic>();
logic.loadCirclePeopleData(); logic.loadCirclePeopleData();
} }
addBadge() { addBadge() {
@ -354,7 +384,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
if (!coreInstance.isLoginSuccess) { if (!coreInstance.isLoginSuccess) {
var data = await DioManager.instance.get(url: Api.getIMInfo); var data = await DioManager.instance.get(url: Api.getIMInfo);
if (data['code'] == 200) { if (data['code'] == 200) {
loginIM( loginIM(
data['data']['account_id'].toString(), data['data']['user_sig']); data['data']['account_id'].toString(), data['data']['user_sig']);
accountId = data['data']['account_id'].toString(); accountId = data['data']['account_id'].toString();
@ -383,20 +412,18 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
final logic = Get.find<MsgLogic>(); final logic = Get.find<MsgLogic>();
EventBusManager.fire(MsgRecommendCardRefresh()); EventBusManager.fire(MsgRecommendCardRefresh());
logic.loadChatData(); logic.loadChatData();
logic.getVisitorMsgData();
} }
update(); update();
} }
void setFirstData() async { void setFirstData() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
sharedPreferences.setString( sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1');
SharedPreferencesHelper.firstLogin, '1');
} }
loadMyCircleData() async { loadMyCircleData() async {
var data = await DioManager.instance var data = await DioManager.instance.get(url: Api.getMyCircleAll);
.get(url: Api.getMyCircleAll);
// var bean = BaseResponse<InterestsBean>.fromJson( // var bean = BaseResponse<InterestsBean>.fromJson(
// data, (data) => InterestsBean.fromJson(data)); // data, (data) => InterestsBean.fromJson(data));
@ -411,7 +438,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
}); });
mycircle.lists = infoList; mycircle.lists = infoList;
if (currentIndex >= mycircle.lists.length - 1) { if (currentIndex >= mycircle.lists.length - 1) {
currentIndex = mycircle.lists.length -1; currentIndex = mycircle.lists.length - 1;
} }
loadCalloutsNew(); loadCalloutsNew();
@ -424,9 +451,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
mycircle.lists.forEach((element) { mycircle.lists.forEach((element) {
idList.add(element.id.toString()); idList.add(element.id.toString());
}); });
var data = await DioManager.instance.post( var data = await DioManager.instance
url:Api.calloutsNew, .post(url: Api.calloutsNew, params: {"interestIds": idList});
params: {"interestIds":idList});
if (data['code'] == 200) { if (data['code'] == 200) {
List infoList = data['data']; List infoList = data['data'];
@ -444,7 +470,9 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
/// ///
connectListener() { connectListener() {
connectivitySub = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { connectivitySub = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
if (result == ConnectivityResult.none) { if (result == ConnectivityResult.none) {
if (currentIndex == 0) { if (currentIndex == 0) {
var logic = Get.put(CircleLogic()); var logic = Get.put(CircleLogic());
@ -459,7 +487,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
var logic = Get.put(MinefragmentLogic()); var logic = Get.put(MinefragmentLogic());
logic.loadData(); logic.loadData();
} }
}}); }
});
} }
void loadEnvTypeData() async { void loadEnvTypeData() async {
@ -482,25 +511,45 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
inviteCode = info.data!.inviteCode!; inviteCode = info.data!.inviteCode!;
link = info.data!.link!; 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); updateIndex(currentIndex);
update(); 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 { class conTop {
bool isTop; bool isTop;
String conId; 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( Stack(
children: [ children: [
ClipOval( ClipOval(
child: GestureDetector(
onTap: () {
var imgList = <String>[];
imgList.add(item.user.avatar);
Get.toNamed(AppRoutes.Swiper,
arguments: {'imaglist': imgList, 'index': 0});
},
child: CachedNetworkImage( child: CachedNetworkImage(
fit: BoxFit.cover, fit: BoxFit.cover,
imageUrl: item.user.avatarThumb, imageUrl: item.user.avatarThumb,
@ -348,7 +341,6 @@ class _LikelistPageState extends State<LikelistPage> with RouteAware {
height: 53.sp, height: 53.sp,
), ),
), ),
),
Positioned( Positioned(
right: 0.sp, right: 0.sp,
left: 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 { getMode() async {
var data = await DioManager.instance.get(url: Api.getUserMine); var data = await DioManager.instance.get(url: Api.getUserMine);
var bean = BaseResponse<MineResponseBean>.fromJson( var bean = BaseResponse<MineResponseBean>.fromJson(
@ -82,21 +91,23 @@ class MinefragmentLogic extends GetxController {
joinedCircle = "${"加入了${bean.data.joininterestcount}"}"; joinedCircle = "${"加入了${bean.data.joininterestcount}"}";
enterHomeInfoMsg = bean.data.mainGuideText; enterHomeInfoMsg = bean.data.mainGuideText;
has_pwd = bean.data.has_pwd; has_pwd = bean.data.has_pwd;
SharedPreferences sharedPreferences = SharedPreferences sharedPreferences =
await SharedPreferences.getInstance(); await SharedPreferences.getInstance();
if(bean.data.user.vip>0){ if(bean.data.user.vip>0){
vipMsg = "会员时长剩余${bean.data.vipExpireDays}"; 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 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); sharedPreferences.setString(SharedPreferencesHelper.PHOTO, bean.data.phone);
like_me_count_new = like_me_count - likeMeCount; like_me_count_new = like_me_count - likeMeCount;
print("***************"); print("***************");
print("$likeMeCount-$like_me_count=$like_me_count_new"); 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(); // like_me_count_new = recentVisitCount.toInt() - bean.data.likeMeCount.toInt();
@ -121,7 +132,7 @@ class MinefragmentLogic extends GetxController {
ageMsg = getAgeCOntent(gender, age, role, orientation); ageMsg = getAgeCOntent(gender, age, role, orientation);
} }
getVisitorMsgData();
update(); update();
} else { } else {
showOKToast(bean.msg); showOKToast(bean.msg);
@ -154,7 +165,7 @@ class User {
double lat; double lat;
String city; String city;
String avatarThumb; String avatarThumb;
String? createTime;
User({ User({
required this.id, required this.id,
required this.has_pwd, required this.has_pwd,
@ -172,6 +183,7 @@ class User {
required this.lat, required this.lat,
required this.city, required this.city,
required this.avatarThumb, required this.avatarThumb,
this.createTime,
}); });
factory User.fromJson(Map<String, dynamic> json) { factory User.fromJson(Map<String, dynamic> json) {
@ -179,6 +191,7 @@ class User {
id: json['id'], id: json['id'],
mark: json['mark'] ?? 0, mark: json['mark'] ?? 0,
has_pwd: json['has_pwd'] ?? false, has_pwd: json['has_pwd'] ?? false,
createTime: json['createTime'] ?? '',
nickname: json['nickname'], nickname: json['nickname'],
avatar: json['avatar'], avatar: json['avatar'],
signature: json['signature'], signature: json['signature'],
@ -202,6 +215,8 @@ class MineResponseBean {
int likeMeCount; int likeMeCount;
int recentVisitCount; int recentVisitCount;
String? vipExpireDate; String? vipExpireDate;
// "createTime" -> "2023-10-09T09:07:20.000+00:00"
String? last_vip_expire_date;
int? vipExpireDays; int? vipExpireDays;
bool? has_pwd; bool? has_pwd;
bool isNewUser; bool isNewUser;
@ -216,6 +231,7 @@ class MineResponseBean {
required this.recentVisitCount, required this.recentVisitCount,
this.vipExpireDate, this.vipExpireDate,
required this.isNewUser, required this.isNewUser,
required this.last_vip_expire_date,
this.vipExpireDays, this.vipExpireDays,
required this.phone, required this.phone,
required this.has_pwd, required this.has_pwd,
@ -226,6 +242,7 @@ class MineResponseBean {
return MineResponseBean( return MineResponseBean(
user: User.fromJson(json['user']), user: User.fromJson(json['user']),
likeCount: json['like_count'], likeCount: json['like_count'],
last_vip_expire_date: json['last_vip_expire_date'] ?? '',
has_pwd: json['has_pwd'], has_pwd: json['has_pwd'],
isNewUser : json['isNewUser'] ?? false, isNewUser : json['isNewUser'] ?? false,
phone: json['phone'], phone: json['phone'],

View File

@ -20,6 +20,7 @@ import '../../common/colors/app_color.dart';
import '../../main.dart'; import '../../main.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../../util/util.dart'; import '../../util/util.dart';
import '../msg/logic.dart';
import 'logic.dart'; import 'logic.dart';
const vipIcon = 'assets/images/home/icon_vip_more.png'; const vipIcon = 'assets/images/home/icon_vip_more.png';
@ -144,7 +145,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
), ),
), ),
if (!logic.isProxy) 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( Positioned(
right: 0.sp, right: 0.sp,
top: 15.sp, top: 6.sp,
child: Text( child: Text(
logic.like_me_count_new>0 ? "+${logic.like_me_count_new}":"", logic.like_me_count_new>0 ? "+${logic.like_me_count_new}":"",
style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), 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) { SharedPreferencesHelper.getInstance().then((sharedPreferences) {
sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, logic.recent_visit_count); sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, logic.recent_visit_count);
}); });
MsgLogic msgLogic = Get.find<MsgLogic>();
msgLogic.updateVisitCount();
Get.toNamed(AppRoutes.VisitorListActivity); Get.toNamed(AppRoutes.VisitorListActivity);
}, },
child: Stack( child: Stack(
@ -725,7 +729,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
), ),
Positioned( Positioned(
right: 0.sp, right: 0.sp,
top: 15.sp, top: 6.sp,
child: Text( child: Text(
logic.recent_visit_count_new>0 ? "+${logic.recent_visit_count_new}":"", logic.recent_visit_count_new>0 ? "+${logic.recent_visit_count_new}":"",
style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)), 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/eventBus.dart';
import '../../../util/util.dart'; import '../../../util/util.dart';
import '../../circle/widgets/discover.dart'; import '../../circle/widgets/discover.dart';
import '../logic.dart';
import '../recommend_circle_friend_item.dart'; import '../recommend_circle_friend_item.dart';
import 'tim_uikit_conversation_item.dart'; import 'tim_uikit_conversation_item.dart';
@ -38,7 +39,7 @@ typedef TIMConversationItemBuilder = Widget Function(
[V2TimUserStatus? onlineStatus]); [V2TimUserStatus? onlineStatus]);
typedef ConversationItemSlideBuilder = List<ConversationItemSlidePanel> typedef ConversationItemSlideBuilder = List<ConversationItemSlidePanel>
Function(V2TimConversation conversationItem); Function(V2TimConversation conversationItem);
typedef ConversationItemSecondaryMenuBuilder = Widget Function( typedef ConversationItemSecondaryMenuBuilder = Widget Function(
V2TimConversation conversationItem, VoidCallback onClose); V2TimConversation conversationItem, VoidCallback onClose);
@ -84,8 +85,7 @@ class TIMConversation extends StatefulWidget {
/// to meet the identifier shows here. /// to meet the identifier shows here.
final bool isShowDraft; final bool isShowDraft;
const TIMConversation( const TIMConversation({Key? key,
{Key? key,
this.lifeCycle, this.lifeCycle,
this.onTapItem, this.onTapItem,
this.controller, this.controller,
@ -118,7 +118,8 @@ class ConversationItemSlidePanel extends TIMUIKitStatelessWidget {
this.icon, this.icon,
this.spacing = 4, this.spacing = 4,
this.label, this.label,
}) : assert(flex > 0), })
: assert(flex > 0),
assert(icon != null || label != null), assert(icon != null || label != null),
super(key: key); super(key: key);
@ -163,10 +164,12 @@ class ConversationItemSlidePanel extends TIMUIKitStatelessWidget {
} }
class _TIMConversationState extends TIMUIKitState<TIMConversation> { class _TIMConversationState extends TIMUIKitState<TIMConversation> {
MsgLogic logic = Get.find<MsgLogic>();
final TUIConversationViewModel model = final TUIConversationViewModel model =
serviceLocator<TUIConversationViewModel>(); serviceLocator<TUIConversationViewModel>();
late TIMUIKitConversationController _timuiKitConversationController; late TIMUIKitConversationController _timuiKitConversationController;
final TUIThemeViewModel themeViewModel = serviceLocator<TUIThemeViewModel>(); final TUIThemeViewModel themeViewModel = serviceLocator<TUIThemeViewModel>();
// final TUIFriendShipViewModel friendShipViewModel = // final TUIFriendShipViewModel friendShipViewModel =
// serviceLocator<TUIFriendShipViewModel>(); // serviceLocator<TUIFriendShipViewModel>();
bool hasMore = true; bool hasMore = true;
@ -174,6 +177,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
List<String> chatImIdList = []; List<String> chatImIdList = [];
Map recommendCircleFriendData = {}; Map recommendCircleFriendData = {};
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -276,8 +280,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
} }
} }
Widget _defaultSecondaryMenu( Widget _defaultSecondaryMenu(V2TimConversation conversationItem,
V2TimConversation conversationItem, VoidCallback onClose) { VoidCallback onClose) {
return TUIKitColumnMenu(data: [ return TUIKitColumnMenu(data: [
if (!PlatformUtils().isWeb) if (!PlatformUtils().isWeb)
ColumnMenuItem( ColumnMenuItem(
@ -309,8 +313,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
} }
List<ConversationItemSlidePanel> _defaultSlideBuilder( List<ConversationItemSlidePanel> _defaultSlideBuilder(
V2TimConversation conversationItem, V2TimConversation conversationItem,) {
) {
final theme = themeViewModel.theme; final theme = themeViewModel.theme;
return [ return [
if (!PlatformUtils().isWeb) if (!PlatformUtils().isWeb)
@ -346,8 +349,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
]; ];
} }
Widget _getSecondaryMenu( Widget _getSecondaryMenu(V2TimConversation conversation,
V2TimConversation conversation, VoidCallback onClose) { VoidCallback onClose) {
if (widget.itemSecondaryMenuBuilder != null) { if (widget.itemSecondaryMenuBuilder != null) {
return widget.itemSecondaryMenuBuilder!(conversation, onClose); return widget.itemSecondaryMenuBuilder!(conversation, onClose);
} }
@ -360,7 +363,6 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
Future<List<V2TimUserFullInfo>> getUserListInfo( Future<List<V2TimUserFullInfo>> getUserListInfo(
List<String> userIdList) async { List<String> userIdList) async {
V2TimValueCallback<String> getLoginUserRes = V2TimValueCallback<String> getLoginUserRes =
await TencentImSDKPlugin.v2TIMManager.getLoginUser(); await TencentImSDKPlugin.v2TIMManager.getLoginUser();
if (getLoginUserRes.code == 0) { if (getLoginUserRes.code == 0) {
@ -378,18 +380,20 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
if (count > size) { if (count > size) {
for (int i = 0; i <= size; i++) { 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); list.addAll(dataList);
} }
} else { } else {
for (int i = 0; i < size; i++) { 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); list.addAll(dataList);
} }
} }
return list; return list;
} else { } else {
// //
V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes = V2TimValueCallback<List<V2TimUserFullInfo>> getUsersInfoRes =
await TencentImSDKPlugin.v2TIMManager await TencentImSDKPlugin.v2TIMManager
@ -482,13 +486,16 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
return ListView.builder( return ListView.builder(
controller: widget.scrollController!, controller: widget.scrollController!,
// shrinkWrap: true, // shrinkWrap: true,
itemCount: recommendCircleFriendData.isNotEmpty && filteredConversationList.length < 15 itemCount: recommendCircleFriendData.isNotEmpty &&
filteredConversationList.length < 15
? filteredConversationList.length + 1 ? filteredConversationList.length + 1
: filteredConversationList.length, : filteredConversationList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index == filteredConversationList.length) { if (index == filteredConversationList.length) {
return recommendCircleFriendData.isNotEmpty return recommendCircleFriendData.isNotEmpty
? RecommendCircleFriendItem(true,recommendCircleFriendData: recommendCircleFriendData,getDataCallBack: () { ? RecommendCircleFriendItem(true,15.sp,
recommendCircleFriendData: recommendCircleFriendData,
getDataCallBack: () {
loadRecommendCircleFriendData(); loadRecommendCircleFriendData();
}) })
: Container(); : Container();
@ -586,7 +593,7 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
color: Colors.transparent, color: Colors.transparent,
child: InkWell( child: InkWell(
child: TIMConversationItem( child: TIMConversationItem(
mark:mark, mark: mark,
isSameCity: isSameCity, isSameCity: isSameCity,
isOfficial: isOfficial, isOfficial: isOfficial,
isCurrent: isCurrent, 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( desktopWidget: AutoScrollTag(
key: key:
ValueKey(conversationItem.conversationID), ValueKey(conversationItem.conversationID),
@ -639,17 +704,74 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
offset: Offset( offset: Offset(
min( min(
details.globalPosition.dx, details.globalPosition.dx,
MediaQuery.of(context) MediaQuery
.of(context)
.size .size
.width - .width -
80), 80),
min( min(
details.globalPosition.dy, details.globalPosition.dy,
MediaQuery.of(context) MediaQuery
.of(context)
.size .size
.height - .height -
130)), 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)); conversationItem, onClose));
}, },
child: conversationLineItem(), child: conversationLineItem(),
@ -771,7 +893,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
color: Colors.white, color: Colors.white,
shadows: [ shadows: [
Shadow( 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, // 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( child: Column(
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Get.toNamed(AppRoutes.UserInfoActivity,arguments: user.userId.toString()); Get.toNamed(AppRoutes.UserInfoActivity,
arguments: user.userId.toString());
}, },
child: Container( child: Container(
child: Row( child: Row(
@ -859,18 +983,25 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
), ),
SizedBox(width: 8.sp,), SizedBox(width: 8.sp,),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment
.start,
children: [ children: [
ShaderMask( ShaderMask(
shaderCallback: (Rect bounds) { shaderCallback: (Rect bounds) {
return const LinearGradient( return const LinearGradient(
begin: Alignment.centerRight, begin: Alignment.centerRight,
end: Alignment.centerLeft, end: Alignment.centerLeft,
colors: [Color(0xff71F3F2), Color(0xffF657FF)], colors: [
).createShader(Offset.zero & bounds.size); Color(0xff71F3F2),
Color(0xffF657FF)
],
).createShader(
Offset.zero & bounds.size);
}, },
child: Text( child: Text(
'匹配度' + (recommendCircleFriendData['recommend_score'].toString() ?? '') + '%', '匹配度' +
(recommendCircleFriendData['recommend_score']
.toString() ?? '') + '%',
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -888,9 +1019,11 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
alignment: Alignment.center, alignment: Alignment.center,
height: 18.sp, height: 18.sp,
padding: padding:
EdgeInsets.only(left: 6.sp, right: 6.sp), EdgeInsets.only(
left: 6.sp, right: 6.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(9.sp), borderRadius: BorderRadius.circular(
9.sp),
gradient: const LinearGradient( gradient: const LinearGradient(
begin: Alignment(0.25, 0.5), begin: Alignment(0.25, 0.5),
end: Alignment(0.75, 0.5), end: Alignment(0.75, 0.5),
@ -917,7 +1050,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
), ),
child: Image.asset( child: Image.asset(
getCircleImage( getCircleImage(
user.vip == 1 ? 'vip' : 'year_vip'), user.vip == 1
? 'vip'
: 'year_vip'),
width: 36.sp, width: 36.sp,
), ),
), ),
@ -927,15 +1062,19 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
)), )),
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
if (!chatImIdList.contains(user.userId.toString())) { if (!chatImIdList.contains(
await createCustomMsg(user.userId.toString(), recommendCircleFriendData['user']['imId']); 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( child: Container(
height: 25.sp, height: 25.sp,
padding: EdgeInsets.only(left: 6.sp,right: 6.sp), padding: EdgeInsets.only(left: 6.sp, right: 6.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: AppColor.mainVerLinearGradient, gradient: AppColor.mainVerLinearGradient,
borderRadius: BorderRadius.circular(12.5.sp)), borderRadius: BorderRadius.circular(12.5.sp)),
@ -982,7 +1121,9 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
), ),
), ),
if (info.containsKey('city')) if (info.containsKey('city'))
info['city'].toString().isNotEmpty info['city']
.toString()
.isNotEmpty
? Container( ? Container(
margin: EdgeInsets.only(top: 10.sp), margin: EdgeInsets.only(top: 10.sp),
child: Row( child: Row(
@ -1073,11 +1214,13 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
if (circleList.isNotEmpty) if (circleList.isNotEmpty)
Container( Container(
height: 72.sp, height: 72.sp,
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp), margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
width: Get.width, width: Get.width,
child: ListView.builder(itemBuilder: (context,index) { child: ListView.builder(itemBuilder: (context, index) {
return circleInfoItem(circleList[index], 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( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only(left: 8.sp, ), padding: EdgeInsets.only(left: 8.sp,),
// alignment: Alignment., // alignment: Alignment.,
height: 72.sp, height: 72.sp,
child: Column( child: Column(
@ -1186,8 +1329,8 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
setState(() {}); setState(() {});
} }
} else { } else {
if ((data['code'] == 21201 || data['code'] == 21202) &&
if ((data['code'] == 21201 || data['code'] == 21202) && recommendCircleFriendData.isNotEmpty) { recommendCircleFriendData.isNotEmpty) {
showOKToast(data['msg']); showOKToast(data['msg']);
showVipDialog(); showVipDialog();
} }

View File

@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.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 '../../common/Widgets/base_tip_widget.dart';
import '../../util/SharedPreferencesHelper.dart'; import '../../util/SharedPreferencesHelper.dart';
import '../circle/logic.dart'; import '../circle/logic.dart';
@ -22,6 +23,9 @@ class MsgLogic extends GetxController {
int total = 0; int total = 0;
bool isStart = false; bool isStart = false;
String tip = '';
int recent_visit_count_new = 0;
@override @override
void onInit() { void onInit() {
@ -31,6 +35,7 @@ class MsgLogic extends GetxController {
loadChatData(); loadChatData();
loadLikeData(); loadLikeData();
loadStatusData(); loadStatusData();
getMode();
} }
loadData() { loadData() {
@ -54,6 +59,33 @@ class MsgLogic extends GetxController {
update(); 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 { void loadChatData() async {
var data = var data =
await DioManager.instance.post(url: Api.recommendQuickChatUser, params: { await DioManager.instance.post(url: Api.recommendQuickChatUser, params: {
@ -63,6 +95,8 @@ class MsgLogic extends GetxController {
if (data['code'] == 200) { if (data['code'] == 200) {
total = data['data']['total']; total = data['data']['total'];
chatList = data['data']['lists']; chatList = data['data']['lists'];
} else if (data['code'] == 404) {
showOKToast('网络不流畅哦,请检查网络情况');
} }
// vicinityList = bean.data.lists; // 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 { Future<bool> queryQuickStart() async {
var data = var data =
await DioManager.getInstance().get(url: Api.queryQuickStart); await DioManager.getInstance().get(url: Api.queryQuickStart);

View File

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

View File

@ -15,6 +15,7 @@ import '../../util/util.dart';
import '../circle/logic.dart'; import '../circle/logic.dart';
import '../userinfo/logic.dart'; import '../userinfo/logic.dart';
import 'logic.dart'; import 'logic.dart';
import 'dart:ui' as ui show PlaceholderAlignment;
class QuickPage extends StatelessWidget { class QuickPage extends StatelessWidget {
QuickPage({Key? key}) : super(key: key); QuickPage({Key? key}) : super(key: key);
@ -316,13 +317,42 @@ class QuickPage extends StatelessWidget {
child: Align( child: Align(
alignment: Alignment.centerLeft, // alignment: Alignment.centerLeft, //
child: Text( child: RichText(
item.signature ?? '暂时还没有签名哦~',
maxLines: 2,
style:
TextStyle(color: Colors.white, fontSize: 18.sp),
overflow: TextOverflow.ellipsis, 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) if (item.interests.isNotEmpty)
@ -427,20 +457,13 @@ class QuickPage extends StatelessWidget {
margin: EdgeInsets.only(right: 11.sp), margin: EdgeInsets.only(right: 11.sp),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(17.0), borderRadius: BorderRadius.circular(17.0),
gradient: const LinearGradient( border: GradientBoxBorder(
colors: [ gradient:
Color(0xFF06F9FA), AppColor.mainVerLinearGradient,
Color(0xFFDC5BFD), width: 0.5.sp,
],
), ),
color: const Color(0xFF392D53), 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( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 2.sp, top: 2.sp,
@ -460,7 +483,6 @@ class QuickPage extends StatelessWidget {
), ),
), ),
), ),
),
], ],
), ),
), ),

View File

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

View File

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

View File

@ -322,15 +322,6 @@ class VisitorlistPage extends StatelessWidget {
Stack( Stack(
children: [ children: [
ClipOval( 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( child: CachedNetworkImage(
fit: BoxFit.cover, fit: BoxFit.cover,
imageUrl: item.user.avatarThumb, imageUrl: item.user.avatarThumb,
@ -338,7 +329,6 @@ class VisitorlistPage extends StatelessWidget {
height: 53.sp, height: 53.sp,
), ),
), ),
),
Positioned( Positioned(
right: 0.sp, right: 0.sp,
left: 0.sp, left: 0.sp,

View File

@ -21,6 +21,7 @@ class World_call_outLogic extends GetxController {
bool isLoad = true; bool isLoad = true;
List<WorldLists> lists = []; List<WorldLists> lists = [];
List<String> wantMeet = []; List<String> wantMeet = [];
List openCallOutIdList = [];
int index = 1; int index = 1;
int total = 0; int total = 0;
@ -123,6 +124,7 @@ class World_call_outLogic extends GetxController {
if (tempLists.isNotEmpty) { if (tempLists.isNotEmpty) {
isLoad = false; isLoad = false;
if (index == 1) { if (index == 1) {
refreshController.refreshCompleted();
lists = tempLists; lists = tempLists;
} else { } else {
@ -139,6 +141,7 @@ class World_call_outLogic extends GetxController {
update(); update();
} else if (bean1.code == 404) { } else if (bean1.code == 404) {
showOKToast('网络不流畅哦,请检查网络情况');
loadFail = true; loadFail = true;
update(); 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/circle_share.dart';
import '../../common/Widgets/tag_widget.dart'; import '../../common/Widgets/tag_widget.dart';
import '../../common/Widgets/text_more.dart';
import '../../common/colors/app_color.dart'; import '../../common/colors/app_color.dart';
import '../../router/app_routers.dart'; import '../../router/app_routers.dart';
import '../circle/widgets/video_item.dart'; import '../circle/widgets/video_item.dart';
@ -152,8 +153,19 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
onLoading: () { onLoading: () {
logic.loadMore(); logic.loadMore();
}, },
onRefresh: () {
logic.isNewMsg = false;
logic.index = 1;
logic.lists.clear();
logic.update();
logic.loadData();
},
enablePullUp: true, enablePullUp: true,
enablePullDown: true,
child:logic.loadFail ? noResultWidget(tip: '',callBack: () { child:logic.loadFail ? noResultWidget(tip: '',callBack: () {
logic.loadFail = false;
logic.isMore = true;
logic.update();
logic.initGerder(); logic.initGerder();
logic.loadData(); logic.loadData();
}) : logic.lists.isEmpty }) : 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 return picHeight > 0
? Container( ? Container(
height: picHeight, height: picHeight,
alignment: Alignment.centerLeft, alignment: Alignment.topLeft,
margin: EdgeInsets.only(left: 10.sp, right: 10.sp), margin: EdgeInsets.only(left: 10.sp, right: 10.sp,bottom: 5.sp),
child: picHeight == 200.sp child: picHeight == 200.sp
? ClipRRect( ? VideoItemWidget(list.album![0].url!)
borderRadius: BorderRadius.circular(6.sp),
child: VideoItemWidget(list.album![0].url!))
: GridView.builder( : GridView.builder(
itemCount: list.album!.length, itemCount: list.album!.length,
physics: const NeverScrollableScrollPhysics(), 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( return Container(
margin: EdgeInsets.only(top: 20.sp), margin: EdgeInsets.only(top: 10.sp,bottom:10.sp),
// alignment: index % 2 == 0 ? Alignment.centerRight : Alignment.centerLeft,
width: Get.width, width: Get.width,
padding: EdgeInsets.only(left: 5.sp, right: 5.sp), padding: EdgeInsets.only(left: 5.sp, right: 5.sp),
// height: widgetAllHeight + wordsHeight, // height: widgetAllHeight + wordsHeight,
@ -795,7 +657,8 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 10.sp, bottom: 10.sp, left: 10.sp, right: 10.sp), top: 10.sp, bottom: 10.sp, left: 10.sp, right: 10.sp),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text.rich(TextSpan(children: <InlineSpan>[ child:
(list!.isQueen!) ? Text.rich(TextSpan(children: <InlineSpan>[
if (list!.isQueen!) if (list!.isQueen!)
WidgetSpan( WidgetSpan(
child: Container( child: Container(
@ -825,11 +688,14 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
), ),
)), )),
), ),
// WidgetSpan(
// child:descText)
TextSpan( TextSpan(
text: list.content!, text: list.content!,
style: TextStyle( style: TextStyle(
color: Color(0xFFF7FAFA), fontSize: 14.sp)), color: Color(0xFFF7FAFA), fontSize: 14.sp)),
])), ])
) : descText,
), ),
if (picHeight > 0) picOrVideoItem(picHeight, list), if (picHeight > 0) picOrVideoItem(picHeight, list),
circleInfoItem(list) circleInfoItem(list)
@ -1035,6 +901,7 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
) )
], ],
), ),
if (isSelf) if (isSelf)
GestureDetector( GestureDetector(
onTap: () { onTap: () {

View File

@ -116,19 +116,18 @@ class _AddWxTipState extends State<AddWxTip> {
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
if (widget.isHidden) { if (widget.isHidden) {
var result = await DioManager()
var result = await DioManager().post( .post(url: Api.confset, params: {
url: Api.confset ,params: {'hideContact':widget.isWxHidden ? 0 : 1} 'hideContact': widget.isWxHidden ? 0 : 1
); });
if (result['code'] == 200) { if (result['code'] == 200) {
showOKToast('操作成功'); showOKToast('操作成功');
} }
Get.back(); Get.back();
} else { } else {
showOKToast('为了维护站内的社交环境,联系信息填写必须真实哦~'); showOKToast('为了维护站内的社交环境,联系信息填写必须真实哦~');
Get.back();
showUpdateWxPicker(phone: '1'); showUpdateWxPicker(phone: '1');
} }
}, },
child: Container( child: Container(
@ -168,7 +167,9 @@ class _AddWxTipState extends State<AddWxTip> {
borderRadius: borderRadius:
BorderRadius.circular(4.sp)), BorderRadius.circular(4.sp)),
child: Text( child: Text(
widget.isHaveWx ? ' 更新联系方式 ':' 填写联系方式 ', widget.isHaveWx
? ' 更新联系方式 '
: ' 填写联系方式 ',
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 14.sp), 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:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../app/minefragment/logic.dart';
import '../../../network/api.dart'; import '../../../network/api.dart';
import '../../../network/dio_manager.dart'; import '../../../network/dio_manager.dart';
import '../../../util/PaymentUtils.dart'; import '../../../util/PaymentUtils.dart';
@ -16,12 +17,24 @@ class Open_vip_tipLogic extends GetxController {
bool isYean = false; bool isYean = false;
bool isShowInviteTip = false; bool isShowInviteTip = false;
bool isVip = false;
@override @override
void onInit() { void onInit() {
super.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 { loadData() async {
var data = await DioManager.instance.get(url: Api.getVipPrice, params: {}); 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; final state = Get.find<Open_vip_tipLogic>().state;
bool isVip = false;
Map<String,String> vipImgMap = { Map<String,String> vipImgMap = {
"身份标识" : 'vip_fun_1', "身份标识" : 'vip_fun_1',
"专属客服": 'vip_fun_2', "专属客服": 'vip_fun_2',
@ -53,22 +51,10 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
logic.loadData(); logic.loadData();
logic.getMode();
logic.isShowInvite(); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List vipFuncList = [ List vipFuncList = [
@ -299,7 +285,7 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
Color(0xffD739EA) Color(0xffD739EA)
])), ])),
child: Text( child: Text(
isVip ? '续费特权' : '领取特权', logic.isVip ? '续费特权' : '领取特权',
style: style:
TextStyle(color: Colors.white, fontSize: 16.sp), TextStyle(color: Colors.white, fontSize: 16.sp),
), ),

View File

@ -7,6 +7,8 @@ class AppColor {
static Color bgColor = Color(0xFF120D29); static Color bgColor = Color(0xFF120D29);
static Color mainBgColor = Color(0XFF392D53); static Color mainBgColor = Color(0XFF392D53);
static Color cityBgColor = Color.fromRGBO(52, 41, 67, 1);
static Gradient mainVerLinearGradient = const LinearGradient( static Gradient mainVerLinearGradient = const LinearGradient(
colors: [ colors: [
Color(0xFF06F9FA), Color(0xFF06F9FA),
@ -54,5 +56,14 @@ class AppColor {
end: Alignment.centerRight, 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 //mine
static const getUserMine = 'user-service/my/main'; static const getUserMine = 'user-service/my/main';
//
static const activeUsers = '/user-service/follow/activeUsers';
//访
static const getVisitorMsg = '/user-service/visit/getVisitorMsg';
//vip弹窗 //vip弹窗
static const getIsVips = 'mall-service/vips/show/'; static const getIsVips = 'mall-service/vips/show/';
@ -99,6 +105,15 @@ class Api {
// //
static const setBlock = 'user-service/user/'; 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/'; static const setLike = 'user-service/user/';
@ -238,7 +253,7 @@ class Api {
static const UnlockWx = 'user-service/wxNum/unlock'; 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'; static const updateWxNum = 'user-service/updateWxNum';
@ -422,4 +437,7 @@ class Api {
// //
static const categoriesList = '/up-service/interest/categories'; static const categoriesList = '/up-service/interest/categories';
//good认证发送
static const goodAuth = '/user-service/user/goodAuth';
} }

View File

@ -43,9 +43,9 @@ class DioManager {
// baseUrl2 // baseUrl2
baseUrl: baseUrl:
// Api.baseUrl2, // Api.baseUrl2,
Api.baseUrl, // Api.baseUrl,
// type == 1 ? Api.baseUrl2 : Api.baseUrl1, type == 1 ? Api.baseUrl2 : Api.baseUrl1,
// //
connectTimeout: const Duration(seconds: 30), connectTimeout: const Duration(seconds: 30),
// //
@ -197,7 +197,7 @@ class DioManager {
var connectivityResult = await Connectivity().checkConnectivity(); var connectivityResult = await Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) { if (connectivityResult == ConnectivityResult.none) {
// showToast(""); // showOKToast("网络不流畅哦,请检查网络情况");
return {'code': 404, 'msg': '网络不流畅哦,请检查网络情况'}; return {'code': 404, 'msg': '网络不流畅哦,请检查网络情况'};
} }
@ -285,7 +285,7 @@ class DioManager {
pushLoginPage(); pushLoginPage();
break; 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']); showOKToast(responseMap['msg']);
} }
} }
@ -295,20 +295,13 @@ class DioManager {
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
return {'code': 500, 'msg': ''}; 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': '服务器开小差了,请重试'}; return {'code': 500, 'msg': '服务器开小差了,请重试'};
} catch (e) { } catch (e) {
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance(); SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') { if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
return {'code': 500, 'msg': ''}; return {'code': 500, 'msg': ''};
} }
// //
return {'code': 500, 'msg': '加载中...'}; return {'code': 500, 'msg': '加载中...'};
} }

View File

@ -86,7 +86,7 @@ showOKToast(String msg) {
msg, msg,
duration: Duration(seconds: msg.length > 15 ? 5 : msg.length > 10 ? 3 : 2), duration: Duration(seconds: msg.length > 15 ? 5 : msg.length > 10 ? 3 : 2),
position: ToastPosition.center, position: ToastPosition.center,
backgroundColor: Colors.black.withOpacity(0.8), backgroundColor: Colors.black,
radius: 13.0, radius: 13.0,
textStyle: const TextStyle(fontSize: 16.0,color: Colors.white), 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 GOOD_RATE = "good_rate";//
// public final static String BUY_VIP = "buy_vip";// // public final static String BUY_VIP = "buy_vip";//
// public final static String RECHARGE = "recharge";// // 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') { if (action == 'my_main') {
Get.until((route) => route.settings.name == '/home'); Get.until((route) => route.settings.name == '/home');
final homeLogic = Get.put(HomeLogic()); 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); conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
} }
Get.toNamed(AppRoutes.Chat, arguments: con); 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 { Future<Position> getCurrentPosition() async {
return await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.low); return await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);