2.1.2代码提交
This commit is contained in:
parent
e8b365d421
commit
3e44662d84
@ -71,8 +71,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 62
|
||||
versionName "2.1.2"
|
||||
versionCode 63
|
||||
versionName "2.1.3"
|
||||
manifestPlaceholders = [
|
||||
vivo_APPID: "105669716",
|
||||
vivo_APPKEY:"84f750207787376b310ca5b0d5969122",
|
||||
|
||||
@ -383,7 +383,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.1;
|
||||
MARKETING_VERSION = 2.1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -534,7 +534,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.1;
|
||||
MARKETING_VERSION = 2.1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -579,7 +579,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.1;
|
||||
MARKETING_VERSION = 2.1.1;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.kyApp;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
||||
@ -117,48 +117,59 @@ class _Call_outPageState extends State<Call_outPage> {
|
||||
padding: EdgeInsets.only(top: 15.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 100.sp,
|
||||
child: TextField(
|
||||
controller:
|
||||
controller.textEditingController,
|
||||
onChanged: (value) {
|
||||
controller.update();
|
||||
},
|
||||
onTap: () {
|
||||
isShowKeyboard = true;
|
||||
setState(() {});
|
||||
},
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 17.0.sp),
|
||||
maxLines: 32,
|
||||
maxLength: 200,
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
color: const Color.fromRGBO(
|
||||
255, 255, 255, 0.6),
|
||||
fontSize: 14.sp),
|
||||
hintText: '请输入...(左下角上传图片或视频哦)',
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 17.sp, right: 17.sp),
|
||||
counter: const Text('')),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 150.sp,
|
||||
child: TextField(
|
||||
controller:
|
||||
controller.textEditingController,
|
||||
onChanged: (value) {
|
||||
controller.update();
|
||||
},
|
||||
onTap: () {
|
||||
isShowKeyboard = true;
|
||||
setState(() {});
|
||||
},
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 17.0.sp),
|
||||
maxLines: 32,
|
||||
maxLength: 200,
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
color: const Color.fromRGBO(
|
||||
255, 255, 255, 0.6),
|
||||
fontSize: 14.sp),
|
||||
hintText: '请输入...(左下角上传图片或视频哦)',
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(
|
||||
left: 17.sp, right: 17.sp),
|
||||
counter: const Text('')),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: Container()),
|
||||
Text(
|
||||
'${controller.textEditingController.text.length}/200',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
SizedBox(width: 15.sp,)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
right: 15.sp,
|
||||
top: 100.sp,
|
||||
child: Text(
|
||||
'${controller.textEditingController.text.length}/200',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)),
|
||||
// Positioned(
|
||||
// right: 15.sp,
|
||||
// top: 100.sp,
|
||||
// child:),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 130.sp),
|
||||
margin: EdgeInsets.only(top: 180.sp),
|
||||
child: _imageAdapter(controller)),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 130.sp, left: 15.sp, right: 15.sp),
|
||||
top: 180.sp, left: 15.sp, right: 15.sp),
|
||||
child: _showVideo(controller),
|
||||
)
|
||||
],
|
||||
@ -440,8 +451,8 @@ class _Call_outPageState extends State<Call_outPage> {
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: 0,
|
||||
top: 5,
|
||||
right: 5,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// showToast("删除");
|
||||
|
||||
@ -1141,7 +1141,7 @@ class _TIMTextFieldLayoutNarrowState
|
||||
}
|
||||
|
||||
if (!isVip) {
|
||||
showOKToast(plate== 5 ? '开通会员之后才能发送语音' : '开通会员之后才能发送图片');
|
||||
showOKToast(plate== 5 ? '开通会员之后才能发送语音' : (plate == 1 || plate == 3) ? '开通会员之后才能发送图片' : '开通会员之后才能发送视频');
|
||||
Get.bottomSheet(
|
||||
Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
|
||||
@ -475,6 +475,8 @@ class CircleLogic extends GetxController {
|
||||
myVip = 0;
|
||||
refreshController.loadComplete();
|
||||
update();
|
||||
} else if (bean.code == 404) {
|
||||
showOKToast(bean.msg);
|
||||
}
|
||||
update();
|
||||
}
|
||||
@ -522,7 +524,7 @@ class CircleLogic extends GetxController {
|
||||
if (list.isNotEmpty) {
|
||||
peopleRefreshController.refreshCompleted();
|
||||
peopleRefreshController.loadComplete();
|
||||
|
||||
// "signature" -> "/////////////////"
|
||||
List info = [];
|
||||
list.forEach((element) {
|
||||
bool isContain = false;
|
||||
@ -546,6 +548,7 @@ class CircleLogic extends GetxController {
|
||||
update();
|
||||
} else if (data['code'] == 404) {
|
||||
isLoadFail = true;
|
||||
showOKToast('网络不流畅哦,请检查网络情况');
|
||||
update();
|
||||
} else {
|
||||
isNewPeopleMore = false;
|
||||
|
||||
@ -108,9 +108,8 @@ class _CirclePageState extends State<CirclePage>
|
||||
child: Stack(
|
||||
children: [
|
||||
Column(children: [
|
||||
Obx(() {
|
||||
return navigatorItem(controller.statistics.value);
|
||||
}),
|
||||
navigatorItem(controller.statistics.value)
|
||||
,
|
||||
// Text(controller.state.msg),
|
||||
//组件使用
|
||||
]),
|
||||
|
||||
@ -25,6 +25,8 @@ import '../../../../util/eventBus.dart';
|
||||
import '../../chat/widget/chat_gift_pannel.dart';
|
||||
import '../../home/logic.dart';
|
||||
|
||||
import 'dart:ui' as ui show PlaceholderAlignment;
|
||||
|
||||
const String todayAddWxStatus = 'todayAddWxStatus';
|
||||
|
||||
class Discover extends StatefulWidget {
|
||||
@ -262,6 +264,7 @@ class _DiscoverState extends State<Discover>
|
||||
} else {
|
||||
loadFail = true;
|
||||
isMore = false;
|
||||
showOKToast(data['msg']);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
@ -295,6 +298,11 @@ class _DiscoverState extends State<Discover>
|
||||
|
||||
return list.isEmpty
|
||||
? loadFail ? noResultWidget(tip: '',callBack: () {
|
||||
isMore = true;
|
||||
loadFail = false;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
refreshData();
|
||||
}) : isMore
|
||||
? loaddingWidget(true)
|
||||
@ -989,13 +997,42 @@ class _FeaturedItemState extends State<FeaturedItem> {
|
||||
Container(
|
||||
width: Get.width - 120.sp,
|
||||
margin: EdgeInsets.only(top: 15.sp, bottom: 15.sp),
|
||||
child: Text(
|
||||
user.signature! ?? '',
|
||||
child: RichText(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: (user.signature! ?? '').length > 15 ? 2 : 1,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp, color: const Color(0XFFF7FAFA)),
|
||||
),
|
||||
maxLines: 2,
|
||||
text: TextSpan(
|
||||
children: [
|
||||
WidgetSpan(
|
||||
alignment: ui.PlaceholderAlignment.middle,
|
||||
// alignment: Rect.fromCenter(center: center, width: width, height: height),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 2.sp,),
|
||||
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
|
||||
height: 20.sp,
|
||||
width: user.city!.length > 4 ? 70.sp : user.city!.contains('km') ? user.city!.length * 13.sp : user.city!.length * 20.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
color: AppColor.cityBgColor,
|
||||
),
|
||||
child: Text(
|
||||
user.city!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: user.signature!,
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,)),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
Container(
|
||||
width: Get.width - 110.sp,
|
||||
@ -1096,34 +1133,26 @@ class _FeaturedItemState extends State<FeaturedItem> {
|
||||
margin: EdgeInsets.only(right: 6.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
border: GradientBoxBorder(
|
||||
gradient:
|
||||
AppColor.mainVerLinearGradient,
|
||||
width: 0.5.sp,
|
||||
),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(0.2.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 10.sp,
|
||||
right: 10.sp,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 10.sp,
|
||||
right: 10.sp,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
tagName,
|
||||
style: const TextStyle(
|
||||
fontSize: 11.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
tagName,
|
||||
style: const TextStyle(
|
||||
fontSize: 11.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -733,12 +733,12 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
}
|
||||
}
|
||||
|
||||
double widgetHeight = 130.sp + contentHeight(lists.content!) + picHeight;
|
||||
// double widgetHeight = 130.sp + contentHeight(lists.content!) + picHeight;
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
width: Get.width,
|
||||
height: widgetHeight,
|
||||
// height: widgetHeight,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -778,7 +778,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: widgetHeight,
|
||||
// height: widgetHeight,
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
|
||||
child: Column(
|
||||
@ -946,7 +946,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
Container(
|
||||
height: 30.sp,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 10.sp),
|
||||
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 5.sp),
|
||||
margin: EdgeInsets.only(top: picHeight > 0 ? 5.sp : 5.sp,bottom: 10.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15.sp),
|
||||
color: Color(0x33000000)
|
||||
@ -1643,6 +1643,7 @@ class InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClien
|
||||
// logic.update();
|
||||
|
||||
}else if(data['code'] == 404){
|
||||
|
||||
var logic = Get.put(CircleLogic());
|
||||
logic.circle.lists.removeAt(logic.state.index);
|
||||
logic.update();
|
||||
|
||||
@ -42,6 +42,8 @@ class _LikeViewState extends State<LikeView>
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
final ScrollController moreScrollController = ScrollController();
|
||||
final RefreshController refreshController = RefreshController();
|
||||
CircleLogic logic = Get.find<CircleLogic>();
|
||||
|
||||
@ -56,6 +58,7 @@ class _LikeViewState extends State<LikeView>
|
||||
var circleId = '';
|
||||
List<Lists> lists = [];
|
||||
List<Lists> recomanddlists = [];
|
||||
List peopleList = [];
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@ -65,7 +68,7 @@ class _LikeViewState extends State<LikeView>
|
||||
// EventBusManager.cancelSubscription(scroToTop!);
|
||||
// }
|
||||
EventBusManager.cancelSubscription(likeRefreshSub!);
|
||||
|
||||
moreScrollController.dispose();
|
||||
scrollController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@ -78,7 +81,7 @@ class _LikeViewState extends State<LikeView>
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
loadActiveUsersData();
|
||||
loadLikeListData();
|
||||
loadRecomdistData();
|
||||
|
||||
@ -92,6 +95,23 @@ class _LikeViewState extends State<LikeView>
|
||||
likeRefreshSub = EventBusManager.on<LikeRefresh>().listen((event) {
|
||||
refreshData();
|
||||
});
|
||||
moreScrollController.addListener(() {
|
||||
if (moreScrollController.position.maxScrollExtent == moreScrollController.offset) {
|
||||
Get.toNamed(AppRoutes.FriendsActivity,arguments: 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadActiveUsersData() async {
|
||||
// if (likeMore) {
|
||||
var data = await DioManager.instance.get(
|
||||
url: Api.activeUsers);
|
||||
if (data["code"] == 200) {
|
||||
peopleList = data['data'];
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
loadLikeListData() async {
|
||||
@ -190,6 +210,7 @@ class _LikeViewState extends State<LikeView>
|
||||
likeMore = true;
|
||||
recomandMore = true;
|
||||
refreshController.resetNoData();
|
||||
loadActiveUsersData();
|
||||
loadLikeListData();
|
||||
loadRecomdistData();
|
||||
}
|
||||
@ -350,6 +371,7 @@ class _LikeViewState extends State<LikeView>
|
||||
if (list.isQueen!) {
|
||||
return Column(
|
||||
children: [
|
||||
|
||||
vipDynamicItem(list),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
@ -377,6 +399,7 @@ class _LikeViewState extends State<LikeView>
|
||||
} else {
|
||||
return Column(
|
||||
children: [
|
||||
|
||||
normalDynamicItem(list),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
@ -418,9 +441,18 @@ class _LikeViewState extends State<LikeView>
|
||||
}
|
||||
}
|
||||
if (list.isQueen!) {
|
||||
return vipDynamicItem(list);
|
||||
return Column(
|
||||
children: [
|
||||
if (index == 0 && peopleList.length > 2)
|
||||
morePeoleListWidget(),
|
||||
vipDynamicItem(list)
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return normalDynamicItem(list);
|
||||
return Column(
|
||||
children: [
|
||||
if (index == 0 && peopleList.isNotEmpty)
|
||||
morePeoleListWidget(),normalDynamicItem(list)]);
|
||||
}
|
||||
} else if (lists.length == index &&
|
||||
recomanddlists.isNotEmpty) {
|
||||
@ -483,83 +515,146 @@ class _LikeViewState extends State<LikeView>
|
||||
);
|
||||
}
|
||||
|
||||
void _showTextContentDialog(BuildContext context, String msg, String title) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 300.sp,
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Stack(
|
||||
morePeoleListWidget() {
|
||||
return Container(
|
||||
width: Get.width,
|
||||
height: 75.sp,
|
||||
margin: EdgeInsets.only(top: 10.sp,bottom: 10.sp),
|
||||
child: ListView.builder(
|
||||
controller: moreScrollController,
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemBuilder: (contenxt, index) {
|
||||
if (index == peopleList.length) {
|
||||
return MoreItem();
|
||||
}
|
||||
return peopleWidget(peopleList[index]);
|
||||
},
|
||||
itemCount: peopleList.length < 10 ? peopleList.length + 1 : 10,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget MoreItem() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.FriendsActivity,arguments: 1);
|
||||
},
|
||||
child: Container(
|
||||
// width: 68.sp,
|
||||
margin: EdgeInsets.only(left: 12.sp),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
Center(
|
||||
child: ClipOval(
|
||||
child: Container(
|
||||
color: Colors.black,
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
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,
|
||||
Center(
|
||||
child: ClipOval(
|
||||
child: Image.asset(
|
||||
getHomeImage("im_more"),
|
||||
width: 50.sp,
|
||||
// height: 48.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
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),
|
||||
],
|
||||
),
|
||||
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)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 8.sp,
|
||||
right: 10.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
color: Colors.white,
|
||||
size: 20.sp,
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
info['avatar_thumb'],
|
||||
fit: BoxFit.cover,
|
||||
width: 50.sp,
|
||||
height: 50.sp,
|
||||
),
|
||||
)),
|
||||
),
|
||||
if ((info['onlineFlag'] ?? '').toString().isNotEmpty)
|
||||
Positioned(bottom: 0,child: Container(
|
||||
height: 20.sp,
|
||||
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(10.sp),
|
||||
color: AppColor.bgColor,
|
||||
border: GradientBoxBorder(
|
||||
gradient:
|
||||
AppColor.mainVerLinearGradient,
|
||||
width: 1.sp,
|
||||
),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
info['onlineFlag'],
|
||||
style: TextStyle(
|
||||
color:
|
||||
const Color.fromRGBO(247, 250, 250, 1.0),
|
||||
fontSize: 10.sp,
|
||||
),
|
||||
)))
|
||||
],
|
||||
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
info['nickname'] ?? '',
|
||||
style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -610,13 +705,13 @@ class _LikeViewState extends State<LikeView>
|
||||
picHeight = picWidth;
|
||||
}
|
||||
} else {
|
||||
picHeight = 200.sp;
|
||||
picHeight = 140.sp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double widgetHeight =
|
||||
130.sp + contentHeight(lists.content!) + picHeight + 76.sp;
|
||||
// double widgetHeight =
|
||||
// 130.sp + contentHeight(lists.content!) + picHeight + 76.sp;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
@ -630,9 +725,9 @@ class _LikeViewState extends State<LikeView>
|
||||
pushHomePage(lists, lists.id.toString());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 10.sp),
|
||||
margin: EdgeInsets.only(bottom: 10.sp),
|
||||
width: Get.width,
|
||||
height: widgetHeight,
|
||||
// height: widgetHeight,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -675,7 +770,7 @@ class _LikeViewState extends State<LikeView>
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: widgetHeight,
|
||||
// height: widgetHeight,
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(top: 12.sp, left: 12.sp, right: 12.sp),
|
||||
child: Column(
|
||||
@ -782,7 +877,9 @@ class _LikeViewState extends State<LikeView>
|
||||
),
|
||||
Container(
|
||||
height: picHeight,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
|
||||
// color: Colors.red,
|
||||
margin: EdgeInsets.only(top: 5.sp,),
|
||||
child: picHeight == 140.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
@ -815,15 +912,6 @@ class _LikeViewState extends State<LikeView>
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
// placeholder: (context, url) =>
|
||||
// SizedBox(
|
||||
// width: 30.sp,
|
||||
// height: 30.sp,
|
||||
// child: CircularProgressIndicator(
|
||||
// color: Color(0xFF07FAFB),
|
||||
// strokeWidth: 2.sp,
|
||||
// ),
|
||||
// ),
|
||||
errorWidget: (context, url, error) =>
|
||||
const Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
@ -882,17 +970,16 @@ class _LikeViewState extends State<LikeView>
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
margin: EdgeInsets.only(bottom: 10.sp,top: 5.sp),
|
||||
child: circleInfoItem(lists.interest, lists, index),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 2.sp,
|
||||
left: 2.sp,
|
||||
child: Container(
|
||||
width: Get.width - 4.sp - 20.sp - 43.sp,
|
||||
child: circleInfoItem(lists.interest, lists, index),
|
||||
))
|
||||
|
||||
])),
|
||||
);
|
||||
}
|
||||
@ -918,7 +1005,7 @@ class _LikeViewState extends State<LikeView>
|
||||
picHeight = picWidth;
|
||||
}
|
||||
} else {
|
||||
picHeight = 200.sp;
|
||||
picHeight = 140.sp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -957,7 +1044,7 @@ class _LikeViewState extends State<LikeView>
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 10.sp),
|
||||
width: Get.width,
|
||||
height: 120.sp + contentHeight(lists.content!) + picHeight + 76.sp,
|
||||
// height: 120.sp + contentHeight(lists.content!) + picHeight + 76.sp,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
@ -1093,6 +1180,7 @@ class _LikeViewState extends State<LikeView>
|
||||
),
|
||||
picHeight > 0
|
||||
? Container(
|
||||
// color: Colors.red,
|
||||
height: picHeight,
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
@ -1210,16 +1298,14 @@ class _LikeViewState extends State<LikeView>
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
margin: EdgeInsets.only(bottom: 10.sp,top: 5.sp),
|
||||
child: circleInfoItem(lists.interest, lists, index),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 2.sp,
|
||||
bottom: 2.sp,
|
||||
child: Container(
|
||||
width: Get.width - 4.sp - 20.sp - 43.sp,
|
||||
child: circleInfoItem(lists.interest, lists, index),
|
||||
))
|
||||
],
|
||||
)),
|
||||
);
|
||||
@ -1235,12 +1321,15 @@ class _LikeViewState extends State<LikeView>
|
||||
children: [
|
||||
if (showTitle)
|
||||
logic.recommendCircleFriendData.isNotEmpty
|
||||
? RecommendCircleFriendItem(
|
||||
false,
|
||||
recommendCircleFriendData: logic.recommendCircleFriendData,
|
||||
getDataCallBack: () {
|
||||
logic.loadRecommendCircleFriendData();
|
||||
})
|
||||
? Container(
|
||||
// color: Colors.red,
|
||||
child: RecommendCircleFriendItem(
|
||||
false,0,
|
||||
recommendCircleFriendData: logic.recommendCircleFriendData,
|
||||
getDataCallBack: () {
|
||||
logic.loadRecommendCircleFriendData();
|
||||
}),
|
||||
)
|
||||
: Container(),
|
||||
if (showTitle)
|
||||
Container(
|
||||
|
||||
@ -13,7 +13,7 @@ import '../../../util/eventBus.dart';
|
||||
import '../../../util/util.dart';
|
||||
import '../../userinfo/logic.dart';
|
||||
import '../view.dart';
|
||||
|
||||
import 'dart:ui' as ui show PlaceholderAlignment;
|
||||
class NewPeople extends StatefulWidget {
|
||||
|
||||
@override
|
||||
@ -74,6 +74,8 @@ class _NewPeopleState extends State<NewPeople> {
|
||||
),
|
||||
)
|
||||
: logic.isLoadFail ? noResultWidget(tip: '', callBack: () {
|
||||
logic.isLoadFail = false;
|
||||
logic.update();
|
||||
logic.onLoading();
|
||||
}) : loaddingWidget(logic.isNewPeopleMore,tip: '过段时间再来欢迎新人吧~');
|
||||
});
|
||||
@ -229,13 +231,50 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
||||
margin: EdgeInsets.symmetric(horizontal: 8.0,vertical: 10.sp),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft, // 文本左对齐,垂直居中
|
||||
child: Text(
|
||||
item.signature ?? '暂时还没有签名哦~',
|
||||
maxLines: 2,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 18.sp),
|
||||
child: RichText(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
maxLines: 2,
|
||||
text: TextSpan(
|
||||
children: [
|
||||
WidgetSpan(
|
||||
alignment: ui.PlaceholderAlignment.middle,
|
||||
// alignment: Rect.fromCenter(center: center, width: width, height: height),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 2.sp,),
|
||||
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
|
||||
height: 20.sp,
|
||||
width: item.city!.length > 4 ? 70.sp : item.city!.contains('km') ? item.city!.length * 13.sp : item.city!.length * 20.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
color: AppColor.cityBgColor,
|
||||
),
|
||||
child: Text(
|
||||
item.city!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: item.signature!,
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,)),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
// Text(
|
||||
// item.signature ?? '暂时还没有签名哦~',
|
||||
// maxLines: 2,
|
||||
// style:
|
||||
// TextStyle(color: Colors.white, fontSize: 18.sp),
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
if (item.interests.isNotEmpty)
|
||||
@ -339,34 +378,26 @@ class _NewPeopleItemState extends State<NewPeopleItem> {
|
||||
margin: EdgeInsets.only(right: 11.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
border: GradientBoxBorder(
|
||||
gradient:
|
||||
AppColor.mainVerLinearGradient,
|
||||
width: 0.5.sp,
|
||||
),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(0.2.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interests[index].title,
|
||||
style: const TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interests[index].title,
|
||||
style: const TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -18,6 +18,8 @@ import '../../../common/Widgets/tag_widget.dart';
|
||||
import 'package:flutter_bmflocation/flutter_bmflocation.dart';
|
||||
|
||||
import '../../../common/colors/app_color.dart';
|
||||
import 'dart:ui' as ui show PlaceholderAlignment;
|
||||
|
||||
class Vicinity extends StatefulWidget {
|
||||
CircleLogic logic;
|
||||
// TODO: add state variables, methods and constructor params
|
||||
@ -99,6 +101,8 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
// ),)
|
||||
],
|
||||
) : widget.logic.isNearLoad ? loaddingWidget(true) : noResultWidget(tip: '',callBack: () {
|
||||
widget.logic.isNearLoad = true;
|
||||
widget.logic.update();
|
||||
_onLoading();
|
||||
});
|
||||
}
|
||||
@ -421,12 +425,42 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
margin: EdgeInsets.symmetric(vertical: 12.0.sp,horizontal: 9.sp),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft, // 文本左对齐,垂直居中
|
||||
child: Text(
|
||||
item.signature,
|
||||
maxLines: 2,
|
||||
style: TextStyle(color: Colors.white, fontSize: 18.sp),
|
||||
child: RichText(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
maxLines: 2,
|
||||
text: TextSpan(
|
||||
children: [
|
||||
WidgetSpan(
|
||||
alignment: ui.PlaceholderAlignment.middle,
|
||||
// alignment: Rect.fromCenter(center: center, width: width, height: height),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 2.sp,),
|
||||
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
|
||||
height: 20.sp,
|
||||
width: item.city!.length > 4 ? 70.sp : item.city!.contains('km') ? item.city!.length * 13.sp : item.city!.length * 20.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
color: AppColor.cityBgColor,
|
||||
),
|
||||
child: Text(
|
||||
item.city!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: item.signature!,
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,)),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
Container(
|
||||
@ -504,34 +538,26 @@ class _VicinityState extends State<Vicinity> with AutomaticKeepAliveClientMixin
|
||||
margin: EdgeInsets.only(right: 11.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
border: GradientBoxBorder(
|
||||
gradient:
|
||||
AppColor.mainVerLinearGradient,
|
||||
width: 0.5.sp,
|
||||
),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(0.2.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interests[index].title,
|
||||
style: const TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interests[index].title,
|
||||
style: const TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/circle/widgets/play_video_view.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:video_player/video_player.dart';
|
||||
|
||||
class VideoItemWidget extends StatefulWidget {
|
||||
String url;
|
||||
@ -14,50 +13,29 @@ class VideoItemWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _VideoItemWidgetState extends State<VideoItemWidget> {
|
||||
VideoPlayerController? videoPlayerController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// ignore: deprecated_member_use
|
||||
videoPlayerController = VideoPlayerController.network(
|
||||
widget.url)
|
||||
..initialize().then((_) {
|
||||
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
super.dispose();
|
||||
videoPlayerController?.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(PlayVideoView(widget.url));
|
||||
},
|
||||
child: AspectRatio(
|
||||
aspectRatio: videoPlayerController!.value.aspectRatio,
|
||||
child: Stack(
|
||||
children: [
|
||||
VideoPlayer(videoPlayerController!),
|
||||
Center(
|
||||
child: videoPlayerController!.value.isPlaying
|
||||
? Container()
|
||||
: Image(
|
||||
image: AssetImage(getMineImage("icon_play")),
|
||||
width: 30.sp,
|
||||
height: 30.sp,
|
||||
),
|
||||
return Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(PlayVideoView(widget.url));
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
ClipRRect(borderRadius: BorderRadius.circular(6.sp),child: CachedNetworkImage(imageUrl:'${widget.url}?vframe/jpg/offset/1',height: 200.sp,fit: BoxFit.cover,)),
|
||||
Image(
|
||||
image: AssetImage(getMineImage("icon_play")),
|
||||
width: 30.sp,
|
||||
height: 30.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ class LikeLogic extends GetxController {
|
||||
}
|
||||
} else if (bean.code == 404) {
|
||||
isLoadFial = true;
|
||||
showOKToast('网络不流畅哦,请检查网络情况');
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
||||
import 'package:circle_app/app/circle/widgets/like_view.dart';
|
||||
import 'package:circle_app/app/circle_list/widgets/circle_type_item.dart';
|
||||
import 'package:circle_app/app/circle_list/widgets/right_circle_iten.dart';
|
||||
import 'package:circle_app/app/select_circle/logic.dart';
|
||||
import 'package:circle_app/common/Widgets/circle_share.dart';
|
||||
import 'package:circle_app/common/Widgets/text_more.dart';
|
||||
@ -109,6 +110,9 @@ class _CircleListPageState extends State<CircleListPage>
|
||||
}
|
||||
|
||||
return logic.isLoadFial ? noResultWidget(tip:'',callBack: () {
|
||||
logic.isLoadFial = false;
|
||||
logic.isLoad = true;
|
||||
logic.update();
|
||||
logic.loadMyInfo();
|
||||
logic.loadData();
|
||||
}) : logic.isLoad
|
||||
@ -162,14 +166,16 @@ class _CircleListPageState extends State<CircleListPage>
|
||||
logic.update();
|
||||
},
|
||||
)
|
||||
: InfoListView(
|
||||
logic.currentIndex,
|
||||
logic.mycircle
|
||||
.lists[logic.currentIndex],
|
||||
logic,
|
||||
key: ValueKey(
|
||||
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),
|
||||
)))
|
||||
: RightCircleIten( logic.currentIndex,
|
||||
logic.mycircle
|
||||
.lists[logic.currentIndex],
|
||||
logic,key: ValueKey(
|
||||
'${logic.mycircle.lists[logic.currentIndex].id.toString() + logic.currentIndex.toString()}'),)))
|
||||
|
||||
// InfoListView(
|
||||
|
||||
|
||||
// )))
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
149
circle_app/lib/app/circle_list/widgets/hug_tip.dart
Normal file
149
circle_app/lib/app/circle_list/widgets/hug_tip.dart
Normal 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),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
2495
circle_app/lib/app/circle_list/widgets/right_circle_iten.dart
Normal file
2495
circle_app/lib/app/circle_list/widgets/right_circle_iten.dart
Normal file
File diff suppressed because it is too large
Load Diff
@ -362,19 +362,11 @@ class _FriendslistPageState extends State<FriendslistPage>
|
||||
Stack(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
imgList.add(item.avatar);
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {'imaglist': imgList, 'index': 0});
|
||||
},
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
),
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@ -2,7 +2,6 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
|
||||
import 'package:circle_app/app/chat/widget/svg_dialog.dart';
|
||||
import 'package:circle_app/app/circle/logic.dart';
|
||||
import 'package:circle_app/app/minefragment/logic.dart';
|
||||
@ -38,6 +37,7 @@ import '../invite/logic.dart';
|
||||
import '../minefragment/view.dart';
|
||||
import '../msg/view.dart';
|
||||
import 'state.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
late TabController tabController;
|
||||
@ -61,8 +61,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
|
||||
StreamSubscription? sub;
|
||||
|
||||
bool isUpdateVersion = false;
|
||||
|
||||
bool isUpdateVersion = false;
|
||||
|
||||
bool isProd = true;
|
||||
|
||||
@ -76,8 +75,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
connectivitySub.cancel();
|
||||
TencentImSDKPlugin.v2TIMManager
|
||||
.v2TIMMessageManager.removeAdvancedMsgListener();
|
||||
TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager
|
||||
.removeAdvancedMsgListener();
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
sub!.cancel();
|
||||
}
|
||||
@ -101,24 +100,20 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
|
||||
loadMyInfoData();
|
||||
|
||||
|
||||
sub = EventBusManager.on<RefreshUnread>().listen((event) {
|
||||
getUnreadSize();
|
||||
});
|
||||
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
|
||||
|
||||
addMsgListener();
|
||||
|
||||
checkVersion();
|
||||
loadMyCircleData();
|
||||
|
||||
initWxApi();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void addMsgListener() {
|
||||
msgListener = V2TimSimpleMsgListener(onRecvC2CTextMessage: (
|
||||
msgID,
|
||||
@ -132,106 +127,149 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
V2TimUserInfo sender,
|
||||
String customData,
|
||||
) {
|
||||
|
||||
if (sender.userID == "qpqz_dev_10_10000000000" ||
|
||||
sender.userID == "qpqz_prod_10_10000000000") {
|
||||
if(customData.isEmpty){
|
||||
if (customData.isEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
print("123123123123"+customData);
|
||||
print("123123123123" + customData);
|
||||
Map<String, dynamic> jsonData = json.decode(customData);
|
||||
int event = jsonData['event'];
|
||||
int event = jsonData['event'];
|
||||
Map<String, dynamic> content = jsonData['content'];
|
||||
switch(event) {
|
||||
case 1://关注
|
||||
String ageMsg = "${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
|
||||
if(content['isFollow']==1){//互关
|
||||
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],3,(){
|
||||
switch (event) {
|
||||
case 1: //关注
|
||||
String ageMsg =
|
||||
"${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
|
||||
if (content['isFollow'] == 1) {
|
||||
//互关
|
||||
showFloatingButtonOverlay(Get.context!, content['nickname'],
|
||||
ageMsg, content['avatarThumb'], 3, () {
|
||||
pushChatPage(content['id'].toString(), content['imId'],
|
||||
content['nickname']);
|
||||
});
|
||||
} else {
|
||||
showFloatingButtonOverlay(Get.context!, content['nickname'],
|
||||
ageMsg, content['avatarThumb'], 1, () {
|
||||
setLike(content['id'].toString());
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case 2: //上线
|
||||
|
||||
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{
|
||||
showFloatingButtonOverlay(Get.context!,content['nickname'],ageMsg,content['avatarThumb'],1,(){
|
||||
setLike(content['id'].toString());
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case 2://上线
|
||||
|
||||
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']);
|
||||
});
|
||||
break;
|
||||
case 9://有新人加入
|
||||
{
|
||||
CircleLogic logic = Get.find<CircleLogic>();
|
||||
logic.isNewPeopleRed = true;
|
||||
logic.update();
|
||||
}
|
||||
break;
|
||||
case 8://有新的喊话
|
||||
{
|
||||
World_call_outLogic logic = Get.find<World_call_outLogic>();
|
||||
logic.isNewMsg = true;
|
||||
logic.update();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case 9: //有新人加入
|
||||
{
|
||||
CircleLogic logic = Get.find<CircleLogic>();
|
||||
logic.isNewPeopleRed = true;
|
||||
logic.update();
|
||||
}
|
||||
break;
|
||||
case 8: //有新的喊话
|
||||
{
|
||||
World_call_outLogic logic = Get.find<World_call_outLogic>();
|
||||
logic.isNewMsg = true;
|
||||
logic.update();
|
||||
}
|
||||
break;
|
||||
case 10: //有新访客
|
||||
{
|
||||
MsgLogic logic = Get.find<MsgLogic>();
|
||||
logic.getMode();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
TencentImSDKPlugin.v2TIMManager.v2TIMMessageManager.addAdvancedMsgListener(
|
||||
listener: V2TimAdvancedMsgListener(onRecvNewMessage: (message) {
|
||||
getUnreadSize();
|
||||
print(message);
|
||||
if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM) {
|
||||
if (message.customElem?.data != null) {
|
||||
print(message.customElem!.data!);
|
||||
Map jsonData = jsonDecode(message.customElem!.data!);
|
||||
if (jsonData.containsKey('event')) {
|
||||
String event = jsonData['event'].toString();
|
||||
|
||||
TencentImSDKPlugin.v2TIMManager
|
||||
.v2TIMMessageManager.addAdvancedMsgListener(
|
||||
listener: V2TimAdvancedMsgListener(
|
||||
onRecvNewMessage: (message) {
|
||||
getUnreadSize();
|
||||
print(message);
|
||||
if (message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM) {
|
||||
if ( message.customElem?.data != null) {
|
||||
print(message.customElem!.data!);
|
||||
Map jsonData = jsonDecode(message.customElem!.data!);
|
||||
if (jsonData.containsKey('event')) {
|
||||
String event = jsonData['event'].toString();
|
||||
if (int.parse(event) == 3) {
|
||||
showOKToast(message.customElem!.desc!.toString());
|
||||
EventBusManager.fire(LikeRefresh());
|
||||
} else if (int.parse(event) == 5) {
|
||||
|
||||
// print(jsonData.toString());
|
||||
var info = jsonDecode(jsonData['content']);
|
||||
TencentImSDKPlugin.v2TIMManager.v2ConversationManager.pinConversation(conversationID: 'c2c_' + info['fromImId'], isPinned: info['top'] == 1);
|
||||
}
|
||||
} else if (jsonData.containsKey('type')) {
|
||||
int type = jsonData['type'];
|
||||
if (type == 1) {
|
||||
String giftUrl = jsonData['gifUrl'];
|
||||
if (giftUrl.isNotEmpty) {
|
||||
Get.bottomSheet(SvgDialog(url: giftUrl),isScrollControlled: true,
|
||||
enableDrag: false,isDismissible:false);
|
||||
}
|
||||
|
||||
}
|
||||
if (int.parse(event) == 1) {
|
||||
Map content = jsonData['content'];
|
||||
String ageMsg =
|
||||
"${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
|
||||
if (content['isFollow'] == 1) {
|
||||
//互关
|
||||
showFloatingButtonOverlay(Get.context!, content['nickname'],
|
||||
ageMsg, content['avatarThumb'], 3, () {
|
||||
pushChatPage(content['id'].toString(), content['imId'],
|
||||
content['nickname']);
|
||||
});
|
||||
} else {
|
||||
showFloatingButtonOverlay(Get.context!, content['nickname'],
|
||||
ageMsg, content['avatarThumb'], 1, () {
|
||||
setLike(content['id'].toString());
|
||||
});
|
||||
}
|
||||
} else if (int.parse(event) == 2) {
|
||||
Map content = jsonData['content'];
|
||||
String ageMsg =
|
||||
"${content['genderName']}·${content['age']}·${content['roleName']}·${content['orientationName']}";
|
||||
|
||||
showFloatingButtonOverlay(Get.context!, content['nickname'],
|
||||
ageMsg, content['avatarThumb'], 2, () {
|
||||
pushChatPage(content['id'].toString(), content['imId'],
|
||||
content['nickname']);
|
||||
});
|
||||
} else if (int.parse(event) == 3) {//喜欢列表刷新
|
||||
showOKToast(message.customElem!.desc!.toString());
|
||||
EventBusManager.fire(LikeRefresh());
|
||||
} else if (int.parse(event) == 5) {//有人送礼会话置顶
|
||||
// print(jsonData.toString());
|
||||
var info = jsonDecode(jsonData['content']);
|
||||
TencentImSDKPlugin.v2TIMManager.v2ConversationManager
|
||||
.pinConversation(
|
||||
conversationID: 'c2c_' + info['fromImId'],
|
||||
isPinned: info['top'] == 1);
|
||||
} else if (int.parse(event) == 9) {//有新人加入
|
||||
CircleLogic logic = Get.find<CircleLogic>();
|
||||
logic.isNewPeopleRed = true;
|
||||
logic.update();
|
||||
} else if (int.parse(event) == 8) {//有新的喊话
|
||||
World_call_outLogic logic = Get.find<World_call_outLogic>();
|
||||
logic.isNewMsg = true;
|
||||
logic.update();
|
||||
} else if (int.parse(event) == 10) {//有新访客
|
||||
MsgLogic logic = Get.find<MsgLogic>();
|
||||
logic.getMode();
|
||||
}
|
||||
} else if (jsonData.containsKey('type')) {
|
||||
int type = jsonData['type'];
|
||||
if (type == 1) {
|
||||
String giftUrl = jsonData['gifUrl'];
|
||||
if (giftUrl.isNotEmpty) {
|
||||
Get.bottomSheet(SvgDialog(url: giftUrl),
|
||||
isScrollControlled: true,
|
||||
enableDrag: false,
|
||||
isDismissible: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}));
|
||||
|
||||
_messageService.addSimpleMsgListener(listener: msgListener);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
switch (state) {
|
||||
@ -250,9 +288,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Future<void> checkVersion() async {
|
||||
var data = await DioManager.instance.get(url: Api.APP_VERSION);
|
||||
var bean = BaseResponse<UpdateInfo>.fromJson(
|
||||
@ -263,25 +298,25 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
}
|
||||
|
||||
setLike(String userId) async {
|
||||
var data = await DioManager.instance.post(
|
||||
url: "${Api.setLike + userId}/follow",
|
||||
params: {'status': "1"});
|
||||
var data = await DioManager.instance
|
||||
.post(url: "${Api.setLike + userId}/follow", params: {'status': "1"});
|
||||
var bean = BaseResponse<dynamic>.fromJson(
|
||||
data,
|
||||
(jsonData) => jsonData,
|
||||
(jsonData) => jsonData,
|
||||
);
|
||||
if (bean.isSuccess()) {
|
||||
update();
|
||||
}
|
||||
showOKToast(bean.msg);
|
||||
}
|
||||
|
||||
getUnreadSize() async {
|
||||
if (coreInstance.isLoginSuccess) {
|
||||
try {
|
||||
V2TimValueCallback<int> getTotalUnreadMessageCountRes =
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getTotalUnreadMessageCount();
|
||||
await TencentImSDKPlugin.v2TIMManager
|
||||
.getConversationManager()
|
||||
.getTotalUnreadMessageCount();
|
||||
print("未读数量desc=" +
|
||||
getTotalUnreadMessageCountRes.desc.toString() +
|
||||
"code=" +
|
||||
@ -290,15 +325,13 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
getTotalUnreadMessageCountRes.data.toString());
|
||||
|
||||
if (getTotalUnreadMessageCountRes.code == 0) {
|
||||
if (getTotalUnreadMessageCountRes.data.toString() != unreadSIze.value) {
|
||||
if (getTotalUnreadMessageCountRes.data.toString() !=
|
||||
unreadSIze.value) {
|
||||
unreadSIze.value = getTotalUnreadMessageCountRes.data.toString();
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -323,11 +356,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
super.onReady();
|
||||
|
||||
FlutterNativeSplash.remove();
|
||||
updateIndex(1);
|
||||
final logic = Get.find<CircleLogic>();
|
||||
logic.loadCirclePeopleData();
|
||||
|
||||
|
||||
}
|
||||
|
||||
addBadge() {
|
||||
@ -354,7 +384,6 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
if (!coreInstance.isLoginSuccess) {
|
||||
var data = await DioManager.instance.get(url: Api.getIMInfo);
|
||||
if (data['code'] == 200) {
|
||||
|
||||
loginIM(
|
||||
data['data']['account_id'].toString(), data['data']['user_sig']);
|
||||
accountId = data['data']['account_id'].toString();
|
||||
@ -379,24 +408,22 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
} else if (index == 4) {
|
||||
final logic = Get.put(MinefragmentLogic());
|
||||
logic.getMode();
|
||||
} else if (index == 3) {
|
||||
} else if (index == 3) {
|
||||
final logic = Get.find<MsgLogic>();
|
||||
EventBusManager.fire(MsgRecommendCardRefresh());
|
||||
logic.loadChatData();
|
||||
logic.getVisitorMsgData();
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
void setFirstData() async {
|
||||
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
|
||||
sharedPreferences.setString(
|
||||
SharedPreferencesHelper.firstLogin, '1');
|
||||
|
||||
sharedPreferences.setString(SharedPreferencesHelper.firstLogin, '1');
|
||||
}
|
||||
|
||||
loadMyCircleData() async {
|
||||
var data = await DioManager.instance
|
||||
.get(url: Api.getMyCircleAll);
|
||||
var data = await DioManager.instance.get(url: Api.getMyCircleAll);
|
||||
|
||||
// var bean = BaseResponse<InterestsBean>.fromJson(
|
||||
// data, (data) => InterestsBean.fromJson(data));
|
||||
@ -411,7 +438,7 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
});
|
||||
mycircle.lists = infoList;
|
||||
if (currentIndex >= mycircle.lists.length - 1) {
|
||||
currentIndex = mycircle.lists.length -1;
|
||||
currentIndex = mycircle.lists.length - 1;
|
||||
}
|
||||
|
||||
loadCalloutsNew();
|
||||
@ -424,9 +451,8 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
mycircle.lists.forEach((element) {
|
||||
idList.add(element.id.toString());
|
||||
});
|
||||
var data = await DioManager.instance.post(
|
||||
url:Api.calloutsNew,
|
||||
params: {"interestIds":idList});
|
||||
var data = await DioManager.instance
|
||||
.post(url: Api.calloutsNew, params: {"interestIds": idList});
|
||||
|
||||
if (data['code'] == 200) {
|
||||
List infoList = data['data'];
|
||||
@ -444,22 +470,25 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
|
||||
/// 设置网络切换监听
|
||||
connectListener() {
|
||||
connectivitySub = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
|
||||
if (result == ConnectivityResult.none) {
|
||||
if (currentIndex == 0) {
|
||||
var logic = Get.put(CircleLogic());
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 1) {
|
||||
var logic = Get.put(LikeLogic());
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 3) {
|
||||
final logic = Get.find<MsgLogic>();
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 4) {
|
||||
var logic = Get.put(MinefragmentLogic());
|
||||
logic.loadData();
|
||||
}
|
||||
}});
|
||||
connectivitySub = Connectivity()
|
||||
.onConnectivityChanged
|
||||
.listen((ConnectivityResult result) {
|
||||
if (result == ConnectivityResult.none) {
|
||||
if (currentIndex == 0) {
|
||||
var logic = Get.put(CircleLogic());
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 1) {
|
||||
var logic = Get.put(LikeLogic());
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 3) {
|
||||
final logic = Get.find<MsgLogic>();
|
||||
logic.loadData();
|
||||
} else if (currentIndex == 4) {
|
||||
var logic = Get.put(MinefragmentLogic());
|
||||
logic.loadData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void loadEnvTypeData() async {
|
||||
@ -482,25 +511,45 @@ class HomeLogic extends GetxController with WidgetsBindingObserver {
|
||||
inviteCode = info.data!.inviteCode!;
|
||||
link = info.data!.link!;
|
||||
}
|
||||
currentIndex = bean.data.isNewUser ? 1 : 0;
|
||||
bool isGreaterThan30Days = isDifferenceGreaterThan30Days(
|
||||
(model!.createTime?.isNotEmpty ?? false)
|
||||
? model!.createTime!
|
||||
: DateTime.now().toString());
|
||||
|
||||
if (isGreaterThan30Days) {
|
||||
currentIndex = 0;
|
||||
} else {
|
||||
currentIndex = 1;
|
||||
}
|
||||
updateIndex(currentIndex);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
bool isDifferenceGreaterThan30Days(String dateString) {
|
||||
// 获取当前时间
|
||||
DateTime now = DateTime.now();
|
||||
|
||||
// 使用日期格式化对象来解析给定的时间字符串
|
||||
DateFormat format = DateFormat("yyyy-MM-dd");
|
||||
DateTime date = format.parse(dateString);
|
||||
|
||||
// 计算日期差异
|
||||
Duration difference = now.difference(date);
|
||||
|
||||
|
||||
// 检查差异是否超过30天
|
||||
if (difference.inDays.abs() > 30) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class conTop {
|
||||
bool isTop;
|
||||
String conId;
|
||||
conTop(this.isTop,this.conId);
|
||||
conTop(this.isTop, this.conId);
|
||||
}
|
||||
|
||||
class MsgRecommendCardRefresh {
|
||||
|
||||
}
|
||||
class MsgRecommendCardRefresh {}
|
||||
|
||||
@ -334,19 +334,11 @@ class _LikelistPageState extends State<LikelistPage> with RouteAware {
|
||||
Stack(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
imgList.add(item.user.avatar);
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {'imaglist': imgList, 'index': 0});
|
||||
},
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.user.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
),
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.user.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@ -71,6 +71,15 @@ class MinefragmentLogic extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
getVisitorMsgData() async {
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getVisitorMsg,);
|
||||
if (data['code'] == 200) {
|
||||
recent_visit_count_new = data['data']['unreadCount'] ?? 0;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
getMode() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
@ -82,21 +91,23 @@ class MinefragmentLogic extends GetxController {
|
||||
joinedCircle = "${"加入了${bean.data.joininterestcount}"}个圈子";
|
||||
enterHomeInfoMsg = bean.data.mainGuideText;
|
||||
|
||||
|
||||
has_pwd = bean.data.has_pwd;
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
if(bean.data.user.vip>0){
|
||||
vipMsg = "会员时长剩余${bean.data.vipExpireDays}天";
|
||||
} else if (bean.data.last_vip_expire_date != '') {
|
||||
vipMsg = "会员已于${bean.data.last_vip_expire_date.toString().split(' ').first}到期";
|
||||
}
|
||||
|
||||
int likeMeCount = sharedPreferences.getInt(SharedPreferencesHelper.LIKEMECOUNT)??0;
|
||||
int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
|
||||
// int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
|
||||
sharedPreferences.setString(SharedPreferencesHelper.PHOTO, bean.data.phone);
|
||||
like_me_count_new = like_me_count - likeMeCount;
|
||||
print("***************");
|
||||
print("$likeMeCount-$like_me_count=$like_me_count_new");
|
||||
|
||||
recent_visit_count_new = recent_visit_count - recentVisitCount;
|
||||
|
||||
// like_me_count_new = recentVisitCount.toInt() - bean.data.likeMeCount.toInt();
|
||||
|
||||
@ -121,7 +132,7 @@ class MinefragmentLogic extends GetxController {
|
||||
|
||||
ageMsg = getAgeCOntent(gender, age, role, orientation);
|
||||
}
|
||||
|
||||
getVisitorMsgData();
|
||||
update();
|
||||
} else {
|
||||
showOKToast(bean.msg);
|
||||
@ -154,7 +165,7 @@ class User {
|
||||
double lat;
|
||||
String city;
|
||||
String avatarThumb;
|
||||
|
||||
String? createTime;
|
||||
User({
|
||||
required this.id,
|
||||
required this.has_pwd,
|
||||
@ -172,6 +183,7 @@ class User {
|
||||
required this.lat,
|
||||
required this.city,
|
||||
required this.avatarThumb,
|
||||
this.createTime,
|
||||
});
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) {
|
||||
@ -179,6 +191,7 @@ class User {
|
||||
id: json['id'],
|
||||
mark: json['mark'] ?? 0,
|
||||
has_pwd: json['has_pwd'] ?? false,
|
||||
createTime: json['createTime'] ?? '',
|
||||
nickname: json['nickname'],
|
||||
avatar: json['avatar'],
|
||||
signature: json['signature'],
|
||||
@ -202,6 +215,8 @@ class MineResponseBean {
|
||||
int likeMeCount;
|
||||
int recentVisitCount;
|
||||
String? vipExpireDate;
|
||||
// "createTime" -> "2023-10-09T09:07:20.000+00:00"
|
||||
String? last_vip_expire_date;
|
||||
int? vipExpireDays;
|
||||
bool? has_pwd;
|
||||
bool isNewUser;
|
||||
@ -216,6 +231,7 @@ class MineResponseBean {
|
||||
required this.recentVisitCount,
|
||||
this.vipExpireDate,
|
||||
required this.isNewUser,
|
||||
required this.last_vip_expire_date,
|
||||
this.vipExpireDays,
|
||||
required this.phone,
|
||||
required this.has_pwd,
|
||||
@ -226,6 +242,7 @@ class MineResponseBean {
|
||||
return MineResponseBean(
|
||||
user: User.fromJson(json['user']),
|
||||
likeCount: json['like_count'],
|
||||
last_vip_expire_date: json['last_vip_expire_date'] ?? '',
|
||||
has_pwd: json['has_pwd'],
|
||||
isNewUser : json['isNewUser'] ?? false,
|
||||
phone: json['phone'],
|
||||
|
||||
@ -20,6 +20,7 @@ import '../../common/colors/app_color.dart';
|
||||
import '../../main.dart';
|
||||
import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../../util/util.dart';
|
||||
import '../msg/logic.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
const vipIcon = 'assets/images/home/icon_vip_more.png';
|
||||
@ -144,7 +145,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
|
||||
),
|
||||
),
|
||||
if (!logic.isProxy)
|
||||
Image.asset(getHomeImage(logic.isVip.value == 0 ? 'open_vip' : 'pay_vip'),height: 28.sp,),
|
||||
Image.asset(getHomeImage(logic.vipMsg.contains('十几种') ? 'open_vip' : 'pay_vip'),height: 28.sp,),
|
||||
],
|
||||
),
|
||||
)),
|
||||
@ -669,7 +670,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
|
||||
),
|
||||
Positioned(
|
||||
right: 0.sp,
|
||||
top: 15.sp,
|
||||
top: 6.sp,
|
||||
child: Text(
|
||||
logic.like_me_count_new>0 ? "+${logic.like_me_count_new}":"",
|
||||
style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
|
||||
@ -685,6 +686,9 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
|
||||
SharedPreferencesHelper.getInstance().then((sharedPreferences) {
|
||||
sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, logic.recent_visit_count);
|
||||
});
|
||||
MsgLogic msgLogic = Get.find<MsgLogic>();
|
||||
msgLogic.updateVisitCount();
|
||||
|
||||
Get.toNamed(AppRoutes.VisitorListActivity);
|
||||
},
|
||||
child: Stack(
|
||||
@ -725,7 +729,7 @@ class _MinefragmentPageState extends State<MinefragmentPage> with RouteAware {
|
||||
),
|
||||
Positioned(
|
||||
right: 0.sp,
|
||||
top: 15.sp,
|
||||
top: 6.sp,
|
||||
child: Text(
|
||||
logic.recent_visit_count_new>0 ? "+${logic.recent_visit_count_new}":"",
|
||||
style: const TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../../common/Widgets/base_tip_widget.dart';
|
||||
import '../../util/SharedPreferencesHelper.dart';
|
||||
import '../circle/logic.dart';
|
||||
@ -22,6 +23,9 @@ class MsgLogic extends GetxController {
|
||||
int total = 0;
|
||||
|
||||
bool isStart = false;
|
||||
String tip = '';
|
||||
|
||||
int recent_visit_count_new = 0;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@ -31,6 +35,7 @@ class MsgLogic extends GetxController {
|
||||
loadChatData();
|
||||
loadLikeData();
|
||||
loadStatusData();
|
||||
getMode();
|
||||
}
|
||||
|
||||
loadData() {
|
||||
@ -54,6 +59,33 @@ class MsgLogic extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
getMode() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
int recent_visit_count = bean.data.recentVisitCount ?? 0;
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
int recentVisitCount = sharedPreferences.getInt(SharedPreferencesHelper.RECENTVISITCOUNT)??0;
|
||||
|
||||
recent_visit_count_new = recent_visit_count - recentVisitCount;
|
||||
getVisitorMsgData();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
updateVisitCount() async {
|
||||
if (recent_visit_count_new > 0) {
|
||||
SharedPreferences sharedPreferences =
|
||||
await SharedPreferences.getInstance();
|
||||
sharedPreferences.setInt(SharedPreferencesHelper.RECENTVISITCOUNT, recent_visit_count_new);
|
||||
}
|
||||
|
||||
getMode();
|
||||
update();
|
||||
}
|
||||
|
||||
void loadChatData() async {
|
||||
var data =
|
||||
await DioManager.instance.post(url: Api.recommendQuickChatUser, params: {
|
||||
@ -63,6 +95,8 @@ class MsgLogic extends GetxController {
|
||||
if (data['code'] == 200) {
|
||||
total = data['data']['total'];
|
||||
chatList = data['data']['lists'];
|
||||
} else if (data['code'] == 404) {
|
||||
showOKToast('网络不流畅哦,请检查网络情况');
|
||||
}
|
||||
|
||||
// vicinityList = bean.data.lists;
|
||||
@ -70,6 +104,16 @@ class MsgLogic extends GetxController {
|
||||
}
|
||||
|
||||
|
||||
getVisitorMsgData() async {
|
||||
var data =
|
||||
await DioManager.instance.get(url: Api.getVisitorMsg,);
|
||||
if (data['code'] == 200) {
|
||||
tip = data['data']['lastMsg'];
|
||||
recent_visit_count_new = data['data']['unreadCount'] ?? 0;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
Future<bool> queryQuickStart() async {
|
||||
var data =
|
||||
await DioManager.getInstance().get(url: Api.queryQuickStart);
|
||||
|
||||
@ -11,10 +11,11 @@ import '../../util/util.dart';
|
||||
import '../circle/widgets/discover.dart';
|
||||
|
||||
class RecommendCircleFriendItem extends StatefulWidget {
|
||||
RecommendCircleFriendItem(this.isShowTopLine,{super.key,required this.recommendCircleFriendData,required this.getDataCallBack,});
|
||||
RecommendCircleFriendItem(this.isShowTopLine,this.padding,{super.key,required this.recommendCircleFriendData,required this.getDataCallBack,});
|
||||
var recommendCircleFriendData;
|
||||
Function getDataCallBack;
|
||||
bool isShowTopLine;
|
||||
double padding;
|
||||
@override
|
||||
_RecommendCircleFriendItemState createState() =>
|
||||
_RecommendCircleFriendItemState();
|
||||
@ -55,7 +56,7 @@ class _RecommendCircleFriendItemState extends State<RecommendCircleFriendItem> {
|
||||
List circleList = recommendCircleFriendData['interests'] ?? [];
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||
padding: EdgeInsets.only(left: widget.padding, right: widget.padding),
|
||||
child: Column(children: [
|
||||
if (widget.isShowTopLine)
|
||||
Container(
|
||||
|
||||
@ -15,6 +15,7 @@ import '../../util/util.dart';
|
||||
import '../circle/logic.dart';
|
||||
import '../userinfo/logic.dart';
|
||||
import 'logic.dart';
|
||||
import 'dart:ui' as ui show PlaceholderAlignment;
|
||||
|
||||
class QuickPage extends StatelessWidget {
|
||||
QuickPage({Key? key}) : super(key: key);
|
||||
@ -316,13 +317,42 @@ class QuickPage extends StatelessWidget {
|
||||
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft, // 文本左对齐,垂直居中
|
||||
child: Text(
|
||||
item.signature ?? '暂时还没有签名哦~',
|
||||
maxLines: 2,
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 18.sp),
|
||||
child: RichText(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
maxLines: 2,
|
||||
text: TextSpan(
|
||||
children: [
|
||||
WidgetSpan(
|
||||
alignment: ui.PlaceholderAlignment.middle,
|
||||
// alignment: Rect.fromCenter(center: center, width: width, height: height),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 2.sp,),
|
||||
padding: EdgeInsets.only(left: 4.sp,right: 4.sp),
|
||||
height: 20.sp,
|
||||
width: item.city!.length > 4 ? 70.sp : item.city!.contains('km') ? item.city!.length * 13.sp : item.city!.length * 20.sp,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
color: AppColor.cityBgColor,
|
||||
),
|
||||
child: Text(
|
||||
item.city!,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: item.signature ?? '暂时还没有签名哦~',
|
||||
// overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,)),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
if (item.interests.isNotEmpty)
|
||||
@ -427,34 +457,26 @@ class QuickPage extends StatelessWidget {
|
||||
margin: EdgeInsets.only(right: 11.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
Color(0xFFDC5BFD),
|
||||
],
|
||||
border: GradientBoxBorder(
|
||||
gradient:
|
||||
AppColor.mainVerLinearGradient,
|
||||
width: 0.5.sp,
|
||||
),
|
||||
color: const Color(0xFF392D53),
|
||||
),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(0.2.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17.0),
|
||||
color: const Color(0xFF392D53),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 2.sp,
|
||||
bottom: 2.sp,
|
||||
left: 15.sp,
|
||||
right: 15.sp,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interests[index].title,
|
||||
style: const TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
interests[index].title,
|
||||
style: const TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -291,7 +291,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
toolbarHeight: 0,
|
||||
foregroundColor: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
expandedHeight: 352.sp,
|
||||
expandedHeight: 362.sp,
|
||||
// bottom: PreferredSize(
|
||||
// preferredSize: Size(Get.width, 40),
|
||||
// child: titleTab(logic),
|
||||
@ -479,7 +479,7 @@ class MyTabbedScreenState extends State<UserinfoPage>
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 58.sp,
|
||||
height: 68.sp,
|
||||
padding: EdgeInsets.symmetric(horizontal: 15.sp),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@ -134,7 +134,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
@ -151,13 +151,16 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
type = info.type!;
|
||||
|
||||
if (info.type == 1) {
|
||||
if (lists.album!.length > 3) {
|
||||
picHeight = 218.sp;
|
||||
} else {
|
||||
picHeight = 109.sp;
|
||||
picHeight = 140.sp;
|
||||
if (info.type == 1) {
|
||||
if (lists.album!.length > 3 && lists.album!.length < 7) {
|
||||
picHeight = picHeight * 2;
|
||||
} else if (lists.album!.length >= 7) {
|
||||
picHeight = picHeight * 3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
picHeight = 140.sp;
|
||||
picHeight = 200.sp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -327,7 +330,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
Container(
|
||||
height: picHeight,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: picHeight == 140.sp
|
||||
child: picHeight == 200.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0]!.url!))
|
||||
@ -340,7 +343,7 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
childAspectRatio: 0.8 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
@ -403,14 +406,14 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
|
||||
///普通图文喊话
|
||||
normalDynamicItem(Lists lists) {
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
Widget descText = logic.openCallOutIdList.contains(lists.id) ? Text(
|
||||
lists.content!,
|
||||
style: TextStyle(color: Colors.white, fontSize: 14.sp),
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 5,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
) : HideText(text: lists.content!,maxWidth: Get.currentRoute == AppRoutes.Home ? Get.width - 90.sp : Get.width - 20.sp,additionText: '查看更多',maxLines: 15,style: TextStyle(color: Colors.white, fontSize: 14.sp),additionStyle: TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),onTap: () {
|
||||
logic.openCallOutIdList.add(lists.id);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@ -423,13 +426,16 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
type = info.type!;
|
||||
|
||||
if (info.type == 1) {
|
||||
if (lists.album!.length > 3) {
|
||||
picHeight = 218.sp;
|
||||
} else {
|
||||
picHeight = 109.sp;
|
||||
picHeight = 140.sp;
|
||||
if (info.type == 1) {
|
||||
if (lists.album!.length > 3 && lists.album!.length < 7) {
|
||||
picHeight = picHeight * 2;
|
||||
} else if (lists.album!.length >= 7) {
|
||||
picHeight = picHeight * 3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
picHeight = 140.sp;
|
||||
picHeight = 200.sp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -587,19 +593,20 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
// margin: EdgeInsets.only(top: 4.sp),
|
||||
child: descText,
|
||||
),
|
||||
SizedBox(height: picHeight > 0 ? 5.sp : 10.sp,),
|
||||
picHeight > 0
|
||||
? Container(
|
||||
height: picHeight,
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: picHeight == 140.sp
|
||||
// alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(bottom: 10.sp),
|
||||
child: picHeight == 200.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child:
|
||||
VideoItemWidget(lists.album![0].url!))
|
||||
: GridView.builder(
|
||||
controller: scrollController,
|
||||
shrinkWrap: true,
|
||||
// shrinkWrap: true,
|
||||
itemCount: lists.album!.length,
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
@ -609,16 +616,10 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio:
|
||||
1.0 //宽高比为1时,子widget
|
||||
0.8 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
if (album.type == 2) {
|
||||
return ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(album.url!));
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
@ -636,9 +637,6 @@ class _HomeCallOutViewState extends State<HomeCallOutView>
|
||||
BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
errorWidget:
|
||||
(context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
|
||||
@ -322,21 +322,11 @@ class VisitorlistPage extends StatelessWidget {
|
||||
Stack(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (logic.isVip > 0 || index < 3) {
|
||||
var imgList = <String>[];
|
||||
imgList.add(item.user.avatar);
|
||||
Get.toNamed(AppRoutes.Swiper,
|
||||
arguments: {'imaglist': imgList, 'index': 0});
|
||||
}
|
||||
},
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.user.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
),
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
imageUrl: item.user.avatarThumb,
|
||||
width: 53.sp,
|
||||
height: 53.sp,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@ -21,6 +21,7 @@ class World_call_outLogic extends GetxController {
|
||||
bool isLoad = true;
|
||||
List<WorldLists> lists = [];
|
||||
List<String> wantMeet = [];
|
||||
List openCallOutIdList = [];
|
||||
int index = 1;
|
||||
|
||||
int total = 0;
|
||||
@ -123,6 +124,7 @@ class World_call_outLogic extends GetxController {
|
||||
if (tempLists.isNotEmpty) {
|
||||
isLoad = false;
|
||||
if (index == 1) {
|
||||
refreshController.refreshCompleted();
|
||||
lists = tempLists;
|
||||
|
||||
} else {
|
||||
@ -139,6 +141,7 @@ class World_call_outLogic extends GetxController {
|
||||
|
||||
update();
|
||||
} else if (bean1.code == 404) {
|
||||
showOKToast('网络不流畅哦,请检查网络情况');
|
||||
loadFail = true;
|
||||
update();
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
|
||||
import '../../common/Widgets/circle_share.dart';
|
||||
import '../../common/Widgets/tag_widget.dart';
|
||||
import '../../common/Widgets/text_more.dart';
|
||||
import '../../common/colors/app_color.dart';
|
||||
import '../../router/app_routers.dart';
|
||||
import '../circle/widgets/video_item.dart';
|
||||
@ -152,8 +153,19 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
onLoading: () {
|
||||
logic.loadMore();
|
||||
},
|
||||
onRefresh: () {
|
||||
logic.isNewMsg = false;
|
||||
logic.index = 1;
|
||||
logic.lists.clear();
|
||||
logic.update();
|
||||
logic.loadData();
|
||||
},
|
||||
enablePullUp: true,
|
||||
enablePullDown: true,
|
||||
child:logic.loadFail ? noResultWidget(tip: '',callBack: () {
|
||||
logic.loadFail = false;
|
||||
logic.isMore = true;
|
||||
logic.update();
|
||||
logic.initGerder();
|
||||
logic.loadData();
|
||||
}) : logic.lists.isEmpty
|
||||
@ -222,175 +234,6 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
),
|
||||
),
|
||||
)),
|
||||
// Positioned(
|
||||
// bottom: 0,
|
||||
// child: Container(
|
||||
// width: Get.width,
|
||||
// height: max(getBottomHeight(context), 0.0),
|
||||
// child: AnimatedContainer(
|
||||
// duration: Duration(
|
||||
// milliseconds:
|
||||
// (logic.showKeyboard && PlatformUtils().isAndroid)
|
||||
// ? 200
|
||||
// : 340),
|
||||
// curve: Curves.fastOutSlowIn,
|
||||
// width: Get.width,
|
||||
// height: max(getBottomHeight(context), 0.0),
|
||||
// child: ListView(
|
||||
// physics: const NeverScrollableScrollPhysics(),
|
||||
// children: [
|
||||
// Container(
|
||||
// width: MediaQuery.of(context).size.width,
|
||||
// decoration: const BoxDecoration(
|
||||
// color: Color(0xFF423055),
|
||||
// borderRadius: BorderRadius.only(
|
||||
// topLeft: Radius.circular(16),
|
||||
// topRight: Radius.circular(16))),
|
||||
// child: Container(
|
||||
// // constraints: const BoxConstraints(
|
||||
// // maxHeight: 60,
|
||||
// // minHeight: 30,
|
||||
// // ),
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// horizontal: 7.0, vertical: 7.0),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// width: 6,
|
||||
// ),
|
||||
// Transform.scale(
|
||||
// scale: 0.8,
|
||||
// child: CupertinoSwitch(
|
||||
// activeColor: AppColor.mainColor,
|
||||
// value: logic.isOpenVip,
|
||||
// onChanged: (bool value) async {
|
||||
// // if (logic.vip == 3) {
|
||||
// // showToast('「年合伙人」专属特权「至尊喊话」,开启后可以闪亮全场哦');
|
||||
// // _isOpenVip = value;
|
||||
// // setState(() {});
|
||||
// // } else {
|
||||
// // showToast('成为「年合伙人」才能使用「至尊喊话」,可以闪亮全场哦');
|
||||
// // showRechargeDialog('super_callout')
|
||||
// // .then((value) {
|
||||
// // logic.loadMyuserId();
|
||||
// // });
|
||||
// // }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// Expanded(
|
||||
// child: Stack(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// children: [
|
||||
// Container(
|
||||
// constraints: const BoxConstraints(
|
||||
// maxHeight: 60,
|
||||
// minHeight: 30,
|
||||
// ),
|
||||
// width: Get.width,
|
||||
// child: ExtendedTextField(
|
||||
// controller: logic.inputController,
|
||||
// focusNode: logic.focusNode,
|
||||
// keyboardType:
|
||||
// TextInputType.multiline,
|
||||
// maxLength: 30,
|
||||
// onTap: () {
|
||||
// logic.showKeyboard = true;
|
||||
// logic.inputController.value = TextEditingValue(
|
||||
// ///用来设置文本 controller.text = "0000"
|
||||
// text: logic.inputController.text,
|
||||
// ///设置光标的位置
|
||||
// selection: TextSelection.fromPosition(
|
||||
// ///用来设置文本的位置
|
||||
// TextPosition(
|
||||
// affinity: TextAffinity.downstream,
|
||||
// /// 光标向后移动的长度
|
||||
// offset: logic.inputController.text.length),),);
|
||||
// logic.update();
|
||||
// },
|
||||
// decoration: InputDecoration(
|
||||
// counterText: '',
|
||||
// contentPadding: EdgeInsets.only(
|
||||
// left: 10,
|
||||
// right: 35,
|
||||
// top: 10,
|
||||
// bottom: 0),
|
||||
// fillColor: Color(0x1AFFFFFF),
|
||||
// filled: true,
|
||||
// border: OutlineInputBorder(
|
||||
// borderRadius:
|
||||
// BorderRadius.circular(
|
||||
// 15),
|
||||
// borderSide:
|
||||
// BorderSide.none),
|
||||
// isDense: true,
|
||||
// hintText: '发个喊话跟大家一起聊聊呗~',
|
||||
// hintStyle: const TextStyle(
|
||||
// color: Color(0xB3FFFFFF),
|
||||
// fontSize: 14),
|
||||
// enabled: false),
|
||||
// maxLines: null,
|
||||
// style: const TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 14),
|
||||
// textInputAction:
|
||||
// TextInputAction.send,
|
||||
// onChanged: (value) {},
|
||||
// onEditingComplete: () {
|
||||
// logic.focusNode.unfocus();
|
||||
// logic.showKeyboard = false;
|
||||
// logic.showEmojiPanel = false;
|
||||
// logic.sendTextMessage();
|
||||
// },
|
||||
// enabled: true,
|
||||
// specialTextSpanBuilder:
|
||||
// DefaultSpecialTextSpanBuilder(
|
||||
// isUseDefaultEmoji: true,
|
||||
// customEmojiStickerList:
|
||||
// ConstData.emojiList,
|
||||
// showAtBackground: true,
|
||||
// )),
|
||||
// ),
|
||||
// Positioned(
|
||||
// right: 10,
|
||||
// child: GestureDetector(
|
||||
// onTap: () {
|
||||
// logic.focusNode.unfocus();
|
||||
// logic.showKeyboard = false;
|
||||
// logic.showEmojiPanel = true;
|
||||
// logic.update();
|
||||
// },
|
||||
// child: Image.asset(
|
||||
// getMsgImage('emoji'),
|
||||
// width: 24,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// )),
|
||||
// SizedBox(
|
||||
// width: 6,
|
||||
// ),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// logic.focusNode.unfocus();
|
||||
// logic.showKeyboard = false;
|
||||
// logic.showEmojiPanel = false;
|
||||
// logic.sendTextMessage();
|
||||
// },
|
||||
// child: Image.asset(
|
||||
// getMsgImage('send'),
|
||||
// width: 24,
|
||||
// )),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// getBottomContainer()
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// )),
|
||||
],
|
||||
));
|
||||
});
|
||||
@ -623,12 +466,10 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
return picHeight > 0
|
||||
? Container(
|
||||
height: picHeight,
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(left: 10.sp, right: 10.sp),
|
||||
alignment: Alignment.topLeft,
|
||||
margin: EdgeInsets.only(left: 10.sp, right: 10.sp,bottom: 5.sp),
|
||||
child: picHeight == 200.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(list.album![0].url!))
|
||||
? VideoItemWidget(list.album![0].url!)
|
||||
: GridView.builder(
|
||||
itemCount: list.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
@ -691,9 +532,30 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
}
|
||||
}
|
||||
|
||||
Widget descText = logic.openCallOutIdList.contains(list.id)
|
||||
? Text(
|
||||
list.content!,
|
||||
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 14.sp),
|
||||
)
|
||||
: Container(
|
||||
// color: Colors.red,
|
||||
child: HideText(
|
||||
text: list.content!,
|
||||
maxWidth: Get.width - 90.sp,
|
||||
additionText: '查看更多',
|
||||
maxLines: 15,
|
||||
style: TextStyle(color: Color(0xFFF7FAFA), fontSize: 14.sp),
|
||||
additionStyle:
|
||||
TextStyle(color: const Color(0xFFFF4DF6), fontSize: 14.sp),
|
||||
onTap: () {
|
||||
logic.openCallOutIdList.add(list.id!);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 20.sp),
|
||||
// alignment: index % 2 == 0 ? Alignment.centerRight : Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(top: 10.sp,bottom:10.sp),
|
||||
width: Get.width,
|
||||
padding: EdgeInsets.only(left: 5.sp, right: 5.sp),
|
||||
// height: widgetAllHeight + wordsHeight,
|
||||
@ -795,7 +657,8 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
margin: EdgeInsets.only(
|
||||
top: 10.sp, bottom: 10.sp, left: 10.sp, right: 10.sp),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text.rich(TextSpan(children: <InlineSpan>[
|
||||
child:
|
||||
(list!.isQueen!) ? Text.rich(TextSpan(children: <InlineSpan>[
|
||||
if (list!.isQueen!)
|
||||
WidgetSpan(
|
||||
child: Container(
|
||||
@ -825,11 +688,14 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
),
|
||||
)),
|
||||
),
|
||||
TextSpan(
|
||||
// WidgetSpan(
|
||||
// child:descText)
|
||||
TextSpan(
|
||||
text: list.content!,
|
||||
style: TextStyle(
|
||||
color: Color(0xFFF7FAFA), fontSize: 14.sp)),
|
||||
])),
|
||||
])
|
||||
) : descText,
|
||||
),
|
||||
if (picHeight > 0) picOrVideoItem(picHeight, list),
|
||||
circleInfoItem(list)
|
||||
@ -1035,6 +901,7 @@ class _WorldCallOutPageState extends State<WorldCallOutPage>
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
if (isSelf)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
@ -116,19 +116,18 @@ class _AddWxTipState extends State<AddWxTip> {
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
if (widget.isHidden) {
|
||||
|
||||
var result = await DioManager().post(
|
||||
url: Api.confset ,params: {'hideContact':widget.isWxHidden ? 0 : 1}
|
||||
);
|
||||
if (result['code'] == 200) {
|
||||
showOKToast('操作成功');
|
||||
}
|
||||
Get.back();
|
||||
|
||||
var result = await DioManager()
|
||||
.post(url: Api.confset, params: {
|
||||
'hideContact': widget.isWxHidden ? 0 : 1
|
||||
});
|
||||
if (result['code'] == 200) {
|
||||
showOKToast('操作成功');
|
||||
}
|
||||
Get.back();
|
||||
} else {
|
||||
showOKToast('为了维护站内的社交环境,联系信息填写必须真实哦~');
|
||||
Get.back();
|
||||
showUpdateWxPicker(phone: '1');
|
||||
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
@ -142,8 +141,8 @@ class _AddWxTipState extends State<AddWxTip> {
|
||||
child: Text(
|
||||
widget.isHidden
|
||||
? widget.isWxHidden
|
||||
? '取消隐藏方式'
|
||||
: '隐藏联系方式'
|
||||
? '取消隐藏方式'
|
||||
: '隐藏联系方式'
|
||||
: '手机号即微信',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
@ -168,7 +167,9 @@ class _AddWxTipState extends State<AddWxTip> {
|
||||
borderRadius:
|
||||
BorderRadius.circular(4.sp)),
|
||||
child: Text(
|
||||
widget.isHaveWx ? ' 更新联系方式 ':' 填写联系方式 ',
|
||||
widget.isHaveWx
|
||||
? ' 更新联系方式 '
|
||||
: ' 填写联系方式 ',
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 14.sp),
|
||||
),
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../app/minefragment/logic.dart';
|
||||
import '../../../network/api.dart';
|
||||
import '../../../network/dio_manager.dart';
|
||||
import '../../../util/PaymentUtils.dart';
|
||||
@ -16,12 +17,24 @@ class Open_vip_tipLogic extends GetxController {
|
||||
bool isYean = false;
|
||||
|
||||
bool isShowInviteTip = false;
|
||||
bool isVip = false;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
}
|
||||
getMode() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
if(bean.data.user.vip>0){
|
||||
isVip = true;
|
||||
} else if (bean.data.last_vip_expire_date != '') {
|
||||
isVip = true;
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
loadData() async {
|
||||
var data = await DioManager.instance.get(url: Api.getVipPrice, params: {});
|
||||
|
||||
@ -29,8 +29,6 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
|
||||
|
||||
final state = Get.find<Open_vip_tipLogic>().state;
|
||||
|
||||
bool isVip = false;
|
||||
|
||||
Map<String,String> vipImgMap = {
|
||||
"身份标识" : 'vip_fun_1',
|
||||
"专属客服": 'vip_fun_2',
|
||||
@ -53,22 +51,10 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
logic.loadData();
|
||||
logic.getMode();
|
||||
logic.isShowInvite();
|
||||
}
|
||||
|
||||
getMode() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
User userInfoBean = bean.data.user;
|
||||
isVip = userInfoBean!.vip! > 0;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List vipFuncList = [
|
||||
@ -299,7 +285,7 @@ class _Open_vip_tipPageState extends State<Open_vip_tipPage> {
|
||||
Color(0xffD739EA)
|
||||
])),
|
||||
child: Text(
|
||||
isVip ? '续费特权' : '领取特权',
|
||||
logic.isVip ? '续费特权' : '领取特权',
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
|
||||
@ -7,6 +7,8 @@ class AppColor {
|
||||
static Color bgColor = Color(0xFF120D29);
|
||||
static Color mainBgColor = Color(0XFF392D53);
|
||||
|
||||
static Color cityBgColor = Color.fromRGBO(52, 41, 67, 1);
|
||||
|
||||
static Gradient mainVerLinearGradient = const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF06F9FA),
|
||||
@ -54,5 +56,14 @@ class AppColor {
|
||||
end: Alignment.centerRight,
|
||||
);
|
||||
|
||||
static Gradient clearLinearGradient = LinearGradient(
|
||||
colors: [
|
||||
mainColor.withOpacity(0),
|
||||
mainColor.withOpacity(0),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -71,6 +71,12 @@ class Api {
|
||||
//mine 基本信息
|
||||
static const getUserMine = 'user-service/my/main';
|
||||
|
||||
//我关注的活跃用户列表
|
||||
static const activeUsers = '/user-service/follow/activeUsers';
|
||||
|
||||
|
||||
//访客未读消息
|
||||
static const getVisitorMsg = '/user-service/visit/getVisitorMsg';
|
||||
|
||||
//发消息是否需要vip弹窗
|
||||
static const getIsVips = 'mall-service/vips/show/';
|
||||
@ -99,6 +105,15 @@ class Api {
|
||||
//拉黑
|
||||
static const setBlock = 'user-service/user/';
|
||||
|
||||
//圈子代理人
|
||||
static const interestAgent = '/up-service/interest/agent/';
|
||||
|
||||
//申请圈子代理人
|
||||
static const applyToAgent = '/up-service/interest/applyToAgent/';
|
||||
|
||||
//打赏圈子代理人
|
||||
static const rewardAgent = '/up-service/interest/agent/reward';
|
||||
|
||||
|
||||
//喜欢
|
||||
static const setLike = 'user-service/user/';
|
||||
@ -238,7 +253,7 @@ class Api {
|
||||
static const UnlockWx = 'user-service/wxNum/unlock';
|
||||
|
||||
//微信号填写文案
|
||||
static const popWxNumStr = 'user-service/content/popup/wxNum';
|
||||
static const popWxNumStr = 'user-service/content/popup/contact';
|
||||
|
||||
//微信号修改
|
||||
static const updateWxNum = 'user-service/updateWxNum';
|
||||
@ -422,4 +437,7 @@ class Api {
|
||||
|
||||
//圈子分类
|
||||
static const categoriesList = '/up-service/interest/categories';
|
||||
|
||||
//good认证发送
|
||||
static const goodAuth = '/user-service/user/goodAuth';
|
||||
}
|
||||
@ -43,9 +43,9 @@ class DioManager {
|
||||
// baseUrl2
|
||||
baseUrl:
|
||||
// Api.baseUrl2,
|
||||
Api.baseUrl,
|
||||
// Api.baseUrl,
|
||||
|
||||
// type == 1 ? Api.baseUrl2 : Api.baseUrl1,
|
||||
type == 1 ? Api.baseUrl2 : Api.baseUrl1,
|
||||
// 连接服务器超时时间,单位是毫秒
|
||||
connectTimeout: const Duration(seconds: 30),
|
||||
// 接收数据的最长时限
|
||||
@ -197,7 +197,7 @@ class DioManager {
|
||||
var connectivityResult = await Connectivity().checkConnectivity();
|
||||
|
||||
if (connectivityResult == ConnectivityResult.none) {
|
||||
// showToast("");
|
||||
// showOKToast("网络不流畅哦,请检查网络情况");
|
||||
return {'code': 404, 'msg': '网络不流畅哦,请检查网络情况'};
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ class DioManager {
|
||||
pushLoginPage();
|
||||
break;
|
||||
}
|
||||
if (responseMap["code"] != 200 && responseMap["code"] != 10000 && !url.contains(Api.checkWxNumState) && responseMap["code"] != 21201 && responseMap['code'] != 404) {
|
||||
if (responseMap["code"] != 200 && responseMap["code"] != 10000 && !url.contains(Api.checkWxNumState) && responseMap["code"] != 21201 && responseMap['code'] != 32104) {
|
||||
showOKToast(responseMap['msg']);
|
||||
}
|
||||
}
|
||||
@ -295,20 +295,13 @@ class DioManager {
|
||||
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
|
||||
return {'code': 500, 'msg': ''};
|
||||
}
|
||||
// // DioError是指返回值不为200的情况
|
||||
// logger.shout('DioError报错${e.type}:${e.error.toString()}');
|
||||
// // 对错误进行判断
|
||||
// onErrorInterceptor(e);
|
||||
// // 判断是否断网了
|
||||
// String? errorMsg = isNetworkConnected
|
||||
// ? e.requestOptions.extra["errorMsg"]
|
||||
// : "网络连接断开,请检查网络设置";
|
||||
return {'code': 500, 'msg': '服务器开小差了,请重试'};
|
||||
} catch (e) {
|
||||
SharedPreferencesHelper sp = await SharedPreferencesHelper.getInstance();
|
||||
if (sp.getString(SharedPreferencesHelper.LOGINPHONE) == '18800000100') {
|
||||
return {'code': 500, 'msg': ''};
|
||||
}
|
||||
|
||||
// 其他一些意外的报错
|
||||
return {'code': 500, 'msg': '加载中...'};
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ showOKToast(String msg) {
|
||||
msg,
|
||||
duration: Duration(seconds: msg.length > 15 ? 5 : msg.length > 10 ? 3 : 2),
|
||||
position: ToastPosition.center,
|
||||
backgroundColor: Colors.black.withOpacity(0.8),
|
||||
backgroundColor: Colors.black,
|
||||
radius: 13.0,
|
||||
textStyle: const TextStyle(fontSize: 16.0,color: Colors.white),
|
||||
);
|
||||
@ -1099,6 +1099,8 @@ pushPage(String action,String param,{String name = ''}) {
|
||||
// public final static String GOOD_RATE = "good_rate";//好评反馈
|
||||
// public final static String BUY_VIP = "buy_vip";//购买会员
|
||||
// public final static String RECHARGE = "recharge";//充值
|
||||
// public final static String INTEREST = "interest";//圈子
|
||||
// public final static String GOOD_AUTH = "good_auth";//good认证
|
||||
if (action == 'my_main') {
|
||||
Get.until((route) => route.settings.name == '/home');
|
||||
final homeLogic = Get.put(HomeLogic());
|
||||
@ -1149,10 +1151,142 @@ pushPage(String action,String param,{String name = ''}) {
|
||||
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Chat, arguments: con);
|
||||
} else if(action == 'interest') {
|
||||
Get.toNamed(AppRoutes.Signal_circle_list,arguments: param);
|
||||
} else if(action == 'good_auth') {
|
||||
var con;
|
||||
if(kDebugMode){
|
||||
con = V2TimConversation(
|
||||
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
|
||||
}else{
|
||||
con = V2TimConversation(
|
||||
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Chat, arguments: con);
|
||||
DioManager.instance.post(url: Api.goodAuth);
|
||||
} else if (action == 'apply_interest_agent') {
|
||||
sendApplyToAgentData(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sendApplyToAgentData(var circleId) async {
|
||||
var data = await DioManager.instance
|
||||
.post(url: Api.applyToAgent + '$circleId');
|
||||
if (data['code'] == 200) {
|
||||
|
||||
var con;
|
||||
if(kDebugMode){
|
||||
con = V2TimConversation(
|
||||
conversationID: "c2c_qpqz_dev_10_102", userID: "qpqz_dev_10_102", showName: "测试乐园客服", type: 1);
|
||||
}else{
|
||||
con = V2TimConversation(
|
||||
conversationID: "c2c_qpqz_prod_10_102", userID: "qpqz_prod_10_102", showName: "乐园客服", type: 1);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Chat, arguments: con);
|
||||
} else if (data['code'] == 32104) {
|
||||
showReportDialog(Get.context!,data['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
void showReportDialog(BuildContext context,String msg) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: Container(
|
||||
height: 200.sp,
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
color: AppColor.bgColor,
|
||||
borderRadius: BorderRadius.circular(12.0.sp),
|
||||
// gradient: const LinearGradient(
|
||||
// colors: [Color(0xFFDD3DF4), Color(0xFF30FFD9)],
|
||||
// begin: Alignment.topCenter,
|
||||
// end: Alignment.bottomCenter,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// margin: EdgeInsets.all(1.sp),
|
||||
// child: Image.asset(getMineImage("im_neglect"),fit: BoxFit.fill,),
|
||||
// ),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 12.sp),
|
||||
child: Column(
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
"申请代理提示",
|
||||
style:
|
||||
TextStyle(color: Colors.white, fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 12.sp, left: 14.sp, right: 14.sp),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
msg,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: const Color(0xCCF7FAFA), fontSize: 16.sp),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
Get.toNamed(AppRoutes.Invite);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 16.sp),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(17),
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0x26FFFFFF),
|
||||
Color(0x26FFFFFF),
|
||||
],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
top: 10.sp,
|
||||
bottom: 10.sp,
|
||||
left: 52.sp,
|
||||
right: 52.sp),
|
||||
child: const Text(
|
||||
"前往邀请",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<Position> getCurrentPosition() async {
|
||||
return await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user