Browse Source

充值更改

ff_new
w-R 3 years ago
parent
commit
a1166e1fc5
  1. 65
      lib/mine/recharge_page.dart
  2. 10
      lib/retrofit/data/base_data.g.dart
  3. 8
      lib/retrofit/min_api.dart
  4. 2
      lib/retrofit/min_api.g.dart
  5. 8
      lib/retrofit/retrofit_api.dart
  6. 2
      lib/retrofit/retrofit_api.g.dart
  7. 7
      lib/settlement/settlement.dart
  8. 2
      pubspec.lock

65
lib/mine/recharge_page.dart

@ -242,25 +242,27 @@ class _RechargePage extends State<RechargePage> {
), ),
Align(alignment: Alignment.bottomCenter,child: Align(alignment: Alignment.bottomCenter,child:
Container( Container(
height: 54.h, height: 56.h,
color: Colors.white, color: Colors.white,
child: Row( child: Row(
children: [ children: [
Spacer(), Expanded(child:Container(
Padding(padding: EdgeInsets.only(top: 7,right: 16), padding:EdgeInsets.only(top: 7.h,left:16),
child:Column( child:Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [ children: [
Text( Text(
S.of(context).heji, S.of(context).heji,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Colors.black, color: Colors.black,
), ),
), ),
Text( Text(
controller.text == "" ? "" :(double.parse(controller.text) * (discount/100)).toString(), controller.text,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
@ -268,7 +270,56 @@ class _RechargePage extends State<RechargePage> {
), ),
), ),
], ],
)), ),
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( GestureDetector(
onTap: () { onTap: () {
recharge(); recharge();

10
lib/retrofit/data/base_data.g.dart

@ -10,6 +10,16 @@ BaseData<T> _$BaseDataFromJson<T>(
Map<String, dynamic> json, Map<String, dynamic> json,
T Function(Object json) fromJsonT, T Function(Object json) fromJsonT,
) { ) {
if(!(json['isSuccess'] as bool))
return BaseData<T>()
..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<T>() return BaseData<T>()
..code = json['code'] as int ..code = json['code'] as int
..data = fromJsonT(json['data']) ..data = fromJsonT(json['data'])

8
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 base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "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 base_url = "http://192.168.10.236:8765/app/";///
const baseUrl = "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 base_url = "http://192.168.10.88:8765/app/";///
// const baseUrl = "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/"; // const base_url = "http://192.168.10.37:8766/app/";

2
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8765/app/'; baseUrl ??= 'http://192.168.10.88:8765/app/';
} }
final Dio _dio; final Dio _dio;

8
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 base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "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 base_url = "http://192.168.10.236:8766/app/"; ///
const baseUrl = "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 base_url = "http://192.168.10.159:8766/app/"; ///
// const baseUrl = "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 baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.88:8766/app/";/// const base_url = "http://192.168.10.88:8766/app/";///
// const baseUrl = "http://192.168.10.142:8766/app/";/// const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8766/app/'; baseUrl ??= 'http://192.168.10.88:8766/app/';
} }
final Dio _dio; final Dio _dio;

7
lib/settlement/settlement.dart

@ -278,6 +278,10 @@ class _Settlement extends State<Settlement> {
this.downOrder = baseData.data; this.downOrder = baseData.data;
querySettlement(); querySettlement();
} }
else{
SmartDialog.showToast(baseData.msg,
alignment: Alignment.center);
}
} else { } else {
/// ///
BaseData<DownOrder> baseData; BaseData<DownOrder> baseData;
@ -356,7 +360,8 @@ class _Settlement extends State<Settlement> {
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
}); });
} }
} else { }
else {
BaseData baseData = await minService BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson()) .settlementApi(placeOrderFirst.toJson())
.catchError((error) { .catchError((error) {

2
pubspec.lock

@ -867,7 +867,7 @@ packages:
name: xdg_directories name: xdg_directories
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.0" version: "0.2.0+1"
xml: xml:
dependency: transitive dependency: transitive
description: description:

Loading…
Cancel
Save