|
|
@ -18,6 +18,8 @@ class MineVipView extends StatelessWidget { |
|
|
|
final double padding; |
|
|
|
final double padding; |
|
|
|
final UserInfo userInfo; |
|
|
|
final UserInfo userInfo; |
|
|
|
final List<Rank> ranks; |
|
|
|
final List<Rank> ranks; |
|
|
|
|
|
|
|
final bool showRank; |
|
|
|
|
|
|
|
final String price; |
|
|
|
|
|
|
|
|
|
|
|
MineVipView({ |
|
|
|
MineVipView({ |
|
|
|
this.vipLevel = 1, |
|
|
|
this.vipLevel = 1, |
|
|
@ -29,6 +31,8 @@ class MineVipView extends StatelessWidget { |
|
|
|
this.rankMax = 0, |
|
|
|
this.rankMax = 0, |
|
|
|
this.rank = 0, |
|
|
|
this.rank = 0, |
|
|
|
this.createTime = "", |
|
|
|
this.createTime = "", |
|
|
|
|
|
|
|
this.showRank, |
|
|
|
|
|
|
|
this.price |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
String topLeft = ""; |
|
|
|
String topLeft = ""; |
|
|
@ -217,9 +221,9 @@ class MineVipView extends StatelessWidget { |
|
|
|
// rank > rankMax |
|
|
|
// rank > rankMax |
|
|
|
// ? S.of(context).dangqiandengji |
|
|
|
// ? S.of(context).dangqiandengji |
|
|
|
// : "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}", |
|
|
|
// : "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}", |
|
|
|
(vipLevel < curLevel)?"":(((rank ?? 0) > rankMax || curLevel == 3 || curLevel ==2) |
|
|
|
(vipLevel == 3)?"":((vipLevel < curLevel)?"":(((rank ?? 0) > rankMax || curLevel == 3 || curLevel ==2) |
|
|
|
? S.of(context).dangqiandengji |
|
|
|
? S.of(context).dangqiandengji |
|
|
|
: "消费¥${rankMax - (rank ?? 0)}元 ${S.of(context).daoxiayidengji}"), |
|
|
|
: "消费¥${rankMax - (rank ?? 0)}元 ${S.of(context).daoxiayidengji}")), |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: textColor, |
|
|
|
color: textColor, |
|
|
@ -233,33 +237,43 @@ class MineVipView extends StatelessWidget { |
|
|
|
TextSpan( |
|
|
|
TextSpan( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
TextSpan( |
|
|
|
TextSpan( |
|
|
|
text: (vipLevel < curLevel)?rankMax.toString():rank.toString(), |
|
|
|
text: vipLevel == 3?"":((vipLevel <= curLevel)?rankMax.toString():rank.toString()), |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 26.sp, |
|
|
|
fontSize: 26.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: textColor, |
|
|
|
color: textColor, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
if ((rank ?? 0) <= rankMax) |
|
|
|
if(vipLevel == 3) |
|
|
|
TextSpan( |
|
|
|
TextSpan( |
|
|
|
text: rankMax > 0 ? "/$rankMax" : "/0", |
|
|
|
text: "${S.of(context).lijikaitong}¥${price??""}/永久", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
color: textColor, |
|
|
|
color: textColor, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
// if ((rank ?? 0) <= rankMax) |
|
|
|
|
|
|
|
// TextSpan( |
|
|
|
|
|
|
|
// text: rankMax > 0 ? "/$rankMax" : "/0", |
|
|
|
|
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// fontSize: 14.sp, |
|
|
|
|
|
|
|
// fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
// color: textColor, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
if(vipLevel <= curLevel && (showRank??true)) |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
height: 8.h, |
|
|
|
height: 8.h, |
|
|
|
child: ClipRRect( |
|
|
|
child: ClipRRect( |
|
|
|
borderRadius: BorderRadius.circular(6.5), |
|
|
|
borderRadius: BorderRadius.circular(6.5), |
|
|
|
child: LinearProgressIndicator( |
|
|
|
child: LinearProgressIndicator( |
|
|
|
value: rankMax > (rank ?? 0) ? ((vipLevel < curLevel) ? rankMax/rankMax:(rank ?? 0) / rankMax) : 0, |
|
|
|
value: rankMax > (rank ?? 0) ? ((vipLevel < curLevel) ? rankMax/rankMax: (rank ?? 0) / rankMax) : 0, |
|
|
|
backgroundColor: Colors.white, |
|
|
|
backgroundColor: Colors.white, |
|
|
|
color: levelColor, |
|
|
|
color: levelColor, |
|
|
|
), |
|
|
|
), |
|
|
@ -318,6 +332,7 @@ class MineVipView extends StatelessWidget { |
|
|
|
.pushNamed('/router/mine_vip_core', arguments: { |
|
|
|
.pushNamed('/router/mine_vip_core', arguments: { |
|
|
|
"rankLevel": curLevel, |
|
|
|
"rankLevel": curLevel, |
|
|
|
"userInfo":userInfo.masterCardRankName, |
|
|
|
"userInfo":userInfo.masterCardRankName, |
|
|
|
|
|
|
|
|
|
|
|
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "", |
|
|
|
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "", |
|
|
|
"expendAmount": double.tryParse(userInfo?.expendAmount??"0").toInt(), |
|
|
|
"expendAmount": double.tryParse(userInfo?.expendAmount??"0").toInt(), |
|
|
|
}); |
|
|
|
}); |
|
|
|