w-R
3 years ago
13 changed files with 329 additions and 94 deletions
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 284 KiB |
After Width: | Height: | Size: 36 KiB |
@ -0,0 +1,203 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||||
|
import 'package:huixiang/generated/l10n.dart'; |
||||||
|
import 'package:huixiang/retrofit/data/login_info.dart'; |
||||||
|
import 'package:huixiang/utils/flutter_utils.dart'; |
||||||
|
import 'package:huixiang/utils/font_weight.dart'; |
||||||
|
import 'package:huixiang/view_widget/receive_success.dart'; |
||||||
|
import 'package:huixiang/view_widget/round_button.dart'; |
||||||
|
import 'package:huixiang/view_widget/separator.dart'; |
||||||
|
|
||||||
|
class ActivityCoupons extends StatefulWidget { |
||||||
|
// final List<NewUserCouponList> newUserCouponList; |
||||||
|
// |
||||||
|
// ActivityCoupons(this.newUserCouponList); |
||||||
|
|
||||||
|
@override |
||||||
|
State<StatefulWidget> createState() { |
||||||
|
return _ActivityCoupons(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
class _ActivityCoupons extends State<ActivityCoupons> { |
||||||
|
@override |
||||||
|
Widget build(BuildContext context) { |
||||||
|
return Container( |
||||||
|
margin: EdgeInsets.only(top:150.h), |
||||||
|
height: MediaQuery.of(context).size.height / 2, |
||||||
|
child: Column( |
||||||
|
children: [ |
||||||
|
Container( |
||||||
|
width: double.infinity, |
||||||
|
height:MediaQuery.of(context).size.height / 2, |
||||||
|
padding: EdgeInsets.only(top: 210.h), |
||||||
|
margin: EdgeInsets.only(top: 20.h, left: 20, right: 20), |
||||||
|
decoration: BoxDecoration( |
||||||
|
image: DecorationImage( |
||||||
|
fit: BoxFit.fill, |
||||||
|
image: AssetImage("assets/image/activity_q.png"), |
||||||
|
), |
||||||
|
), |
||||||
|
child: Column( |
||||||
|
children: [ |
||||||
|
Expanded( |
||||||
|
child: reward(), |
||||||
|
), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
Navigator.of(context).pop(); |
||||||
|
SmartDialog.showToast("领取成功",alignment: Alignment.center); |
||||||
|
}, |
||||||
|
child: Container( |
||||||
|
margin: EdgeInsets.only( |
||||||
|
left: 60.w, right: 60.w, top: 20.h, bottom:20.h), |
||||||
|
decoration: BoxDecoration( |
||||||
|
gradient: new LinearGradient( |
||||||
|
begin: Alignment.centerLeft, |
||||||
|
end: Alignment.centerRight, |
||||||
|
colors: [ |
||||||
|
Color(0xFFFFDCA1), |
||||||
|
Color(0xFFFAE4C0), |
||||||
|
]), |
||||||
|
borderRadius: BorderRadius.circular(22.5), |
||||||
|
), |
||||||
|
width: MediaQuery.of(context).size.width, |
||||||
|
height: 40, |
||||||
|
alignment: Alignment.center, |
||||||
|
child: Text( |
||||||
|
"立即领取", |
||||||
|
style: TextStyle( |
||||||
|
fontWeight: FontWeight.bold, |
||||||
|
fontSize: 14.sp, |
||||||
|
color: Color(0xFF4A4748), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
SizedBox(height: 35), |
||||||
|
GestureDetector( |
||||||
|
onTap: () { |
||||||
|
setState(() { |
||||||
|
Navigator.of(context).pop(); |
||||||
|
}); |
||||||
|
}, |
||||||
|
child: Image.asset( |
||||||
|
"assets/image/yq_qx.png", |
||||||
|
width: 34, |
||||||
|
height: 34, |
||||||
|
), |
||||||
|
) |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
Widget reward() { |
||||||
|
return ListView.builder( |
||||||
|
padding: EdgeInsets.zero, |
||||||
|
itemCount: 4, |
||||||
|
scrollDirection: Axis.vertical, |
||||||
|
shrinkWrap: true, |
||||||
|
physics: BouncingScrollPhysics(), |
||||||
|
itemBuilder: (context, position) { |
||||||
|
return GestureDetector( |
||||||
|
onTap: () {}, |
||||||
|
child: rewardItem(), |
||||||
|
); |
||||||
|
}, |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
Widget rewardItem() { |
||||||
|
return Container( |
||||||
|
height: 69.h, |
||||||
|
width: double.infinity, |
||||||
|
decoration: BoxDecoration( |
||||||
|
image: DecorationImage( |
||||||
|
fit: BoxFit.fill, |
||||||
|
image: AssetImage("assets/image/xin_rq.png"), |
||||||
|
), |
||||||
|
), |
||||||
|
margin: EdgeInsets.symmetric(horizontal: 60, vertical: 5), |
||||||
|
padding: EdgeInsets.only(left: 16.w, right: 25.w), |
||||||
|
child: Row( |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
children: [ |
||||||
|
Text.rich( |
||||||
|
TextSpan( |
||||||
|
children: [ |
||||||
|
TextSpan( |
||||||
|
text: "¥", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 25.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xFFDE5F3B), |
||||||
|
), |
||||||
|
), |
||||||
|
TextSpan( |
||||||
|
// text: double.tryParse( |
||||||
|
// "${newUserCouponList.discountAmount}" ?? "0") |
||||||
|
// .toInt() |
||||||
|
// .toString() ?? |
||||||
|
// "", |
||||||
|
text: "10", |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 35.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xFFDE5F3B), |
||||||
|
), |
||||||
|
), |
||||||
|
], |
||||||
|
), |
||||||
|
), |
||||||
|
Expanded(child:Padding( |
||||||
|
padding: EdgeInsets.only(top: 4, bottom: 4,left:10), |
||||||
|
child: Column( |
||||||
|
crossAxisAlignment: CrossAxisAlignment.center, |
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||||
|
children: [ |
||||||
|
Text( |
||||||
|
"海峡姐妹茶吧", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
maxLines: 2, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 14.sp, |
||||||
|
fontWeight: MyFontWeight.semi_bold, |
||||||
|
color: Color(0xFF181818), |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
"10元代金劵一张", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
maxLines: 2, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 12.sp, |
||||||
|
fontWeight: MyFontWeight.medium, |
||||||
|
color: Color(0xFFD3623D), |
||||||
|
), |
||||||
|
), |
||||||
|
Text( |
||||||
|
// "有效期至:${(newUserCouponList.useEndTime != null && newUserCouponList.useEndTime != "") |
||||||
|
// ? newUserCouponList.useEndTime.split(" ")[0] |
||||||
|
// : "$newUserCouponList.useEndTime"}", |
||||||
|
"有效期至:2021-07-30", |
||||||
|
overflow: TextOverflow.ellipsis, |
||||||
|
maxLines: 2, |
||||||
|
style: TextStyle( |
||||||
|
fontSize: 10.sp, |
||||||
|
fontWeight: MyFontWeight.regular, |
||||||
|
color: Color(0xFF727272), |
||||||
|
), |
||||||
|
) |
||||||
|
], |
||||||
|
))), |
||||||
|
], |
||||||
|
), |
||||||
|
); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue