From c776a4f33613f2378b469f10aa91342dc9fc670e Mon Sep 17 00:00:00 2001 From: Loki <654612@qq.com> Date: Thu, 11 Aug 2022 11:33:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8flutter3.0=E5=8F=AF=E4=BB=A5=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E9=A1=B9=E7=9B=AE=E3=80=82=20discount=5Fzone.dart=20d?= =?UTF-8?q?iscountItem=E9=AB=98=E5=BA=A6=E8=B6=85=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/rechargeBtn.png | Bin 0 -> 1764 bytes assets/image/3x/rechargeBtn.png | Bin 0 -> 3390 bytes assets/image/rechargeBtn.png | Bin 1435 -> 726 bytes lib/home/home_view/discount_zone.dart | 4 +- lib/mine/mine_wallet_page.dart | 135 +++++++++++++++++++++++++- lib/retrofit/data/user_info.dart | 3 + 6 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 assets/image/2x/rechargeBtn.png create mode 100644 assets/image/3x/rechargeBtn.png diff --git a/assets/image/2x/rechargeBtn.png b/assets/image/2x/rechargeBtn.png new file mode 100644 index 0000000000000000000000000000000000000000..87ac9ce2dd88b1c53579d3979acba8bcd25b1771 GIT binary patch literal 1764 zcmVPx*o=HSORCr$PolB@zRTRg68%0yZi6Bj^>}6y@NrizykBOwv1GEMeL`9Z`gOnsl zFbczLAW0d$X7(5uQdEN|is)ev8f27Bf<{4*P=gX`#fp99^KrlPefOO2?6ddzAGqAX zcfP&X`mf(Tcb~o2UOUjS%gp8h7XlXp7XV9vCBUNiGZ$FUF|%b(%L;^+`#Y&SGjkAE z0juNh6~LU-cB%hvE06?SGjlN40PBIZdV+Qvk}g`;D!68L7VrRYJFvKmg2<*k6leup zGrI(M1h@&9org5Cvdaog6kIbq2Y4b52`1WCmqnIs%_}ewn9R)I`nLg_^rF>#(9|L{ z4z8K`?7;KD84_3uOiF>qz%{e^z|+9JOyCbH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Y^pXH>_Io3p5TD?#xkeB4>|^u&Nu&KC`xA;FP4BV~c1JDK6@5tl z(+TyZ9K}t$=YYm{H`5$_b0kKyQ7JW+J{Ug|k>>1KJk{Pzpx2v7@AbWVxC0b>mDOQp zJa~&0yLt*nA}{*ypLoa)B`bm&s(X9cJaf?b`(zZN4(IgDtxHGdy<;_jcM_Tb-{gXs zFQtHrHA>r#T@|C)0B_xqELJvQs;?}m*zs>l<7m)>;@I3tB%<_k49a|Z6uAw)1J@X~ z-i*9BA{*_>>Og~}Mn_>9e=uv$h%ee<)1j&CG>PYivV=||+S~01*zD#Hh6C6b%=7vMAyq&XGEvDQY87M%!u2D_ zb?5>G_7db}sk*a-?Vh((cT*9{#3QCOdbRXM6zgF)voONDY#B%KxV>KZIKnwkw)W{! z-Mw1E2We!;vM4iDJJw~9Q&r9;BtKtRg=q#w29}Bb#)Gx$SpKOPInZHW}bOn zW##jLn&4#-_i~ZjSVx9tX92@jBCk`9uw(897Y`$6y1ttGT%;z%ZjZwh+Q8Q@;aCmb z`HU(FLDY;ZxdjH;n6GQXTILM8mmNWUBfS|pVZSV0Bi5dqzBh5GvV%fP2HgG}5WkM9 zmHip@9CQ3HzuF`d-T|Jp#m_a~2a0ep=bJrF_<~}0R3^$}8;fmK9DyGnS3B(IRl3jU zkt(RldL5Mjtj&2Bm!XZ+rx)40-4b~-FS69-eS_#HtmkDdUd`ycI1A+l5g)cS+i=m)}~BR zf*1=)_9X0WpibR%<^NHyK6T7Io~3!}``2eU;Z8Wt;uU(_I?phCC2})D+~5=yT&X%Y y{oB3P3A~^+u0C!wpOD`=|Jum0pJf^d%&R4d*E&^wFrGv&L>LdYH|rLYm-c^Niu4}< literal 0 HcmV?d00001 diff --git a/assets/image/rechargeBtn.png b/assets/image/rechargeBtn.png index 868e192e4541c47341b5e55daf6ba76b832f71ae..8c27e94b2b8fa7d9c7a800daebe66db5ebae7641 100644 GIT binary patch literal 726 zcmV;{0xA88P)Px%kV!;ARA@u(o4;#RK@i73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WOo?cqLzi-XT2qSOmK?lieYqO7&ZwP4=$glQiZXT2(~)9r9JVeJV~}lKkE2l~ zF}TV5?+gktEUK$ts|hSmO!Yt1r&}u)lTv~ateUZ5d;Ml;#YHMQSLa$$H5m5fBU2Uy zw;X_PakxDr))-)c9JE}G4zj0p{WXOhgHJ~m=Xrcu9OgV=My~?%L*BU~+>R#ICw?q3ekQ$( zqDC&|fc4wr_8KqwCLSEo8++3{bC-(yzxg&ZVvH^^*e0X$o%Uth#=ez{88SQ%=)Q4c zqdf#Bj@^(tf7z&BZMpFaLhdvH6Bjx)#(n*YyIOy-Lheo%ip;Xq<%C5zHuO`a>Sj2% zqk!9CMU(hQ{dhZpO1UUsA?Zqy0P&_JJ+_AP-eocM>QOcpLg)u`(*7z;Nx)`=AW<)W z?NTXTL#Qa2BAM%EH`ueU<`j*+_^HCPvd&s1gij~gw?EF=DsQR{VLIsn3Bz+F>x>ux zNovN*(qFsHuk({*tsdH=QFPM1NBXeJd)EnXT{G3k_pDCXYKPl_o39`?%W5@Y?03{I z^BHn=XgaYP$w4i-`UGhf{)`y!&DWJv?u37yvF2=t)rhIKgv%=(_cG9RG-t=zPNbt< z{YjcK$?YEMmCn>-TS7n^+Cw$LGSxtDjvy;7&j@1}Y{eh_40kNQu+($-SVFSRnO4N^ zCm4?wHQ`8)U6|*=78^jskYOlLdOv5iIz{5k8)Ni=IQ_{E*D91J_b~vAK$n1z4$j($ zX_3*MG^)(m61K971URr=+Rj!klZk@U&ou~~XCD^aC{UMui?5X{%R6!f{~P~Jkr`AD zcRX5r03w7ML4KBMvK{&x%9uVS5#Jh4ZPC6J0$GNr6pXX9rGxbDL+7*$z#$rPxPn@t z3S9rklt_%TL;o?DvzhVUf2z1q{iR($Gh7r7a|)2{m?pGA6;h2KKC(J}XC- R`sLDh3wZduKXN;h`5( { )), if(widget.coupon.length != 0) Container( - height: 100.h, + height: 120.h, margin: EdgeInsets.only(top: 10.h), child: ListView.builder( scrollDirection: Axis.horizontal, @@ -76,7 +76,7 @@ class _DiscountZone extends State { Widget discountItem(Coupon coupon) { return Container( width: 290.w, - height: 100.h, + height: 120.h, decoration: BoxDecoration( image: DecorationImage( fit: BoxFit.fill, diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 174fbb59..7dcbcd4d 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -27,6 +27,7 @@ class MineWalletPage extends StatefulWidget { class _MineWalletPage extends State { dynamic mBalance = 0; + dynamic mgreenMoney = 0; @override void initState() { @@ -45,7 +46,7 @@ class _MineWalletPage extends State { userInfo = UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user'))); mBalance = double.tryParse(userInfo.money); - + mgreenMoney = double.tryParse(userInfo.greenMoney); if (mounted) setState(() {}); String token = sharedPreferences.getString("token"); apiService = ApiService(Dio(), context: context, token: token); @@ -263,7 +264,139 @@ class _MineWalletPage extends State { ); } + //assets/image/recharge,Btn.png Widget balance() { + return Container( + margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 8.h), + decoration: BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(25), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: IntrinsicHeight( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + //24.w, 24.h, 24.w, 24.h + Padding( + padding: EdgeInsets.only( + left: 24, + top: 24, + ), + child: Text( + "总资产(元)", + style: TextStyle(color: Colors.white, fontSize: 16), + ), + ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 24, + ), + Text( + "$mBalance", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 50, + color: Colors.white, + ), + ), + Spacer( + flex: 1, + ), + InkWell( + onTap: (){ + toRecharge(); + }, + child: SizedBox( + width: 87.w, + height: 46.h, + child: Stack( + children: [ + Positioned.fill( + child: Image.asset( + "assets/image/rechargeBtn.png", + fit: BoxFit.fill, + ), + ), + Positioned( + left: 14.w, + top: 0, + bottom: 0, + child: Container( + alignment: Alignment.centerLeft, + child: Text( + "充值", + style: TextStyle( + fontSize: 18, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF32A060), + ), + ), + )), + ], + ), + ), + ), + ], + ), + flex: 1, + ), + if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0) + SizedBox( + height: 22, + ), + if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0) + Padding( + padding: EdgeInsets.only( + left: 24, + ), + child: Text( + "绿币余额", + style: TextStyle( + fontSize: 16, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ), + if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0) + SizedBox( + height: 8, + ), + if(userInfo != null && userInfo.greenMoney != null && userInfo.greenMoney.isNotEmpty && double.tryParse(userInfo.greenMoney) > 0) + Padding( + padding: EdgeInsets.only( + left: 24, + ), + child: Text( + "$mgreenMoney", + style: TextStyle( + fontSize: 24, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ), + SizedBox( + height: 24, + ), + ], + ), + ), + ); + } + + Widget balance1() { return Container( width: double.infinity, margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 8.h), diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index 4653f724..9199e9ab 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -34,6 +34,7 @@ class UserInfo { String money; String expendAmount; String points; + String greenMoney; bool isBind; String masterId; int inviteNumber; @@ -64,6 +65,7 @@ class UserInfo { ..money = json['money'] as String ..expendAmount = json['expendAmount'] as String ..points = json['points'] as String + ..greenMoney = json['greenMoney'] as String ..isBind = json['isBind'] as bool ..masterId = json['masterId'] as String ..inviteNumber = json['inviteNumber'] as int @@ -93,6 +95,7 @@ class UserInfo { 'money': this.money, 'expendAmount': this.expendAmount, 'points': this.points, + 'greenMoney': this.greenMoney, 'isBind': this.isBind, 'masterId': this.masterId, "inviteNumber": this.inviteNumber,