You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
4.2 KiB
133 lines
4.2 KiB
3 years ago
|
import 'package:flutter/material.dart';
|
||
|
import 'package:huixiang/generated/l10n.dart';
|
||
|
import 'package:huixiang/retrofit/data/sign_info.dart';
|
||
|
import 'package:huixiang/retrofit/data/user_info.dart';
|
||
|
import 'package:huixiang/utils/font_weight.dart';
|
||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
|
|
||
|
class IntegralVip extends StatefulWidget {
|
||
|
|
||
|
final SignInfo signInfo;
|
||
|
final UserInfo userinfo;
|
||
|
final rankLevel;
|
||
|
|
||
|
IntegralVip(this.rankLevel, this.signInfo, this.userinfo);
|
||
|
|
||
|
@override
|
||
|
State<StatefulWidget> createState() {
|
||
|
return _IntegralVip();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
class _IntegralVip extends State<IntegralVip> {
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Container(
|
||
|
padding: EdgeInsets.symmetric(vertical: 16.h),
|
||
|
child: Row(
|
||
|
children: [
|
||
|
Expanded(
|
||
|
flex: 1,
|
||
|
child: Column(
|
||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
children: [
|
||
|
Text(
|
||
|
widget.signInfo != null ? "${widget.signInfo.point}" : "0",
|
||
|
style: TextStyle(
|
||
|
fontWeight: MyFontWeight.medium,
|
||
|
fontSize: 21.sp,
|
||
|
color: Colors.white,
|
||
|
),
|
||
|
),
|
||
|
SizedBox(
|
||
|
height: 6.h,
|
||
|
),
|
||
|
Text(
|
||
|
S.of(context).wodejifenzhi,
|
||
|
style: TextStyle(
|
||
|
fontSize: 12.sp,
|
||
|
fontWeight: MyFontWeight.regular,
|
||
|
color: Color(0xFFF2F2F2),
|
||
|
),
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
Container(
|
||
|
width: 2.w,
|
||
|
height: 32.h,
|
||
|
color: Color(0xFFFFFFFF),
|
||
|
),
|
||
|
Expanded(
|
||
|
flex: 1,
|
||
|
child: InkWell(
|
||
|
onTap: () {
|
||
|
SharedPreferences.getInstance().then((value) {
|
||
|
if (value.getString("token") != null &&
|
||
|
value.getString("token") != "") {
|
||
|
Navigator.of(context)
|
||
|
.pushNamed('/router/mine_vip_level_page', arguments: {
|
||
|
"rankLevel": widget.rankLevel,
|
||
|
"createTime":
|
||
|
(widget.userinfo != null) ? "${widget.userinfo.createTime}" : "",
|
||
|
"points": (widget.userinfo != null)
|
||
|
? int.tryParse(widget.userinfo.points)
|
||
|
: 0,
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
child: Column(
|
||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
children: [
|
||
|
Text(
|
||
|
(widget.signInfo != null && widget.signInfo.rank != null)
|
||
|
? "${widget.signInfo.rank.rankName.replaceAll("会员", "")}"
|
||
|
: "",
|
||
|
style: TextStyle(
|
||
|
fontWeight: MyFontWeight.medium,
|
||
|
fontSize: 21.sp,
|
||
|
color: Colors.white,
|
||
|
),
|
||
|
),
|
||
|
SizedBox(
|
||
|
height: 6.h,
|
||
|
),
|
||
|
Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
children: [
|
||
|
Text(
|
||
|
S.of(context).wodehuiyuandengji,
|
||
|
style: TextStyle(
|
||
|
fontSize: 12.sp,
|
||
|
fontWeight: MyFontWeight.regular,
|
||
|
color: Color(0xFFF2F2F2),
|
||
|
),
|
||
|
),
|
||
|
Icon(
|
||
|
Icons.keyboard_arrow_right,
|
||
|
color: Colors.white,
|
||
|
size: 15,
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|