修复余额页面请求失败的问题,修改错误页面

master
laiiihz 4 years ago
parent 6a1c0935b5
commit 6a923e64ac

@ -39,7 +39,6 @@ import 'utils/app_router.dart';
// import 'package:sharesdk_plugin/sharesdk_plugin.dart'; // import 'package:sharesdk_plugin/sharesdk_plugin.dart';
List<CameraDescription> cameras; List<CameraDescription> cameras;
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
@ -58,7 +57,7 @@ void main() async {
// useEncrypt: true // useEncrypt: true
); );
// //
bool isDebug = true; bool isDebug = false;
AppConfig.setDebug(isDebug); AppConfig.setDebug(isDebug);
// //
@ -74,11 +73,12 @@ void main() async {
// !!!! // !!!!
ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails) { ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails) {
print(flutterErrorDetails.toString()); print(flutterErrorDetails.toString());
return Center( if (isDebug) return ErrorWidget(flutterErrorDetails.exception);
child: Container( return Material(
color: Colors.white, color: Colors.white,
child: Center(
child: Text( child: Text(
"app不小心奔溃了!请重新打开app!", "服务器繁忙,请稍后再试!",
style: TextStyle(color: Colors.black, fontSize: 18), style: TextStyle(color: Colors.black, fontSize: 18),
), ),
), ),

@ -159,7 +159,7 @@ class _UserBalancePageState extends State<UserBalancePage> {
[ [
'可使用(元)'.text.size(14.sp).color(Color(0xFF333333)).make(), '可使用(元)'.text.size(14.sp).color(Color(0xFF333333)).make(),
4.hb, 4.hb,
_model.data.balance (_model?.data?.balance ?? 0.0)
.toStringAsFixed(2) .toStringAsFixed(2)
.text .text
.size(30) .size(30)
@ -170,7 +170,7 @@ class _UserBalancePageState extends State<UserBalancePage> {
[ [
'累计提现(元)'.text.size(14.sp).color(Color(0xFF333333)).make(), '累计提现(元)'.text.size(14.sp).color(Color(0xFF333333)).make(),
4.hb, 4.hb,
_model.data.totalWithdraw (_model?.data?.totalWithdraw ?? 0.0)
.toStringAsFixed(2) .toStringAsFixed(2)
.text .text
.size(30) .size(30)
@ -260,7 +260,7 @@ class _UserBalancePageState extends State<UserBalancePage> {
height: 1.w, height: 1.w,
thickness: 1.w, thickness: 1.w,
), ),
itemCount: _historyModel.data.list.length, itemCount: _historyModel?.data?.list?.length ?? 0,
), ),
).material(color: Color(0xFFF9F9FB)).expand(), ).material(color: Color(0xFFF9F9FB)).expand(),
], ],

@ -15,9 +15,10 @@ class UserBalanceFunc {
@required String month, @required String month,
@required int status, @required int status,
}) async { }) async {
ResultData result = await HttpManager.post(APIV2.userAPI.balanceMonthHistory, { ResultData result =
'date':month, await HttpManager.post(APIV2.userAPI.balanceMonthHistory, {
'status':status, 'date': month,
'status': status,
}); });
return UserBalanceHistoryModel.fromJson(result.data); return UserBalanceHistoryModel.fromJson(result.data);
} }

@ -73,7 +73,11 @@ class _UserHistoryBenefitPageState extends State<UserHistoryBenefitPage> {
children: [ children: [
'累计总收益(瑞币)'.text.black.make(), '累计总收益(瑞币)'.text.black.make(),
8.hb, 8.hb,
_model.data.allAmount.text.black.size(34.sp).make(), (_model?.data?.allAmount?.toStringAsFixed(2) ?? '')
.text
.black
.size(34.sp)
.make(),
], ],
).expand(), ).expand(),
Image.asset( Image.asset(
@ -88,11 +92,11 @@ class _UserHistoryBenefitPageState extends State<UserHistoryBenefitPage> {
padding: EdgeInsets.symmetric(vertical: 8.w), padding: EdgeInsets.symmetric(vertical: 8.w),
child: Row( child: Row(
children: [ children: [
_renderColumn('自购收益', _model.data.purchaseAmountValue), _renderColumn('自购收益', _model?.data?.purchaseAmountValue ?? ''),
_renderDivider(), _renderDivider(),
_renderColumn('导购收益', _model.data.guideAmountValue), _renderColumn('导购收益', _model?.data?.guideAmountValue ?? ''),
_renderDivider(), _renderDivider(),
_renderColumn('店铺补贴', _model.data.trrValue), _renderColumn('店铺补贴', _model?.data?.trrValue ?? ''),
], ],
), ),
), ),

Loading…
Cancel
Save