|
|
@ -24,9 +24,9 @@ class CouponWidget extends StatefulWidget { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _CouponWidget extends State<CouponWidget> { |
|
|
|
class _CouponWidget extends State<CouponWidget> { |
|
|
|
|
|
|
|
bool selectIndex = false; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Container( |
|
|
|
return Container( |
|
|
@ -101,9 +101,13 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
// flex: 1, |
|
|
|
// flex: 1, |
|
|
|
// ), |
|
|
|
// ), |
|
|
|
SizedBox(width:8,), |
|
|
|
SizedBox( |
|
|
|
|
|
|
|
width: 8, |
|
|
|
|
|
|
|
), |
|
|
|
couponListWidget(context), |
|
|
|
couponListWidget(context), |
|
|
|
SizedBox(width:5,), |
|
|
|
SizedBox( |
|
|
|
|
|
|
|
width: 5, |
|
|
|
|
|
|
|
), |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
flex: 2, |
|
|
|
flex: 2, |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
@ -172,7 +176,13 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
margin: EdgeInsets.only(right: 23.w), |
|
|
|
margin: EdgeInsets.only(right: 23.w), |
|
|
|
child: GestureDetector( |
|
|
|
child: GestureDetector( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
Navigator.of(context).pop(widget.couponList); |
|
|
|
if(widget.selected == true){ |
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
|
|
|
.pop(); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
|
|
|
.pop(widget.couponList); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Image.asset( |
|
|
|
child: Image.asset( |
|
|
|
widget.selected |
|
|
|
widget.selected |
|
|
@ -233,7 +243,7 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
widget.couponList.isEx = |
|
|
|
widget.couponList.isEx = |
|
|
|
!(widget.couponList.isEx ?? false); |
|
|
|
!(widget.couponList.isEx ?? false); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
@ -262,18 +272,21 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
if ((widget.couponList?.isEx ?? false) && (widget.couponList?.usableReason != null)) |
|
|
|
if ((widget.couponList?.isEx ?? false) && |
|
|
|
|
|
|
|
(widget.couponList.usableReason != null)) |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Expanded(child: Text( |
|
|
|
Expanded( |
|
|
|
|
|
|
|
child: Text( |
|
|
|
"不可用原因:", |
|
|
|
"不可用原因:", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Color(0xFF353535), |
|
|
|
color: Color(0xFF353535), |
|
|
|
fontSize: 10.sp, |
|
|
|
fontSize: 10.sp, |
|
|
|
), |
|
|
|
), |
|
|
|
)), |
|
|
|
)), |
|
|
|
Expanded(child: Align( |
|
|
|
Expanded( |
|
|
|
|
|
|
|
child: Align( |
|
|
|
alignment: Alignment.centerRight, |
|
|
|
alignment: Alignment.centerRight, |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
widget.couponList.usableReason ?? "", |
|
|
|
widget.couponList.usableReason ?? "", |
|
|
@ -283,8 +296,7 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
fontSize: 10.sp, |
|
|
|
fontSize: 10.sp, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
)) |
|
|
|
)), |
|
|
|
, |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
@ -312,7 +324,7 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
color: Color(0xff32A060), |
|
|
|
color: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
@ -325,20 +337,19 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 30.sp, |
|
|
|
fontSize: 30.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xff32A060), |
|
|
|
color: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
S.of(context).manyuankeyong(widget.couponList != null |
|
|
|
S.of(context).manyuankeyong(widget.couponList != null |
|
|
|
? ("${widget.couponList.fullAmount}" ?? "0") |
|
|
|
? ("${widget.couponList.fullAmount}" ?? "0").toString() |
|
|
|
.toString() |
|
|
|
|
|
|
|
: ""), |
|
|
|
: ""), |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xff32A060), |
|
|
|
color: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
@ -349,13 +360,13 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.only(bottom:10,top: 7,left: 12), |
|
|
|
padding: EdgeInsets.only(bottom: 10, top: 7, left: 12), |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
S.of(context).duihuanquan, |
|
|
|
S.of(context).duihuanquan, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 26.sp, |
|
|
|
fontSize: 26.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xff32A060), |
|
|
|
color: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
@ -364,7 +375,7 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xff32A060), |
|
|
|
color: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
@ -375,7 +386,7 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.only(bottom:10,top: 7,left: 12), |
|
|
|
padding: EdgeInsets.only(bottom: 10, top: 7, left: 12), |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
S.of(context).duihuanquan, |
|
|
|
S.of(context).duihuanquan, |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
@ -410,27 +421,29 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
color: widget.couponList.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), |
|
|
|
color: widget.couponList.status == 3 |
|
|
|
|
|
|
|
? Color(0xFFB3B3B3) |
|
|
|
|
|
|
|
: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
|
height: 4.h, |
|
|
|
height: 4.h, |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
widget.couponList != null |
|
|
|
widget.couponList != null |
|
|
|
? "${AppUtils.calculateDouble(double.tryParse(widget.couponList.limitAmount) ?? 0)}" |
|
|
|
? "${AppUtils.calculateDouble(double.tryParse(widget.couponList.limitAmount) ?? 0)}" |
|
|
|
: "", |
|
|
|
: "", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 28.sp, |
|
|
|
fontSize: 28.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xff32A060), |
|
|
|
color: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
); |
|
|
|
); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return Column( |
|
|
|
return Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
@ -441,14 +454,14 @@ class _CouponWidget extends State<CouponWidget> { |
|
|
|
textBaseline: TextBaseline.alphabetic, |
|
|
|
textBaseline: TextBaseline.alphabetic, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
widget.couponList != null |
|
|
|
widget.couponList != null |
|
|
|
? "${(widget.couponList.discountPercent / 10.0 >= 10) ? 10 : widget.couponList.discountPercent / 10.0}" ?? |
|
|
|
? "${(widget.couponList.discountPercent / 10.0 >= 10) ? 10 : widget.couponList.discountPercent / 10.0}" ?? |
|
|
|
"0" |
|
|
|
"0" |
|
|
|
: "", |
|
|
|
: "", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 30.sp, |
|
|
|
fontSize: 30.sp, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xff32A060), |
|
|
|
color: Color(0xff32A060), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
|