Browse Source

订单更改

zyh
w-R 3 years ago
parent
commit
2bd3756aa1
  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. 9
      lib/settlement/settlement.dart
  6. 3
      lib/store/shopping/shopping_cart/shopping_cart_page.dart
  7. 2
      lib/store/store_view/store_info.dart

10
lib/retrofit/min_api.dart

@ -35,12 +35,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.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/";
@ -190,7 +190,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 ??= 'http://192.168.10.236:8765/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

@ -65,15 +65,15 @@ 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.37:8766/app/"; // const base_url = "http://192.168.10.37: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.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 ??= 'http://192.168.10.236:8766/app/'; baseUrl ??= 'http://192.168.10.104:8766/app/';
} }
final Dio _dio; final Dio _dio;

9
lib/settlement/settlement.dart

@ -413,20 +413,17 @@ 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,
? SmartDialog.showToast("下单失败:订单实付金额不能为0",
alignment: Alignment.center)
: SmartDialog.showToast(baseData?.msg ?? "",
alignment: Alignment.center); alignment: Alignment.center);
} }
} else { } else {

3
lib/store/shopping/shopping_cart/shopping_cart_page.dart

@ -1,7 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
@ -323,7 +322,7 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
height: 32.h, height: 32.h,
margin: EdgeInsets.only(left: 6.w), margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isAllSelect ? Color(0xFFFB312B) :Color(0xFFE5E5E5), color:Color(0xFFFB312B),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(

2
lib/store/store_view/store_info.dart

@ -30,7 +30,7 @@ class _StoreInfoView extends State<StoreInfoView> {
top: 5.h, top: 5.h,
bottom: 6.h, bottom: 6.h,
), ),
height: 154.h, height: 162.h,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

Loading…
Cancel
Save