Browse Source

首页优惠券更改

zyh
w-R 3 years ago
parent
commit
9724f835ee
  1. BIN
      assets/image/2x/welfare_zx.webp
  2. BIN
      assets/image/2x/welfare_zx_tu.webp
  3. BIN
      assets/image/3x/welfare_zx.webp
  4. BIN
      assets/image/3x/welfare_zx_tu.webp
  5. BIN
      assets/image/welfare_zx.webp
  6. BIN
      assets/image/welfare_zx_tu.webp
  7. 43
      lib/home/home_page.dart
  8. 302
      lib/home/home_view/discount_zone.dart
  9. 2
      lib/home/home_view/home_banner.dart
  10. 1
      lib/home/home_view/welfare_core.dart
  11. 220
      lib/home/welfare_page.dart
  12. 136
      lib/view_widget/new_coupon_widget.dart

BIN
assets/image/2x/welfare_zx.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 134 KiB

BIN
assets/image/2x/welfare_zx_tu.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
assets/image/3x/welfare_zx.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 310 KiB

BIN
assets/image/3x/welfare_zx_tu.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
assets/image/welfare_zx.webp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 68 KiB

BIN
assets/image/welfare_zx_tu.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

43
lib/home/home_page.dart

@ -21,6 +21,7 @@ import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/founder.dart'; import 'package:huixiang/retrofit/data/founder.dart';
import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/goods_category.dart'; import 'package:huixiang/retrofit/data/goods_category.dart';
@ -71,6 +72,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}); });
queryMsgStats(); queryMsgStats();
queryActivity(); queryActivity();
queryCoupon();
if ((widget.invite ?? "") != "" || if ((widget.invite ?? "") != "" ||
widget.interviewCouponList != null && widget.interviewCouponList != null &&
@ -142,6 +144,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
Founder founder; Founder founder;
bool isSigned = false; bool isSigned = false;
int totalMsg = 0; int totalMsg = 0;
List<Coupon> coupons = [];
int state = 1;
queryHome() async { queryHome() async {
// EasyLoading.show(status: S.of(context).zhengzaijiazai); // EasyLoading.show(status: S.of(context).zhengzaijiazai);
@ -329,9 +333,46 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
} }
queryCoupon() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCoupon({
"centre": true,
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": 0
}).catchError((onError) {
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (pageNum == 1) coupons.clear();
if (baseData != null && baseData.isSuccess) {
coupons.addAll(baseData.data.list);
refreshController.refreshCompleted();
refreshController.loadComplete();
if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
pageNum += 1;
}
setState(() {});
} else {
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
_onRefresh(){ _onRefresh(){
queryHome(); queryHome();
queryMsgStats(); queryMsgStats();
queryCoupon();
} }
@override @override
@ -465,7 +506,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
// }), // }),
/// ///
DiscountZone(), DiscountZone(coupons),
/// ///
HomeRecommendGoods(), HomeRecommendGoods(),

302
lib/home/home_view/discount_zone.dart

@ -1,12 +1,20 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/item_title.dart'; import 'package:huixiang/view_widget/item_title.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class DiscountZone extends StatefulWidget { class DiscountZone extends StatefulWidget {
final List<Coupon> coupon;
DiscountZone(this.coupon);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _DiscountZone(); return _DiscountZone();
@ -19,6 +27,7 @@ class _DiscountZone extends State<DiscountZone> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
} }
@override @override
@ -30,22 +39,44 @@ class _DiscountZone extends State<DiscountZone> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
ItemTitle( Padding(padding:EdgeInsets.symmetric(horizontal: 14.w),
text: "特惠专区", child: Row(
), children: [
Expanded(child:
Text(
"特惠专区",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
)),
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/welfare_page');
},
child: Text(
"更多好券",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
)
],
),),
Container( Container(
height: 91.h, height: 91,
margin: EdgeInsets.only(top: 14,left: 14.w), margin: EdgeInsets.only(top: 10),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: 6, padding: EdgeInsets.symmetric(horizontal: 10),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return discountItem(widget.coupon[position]);
onTap: () {},
child: discountItem(),
);
}, },
itemCount:widget.coupon.length,
), ),
), ),
], ],
@ -53,9 +84,9 @@ class _DiscountZone extends State<DiscountZone> {
); );
} }
Widget discountItem() { Widget discountItem(Coupon coupon) {
return Container( return Container(
width: 246.w, width: 300.w,
height: 91.h, height: 91.h,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
@ -63,79 +94,232 @@ class _DiscountZone extends State<DiscountZone> {
image: AssetImage("assets/image/discount.webp"), image: AssetImage("assets/image/discount.webp"),
), ),
), ),
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 15.h),
margin: EdgeInsets.only(right: 6.w), margin: EdgeInsets.only(right: 6.w),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column( Expanded(
children: [ flex: 1,
Text.rich( child:Container(
TextSpan( margin: EdgeInsets.only(top: 12,bottom: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
TextSpan( Expanded(child: Container(
text: "¥", child:discountWidget(coupon),
style: TextStyle( )),
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
TextSpan(
text: "30",
style: TextStyle(
fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF32A060),
),
),
], ],
), ),
), )),
Expanded(
flex: 2,
child: Container(
margin: EdgeInsets.only(top: 12,left:35,bottom: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child:
Text(
coupon != null ? coupon.couponName ?? "" : "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D),
),
),),
Spacer(),
SizedBox(height:5),
Expanded(child:
(coupon.useStartTime == null &&
coupon.useEndTime == null)?
Text(
S.of(context).quantian,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
):Text(
"有效期至 ${coupon.useEndTime.substring(0, coupon.useEndTime.indexOf(" "))}",
maxLines:1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF4D4D4D),
),
)),
],
),
)),
],
)
);
}
Widget discountWidget(Coupon coupon) {
if (coupon.bizType == 1) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text( Text(
"满30.1可用", "¥",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], SizedBox(
), height: 4.h,
Spacer(), ),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text( Text(
"百年川椒(哈乐城店)", coupon != null
? double.tryParse("${coupon.discountAmount}" ?? "0")
.toInt()
.toString()
: "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 30.sp,
fontWeight: MyFontWeight.bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
],
),
Text(
S.of(context).manyuankeyong(coupon != null
? ("${coupon.fullAmount}" ?? "0")
.toString()
: ""),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else if (coupon.bizType == 3) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).duihuanquan,
style: TextStyle(
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
),
Text(
S.of(context).xianshangshiyong,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else if (coupon.bizType == 5) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.only(bottom:10,top: 7),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).duihuanquan,
style: TextStyle(
fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
),
),
Text(
S.of(context).xianxiashiyong,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
],
);
} else {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text( Text(
"新人满减30元", coupon != null
? "${(coupon.discountPercent / 10.0 >= 10) ? 10 : coupon.discountPercent / 10.0}" ??
"0"
: "",
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 30.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF4D4D4D), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
SizedBox(
height: 4.h,
),
Text( Text(
"有效期至2022-09-10", "",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 20.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF4D4D4D), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
), ),
], ],
) ),
Text(
S.of(context).quanchangtongyong,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
),
),
], ],
), );
); }
} }
} }

2
lib/home/home_view/home_banner.dart

@ -26,7 +26,7 @@ class _HomeBanner extends State<HomeBanner> {
aspectRatio: 1.4, aspectRatio: 1.4,
child: Swiper( child: Swiper(
pagination: SwiperPagination( pagination: SwiperPagination(
margin: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(bottom: 12.h),
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder( builder: DotSwiperPaginationBuilder(
size: 8, size: 8,

1
lib/home/home_view/welfare_core.dart

@ -58,7 +58,6 @@ class _WelfareCore extends State<WelfareCore> {
) )
], ],
),), ),),
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(left:9.w,right: 9.w,top: 16.h,bottom: 12.h), margin: EdgeInsets.only(left:9.w,right: 9.w,top: 16.h,bottom: 12.h),

220
lib/home/welfare_page.dart

@ -120,18 +120,18 @@ class _WelfarePage extends State<WelfarePage> {
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
scrollController: scrollController, scrollController: scrollController,
child: Container( child: Container(
margin: EdgeInsets.only(top: 125.h,left: 14,right: 14), margin: EdgeInsets.only(top: 45.h,left: 14,right: 14),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Color(0xFFF9FAF7),
),
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: FutureBuilder( child: FutureBuilder(
// future: querySignInfo(), // future: querySignInfo(),
builder: (context, snap) { builder: (context, snap) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
weekCoupons(), weekCoupons(),
inviteFriends(), inviteFriends(),
@ -153,95 +153,137 @@ class _WelfarePage extends State<WelfarePage> {
/// ///
Widget weekCoupons() { Widget weekCoupons() {
return Container( return Stack(
width: double.infinity, alignment: Alignment.topRight,
decoration: BoxDecoration( children: [
borderRadius: BorderRadius.circular(6), Container(
color: Colors.white, width: double.infinity,
boxShadow: [ margin: EdgeInsets.only(top: 95),
BoxShadow( decoration: BoxDecoration(
color: Color(0x08213303).withAlpha(12), borderRadius: BorderRadius.circular(6),
offset: Offset(0, 2), color: Colors.white,
blurRadius: 3, boxShadow: [
spreadRadius: 0, BoxShadow(
), color: Color(0x08213303).withAlpha(12),
], offset: Offset(0, 2),
), blurRadius: 3,
// margin: EdgeInsets.only(top: 139.h), spreadRadius: 0,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 16.h),
child:
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).lingquanzhongxin,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
),
),
Text(
"每周上新 ",
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
), ),
], ],
)), ),
AspectRatio( // margin: EdgeInsets.only(top: 139.h),
aspectRatio: 1.22, child: Column(
child: Swiper( mainAxisAlignment: MainAxisAlignment.start,
viewportFraction: 0.9, crossAxisAlignment: CrossAxisAlignment.start,
scale: 0.7, children: [
pagination: SwiperPagination( Padding(
alignment: Alignment.bottomCenter, padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 16.h),
builder: DotSwiperPaginationBuilder( child:
size: 8, Row(
activeSize: 8, mainAxisAlignment: MainAxisAlignment.spaceBetween,
space: 5, crossAxisAlignment: CrossAxisAlignment.center,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return Column(
children: [ children: [
Container( Text(
// height: 84.h, S.of(context).lingquanzhongxin,
// child: ListView.builder( style: TextStyle(
// scrollDirection: Axis.horizontal, color: Color(0xFF0D0D0D),
// physics: BouncingScrollPhysics(), fontSize: 15.sp,
// padding: EdgeInsets.symmetric(horizontal: 12), fontWeight: MyFontWeight.bold,
// itemCount:3, ),
// itemBuilder: (context, index) { ),
// return GestureDetector( Text(
// onTap: () { "每周上新 ",
// style: TextStyle(
// }, color: Color(0xFF4D4D4D),
// child: weekItem(), fontSize: 12.sp,
// ); fontWeight: MyFontWeight.regular,
// }, ),
// ),
child: weekItem(),
), ),
], ],
); )),
}, AspectRatio(
itemCount:3, aspectRatio: 1.22,
), child: Swiper(
) viewportFraction: 0.9,
], scale: 0.7,
), pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return Column(
children: [
Container(
// height: 84.h,
// child: ListView.builder(
// scrollDirection: Axis.horizontal,
// physics: BouncingScrollPhysics(),
// padding: EdgeInsets.symmetric(horizontal: 12),
// itemCount:3,
// itemBuilder: (context, index) {
// return GestureDetector(
// onTap: () {
//
// },
// child: weekItem(),
// );
// },
// ),
child: weekItem(),
),
],
);
},
itemCount:3,
),
)
],
)
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.only(top: 12),
child: Text(
"福利周周有,优惠享不停",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.bold,
color: Color(0xFFFFFFFF),
),
)),
SizedBox(height: 8,),
Text(
"各种优惠全都有",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFFFFFFF),
),
),
],
)),
Image.asset(
"assets/image/welfare_zx_tu.webp",
width:120.w,
height:105.h,
fit: BoxFit.cover,
)
],
),
],
); );
} }

136
lib/view_widget/new_coupon_widget.dart

@ -16,7 +16,7 @@ class NewCouponWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return buildCoupon(context); return homeCoupon(context);
} }
@ -408,73 +408,71 @@ class NewCouponWidget extends StatelessWidget {
], ],
), ),
)), )),
Expanded( Container(
flex: 2, margin: EdgeInsets.only(top: 12,left: 12,bottom: 12),
child:Container( child: Column(
margin: EdgeInsets.only(top: 12,left: 12,bottom: 12), mainAxisAlignment: MainAxisAlignment.start,
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: [
crossAxisAlignment: CrossAxisAlignment.start, Expanded(child:
children: [ Text(
Expanded(child: coupon != null ? coupon.couponName ?? "" : "",
Text( maxLines: 1,
coupon != null ? coupon.couponName ?? "" : "", overflow: TextOverflow.ellipsis,
maxLines: 1, style: TextStyle(
overflow: TextOverflow.ellipsis, fontSize: 14.sp,
style: TextStyle( fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, color: Color(0xFF353535),
fontWeight: MyFontWeight.semi_bold, ),
color: Color(0xFF353535), )),
), Expanded(child:
)), (coupon.useStartTime == null &&
Expanded(child: coupon.useEndTime == null)?
(coupon.useStartTime == null && Text(
coupon.useEndTime == null)? S.of(context).quantian,
Text( maxLines: 1,
S.of(context).quantian, overflow: TextOverflow.ellipsis,
maxLines: 1, style: TextStyle(
overflow: TextOverflow.ellipsis, fontSize: 12.sp,
style: TextStyle( fontWeight: MyFontWeight.regular,
fontSize: 12.sp, color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
fontWeight: MyFontWeight.regular, ),
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), ):Text(
), "有效期至 ${coupon?.useEndTime ?? ""}",
):Text( maxLines:1,
"有效期至 ${coupon?.useEndTime ?? ""}", overflow: TextOverflow.ellipsis,
maxLines:1, style: TextStyle(
overflow: TextOverflow.ellipsis, fontSize: 12.sp,
style: TextStyle( fontWeight: MyFontWeight.regular,
fontSize: 12.sp, color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
fontWeight: MyFontWeight.regular, ),
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), )),
), GestureDetector(
)), onTap: (){
GestureDetector( // showDeleteDialog();
onTap: (){
// showDeleteDialog();
}, },
child: Row( child: Row(
children: [ children: [
Text( Text(
"使用详情", "使用详情",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF4D4D4D), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF4D4D4D),
), ),
),
Icon(
Icons.keyboard_arrow_right,
color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
size: 20,
)
],
), ),
) Icon(
], Icons.keyboard_arrow_right,
), color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D),
)), size: 20,
)
],
),
)
],
),
),
Column( Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
@ -583,7 +581,7 @@ class NewCouponWidget extends StatelessWidget {
Text( Text(
S.of(context).duihuanquan, S.of(context).duihuanquan,
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
@ -617,7 +615,7 @@ class NewCouponWidget extends StatelessWidget {
"0" "0"
: "", : "",
style: TextStyle( style: TextStyle(
fontSize: 40.sp, fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),
@ -628,7 +626,7 @@ class NewCouponWidget extends StatelessWidget {
Text( Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060),
), ),

Loading…
Cancel
Save