From 5e10d63e021d4b1798d0b820df12ac029cc19223 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 18 May 2022 11:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=8F=E5=88=A9=E4=B8=AD=E5=BF=83=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E5=88=B8=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/week_coupons.png | Bin 3684 -> 0 bytes assets/image/2x/week_coupons.webp | Bin 0 -> 12296 bytes assets/image/3x/week_coupons.png | Bin 7183 -> 0 bytes assets/image/3x/week_coupons.webp | Bin 0 -> 26674 bytes assets/image/week_coupons.png | Bin 1206 -> 0 bytes assets/image/week_coupons.webp | Bin 0 -> 756 bytes lib/home/welfare_page.dart | 136 ++++---- lib/view_widget/new_coupon_widget.dart | 411 ++++++++++++++++++++++++- 8 files changed, 480 insertions(+), 67 deletions(-) delete mode 100644 assets/image/2x/week_coupons.png create mode 100644 assets/image/2x/week_coupons.webp delete mode 100644 assets/image/3x/week_coupons.png create mode 100644 assets/image/3x/week_coupons.webp delete mode 100644 assets/image/week_coupons.png create mode 100644 assets/image/week_coupons.webp diff --git a/assets/image/2x/week_coupons.png b/assets/image/2x/week_coupons.png deleted file mode 100644 index b72f25bd11d08f5306349623356014cb7002cb08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3684 zcmeH~`&W|L8pnx)c*_Pg&0A?XjUuBWO4z($o%0WzAN}Qh-?i7X_Vawd`+4{N z?5v;wqOsu@h9D5g_^=-#7z6@m0N>U6n}H|&9(p_Q+H@h9cmP!2Z8ZY|nb;gA_ac~&rkU&@z1fTB|iT>xi_`A z{dl(>J`J=9j5Qm~ws;8Z6em^kZ*vjH6SF4*oJSriMDH|fJD?N#;A8N2$d|1OR+WV+ zmA6W{7}zE&I$k^l1#7F=g=NTaIV*D8m+qNwZ%j}$e5Qhp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ym=YVS?=&)}9q5eSh)xQC;77$MW diff --git a/assets/image/2x/week_coupons.webp b/assets/image/2x/week_coupons.webp new file mode 100644 index 0000000000000000000000000000000000000000..83eddd923c6ca5f5842702c8ae5855a3d57985ba GIT binary patch literal 12296 zcmeIwe=L-790%~vVT={FFh!iQ`B4%H7qhUAvwoaQexww~-NK!7Kjt*cRF?AFvNE%g zwxpVpUupDXX=Eb5f5fI?T1&K@;zHkt*|A;gpZ@5N&-c0K`M#ge^L_67eO}MQVKJGo zA0Xt24?CFc9;ydGokF?>+yh|w`m#+m$SG);Qb#RvNg$MpIetF$(6G~Vso21H#$bbC4*+kE)|o>0cg=A8}Zk&oXSyaIg85TAdW8?Q%bTe ze?yMikdve$DH+pBjpvHQRQ^b^ryyQN%|$h8#am*8r%sYSl@tc81?xmI|!> zn%`Rrm6khr!*whj{;wxlt;@{75&xX}QpR#J`D)F_2ol* zYe!_XYK363puDT=hgn8*K*hATl;*YlFTj&NN@vp*H7AD|aUUid%wJTw zjP})5EF6?;YxWMNeW_GV)unel{Cwbc;D!8SZefM44@^4Gmkq}k&ehg1WOD6mA-%(G zbJYzDnVHuN(@nu^=O#;Hm)!g9^&Jx&5{{4B zSVaL8Kmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwKKmim$0Te(16hHwK zKmim$0Te(16hHwK_%8%pJWcWqGKb7ETc5UgnB*5*m3MdKot@#e)-0qN_K$~KX)3eX s*_S1If~LxhD{lryv@qujD+m3P`{IfQ?q76x#BM9*Rm8G)2g&W=HyC3ScmMzZ literal 0 HcmV?d00001 diff --git a/assets/image/3x/week_coupons.png b/assets/image/3x/week_coupons.png deleted file mode 100644 index 34250fe2812769f5158bcc2c33f652f6f00a5aae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7183 zcmeHMYarA68)r?XIvBZMCL>O6M@r+{%zxlt~o9+Aiy?DN#@AG_~=l49H?EA_PeKZaqM ztr+D`V8#o}97t#699%o(?EO0H6!KH8?p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l=?dR{e6Y{(#@My&SPa;NM{{4`y#R5 zN8od8X5CQeJ#x;>bj6xe=#m>0JC|F?Jl%%F2|5$&T)FNCb1n6wCIdlO84u??X4~}4 zTcKd+Uv!6a4qa*Cr0C#ynr}J%AUSzpT^Nb;mNp!eyg1*X95wa6Jwy%xOVg0$ew9tJ0wg84=uw!D8C!i}461bHS;* z`P*34uXFTRs8HOIMU8&B)>^#9UfGvXgg&`AT^tfwIJev}i>?`L(E>MkCQuT^F#z#Q zgxVxhj++PohN#%6kRf?Z&;lkK+Kh@T6-vmALZCacv0gl&;c z7OJxkR`z-pxi|>sy;hakJLjolk-qVFp@7?25GeRg|I7D6Neq)GaHdf^LT75MtvE*w zf2Gu9F1FIz>^m|$?EXXjgPa{wwL>BR5}`APAG0519dGqK_ddhAgq__jRbac}V4 ztwh6Qp40Ow6ApqMizwJ(B8*A2+_oVoI%#pVc<<8Zzo1}N(}v3t)4nj<^7Q>DCm=e4 zoVQLP{jXE;x%scdX$S?A?kqK9O-!&#B;w8ROltG~+1=Umbsq?{Wdbhw=D!fYv0D@J zWW!FLeOy;>yEFNj7O^3BcBz~8iBRpLHT*u}YI+n%I}YQW>aQh_zgO9Z!^IXH5Tt*= z){6Vw?aJzcZ3z&vI(p{r_1jLYr~~|pLVJEb5m7y$%EUf-MN@A_=r6r7H+|V2#q^@3-ES$fiexp_9o8E`#Fa zQIZKTb!kJEcS6GNuNW_}i{fYBBj5DyL$XJ&2o$J>yppGkBlf}@J}Fmc4|vtV(DVNV DD2Li& diff --git a/assets/image/3x/week_coupons.webp b/assets/image/3x/week_coupons.webp new file mode 100644 index 0000000000000000000000000000000000000000..17851b1e7238c910b1b8669c9c9b0de1dc76c7ba GIT binary patch literal 26674 zcmeIwc}!GC90%|pN3~d~LLq>lq98TOA!scMlCbCkjdo!<h2UiDkw+%$Jk9i~tG*4u2W8q0Hh$ay%xh@n7c)vh4jj$IEi4 zGuMV0lgs4Y{8ia|RgMS?31h}cWaE88LS?y&$(DkkaM@b2BHQss-(VLf=IzEjIwT}6 z*%FJ%|7%(CJex;kK0~CCw9@9CNmLO_q}j33rk_i+=_{h!jUis4UVm*yk*VeV{D>y= ziIm-m-fJS-;JLifmANb5;vdec%goVX&Uu#k@hOOWNtf&?n0&~XNoLF?F{OjdjX6Hz zOJpLsZ?!q`+gyS6!_MxB!TI!c-yKZWiPRJKCk~r;32pZKciJW2+EupTXp}JavtBCQuI4#TAMhrFS2K&E~*!4HHwnWiW`UQ$BN}_9A0_~s-rGh#1+5) zoKhFm7dZj#mtBtjrgkGw&%nsJxg}4ZUAM z%D>kQJ3Xxl-;zR!6Eyc$(U_Q{uhbxACKu);!zlMzewD=}M{NjQGZt zvVOe>F#`{{Q_m(ESf&E=As4HriioP1+JN4Pxy3Ep`OO368Et+eS;Fq)nT5XfAAXr~ zzQ3WgBPCzjs`Y_Eb%k%#i1qU)uZl$4^PH#G`ddZ3IbrWY$eE6@mXWNbu#xedCzo>M zR0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_< z0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb z2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZaf&VP9yCN?7l#ZY=TW`{|)9N#k z#I`iHl{aVXf8wec+xRW5(d&8f9vo{?PJw=}WZGoi=9`z}M_sK&{zbYzKe#4Yr|gvs z4XX1r6&}kaR!>>a*65jT{UX+~{%#e^K#`T<*{-ppK6K*@|In|a<%Th19%9FGW%?6e CNs&DO literal 0 HcmV?d00001 diff --git a/assets/image/week_coupons.png b/assets/image/week_coupons.png deleted file mode 100644 index fc9268701c620178286ff2e207de3c61de98c444..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1206 zcmeAS@N?(olHy`uVBq!ia0y~yU~~quLpa!gq{Q^l2|$XmILO_JVcj{ImkbOn1)eUB zAr*0NZ~6LNjul~lQ0#T-P4?TPvQ|6e3>d~de-`}Eno>REzKnQJvW4 zTX{yuBbZq9R6m$y=l}4{tkFDD?|ZNF@5{8j9G?HC1^>R^x+{Am>btkg9jo&d$s7VZ zm>O3-{F4?DzF~^$IiVLvUcdM%pZ;v-wa}@ClKZ<3SFlWBXe?uuY0IrV&wpg^%gOui z3iRi-nD5e;ZON@w_@?+_cf;WgcU|7NJn5csb@z+!&zBY)sn{cVw?<%d)hd&`?}s-? zH(qAqbFNfyXmD_`;5pjBzzF0@0=Wk^Hq2hABB0=KAW?&vg+rjgcnTvE3&$J|jmfQz zKvkzwK&l#yBH1_u6c+eQ151j1NYmg4Dh5&@Jy@v-feQ|ToIs;87MuW@!(tMU0-KUNs;`l*oi)kG<8>p%IM6Brtm8O;xGYr4>ReWQ8pBx&ix zsnOToy;I05i9eQTll3}&6F(!%e`W;2s@7@5Syen`#THU0BTd;TMDSL|A!vd`efr_SuZSI^8biQKxXYNNef1~@}X nafR?If37Xb(hg^zU(ZlncKzLxMqhnkLB!zc>gTe~DWM4fL_^Wv diff --git a/assets/image/week_coupons.webp b/assets/image/week_coupons.webp new file mode 100644 index 0000000000000000000000000000000000000000..29f702612235bed79205926807aa7bf3b8daa8f2 GIT binary patch literal 756 zcmWIYbaQ*d#J~{l>J$(bU=hK^z`$St#7>M1!3+$Z&dvc6Kv@O`CJ7M90+h7*2N-ENQg5fwKy55=mQX!6ag(~U|>uE zvPIG%>OiNuh>447hk)&UjjI~^1e&|jdC%e?Hf{?A(i z94bE_>us2z@bQ15ath { decoration: BoxDecoration( image: DecorationImage( fit: BoxFit.fill, - image: AssetImage("assets/image/week_coupons.png"), + image: AssetImage("assets/image/week_coupons.webp"), ), ), - padding: EdgeInsets.symmetric(horizontal: 10.w,vertical: 10.h), + padding: EdgeInsets.symmetric(horizontal: 12.w,vertical: 12.h), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - Expanded(child: - Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded(child: Text( - "百年川椒(哈乐城店)", - style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.bold, - color: Color(0xFF0D0D0D), - ), - )), - Text( - "新人满减30元", - style: TextStyle( - fontSize: 11.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF4D4D4D), - ), - ), - SizedBox(height:4.h,), - Text( - "有效期至2022-09-10 12:00:00", - style: TextStyle( - fontSize: 11.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF4D4D4D), - ), - ), - ], - )), Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -302,57 +270,93 @@ class _WelfarePage extends State { TextSpan( text: "¥", style: TextStyle( - fontSize: 12.sp, + fontSize: 16.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFFF4500), + color: Color(0xFF32A060), ), ), TextSpan( text: "30", style: TextStyle( - fontSize: 24.sp, + fontSize: 26.sp, fontWeight: MyFontWeight.semi_bold, - color: Color(0xFFFF4500), + color: Color(0xFF32A060), ), ), ], ), ), - Expanded(child: Text( + Text( "满30.1可用", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, - color: Color(0xFFFF4500), + color: Color(0xFF32A060), + ), + ), + ], + ), + SizedBox(width: 30,), + Expanded(child: + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: Text( + "新人满减30元", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF353535), ), )), - Container( - width: 55.w, - height: 19.h, - decoration: BoxDecoration( - gradient: new LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color(0xFFFF4F00), - Color(0xFFFF2700), - ]), - // border: Border.all(color: Colors.white,width: 0.5), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(3), + SizedBox(height:4.h,), + Text( + "有效期至2022-09-10 12:00:00", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), ), - alignment: Alignment.center, - child:Text( - "领取", - style: TextStyle( - fontSize: 12.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFFFFFFFF), + ), + SizedBox(height:5.h,), + Row( + children: [ + Text( + "使用详情", + style: TextStyle( + fontSize: 11.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), ), - ), - ) + Icon( + Icons.keyboard_arrow_right, + color: Color(0xFF4D4D4D), + size: 20, + ) + ], + ), ], - ), + )), + Container( + width: 50.w, + height: 19.h, + decoration: BoxDecoration( + color: Color(0xFF32A060), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(3), + ), + alignment: Alignment.center, + child:Text( + "领取", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ) ], ), ); diff --git a/lib/view_widget/new_coupon_widget.dart b/lib/view_widget/new_coupon_widget.dart index 4df2b639..25fe5328 100644 --- a/lib/view_widget/new_coupon_widget.dart +++ b/lib/view_widget/new_coupon_widget.dart @@ -16,9 +16,10 @@ class NewCouponWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return buildCoupon(context); + return homeCoupon(context); } + ///优惠券ui Widget buildCoupon(BuildContext context) { // if(coupon != null) { // coupon.isEx = fa; @@ -368,6 +369,414 @@ class NewCouponWidget extends StatelessWidget { ); } + ///首页优惠券ui + Widget homeCoupon(BuildContext context) { + return Container( + height: 100.h, + width: double.infinity, + margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.fill, + image: AssetImage("assets/image/week_coupons.webp"), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child:Container( + margin: EdgeInsets.only(top: 12,bottom: 12), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: Container( + child:homeWidget(context), + )), + ], + ), + )), + Expanded( + flex: 2, + child:Container( + margin: EdgeInsets.only(top: 12,left: 12,bottom: 12), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + 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(0xFF353535), + ), + )), + 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: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), + ), + ):Text( + "有效期至 ${coupon?.useEndTime ?? ""}", + maxLines:1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), + ), + )), + GestureDetector( + onTap: (){ + // showDeleteDialog(); + + }, + child: Row( + children: [ + Text( + "使用详情", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xFF4D4D4D), + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: coupon.status == 3 ? Color(0xFFB3B3B3) :Color(0xFF4D4D4D), + size: 20, + ) + ], + ), + ) + ], + ), + )), + Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.only(right:12.w,bottom: 12), + child: homeBtn(context), + ) + ], + ) + ], + ), + ); + } + + Widget homeWidget(BuildContext context) { + 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( + "¥", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + coupon != null + ? double.tryParse("${coupon.discountAmount}" ?? "0") + .toInt() + .toString() + : "", + style: TextStyle( + fontSize: 26.sp, + fontWeight: MyFontWeight.semi_bold, + 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: 26.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( + coupon != null + ? "${(coupon.discountPercent / 10.0 >= 10) ? 10 : coupon.discountPercent / 10.0}" ?? + "0" + : "", + style: TextStyle( + fontSize: 40.sp, + fontWeight: MyFontWeight.semi_bold, + color: coupon.status == 3 ? Color(0xFFB3B3B3):Color(0xff32A060), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + "折", + style: TextStyle( + fontSize: 20.sp, + fontWeight: MyFontWeight.semi_bold, + 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), + ), + ), + ], + ); + } + } + + Widget homeBtn(context) { + if (type == 1) { + if (coupon != null && coupon.status == 0) { + return Align( + alignment: Alignment.centerRight, + child: InkWell( + onTap: () { + callback(type); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(3), + color: Color(0xFF32A060), + ), + child: Text( + S.of(context).lingqu, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ), + ), + ); + } else { + return Align( + alignment: Alignment.centerRight, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(3), + color: Colors.grey, + ), + child: Text( + S.of(context).yilingqu, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ), + ); + } + } else { + if (coupon != null && coupon.status == 1) { + return Align( + alignment: Alignment.centerRight, + child: InkWell( + onTap: () { + callback(type); + }, + child: Container( + width: 56.w, + height: 19.h, + decoration: BoxDecoration( + color: Color(0xFF32A060), + borderRadius: BorderRadius.circular(3), + ), + alignment: Alignment.center, + child:Text( + "立即使用", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFFFFFFF), + ), + ), + ), + // Container( + // padding: EdgeInsets.fromLTRB(16.w, 2.h, 16.w, 2.h), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10.5), + // color: Color(0xFF32A060), + // ), + // child: Text( + // (coupon.bizType == 5 || coupon.bizType == 3) + // ? S.of(context).quhexiao + // : S.of(context).qushiyong, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.medium, + // color: Colors.white, + // ), + // ), + // ), + ), + ); + } else if (coupon != null && coupon.status == 2) { + return Align( + alignment: Alignment.centerRight, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(3), + // border: Border.all( + // width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid) + color: Color(0xFFA0A0A0), + ), + child: Text( + S.of(context).yishiyong, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ), + ); + } else { + return Align( + alignment: Alignment.centerRight, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 14,vertical: 2), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10.5), + // // border: Border.all( + // // width: 1, color: Color(0xFFA0A0A0), style: BorderStyle.solid) + // color: Color(0xFFA0A0A0), + // ), + child: Text( + S.of(context).yishixiao, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFFB3B3B3), + ), + ), + ), + ); + } + } + } + Widget priceWidget(BuildContext context) { if (coupon.bizType == 1) { return Column(