|
|
|
@ -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,180 +178,191 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RefreshController refreshController; |
|
|
|
|
bool dialogShowing = false; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Stack( |
|
|
|
|
children: [ |
|
|
|
|
Positioned( |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 54.h, |
|
|
|
|
child: NestedScrollView( |
|
|
|
|
controller: controller, |
|
|
|
|
dragStartBehavior: DragStartBehavior.start, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
headerSliverBuilder: (BuildContext context, bool innerScrolled) { |
|
|
|
|
return [ |
|
|
|
|
SliverOverlapAbsorber( |
|
|
|
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor( |
|
|
|
|
context), |
|
|
|
|
sliver: SliverAppBar( |
|
|
|
|
expandedHeight: |
|
|
|
|
(storeInfo != null && storeInfo.couponVOList != null) |
|
|
|
|
? 470.h |
|
|
|
|
: 365.h, |
|
|
|
|
floating: false, |
|
|
|
|
snap: false, |
|
|
|
|
pinned: true, |
|
|
|
|
stretch: false, |
|
|
|
|
brightness: Brightness.light, |
|
|
|
|
leading: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
margin: EdgeInsets.only(left: 10), |
|
|
|
|
padding: EdgeInsets.all(6), |
|
|
|
|
child: Icon( |
|
|
|
|
Icons.arrow_back_ios, |
|
|
|
|
color: Colors.black, |
|
|
|
|
size: 24, |
|
|
|
|
return WillPopScope( |
|
|
|
|
onWillPop: () async { |
|
|
|
|
if (dialogShowing) { |
|
|
|
|
debugPrint("ssssasdadsasdadasd"); |
|
|
|
|
SmartDialog.dismiss(); |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Positioned( |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 54.h, |
|
|
|
|
child: NestedScrollView( |
|
|
|
|
controller: controller, |
|
|
|
|
dragStartBehavior: DragStartBehavior.start, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
headerSliverBuilder: (BuildContext context, bool innerScrolled) { |
|
|
|
|
return [ |
|
|
|
|
SliverOverlapAbsorber( |
|
|
|
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor( |
|
|
|
|
context), |
|
|
|
|
sliver: SliverAppBar( |
|
|
|
|
expandedHeight: |
|
|
|
|
(storeInfo != null && storeInfo.couponVOList != null) |
|
|
|
|
? 470.h |
|
|
|
|
: 365.h, |
|
|
|
|
floating: false, |
|
|
|
|
snap: false, |
|
|
|
|
pinned: true, |
|
|
|
|
stretch: false, |
|
|
|
|
brightness: Brightness.light, |
|
|
|
|
leading: GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
margin: EdgeInsets.only(left: 10), |
|
|
|
|
padding: EdgeInsets.all(6), |
|
|
|
|
child: Icon( |
|
|
|
|
Icons.arrow_back_ios, |
|
|
|
|
color: Colors.black, |
|
|
|
|
size: 24, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
flexibleSpace: FlexibleSpaceBar( |
|
|
|
|
title: Title( |
|
|
|
|
controller, |
|
|
|
|
storeInfo != null ? storeInfo.storeName : '', |
|
|
|
|
), |
|
|
|
|
collapseMode: CollapseMode.pin, |
|
|
|
|
stretchModes: [ |
|
|
|
|
StretchMode.zoomBackground, |
|
|
|
|
StretchMode.fadeTitle, |
|
|
|
|
StretchMode.blurBackground, |
|
|
|
|
], |
|
|
|
|
background: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Positioned( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
buildSwiper(), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
child: Container( |
|
|
|
|
flexibleSpace: FlexibleSpaceBar( |
|
|
|
|
title: Title( |
|
|
|
|
controller, |
|
|
|
|
storeInfo != null ? storeInfo.storeName : '', |
|
|
|
|
), |
|
|
|
|
collapseMode: CollapseMode.pin, |
|
|
|
|
stretchModes: [ |
|
|
|
|
StretchMode.zoomBackground, |
|
|
|
|
StretchMode.fadeTitle, |
|
|
|
|
StretchMode.blurBackground, |
|
|
|
|
], |
|
|
|
|
background: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Positioned( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
///门店信息 |
|
|
|
|
StoreInfoView(storeInfo), |
|
|
|
|
|
|
|
|
|
///门店对应优惠券 |
|
|
|
|
if (storeInfo != null && |
|
|
|
|
storeInfo.couponVOList != null) |
|
|
|
|
UnionCoupon( |
|
|
|
|
storeInfo, |
|
|
|
|
_receiveCoupon, |
|
|
|
|
coupon: true, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
if (storeInfo == null || |
|
|
|
|
storeInfo.couponVOList == null) |
|
|
|
|
SizedBox( |
|
|
|
|
height: 8, |
|
|
|
|
buildSwiper(), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///门店对应VIP信息 |
|
|
|
|
Vip(storeInfo, () {}, false), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
top: 110.h, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
backgroundColor: Color(0x33FAFAFA), |
|
|
|
|
centerTitle: false, |
|
|
|
|
elevation: 0, |
|
|
|
|
bottom: PreferredSize( |
|
|
|
|
preferredSize: Size( |
|
|
|
|
MediaQuery.of(context).size.width, |
|
|
|
|
38, |
|
|
|
|
Positioned( |
|
|
|
|
child: Container( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
///门店信息 |
|
|
|
|
StoreInfoView(storeInfo), |
|
|
|
|
|
|
|
|
|
///门店对应优惠券 |
|
|
|
|
if (storeInfo != null && |
|
|
|
|
storeInfo.couponVOList != null) |
|
|
|
|
UnionCoupon( |
|
|
|
|
storeInfo, |
|
|
|
|
_receiveCoupon, |
|
|
|
|
coupon: true, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
if (storeInfo == null || |
|
|
|
|
storeInfo.couponVOList == null) |
|
|
|
|
SizedBox( |
|
|
|
|
height: 8, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///门店对应VIP信息 |
|
|
|
|
Vip(storeInfo, () {}, false), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
top: 110.h, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w), |
|
|
|
|
width: MediaQuery.of(context).size.width, |
|
|
|
|
child: TabBar( |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
automaticIndicatorColorAdjustment: true, |
|
|
|
|
isScrollable: true, |
|
|
|
|
indicatorWeight: 1, |
|
|
|
|
indicatorColor: Color(0xFFFAFAFA), |
|
|
|
|
labelPadding: EdgeInsets.only( |
|
|
|
|
left: 8.w, |
|
|
|
|
right: 8.w, |
|
|
|
|
), |
|
|
|
|
indicatorSize: TabBarIndicatorSize.label, |
|
|
|
|
unselectedLabelStyle: TextStyle( |
|
|
|
|
fontSize: 15.sp, |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
), |
|
|
|
|
labelStyle: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
backgroundColor: Color(0x33FAFAFA), |
|
|
|
|
centerTitle: false, |
|
|
|
|
elevation: 0, |
|
|
|
|
bottom: PreferredSize( |
|
|
|
|
preferredSize: Size( |
|
|
|
|
MediaQuery.of(context).size.width, |
|
|
|
|
38, |
|
|
|
|
), |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w), |
|
|
|
|
width: MediaQuery.of(context).size.width, |
|
|
|
|
child: TabBar( |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
automaticIndicatorColorAdjustment: true, |
|
|
|
|
isScrollable: true, |
|
|
|
|
indicatorWeight: 1, |
|
|
|
|
indicatorColor: Color(0xFFFAFAFA), |
|
|
|
|
labelPadding: EdgeInsets.only( |
|
|
|
|
left: 8.w, |
|
|
|
|
right: 8.w, |
|
|
|
|
), |
|
|
|
|
indicatorSize: TabBarIndicatorSize.label, |
|
|
|
|
unselectedLabelStyle: TextStyle( |
|
|
|
|
fontSize: 15.sp, |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
), |
|
|
|
|
labelStyle: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
), |
|
|
|
|
labelColor: Colors.black, |
|
|
|
|
tabs: [ |
|
|
|
|
MyTab(text: S.of(context).diancan), |
|
|
|
|
MyTab(text: S.of(context).xindianhuodong), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
labelColor: Colors.black, |
|
|
|
|
tabs: [ |
|
|
|
|
MyTab(text: S.of(context).diancan), |
|
|
|
|
MyTab(text: S.of(context).xindianhuodong), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
}, |
|
|
|
|
body: TabBarView( |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
children: [ |
|
|
|
|
///点餐 |
|
|
|
|
StoreOrderListPage( |
|
|
|
|
widget.arguments, |
|
|
|
|
activitys, |
|
|
|
|
storeInfo, |
|
|
|
|
shopCarGoods, |
|
|
|
|
controller, |
|
|
|
|
_queryMiNiDetail, |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
}, |
|
|
|
|
body: TabBarView( |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
children: [ |
|
|
|
|
///点餐 |
|
|
|
|
StoreOrderListPage( |
|
|
|
|
widget.arguments, |
|
|
|
|
activitys, |
|
|
|
|
storeInfo, |
|
|
|
|
shopCarGoods, |
|
|
|
|
controller, |
|
|
|
|
_queryMiNiDetail, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///星店活动, |
|
|
|
|
StoreActivity( |
|
|
|
|
widget.arguments, |
|
|
|
|
activitys, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
), |
|
|
|
|
),/*SmartRefresher( |
|
|
|
|
///星店活动, |
|
|
|
|
StoreActivity( |
|
|
|
|
widget.arguments, |
|
|
|
|
activitys, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
), |
|
|
|
|
), /*SmartRefresher( |
|
|
|
|
controller: refreshController = |
|
|
|
|
RefreshController(initialRefresh: false), |
|
|
|
|
enablePullDown: true, |
|
|
|
@ -360,89 +374,90 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
}, |
|
|
|
|
child: |
|
|
|
|
),*/ |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
height: 54.h, |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Spacer(), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).heji, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
height: 54.h, |
|
|
|
|
color: Color(0xFFFAFAFA), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Spacer(), |
|
|
|
|
Text( |
|
|
|
|
S.of(context).heji, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
"¥${shopCarGoods != null ? shopCarGoods.cartSum : "0.0"}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF32A060), |
|
|
|
|
Text( |
|
|
|
|
"¥${shopCarGoods != null ? shopCarGoods.cartSum : "0.0"}", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
color: Color(0xFF32A060), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
GestureDetector( |
|
|
|
|
Spacer(), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
toDownOrder(); |
|
|
|
|
}, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 103.w, |
|
|
|
|
height: 54.h, |
|
|
|
|
text: S.current.jiesuan, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 0, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
toDownOrder(); |
|
|
|
|
showShoppingCart(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopp.png", |
|
|
|
|
width: 88, |
|
|
|
|
height: 88, |
|
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
right: 15, |
|
|
|
|
top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 103.w, |
|
|
|
|
height: 54.h, |
|
|
|
|
text: S.current.jiesuan, |
|
|
|
|
width: 17, |
|
|
|
|
height: 17, |
|
|
|
|
text: "${count()}", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 0, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
showShoppingCart(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopp.png", |
|
|
|
|
width: 88, |
|
|
|
|
height: 88, |
|
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
right: 15, |
|
|
|
|
top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 17, |
|
|
|
|
height: 17, |
|
|
|
|
text: "${count()}", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -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( |
|
|
|
|
shopCartKey, |
|
|
|
|
this.shopCarGoods, |
|
|
|
|
clearShopCar, |
|
|
|
|
toDownOrder, |
|
|
|
|
shopCartAdd, |
|
|
|
|
shopCartReduce, |
|
|
|
|
); |
|
|
|
|
// 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; |
|
|
|
|
print("shopingCar111111: ${this.shopCarGoods.toJson()}"); |
|
|
|
|
if (shopCartKey != null) { |
|
|
|
|
shopCartKey.currentState.setState(() {}); |
|
|
|
|
} |
|
|
|
|
setState(() {}); |
|
|
|
|
}); |
|
|
|
|
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; |
|
|
|
|
print("shopingCar111111: ${this.shopCarGoods.toJson()}"); |
|
|
|
|
if (shopCartKey != null) { |
|
|
|
|
shopCartKey.currentState.setState(() {}); |
|
|
|
|
} |
|
|
|
|
setState(() {}); |
|
|
|
|
}); |
|
|
|
|
this.shopCarGoods = await queryShopCar(); |
|
|
|
|
|
|
|
|
|
print("shopingCar111111: ${this.shopCarGoods.toJson()}"); |
|
|
|
|
if (shopCartKey != null) { |
|
|
|
|
shopCartKey.currentState.setState(() {}); |
|
|
|
|
} |
|
|
|
|
setState(() {}); |
|
|
|
|
} |
|
|
|
|
return this.shopCarGoods; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///商品➕1 |
|
|
|
|