From 3ce4ebdd79f4f2cb3271330fc11b7c116674c49b Mon Sep 17 00:00:00 2001 From: fmk Date: Sat, 7 Aug 2021 18:42:37 +0800 Subject: [PATCH] image --- lib/home/home_page.dart | 4 ++-- lib/home/points_mall_page.dart | 2 +- lib/integral/integral_page.dart | 22 ++++++++++++++-------- lib/login/login_page.dart | 2 +- lib/mine/mine_vip_level_page.dart | 2 +- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index fb468027..2a8160ce 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -181,7 +181,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { moreText: S.of(context).renwuzhongxin, onTap: () { SharedPreferences.getInstance().then((value) { - if (value.getString('token') == null) { + if (value.getString('token') == null || value.getString('token') == "") { loginTips(); } else { Navigator.of(context).pushNamed('/router/integral_page'); @@ -192,7 +192,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { InkWell( onTap: () { SharedPreferences.getInstance().then((value) { - if (value.getString('token') == null) { + if (value.getString('token') == null || value.getString('token') == "") { loginTips(); } else { Navigator.of(context).pushNamed('/router/integral_page'); diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 8b7b0a08..0e06f305 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -292,7 +292,7 @@ class _PointsMallPage extends State arguments: {"goodsId": goods[index].id}); SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); String token = sharedPreferences.getString("token"); - if (token != null) queryUser(); + if (token != null && token != "") queryUser(); } _sortChange(item) { diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index 98fc9740..f007ee62 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -322,7 +322,7 @@ class _IntegralPage extends State { style: TextStyle( color: Color(0xFF353535), fontSize: 14.sp, - fontWeight: FontWeight.w500), + fontWeight: FontWeight.w500,), ), SizedBox( height: 10.h, @@ -442,7 +442,7 @@ class _IntegralPage extends State { style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16.sp, - color: Color(0xFF353535)), + color: Color(0xFF353535),), ), SizedBox( height: 10.h, @@ -465,7 +465,7 @@ class _IntegralPage extends State { mainAxisSpacing: 8.h, crossAxisSpacing: 18.w, padding: EdgeInsets.only(bottom: 32.h), - physics: new NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), itemBuilder: (context, position) { return signInItem(position); }, @@ -557,13 +557,19 @@ class _IntegralPage extends State { flex: 1, child: InkWell( onTap: () { - Navigator.of(context) - .pushNamed('/router/mine_vip_level_page', arguments: { - "rankLevel": rankLevel, - "createTime": + SharedPreferences.getInstance().then((value) { + if (value.getString("token") != null && value.getString("token") != "") { + Navigator.of(context) + .pushNamed('/router/mine_vip_level_page', arguments: { + "rankLevel": rankLevel, + "createTime": (userinfo != null) ? "${userinfo.createTime}" : "", - "points": + "points": (userinfo != null) ? int.tryParse(userinfo.points) : 0, + }); + } else { + + } }); }, child: Column( diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 923d356f..2ed589eb 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -398,7 +398,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { firstCurve: Curves.easeInQuart, secondCurve: Curves.easeInQuart, crossFadeState: isShowLogin ? CrossFadeState.showSecond : CrossFadeState.showFirst, - duration: Duration(milliseconds: Platform.isIOS ? 1000 : 300), + duration: Duration(milliseconds: Platform.isIOS ? 1000 : 1000), ); } diff --git a/lib/mine/mine_vip_level_page.dart b/lib/mine/mine_vip_level_page.dart index f86c955b..19557e62 100644 --- a/lib/mine/mine_vip_level_page.dart +++ b/lib/mine/mine_vip_level_page.dart @@ -70,7 +70,7 @@ class _MineVipLevelPage extends State { child: Column( children: [ AspectRatio( - aspectRatio: 1.8, + aspectRatio: 1.7, child: Swiper( viewportFraction: 0.95, loop: false,