diff --git a/lib/retrofit/data/shoppingCart.dart b/lib/retrofit/data/shoppingCart.dart index 365ae6d7..c6a85668 100644 --- a/lib/retrofit/data/shoppingCart.dart +++ b/lib/retrofit/data/shoppingCart.dart @@ -15,14 +15,14 @@ class ShoppingCart { String storeName; int tableId; - static ShoppingCart fromMap(Map map) { + static ShoppingCart fromJon(Map map) { if (map == null) return null; ShoppingCart shoppingCartBean = ShoppingCart(); shoppingCartBean.cartSum = map['cartSum']; shoppingCartBean.numberOfPeople = map['numberOfPeople']; shoppingCartBean.selected = map['selected']; shoppingCartBean.shoppingCartSkuItemList = List()..addAll( - (map['shoppingCartSkuItemList'] as List ?? []).map((o) => ShoppingCartSkuItemListBean.fromMap(o)) + (map['shoppingCartSkuItemList'] as List ?? []).map((o) => ShoppingCartSkuItemListBean.fromJon(o)) ); shoppingCartBean.storeId = map['storeId']; shoppingCartBean.storeName = map['storeName']; @@ -72,7 +72,7 @@ class ShoppingCartSkuItemListBean { int storeId; int tableId; - static ShoppingCartSkuItemListBean fromMap(Map map) { + static ShoppingCartSkuItemListBean fromJon(Map map) { if (map == null) return null; ShoppingCartSkuItemListBean shoppingCartSkuItemListBean = ShoppingCartSkuItemListBean(); shoppingCartSkuItemListBean.buyNum = map['buyNum']; @@ -80,7 +80,7 @@ class ShoppingCartSkuItemListBean { shoppingCartSkuItemListBean.groupId = map['groupId']; shoppingCartSkuItemListBean.id = map['id']; shoppingCartSkuItemListBean.platterList = List()..addAll( - (map['platterList'] as List ?? []).map((o) => PlatterListBean.fromMap(o)) + (map['platterList'] as List ?? []).map((o) => PlatterListBean.fromJon(o)) ); shoppingCartSkuItemListBean.productId = map['productId']; shoppingCartSkuItemListBean.productName = map['productName']; @@ -125,7 +125,7 @@ class PlatterListBean { bool required; int skuId; - static PlatterListBean fromMap(Map map) { + static PlatterListBean fromJon(Map map) { if (map == null) return null; PlatterListBean platterListBean = PlatterListBean(); platterListBean.deleted = map['deleted']; diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 92b33279..8f3ce159 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -13,6 +13,7 @@ import 'package:retrofit/retrofit.dart'; import 'data/findMiNiGroupList.dart'; import 'data/miNiDetail.dart'; +import 'data/shoppingCart.dart'; part 'min_api.g.dart'; // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 @@ -127,7 +128,7 @@ abstract class MinApiService { ///添加购物车 @POST("shoppingcart") - Future> shoppingCart( + Future> shoppingCart( @Body() Map param,Map header); diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 56e0cc46..2dcec64f 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -17,18 +17,22 @@ class _MinApiService implements MinApiService { String baseUrl; @override - Future>> findMiNiGroupList(param) async { + Future>> findMiNiGroupList( + param, header) async { ArgumentError.checkNotNull(param, 'param'); + ArgumentError.checkNotNull(header, 'header'); const _extra = {}; final queryParameters = {}; final _data = {}; _data.addAll(param ?? {}); + final _header= {}; + _header.addAll(header ?? {}); final _result = await _dio.request>( 'product/findMiNiGroupList', queryParameters: queryParameters, options: RequestOptions( method: 'POST', - headers: {}, + headers: _header, extra: _extra, baseUrl: baseUrl), data: _data); @@ -58,30 +62,7 @@ class _MinApiService implements MinApiService { data: _data); final value = BaseData.fromJson( _result.data, - (json) => MiNiDetail.fromJson(json), - ); - return value; - } - - @override - Future> shoppingCart(param, header) async { - ArgumentError.checkNotNull(param, 'param'); - ArgumentError.checkNotNull(header, 'header'); - const _extra = {}; - final queryParameters = {}; - final _data = {}; - _data.addAll(param ?? {}); - final _result = await _dio.request>('shoppingcart', - queryParameters: queryParameters, - options: RequestOptions( - method: 'POST', - headers: {}, - extra: _extra, - baseUrl: baseUrl), - data: _data); - final value = BaseData.fromJson( - _result.data, - (json) => FindMiNiGroupList.fromJson(json), + (json) => MiNiDetail.fromMap(json), ); return value; } diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index f07d484b..c5b25cc7 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -80,7 +80,7 @@ class _StoreOrderPage extends State activitys, ), ]; - minLogin(); + queryStoreInfo(); }