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

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

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

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

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

Loading…
Cancel
Save