自测bug
This commit is contained in:
parent
21bd31452d
commit
d8a55f3e3e
@ -52,7 +52,7 @@ class FriendslistPage extends StatelessWidget {
|
||||
Widget ListItem(UserInfo item) {
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id);
|
||||
Get.toNamed(AppRoutes.UserInfoActivity, arguments: item.id.toString());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 21),
|
||||
|
||||
@ -13,9 +13,9 @@ class MinefragmentLogic extends GetxController {
|
||||
User? userInfoBean = null;
|
||||
String ageMsg = "";
|
||||
var isVip = 0;
|
||||
var like_count = "0";
|
||||
var like_me_count = "0";
|
||||
var recent_visit_count = "0";
|
||||
var like_count = 0;
|
||||
var like_me_count = 0;
|
||||
var recent_visit_count = 0;
|
||||
|
||||
|
||||
num like_me_count_new = 0;
|
||||
@ -32,19 +32,17 @@ class MinefragmentLogic extends GetxController {
|
||||
int likeMeCount = prefs.getInt("likeMeCount") ?? 0;
|
||||
int recentVisitCount = prefs.getInt("recentVisitCount") ?? 0;
|
||||
|
||||
like_count = bean.data.likeCount.toString();
|
||||
like_me_count = bean.data.likeMeCount.toString();
|
||||
recent_visit_count = bean.data.recentVisitCount.toString();
|
||||
like_count = bean.data.likeCount??0;
|
||||
like_me_count = bean.data.likeMeCount??0;
|
||||
recent_visit_count = bean.data.recentVisitCount??0;
|
||||
|
||||
|
||||
// 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;
|
||||
prefs.setInt("likeMeCount", bean.data.likeMeCount);
|
||||
prefs.setInt("recentVisitCount", bean.data.recentVisitCount);
|
||||
recent_visit_count_new = recentVisitCount-recent_visit_count;
|
||||
|
||||
|
||||
userInfoBean = bean.data.user;
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../util/util.dart';
|
||||
import 'logic.dart';
|
||||
@ -214,7 +215,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
logic.like_count,
|
||||
logic.like_count.toString(),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
@ -241,8 +242,11 @@ class MinefragmentPage extends StatelessWidget {
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
print("喜欢我的");
|
||||
onTap: ()async {
|
||||
if(null!=logic.like_me_count){
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.setInt("likeMeCount", logic.like_me_count);
|
||||
}
|
||||
Get.toNamed(AppRoutes.FriendsActivity, arguments: "1");
|
||||
},
|
||||
child: Stack(
|
||||
@ -254,7 +258,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
child: Text(
|
||||
logic.like_me_count,
|
||||
logic.like_me_count.toString(),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
@ -287,7 +291,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
right: 0.sp,
|
||||
top: 15.sp,
|
||||
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)),
|
||||
),
|
||||
)
|
||||
@ -296,9 +300,14 @@ class MinefragmentPage extends StatelessWidget {
|
||||
),
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
print("最近来访");
|
||||
onTap: () async{
|
||||
if(null!=logic.recent_visit_count){
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.setInt("recentVisitCount", logic.recent_visit_count);
|
||||
}
|
||||
|
||||
Get.toNamed(AppRoutes.FriendsActivity, arguments: "2");
|
||||
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
@ -309,7 +318,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
child: Text(
|
||||
logic.recent_visit_count,
|
||||
logic.recent_visit_count.toString(),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
@ -342,7 +351,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
right: 0.sp,
|
||||
top: 15.sp,
|
||||
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)),
|
||||
),
|
||||
)
|
||||
@ -395,7 +404,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
onTap: () {
|
||||
if(logic.userInfoBean!=null){
|
||||
var imgList = <String>[];
|
||||
imgList.add(logic.userInfoBean!.avatar!);
|
||||
imgList.add(logic.userInfoBean!.avatar);
|
||||
// Get.toNamed(AppRoutes.Swiper,arguments:imgList);
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
@ -408,7 +417,7 @@ class MinefragmentPage extends StatelessWidget {
|
||||
width: 65.sp,
|
||||
height: 65.sp,
|
||||
): CachedNetworkImage(
|
||||
imageUrl: logic.userInfoBean!=null ? logic.userInfoBean!.avatar!: "",
|
||||
imageUrl: logic.userInfoBean!=null ? logic.userInfoBean!.avatar: "",
|
||||
width: 65.sp,
|
||||
height: 65.sp,
|
||||
),
|
||||
|
||||
@ -42,7 +42,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
print('Current tab index: ${_tabController.previousIndex}');
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController.dispose();
|
||||
@ -61,10 +60,6 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final logic = Get.find<UserinfoLogic>();
|
||||
final state = Get.find<UserinfoLogic>().state;
|
||||
|
||||
@ -93,7 +88,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
Positioned(
|
||||
bottom: 27.sp,
|
||||
width: Get.width,
|
||||
child: logic.isShowAlbum ? _MeInfoButton(logic) : Container(),
|
||||
child: _MeInfoButton(logic),
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -295,6 +290,7 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
titleTab(controller),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 26.sp),
|
||||
// color: Colors.blue,
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
@ -375,24 +371,22 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Widget _imageAdapter(UserinfoLogic controller) {
|
||||
return Stack(children: [
|
||||
Container(
|
||||
child: Column(
|
||||
return Stack(
|
||||
children: [
|
||||
Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
controller.isMe? Container(
|
||||
margin: EdgeInsets.only(top: 18.sp, bottom: 14.sp),
|
||||
child: controller.isMe
|
||||
? Text(
|
||||
child:
|
||||
Text(
|
||||
controller.isLikeFoMsg,
|
||||
style: const TextStyle(color: Colors.white30),
|
||||
)
|
||||
: Container()),
|
||||
GridView.builder(
|
||||
)):Container(),
|
||||
Expanded(child: Container(
|
||||
margin: EdgeInsets.only(bottom: 28.0),
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, // 每行显示的项目数量
|
||||
@ -438,18 +432,20 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
logic.isMe
|
||||
? Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 27.sp,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// showToast("完善资料");
|
||||
Get.toNamed(AppRoutes.Complete_materialPage, arguments: "user");
|
||||
Get.toNamed(AppRoutes.Complete_materialPage,
|
||||
arguments: "user");
|
||||
// controller.onInit();
|
||||
},
|
||||
child: Center(
|
||||
@ -477,7 +473,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
),
|
||||
),
|
||||
))
|
||||
],);
|
||||
: Container()
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(UserinfoLogic controller) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user