|
|
|
@ -6,6 +6,7 @@ import 'package:huixiang/retrofit/data/coupon.dart';
|
|
|
|
|
import 'package:huixiang/view_widget/custom_image.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/round_button.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/separator.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
|
|
class CouponWidget extends StatelessWidget { |
|
|
|
|
final GestureTapCallback callback; |
|
|
|
@ -43,14 +44,14 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
), |
|
|
|
|
if (coupon.status == 3) |
|
|
|
|
Positioned( |
|
|
|
|
top: 10, |
|
|
|
|
top: 10.h, |
|
|
|
|
right: 0, |
|
|
|
|
child: Transform.rotate( |
|
|
|
|
angle: pi / 5.0, |
|
|
|
|
child: Text( |
|
|
|
|
S.of(context).yishijiao, //已失效 |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 8, |
|
|
|
|
fontSize: 8.sp, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -70,29 +71,29 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(left: 20), |
|
|
|
|
child: MImage( |
|
|
|
|
margin: EdgeInsets.only(left: 20), |
|
|
|
|
child: MImage( |
|
|
|
|
(coupon == null || |
|
|
|
|
coupon.couponImg == null || |
|
|
|
|
coupon.couponImg == "") |
|
|
|
|
coupon.couponImg == null || |
|
|
|
|
coupon.couponImg == "") |
|
|
|
|
? "" |
|
|
|
|
: coupon.couponImg, |
|
|
|
|
) |
|
|
|
|
// Image.network( |
|
|
|
|
) |
|
|
|
|
// Image.network( |
|
|
|
|
|
|
|
|
|
// width: 60, |
|
|
|
|
// height: 60, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// errorBuilder: (context, error, e) { |
|
|
|
|
// return Image.asset( |
|
|
|
|
// "assets/image/default_1.png"); |
|
|
|
|
// }, |
|
|
|
|
// ), |
|
|
|
|
), |
|
|
|
|
// width: 60, |
|
|
|
|
// height: 60, |
|
|
|
|
// fit: BoxFit.cover, |
|
|
|
|
// errorBuilder: (context, error, e) { |
|
|
|
|
// return Image.asset( |
|
|
|
|
// "assets/image/default_1.png"); |
|
|
|
|
// }, |
|
|
|
|
// ), |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Container( |
|
|
|
|
height: 60, |
|
|
|
|
height: 60.h, |
|
|
|
|
margin: EdgeInsets.only(left: 12), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: |
|
|
|
@ -109,7 +110,7 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
coupon.couponName ?? "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
fontSize: 14, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -118,12 +119,12 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
? Row( |
|
|
|
|
children: [ |
|
|
|
|
RoundButton( |
|
|
|
|
width: 42, |
|
|
|
|
height: 21, |
|
|
|
|
width: 42.w, |
|
|
|
|
height: 21.h, |
|
|
|
|
text: |
|
|
|
|
S.of(context).lingqu, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
top: 2, |
|
|
|
|
bottom: 2, |
|
|
|
@ -148,7 +149,7 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color( |
|
|
|
|
0xFF32A060), |
|
|
|
|
fontSize: 12, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Icon( |
|
|
|
@ -172,7 +173,7 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
child: Text( |
|
|
|
|
coupon.couponDescription ?? "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10, |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -201,13 +202,17 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
alignment: Alignment.centerLeft, |
|
|
|
|
child: Text( |
|
|
|
|
coupon.status == 0 |
|
|
|
|
? S.of(context).faxingshijian(coupon.publishStartTime) |
|
|
|
|
? S |
|
|
|
|
.of(context) |
|
|
|
|
.faxingshijian(coupon.publishStartTime) |
|
|
|
|
: coupon.status == 1 |
|
|
|
|
? S.of(context).lingqushijian(coupon.receiveTime) |
|
|
|
|
? S |
|
|
|
|
.of(context) |
|
|
|
|
.lingqushijian(coupon.receiveTime) |
|
|
|
|
: S.of(context).shiyongriqi, |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF727272), |
|
|
|
|
fontSize: 10, |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -252,14 +257,14 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
"领取成功", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff353535), |
|
|
|
|
fontSize: 16, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
fontWeight: FontWeight.bold), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"您已成功领取优惠劵,请在", |
|
|
|
|
style: |
|
|
|
|
TextStyle(color: Color(0xff353535), fontSize: 14), |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff353535), fontSize: 14.sp), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
@ -269,7 +274,7 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
"卡包-可使用", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xffFF7A1A), |
|
|
|
|
fontSize: 14, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.bold), |
|
|
|
|
), |
|
|
|
|
onTap: callback, |
|
|
|
@ -277,18 +282,18 @@ class CouponWidget extends StatelessWidget {
|
|
|
|
|
Text( |
|
|
|
|
"中查看", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xff353535), fontSize: 14), |
|
|
|
|
color: Color(0xff353535), fontSize: 14.sp), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(top: 30), |
|
|
|
|
padding: EdgeInsets.only(top: 30.h), |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 130, |
|
|
|
|
height: 34, |
|
|
|
|
width: 130.w, |
|
|
|
|
height: 34.h, |
|
|
|
|
text: S.of(context).queren, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontSize: 12, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
callback: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|