Browse Source

safety

master
fmk 3 years ago
parent
commit
110892e82e
  1. 1
      lib/mine/mine_page.dart
  2. 50
      lib/view_widget/mine_vip_view.dart

1
lib/mine/mine_page.dart

@ -154,6 +154,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
/// VIP等级信息
MineVipView(
tag: "vip",
ranks: ranks,
userInfo: userInfo,
rank: (userInfo != null)

50
lib/view_widget/mine_vip_view.dart

@ -21,7 +21,7 @@ class MineVipView extends StatelessWidget {
MineVipView({
this.vipLevel = 1,
this.ranks,
this.tag = "",
this.tag,
this.userInfo,
this.padding = 16,
this.curLevel = 1,
@ -113,27 +113,8 @@ class MineVipView extends StatelessWidget {
break;
}
}
return GestureDetector(
onTap: () {
if (userInfo != null) {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/mine_vip_level_page', arguments: {
"rankLevel": curLevel,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "",
"points": (userInfo != null) ? int.tryParse(userInfo.points) : 0,
});
});
}
},
child: Hero(
tag: tag,
child: Container(
Widget widget = Container(
margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h),
width: MediaQuery.of(context).size.width - 32.w,
height: (MediaQuery.of(context).size.width - 32.w) /
@ -305,8 +286,29 @@ class MineVipView extends StatelessWidget {
),
],
),
),
),
);
return GestureDetector(
onTap: () {
if (userInfo != null) {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/mine_vip_level_page', arguments: {
"rankLevel": curLevel,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "",
"points": (userInfo != null) ? int.tryParse(userInfo.points) : 0,
});
});
}
},
child: (tag == null || tag == "")
? widget
: Hero(tag: tag, child: widget),
);
}
}

Loading…
Cancel
Save