|
|
|
@ -22,8 +22,7 @@ class VipTop extends StatefulWidget {
|
|
|
|
|
final VipCardHome vipCardHome; |
|
|
|
|
final Function onRefresh; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VipTop(this.vipCardHome,this.onRefresh); |
|
|
|
|
VipTop(this.vipCardHome, this.onRefresh); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
@ -98,7 +97,8 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
if (payRes['resultStatus'] == 9000 || |
|
|
|
|
payRes['resultStatus'] == '9000') { |
|
|
|
|
widget.onRefresh(); |
|
|
|
|
SmartDialog.showToast("支付成功", alignment: Alignment.center); |
|
|
|
|
SmartDialog.showToast("支付成功", |
|
|
|
|
alignment: Alignment.center); |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(payRes['memo'], |
|
|
|
|
alignment: Alignment.center); |
|
|
|
@ -121,9 +121,9 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
SizedBox( |
|
|
|
|
height: 15.h, |
|
|
|
|
), |
|
|
|
|
(!(widget?.vipCardHome?.member?.isVip ?? false))? |
|
|
|
|
vipCardList(): |
|
|
|
|
Padding( |
|
|
|
|
(!(widget?.vipCardHome?.member?.isVip ?? false)) |
|
|
|
|
? vipCardList() |
|
|
|
|
: Padding( |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
@ -156,7 +156,8 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: widget?.vipCardHome?.member?.vipDuration |
|
|
|
|
text: widget |
|
|
|
|
?.vipCardHome?.member?.vipDuration |
|
|
|
|
.toString() ?? |
|
|
|
|
"0", |
|
|
|
|
style: TextStyle( |
|
|
|
@ -208,9 +209,13 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"${(widget?.vipCardHome?.member?.isVipSubscribe ??false) ?"已开通自动续费":"续费回乡VIP"}", |
|
|
|
|
"${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "已开通自动续费" : "续费回乡VIP"}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color((widget?.vipCardHome?.member?.isVipSubscribe ??false)?0xff3A3936:0xff32A060), |
|
|
|
|
color: Color((widget?.vipCardHome |
|
|
|
|
?.member?.isVipSubscribe ?? |
|
|
|
|
false) |
|
|
|
|
? 0xff3A3936 |
|
|
|
|
: 0xff32A060), |
|
|
|
|
fontSize: 15.sp, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
), |
|
|
|
@ -219,7 +224,7 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
width: 6.w, |
|
|
|
|
), |
|
|
|
|
Image.asset( |
|
|
|
|
"${(widget?.vipCardHome?.member?.isVipSubscribe ??false) ? "assets/image/vip_xf.webp":"assets/image/icon_right.webp"}", |
|
|
|
|
"${(widget?.vipCardHome?.member?.isVipSubscribe ?? false) ? "assets/image/vip_xf.webp" : "assets/image/icon_right.webp"}", |
|
|
|
|
width: 16, |
|
|
|
|
height: 16, |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
@ -290,7 +295,7 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
), |
|
|
|
|
if (widget?.vipCardHome?.member?.isVip ?? false) |
|
|
|
|
Text( |
|
|
|
|
"有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0,( widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}", |
|
|
|
|
"有效期至 ${(widget?.vipCardHome?.member?.vipExpire ?? "").substring(0, (widget?.vipCardHome?.member?.vipExpire ?? "").indexOf(" "))}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xffFFFFFF), |
|
|
|
|
fontSize: 13.sp, |
|
|
|
@ -319,9 +324,9 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
selectIndex = position; |
|
|
|
|
if(widget?.vipCardHome?.member?.isVip ?? false){ |
|
|
|
|
if (widget?.vipCardHome?.member?.isVip ?? false) { |
|
|
|
|
vipShowBottomSheet(); |
|
|
|
|
} else{ |
|
|
|
|
} else { |
|
|
|
|
vipTreatyShowBottomSheet(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -445,7 +450,9 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
|
|
|
|
|
Widget renewBuildBottomSheetWidget(BuildContext context, state) { |
|
|
|
|
return Container( |
|
|
|
|
padding: EdgeInsets.only(top: 10.h,), |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
top: 10.h, |
|
|
|
|
), |
|
|
|
|
decoration: new BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: new BorderRadius.only( |
|
|
|
@ -457,13 +464,13 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Padding(padding:EdgeInsets.only(right:14.w), |
|
|
|
|
child: |
|
|
|
|
Row( |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 14.w), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).xuefeihuiyuan , |
|
|
|
|
S.of(context).xuefeihuiyuan, |
|
|
|
|
textAlign: TextAlign.center, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
@ -482,7 +489,9 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
SizedBox(height:11.h,), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 11.h, |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
height: 132.h, |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14.w), |
|
|
|
@ -497,7 +506,8 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
selectIndex = position; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: vipCardItem(widget?.vipCardHome?.cards[position], position), |
|
|
|
|
child: vipCardItem( |
|
|
|
|
widget?.vipCardHome?.cards[position], position), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
@ -505,7 +515,8 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 40.h, |
|
|
|
|
margin: EdgeInsets.only(top: 14.h,left: 14.w,right: 14.w,bottom:5.h), |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
top: 14.h, left: 14.w, right: 14.w, bottom: 5.h), |
|
|
|
|
decoration: new BoxDecoration( |
|
|
|
|
color: Color(0xff383A38), |
|
|
|
|
borderRadius: BorderRadius.circular(24)), |
|
|
|
@ -534,12 +545,12 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/user_vip_service_page'); |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/user_vip_service_page'); |
|
|
|
|
}, |
|
|
|
|
child: Padding( |
|
|
|
|
padding: EdgeInsets.only(left:14.w,bottom: 15.h), |
|
|
|
|
padding: EdgeInsets.only(left: 14.w, bottom: 15.h), |
|
|
|
|
child: Text.rich( |
|
|
|
|
TextSpan( |
|
|
|
|
children: [ |
|
|
|
@ -594,9 +605,9 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/user_vip_service_page'); |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/user_vip_service_page'); |
|
|
|
|
}, |
|
|
|
|
child: Padding( |
|
|
|
|
padding: EdgeInsets.only(left: 4.w), |
|
|
|
@ -705,6 +716,8 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
if (!(widget?.vipCardHome?.cards[selectIndex]?.autoSubscribe ?? |
|
|
|
|
false)) |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
state(() { |
|
|
|
@ -809,10 +822,10 @@ class _VipTop extends State<VipTop> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: 40.h, |
|
|
|
|
margin: EdgeInsets.only(top: 30.h), |
|
|
|
|
decoration: new BoxDecoration( |
|
|
|
|
color: Color(0xff383A38), |
|
|
|
|
borderRadius: BorderRadius.circular(24)), |
|
|
|
|