|
|
|
@ -27,6 +27,7 @@ class MineWalletPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _MineWalletPage extends State<MineWalletPage> { |
|
|
|
|
dynamic mBalance = 0; |
|
|
|
|
dynamic mgreenMoney = 0; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
@ -45,7 +46,7 @@ class _MineWalletPage extends State<MineWalletPage> {
|
|
|
|
|
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<MineWalletPage> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//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), |
|
|
|
|