Browse Source

订单更新1

remove_uniapp
w-R 3 years ago
parent
commit
5f1d428ada
  1. 10
      lib/retrofit/min_api.dart
  2. 8
      lib/retrofit/min_api.g.dart
  3. 8
      lib/retrofit/retrofit_api.dart
  4. 2
      lib/retrofit/retrofit_api.g.dart
  5. 15
      lib/settlement/settlement.dart

10
lib/retrofit/min_api.dart

@ -21,8 +21,8 @@ import 'data/shoppingCart.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const base_url = "https://pos.api.lotus-wallet.com/app/"; /// // const base_url = "https://pos.api.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.api.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///
// const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
@ -32,8 +32,8 @@ const baseUrl = "https://pos.api.lotus-wallet.com/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.139:8765/app/";/// const base_url = "http://192.168.10.104:8765/app/";///
// const baseUrl = "http://192.168.10.139:8765/app/";/// const baseUrl = "http://192.168.10.104:8765/app/";///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
@ -183,7 +183,7 @@ abstract class MinApiService {
/// ///
@POST("order/placeOrderFirst") @POST("order/placeOrderFirst")
Future<BaseData<DownOrder>> placeOrderFirst(@Body() Map<String, dynamic> param); Future<BaseData<dynamic>> placeOrderFirst(@Body() Map<String, dynamic> param);
/// ///
@POST("order/addOrder") @POST("order/addOrder")

8
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 ??= 'https://pos.api.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.104:8765/app/';
} }
final Dio _dio; final Dio _dio;
@ -269,7 +269,7 @@ class _MinApiService implements MinApiService {
} }
@override @override
Future<BaseData<DownOrder>> placeOrderFirst(param) async { Future<BaseData<dynamic>> placeOrderFirst(param) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
@ -284,9 +284,9 @@ class _MinApiService implements MinApiService {
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
final value = BaseData<DownOrder>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => DownOrder.fromJson(json), (json) => json,
); );
return value; return value;
} }

8
lib/retrofit/retrofit_api.dart

@ -58,8 +58,8 @@ import 'data/vip_rule_details.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// 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
@ -71,8 +71,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/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.139:8766/app/";/// const base_url = "http://192.168.10.104:8766/app/";///
// const baseUrl = "http://192.168.10.139:8766/app/";/// const baseUrl = "http://192.168.10.104: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 ??= 'https://pos.platform.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.104:8766/app/';
} }
final Dio _dio; final Dio _dio;

15
lib/settlement/settlement.dart

@ -274,23 +274,21 @@ class _Settlement extends State<Settlement> {
if (tableId == 0) { if (tableId == 0) {
/// ///
BaseData<DownOrder> baseData = await minService BaseData<dynamic> baseData = await minService
.placeOrderFirst(placeOrderFirst.toJson()) .placeOrderFirst(placeOrderFirst.toJson())
.catchError((error) { .catchError((error) {
print("error: $error"); print("error: $error");
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
placeOrder = true; placeOrder = true;
this.downOrder = baseData.data; this.downOrder = DownOrder.fromJson(baseData.data);
querySettlement(); querySettlement();
} else { } else {
baseData?.isSuccess ?? false ? SmartDialog.showToast(baseData?.msg, alignment: Alignment.center);
SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center) :
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} else { } else {
/// ///
BaseData<DownOrder> baseData; BaseData<dynamic> baseData;
if (parentId == "") { if (parentId == "") {
// //
if (placeOrder) { if (placeOrder) {
@ -319,11 +317,14 @@ class _Settlement extends State<Settlement> {
} }
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
placeOrder = true; placeOrder = true;
this.downOrder = baseData.data; this.downOrder = DownOrder.fromJson(baseData.data);
queryOrderDetails( queryOrderDetails(
(parentId == null || parentId == "") ? baseData.data.id : parentId); (parentId == null || parentId == "") ? baseData.data.id : parentId);
setState(() {}); setState(() {});
} }
else {
SmartDialog.showToast(baseData?.msg, alignment: Alignment.center);
}
} }
} }

Loading…
Cancel
Save