|
|
|
@ -24,7 +24,6 @@ import 'package:huixiang/store/store_view/store_order_list.dart';
|
|
|
|
|
import 'package:huixiang/union/union_view/union_coupon.dart'; |
|
|
|
|
import 'package:huixiang/union/union_view/vip.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/custom_image.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_tab.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/receive_success.dart'; |
|
|
|
@ -128,10 +127,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
|
|
|
|
|
///获取父订单(火锅订单加菜前调用) |
|
|
|
|
getParentInfo() async { |
|
|
|
|
BaseData baseData = await minService.getParentInfo("$tableId") |
|
|
|
|
.catchError((error) {debugPrint(error);}); |
|
|
|
|
BaseData baseData = |
|
|
|
|
await minService.getParentInfo("$tableId").catchError((error) { |
|
|
|
|
debugPrint(error); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
if(baseData.data != null) { |
|
|
|
|
if (baseData.data != null) { |
|
|
|
|
parentId = baseData.data["id"]; |
|
|
|
|
parentCode = baseData.data["parentCode"]; |
|
|
|
|
} else { |
|
|
|
@ -160,8 +161,10 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
|
|
|
|
|
/// 查询店铺信息 |
|
|
|
|
queryStoreInfo() async { |
|
|
|
|
BaseData baseData = await apiService.queryStoreInfo(storeId) |
|
|
|
|
.catchError((error) {debugPrint(error);}); |
|
|
|
|
BaseData baseData = |
|
|
|
|
await apiService.queryStoreInfo(storeId).catchError((error) { |
|
|
|
|
debugPrint(error); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
storeInfo = StoreInfo.fromJson(baseData.data); |
|
|
|
|
activitys = storeInfo.informationVOPageVO.list |
|
|
|
@ -175,10 +178,21 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RefreshController refreshController; |
|
|
|
|
bool dialogShowing = false; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Stack( |
|
|
|
|
return WillPopScope( |
|
|
|
|
onWillPop: () async { |
|
|
|
|
if (dialogShowing) { |
|
|
|
|
debugPrint("ssssasdadsasdadasd"); |
|
|
|
|
SmartDialog.dismiss(); |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Positioned( |
|
|
|
|
left: 0, |
|
|
|
@ -348,7 +362,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
], |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
), |
|
|
|
|
),/*SmartRefresher( |
|
|
|
|
), /*SmartRefresher( |
|
|
|
|
controller: refreshController = |
|
|
|
|
RefreshController(initialRefresh: false), |
|
|
|
|
enablePullDown: true, |
|
|
|
@ -443,6 +457,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -568,19 +583,34 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
showShoppingCart() { |
|
|
|
|
queryShopCar().then((value) { |
|
|
|
|
this.shopCarGoods = value; |
|
|
|
|
showModalBottomSheet( |
|
|
|
|
context: context, |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
|
builder: (context) { |
|
|
|
|
return ShopCar( |
|
|
|
|
// showModalBottomSheet( |
|
|
|
|
// context: context, |
|
|
|
|
// backgroundColor: Colors.transparent, |
|
|
|
|
// builder: (context) { |
|
|
|
|
// return ShopCar( |
|
|
|
|
// shopCartKey, |
|
|
|
|
// this.shopCarGoods, |
|
|
|
|
// clearShopCar, |
|
|
|
|
// toDownOrder, |
|
|
|
|
// shopCartAdd, |
|
|
|
|
// shopCartReduce, |
|
|
|
|
// ); |
|
|
|
|
// }, |
|
|
|
|
// ); |
|
|
|
|
dialogShowing = true; |
|
|
|
|
SmartDialog.show( |
|
|
|
|
widget: ShopCar( |
|
|
|
|
shopCartKey, |
|
|
|
|
this.shopCarGoods, |
|
|
|
|
clearShopCar, |
|
|
|
|
toDownOrder, |
|
|
|
|
shopCartAdd, |
|
|
|
|
shopCartReduce, |
|
|
|
|
); |
|
|
|
|
), |
|
|
|
|
onDismiss: () { |
|
|
|
|
dialogShowing = false; |
|
|
|
|
}, |
|
|
|
|
alignmentTemp: Alignment.bottomCenter, |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -604,20 +634,20 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
|
|
|
|
|
///选规格弹窗 |
|
|
|
|
showStoreSelector(MiNiDetail miNiDetail, String id) async { |
|
|
|
|
showModalBottomSheet( |
|
|
|
|
context: context, |
|
|
|
|
backgroundColor: Colors.transparent, |
|
|
|
|
builder: (context) { |
|
|
|
|
return ProductSku( |
|
|
|
|
dialogShowing = true; |
|
|
|
|
SmartDialog.show( |
|
|
|
|
widget: ProductSku( |
|
|
|
|
miNiDetail, |
|
|
|
|
shopCarGoods, |
|
|
|
|
id, |
|
|
|
|
_addShopCar, |
|
|
|
|
add, |
|
|
|
|
reduce, |
|
|
|
|
); |
|
|
|
|
), |
|
|
|
|
onDismiss: () { |
|
|
|
|
dialogShowing = false; |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
alignmentTemp: Alignment.bottomCenter,); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///添加购物车 |
|
|
|
@ -687,41 +717,43 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///购物车➕1 |
|
|
|
|
shopCartAdd(ShoppingCartSkuItemListBean cartSkuItem) async { |
|
|
|
|
Future<ShoppingCart> shopCartAdd( |
|
|
|
|
ShoppingCartSkuItemListBean cartSkuItem) async { |
|
|
|
|
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson(); |
|
|
|
|
cartSkuItem.buyNum += 1; |
|
|
|
|
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; |
|
|
|
|
BaseData<List<ShoppingCart>> baseDate = |
|
|
|
|
await minService.shoppingCartSingle(shopCarTemp); |
|
|
|
|
if (baseDate.isSuccess) { |
|
|
|
|
queryShopCar().then((value) { |
|
|
|
|
this.shopCarGoods = value; |
|
|
|
|
this.shopCarGoods = await queryShopCar(); |
|
|
|
|
|
|
|
|
|
print("shopingCar111111: ${this.shopCarGoods.toJson()}"); |
|
|
|
|
if (shopCartKey != null) { |
|
|
|
|
shopCartKey.currentState.setState(() {}); |
|
|
|
|
} |
|
|
|
|
setState(() {}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
return this.shopCarGoods; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///购物车➖1 |
|
|
|
|
shopCartReduce(ShoppingCartSkuItemListBean cartSkuItem) async { |
|
|
|
|
Future<ShoppingCart> shopCartReduce( |
|
|
|
|
ShoppingCartSkuItemListBean cartSkuItem) async { |
|
|
|
|
Map<String, dynamic> shopCarTemp = shopCarGoods.toJson(); |
|
|
|
|
cartSkuItem.buyNum -= 1; |
|
|
|
|
shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; |
|
|
|
|
BaseData<List<ShoppingCart>> baseDate = |
|
|
|
|
await minService.shoppingCartSingle(shopCarTemp); |
|
|
|
|
if (baseDate.isSuccess) { |
|
|
|
|
queryShopCar().then((value) { |
|
|
|
|
this.shopCarGoods = value; |
|
|
|
|
this.shopCarGoods = await queryShopCar(); |
|
|
|
|
|
|
|
|
|
print("shopingCar111111: ${this.shopCarGoods.toJson()}"); |
|
|
|
|
if (shopCartKey != null) { |
|
|
|
|
shopCartKey.currentState.setState(() {}); |
|
|
|
|
} |
|
|
|
|
setState(() {}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
return this.shopCarGoods; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///商品➕1 |
|
|
|
|