自测bug
This commit is contained in:
parent
21bd31452d
commit
d8a55f3e3e
@ -52,7 +52,7 @@ class FriendslistPage extends StatelessWidget {
|
|||||||
Widget ListItem(UserInfo item) {
|
Widget ListItem(UserInfo item) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: (){
|
onTap: (){
|
||||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id);
|
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(bottom: 21),
|
margin: EdgeInsets.only(bottom: 21),
|
||||||
|
|||||||
@ -13,9 +13,9 @@ class MinefragmentLogic extends GetxController {
|
|||||||
User? userInfoBean = null;
|
User? userInfoBean = null;
|
||||||
String ageMsg = "";
|
String ageMsg = "";
|
||||||
var isVip = 0;
|
var isVip = 0;
|
||||||
var like_count = "0";
|
var like_count = 0;
|
||||||
var like_me_count = "0";
|
var like_me_count = 0;
|
||||||
var recent_visit_count = "0";
|
var recent_visit_count = 0;
|
||||||
|
|
||||||
|
|
||||||
num like_me_count_new = 0;
|
num like_me_count_new = 0;
|
||||||
@ -32,19 +32,17 @@ class MinefragmentLogic extends GetxController {
|
|||||||
int likeMeCount = prefs.getInt("likeMeCount") ?? 0;
|
int likeMeCount = prefs.getInt("likeMeCount") ?? 0;
|
||||||
int recentVisitCount = prefs.getInt("recentVisitCount") ?? 0;
|
int recentVisitCount = prefs.getInt("recentVisitCount") ?? 0;
|
||||||
|
|
||||||
like_count = bean.data.likeCount.toString();
|
like_count = bean.data.likeCount??0;
|
||||||
like_me_count = bean.data.likeMeCount.toString();
|
like_me_count = bean.data.likeMeCount??0;
|
||||||
recent_visit_count = bean.data.recentVisitCount.toString();
|
recent_visit_count = bean.data.recentVisitCount??0;
|
||||||
|
|
||||||
|
|
||||||
// like_me_count_new = recentVisitCount.toInt() - bean.data.likeMeCount.toInt();
|
// like_me_count_new = recentVisitCount.toInt() - bean.data.likeMeCount.toInt();
|
||||||
|
|
||||||
like_me_count_new = (likeMeCount as int) - (bean.data.likeMeCount).toInt();
|
like_me_count_new = likeMeCount - like_me_count;
|
||||||
|
|
||||||
|
|
||||||
recent_visit_count_new = recentVisitCount-bean.data.recentVisitCount;
|
recent_visit_count_new = recentVisitCount-recent_visit_count;
|
||||||
prefs.setInt("likeMeCount", bean.data.likeMeCount);
|
|
||||||
prefs.setInt("recentVisitCount", bean.data.recentVisitCount);
|
|
||||||
|
|
||||||
|
|
||||||
userInfoBean = bean.data.user;
|
userInfoBean = bean.data.user;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:circle_app/router/app_routers.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../../util/util.dart';
|
import '../../util/util.dart';
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@ -214,7 +215,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
logic.like_count,
|
logic.like_count.toString(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 16.sp,
|
fontSize: 16.sp,
|
||||||
@ -241,8 +242,11 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: ()async {
|
||||||
print("喜欢我的");
|
if(null!=logic.like_me_count){
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
prefs.setInt("likeMeCount", logic.like_me_count);
|
||||||
|
}
|
||||||
Get.toNamed(AppRoutes.FriendsActivity, arguments: "1");
|
Get.toNamed(AppRoutes.FriendsActivity, arguments: "1");
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@ -254,7 +258,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
logic.like_me_count,
|
logic.like_me_count.toString(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 16.sp,
|
fontSize: 16.sp,
|
||||||
@ -287,7 +291,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
right: 0.sp,
|
right: 0.sp,
|
||||||
top: 15.sp,
|
top: 15.sp,
|
||||||
child: Text(
|
child: Text(
|
||||||
logic.like_me_count_new>0 ? logic.like_me_count_new.toString():"",
|
logic.like_me_count_new>0 ? "+"+logic.like_me_count_new.toString():"",
|
||||||
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
|
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -296,9 +300,14 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: () async{
|
||||||
print("最近来访");
|
if(null!=logic.recent_visit_count){
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
prefs.setInt("recentVisitCount", logic.recent_visit_count);
|
||||||
|
}
|
||||||
|
|
||||||
Get.toNamed(AppRoutes.FriendsActivity, arguments: "2");
|
Get.toNamed(AppRoutes.FriendsActivity, arguments: "2");
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
@ -309,7 +318,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
logic.recent_visit_count,
|
logic.recent_visit_count.toString(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 16.sp,
|
fontSize: 16.sp,
|
||||||
@ -342,7 +351,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
right: 0.sp,
|
right: 0.sp,
|
||||||
top: 15.sp,
|
top: 15.sp,
|
||||||
child: Text(
|
child: Text(
|
||||||
logic.recent_visit_count_new>0 ? logic.recent_visit_count_new.toString():"",
|
logic.recent_visit_count_new>0 ? "+"+logic.recent_visit_count_new.toString():"",
|
||||||
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
|
style: TextStyle(color: Color.fromRGBO(0, 255, 210, 1.0)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -395,7 +404,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
if(logic.userInfoBean!=null){
|
if(logic.userInfoBean!=null){
|
||||||
var imgList = <String>[];
|
var imgList = <String>[];
|
||||||
imgList.add(logic.userInfoBean!.avatar!);
|
imgList.add(logic.userInfoBean!.avatar);
|
||||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||||
'imaglist': imgList,
|
'imaglist': imgList,
|
||||||
@ -408,7 +417,7 @@ class MinefragmentPage extends StatelessWidget {
|
|||||||
width: 65.sp,
|
width: 65.sp,
|
||||||
height: 65.sp,
|
height: 65.sp,
|
||||||
): CachedNetworkImage(
|
): CachedNetworkImage(
|
||||||
imageUrl: logic.userInfoBean!=null ? logic.userInfoBean!.avatar!: "",
|
imageUrl: logic.userInfoBean!=null ? logic.userInfoBean!.avatar: "",
|
||||||
width: 65.sp,
|
width: 65.sp,
|
||||||
height: 65.sp,
|
height: 65.sp,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -42,7 +42,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
print('Current tab index: ${_tabController.previousIndex}');
|
print('Current tab index: ${_tabController.previousIndex}');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_tabController.dispose();
|
_tabController.dispose();
|
||||||
@ -61,10 +60,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final logic = Get.find<UserinfoLogic>();
|
final logic = Get.find<UserinfoLogic>();
|
||||||
final state = Get.find<UserinfoLogic>().state;
|
final state = Get.find<UserinfoLogic>().state;
|
||||||
|
|
||||||
@ -93,7 +88,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
Positioned(
|
Positioned(
|
||||||
bottom: 27.sp,
|
bottom: 27.sp,
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
child: logic.isShowAlbum ? _MeInfoButton(logic) : Container(),
|
child: _MeInfoButton(logic),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -103,7 +98,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
|
|
||||||
Widget _MeInfoButton(UserinfoLogic controller) {
|
Widget _MeInfoButton(UserinfoLogic controller) {
|
||||||
if (controller.isMe) {
|
if (controller.isMe) {
|
||||||
return Container();
|
return Container();
|
||||||
} else {
|
} else {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(left: 18.sp, right: 18.sp),
|
margin: EdgeInsets.only(left: 18.sp, right: 18.sp),
|
||||||
@ -112,7 +107,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// showToast("鼓掌");
|
// showToast("鼓掌");
|
||||||
_showBottomSheet(context);
|
_showBottomSheet(context);
|
||||||
},
|
},
|
||||||
child: Image(
|
child: Image(
|
||||||
@ -295,6 +290,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
titleTab(controller),
|
titleTab(controller),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(bottom: 26.sp),
|
||||||
// color: Colors.blue,
|
// color: Colors.blue,
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
@ -375,109 +371,111 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Widget _imageAdapter(UserinfoLogic controller) {
|
Widget _imageAdapter(UserinfoLogic controller) {
|
||||||
return Stack(children: [
|
return Stack(
|
||||||
Container(
|
children: [
|
||||||
child: Column(
|
Column(
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
controller.isMe? Container(
|
||||||
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
||||||
child: controller.isMe
|
child:
|
||||||
? Text(
|
Text(
|
||||||
controller.isLikeFoMsg,
|
controller.isLikeFoMsg,
|
||||||
style: const TextStyle(color: Colors.white30),
|
style: const TextStyle(color: Colors.white30),
|
||||||
)
|
)):Container(),
|
||||||
: Container()),
|
Expanded(child: Container(
|
||||||
GridView.builder(
|
margin: EdgeInsets.only(bottom: 28.0),
|
||||||
shrinkWrap: true,
|
child: GridView.builder(
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
shrinkWrap: true,
|
||||||
crossAxisCount: 3, // 每行显示的项目数量
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
),
|
crossAxisCount: 3, // 每行显示的项目数量
|
||||||
itemCount: controller.isMe
|
),
|
||||||
? controller.isEdit
|
itemCount: controller.isMe
|
||||||
? controller.state.imaglist.length + 1
|
? controller.isEdit
|
||||||
: controller.state.imaglist.length
|
? controller.state.imaglist.length + 1
|
||||||
: controller.state.imaglist.length, // 项目的总数量,包括固定图片和接口获取的项目
|
: controller.state.imaglist.length
|
||||||
itemBuilder: (BuildContext context, int index) {
|
: controller.state.imaglist.length, // 项目的总数量,包括固定图片和接口获取的项目
|
||||||
if (controller.isMe && controller.isEdit) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
if (index == 0) {
|
if (controller.isMe && controller.isEdit) {
|
||||||
// 第一个项目,显示固定的图片
|
if (index == 0) {
|
||||||
return GestureDetector(
|
// 第一个项目,显示固定的图片
|
||||||
onTap: () {
|
return GestureDetector(
|
||||||
controller.getImageFile();
|
onTap: () {
|
||||||
},
|
controller.getImageFile();
|
||||||
child: Container(
|
},
|
||||||
margin: EdgeInsets.all(5.sp),
|
child: Container(
|
||||||
child: Image(
|
margin: EdgeInsets.all(5.sp),
|
||||||
image: AssetImage(getMineImage("icon_img_add")),
|
child: Image(
|
||||||
|
image: AssetImage(getMineImage("icon_img_add")),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
} else {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.all(5.sp),
|
||||||
|
child: Center(
|
||||||
|
child: _buildImageItem(
|
||||||
|
controller.state.imaglist[index - 1].url,
|
||||||
|
controller,
|
||||||
|
index - 1)),
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.all(5.sp),
|
margin: EdgeInsets.all(5.sp),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: _buildImageItem(
|
child: _buildImageItem(
|
||||||
controller.state.imaglist[index - 1].url,
|
controller.state.imaglist[index].url,
|
||||||
controller,
|
controller,
|
||||||
index - 1)),
|
index)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
},
|
||||||
return Container(
|
),
|
||||||
margin: EdgeInsets.all(5.sp),
|
))
|
||||||
child: Center(
|
|
||||||
child: _buildImageItem(
|
|
||||||
controller.state.imaglist[index].url,
|
|
||||||
controller,
|
|
||||||
index)),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
logic.isMe
|
||||||
Positioned(
|
? Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 27.sp,
|
bottom: 27.sp,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// showToast("完善资料");
|
// showToast("完善资料");
|
||||||
Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user");
|
Get.toNamed(AppRoutes.Complete_materialPage,
|
||||||
// controller.onInit();
|
arguments: "user");
|
||||||
},
|
// controller.onInit();
|
||||||
child: Center(
|
},
|
||||||
child: Container(
|
child: Center(
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
borderRadius: BorderRadius.circular(17),
|
decoration: BoxDecoration(
|
||||||
gradient: LinearGradient(
|
borderRadius: BorderRadius.circular(17),
|
||||||
colors: [
|
gradient: LinearGradient(
|
||||||
Color(0xFF06F9FA),
|
colors: [
|
||||||
Color(0xFFDC5BFD),
|
Color(0xFF06F9FA),
|
||||||
],
|
Color(0xFFDC5BFD),
|
||||||
begin: Alignment.centerLeft,
|
],
|
||||||
end: Alignment.centerRight,
|
begin: Alignment.centerLeft,
|
||||||
|
end: Alignment.centerRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 10.sp, bottom: 10.sp, left: 55.sp, right: 55.sp),
|
||||||
|
child: Text(
|
||||||
|
"完善个人形象",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
))
|
||||||
padding: EdgeInsets.only(
|
: Container()
|
||||||
top: 10.sp, bottom: 10.sp, left: 55.sp, right: 55.sp),
|
],
|
||||||
child: Text(
|
);
|
||||||
"完善个人形象",
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 12,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
))
|
|
||||||
],);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildInfoRow(UserinfoLogic controller) {
|
Widget _buildInfoRow(UserinfoLogic controller) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user