diff --git a/assets/image/2x/rechargeBtn.png b/assets/image/2x/rechargeBtn.png new file mode 100644 index 00000000..87ac9ce2 Binary files /dev/null and b/assets/image/2x/rechargeBtn.png differ diff --git a/assets/image/3x/rechargeBtn.png b/assets/image/3x/rechargeBtn.png new file mode 100644 index 00000000..1ccbc437 Binary files /dev/null and b/assets/image/3x/rechargeBtn.png differ diff --git a/assets/image/rechargeBtn.png b/assets/image/rechargeBtn.png index 868e192e..8c27e94b 100644 Binary files a/assets/image/rechargeBtn.png and b/assets/image/rechargeBtn.png differ diff --git a/lib/home/home_view/discount_zone.dart b/lib/home/home_view/discount_zone.dart index 27d9a392..2e0e51a7 100644 --- a/lib/home/home_view/discount_zone.dart +++ b/lib/home/home_view/discount_zone.dart @@ -51,7 +51,7 @@ class _DiscountZone extends State { )), 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,