diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 51323858..fa6854aa 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -242,25 +242,27 @@ class _RechargePage extends State { ), Align(alignment: Alignment.bottomCenter,child: Container( - height: 54.h, + height: 56.h, color: Colors.white, child: Row( children: [ - Spacer(), - Padding(padding: EdgeInsets.only(top: 7,right: 16), + Expanded(child:Container( + padding:EdgeInsets.only(top: 7.h,left:16), child:Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( children: [ Text( S.of(context).heji, style: TextStyle( - fontSize: 12.sp, + fontSize: 14.sp, fontWeight: MyFontWeight.regular, color: Colors.black, ), ), Text( - controller.text == "" ? "" :(double.parse(controller.text) * (discount/100)).toString(), + controller.text, style: TextStyle( fontSize: 16.sp, fontWeight: MyFontWeight.medium, @@ -268,7 +270,56 @@ class _RechargePage extends State { ), ), ], - )), + ), + if(controller.text != "") + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "充值", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFADADAD), + ), + ), + TextSpan( + text:"¥${controller.text}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.blueAccent, + ), + ), + TextSpan( + text: "赠送", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFADADAD), + ), + ), + TextSpan( + text:"¥${((double.tryParse(controller.text)??0) - ((double.tryParse(controller.text)??0) * (discount/100))).toStringAsFixed(2)}", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.blueAccent, + ), + ),TextSpan( + text: "元", + style: TextStyle( + fontSize:12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFADADAD), + ), + ), + ], + ), + ), + ], + )) + ), GestureDetector( onTap: () { recharge(); diff --git a/lib/retrofit/data/base_data.g.dart b/lib/retrofit/data/base_data.g.dart index 3a4ba372..8c7d9178 100644 --- a/lib/retrofit/data/base_data.g.dart +++ b/lib/retrofit/data/base_data.g.dart @@ -10,6 +10,16 @@ BaseData _$BaseDataFromJson( Map json, T Function(Object json) fromJsonT, ) { + if(!(json['isSuccess'] as bool)) + return BaseData() + ..code = json['code'] as int + ..data = null + ..extra = json['extra'] + ..isError = json['isError'] as bool + ..isSuccess = json['isSuccess'] as bool + ..msg = json['msg'] as String + ..path = json['path'] as String + ..timestamp = json['timestamp'] as String; return BaseData() ..code = json['code'] as int ..data = fromJsonT(json['data']) diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 8d0223bb..901bc3f1 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -28,12 +28,12 @@ part 'min_api.g.dart'; // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 -const base_url = "http://192.168.10.236:8765/app/";///费韬 -const baseUrl = "http://192.168.10.236:8765/app/";///费韬 +// const base_url = "http://192.168.10.236:8765/app/";///费韬 +// const baseUrl = "http://192.168.10.236:8765/app/";///费韬 -// const base_url = "http://192.168.10.88:8765/app/";///詹云久 -// const baseUrl = "http://192.168.10.88:8765/app/";///詹云久 +const base_url = "http://192.168.10.88:8765/app/";///詹云久 +const baseUrl = "http://192.168.10.88:8765/app/";///詹云久 // const base_url = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 1c1cc751..856ae6e1 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.236:8765/app/'; + baseUrl ??= 'http://192.168.10.88:8765/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 456c4536..b95d48d0 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -60,8 +60,8 @@ part 'retrofit_api.g.dart'; // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.159:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.159:8766/app/"; ///费韬 @@ -70,8 +70,8 @@ const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const baseUrl = "http://192.168.10.37:8766/app/"; -// const base_url = "http://192.168.10.88:8766/app/";///詹云久 -// const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 +const base_url = "http://192.168.10.88:8766/app/";///詹云久 +const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 71083690..527cc52a 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.236:8766/app/'; + baseUrl ??= 'http://192.168.10.88:8766/app/'; } final Dio _dio; diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index b25b4a28..123a61ce 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -278,6 +278,10 @@ class _Settlement extends State { this.downOrder = baseData.data; querySettlement(); } + else{ + SmartDialog.showToast(baseData.msg, + alignment: Alignment.center); + } } else { ///火锅店下单, 等待结算 BaseData baseData; @@ -356,7 +360,8 @@ class _Settlement extends State { toOrderDetails(placeOrderFirst.id); }); } - } else { + } + else { BaseData baseData = await minService .settlementApi(placeOrderFirst.toJson()) .catchError((error) { diff --git a/pubspec.lock b/pubspec.lock index 2be72f68..9664509d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -867,7 +867,7 @@ packages: name: xdg_directories url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: