|
|
|
@ -43,7 +43,7 @@ class StoreOrderPage extends StatefulWidget {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
|
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin*/ { |
|
|
|
|
with TickerProviderStateMixin { |
|
|
|
|
TabController tabcontroller; |
|
|
|
|
ApiService apiService; |
|
|
|
|
MinApiService minService; |
|
|
|
@ -125,9 +125,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
await minService.getParentInfo("$tableId").catchError((error) { |
|
|
|
|
debugPrint(error); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (baseData != null && baseData.isSuccess) {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///获取桌子信息 |
|
|
|
@ -164,6 +162,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RefreshController refreshController; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Stack( |
|
|
|
@ -173,173 +173,181 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 54.h, |
|
|
|
|
child: DefaultTabController( |
|
|
|
|
length: 2, |
|
|
|
|
child: NestedScrollView( |
|
|
|
|
controller: controller, |
|
|
|
|
dragStartBehavior: DragStartBehavior.start, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
headerSliverBuilder: |
|
|
|
|
(BuildContext context, bool innerBoxIsScrolled) { |
|
|
|
|
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, |
|
|
|
|
), |
|
|
|
|
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( |
|
|
|
|
), |
|
|
|
|
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( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
buildSwiper(), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
///门店信息 |
|
|
|
|
StoreInfoView(storeInfo), |
|
|
|
|
|
|
|
|
|
///门店对应优惠券 |
|
|
|
|
if (storeInfo != null && |
|
|
|
|
storeInfo.couponVOList != null) |
|
|
|
|
UnionCoupon( |
|
|
|
|
storeInfo, |
|
|
|
|
_receiveCoupon, |
|
|
|
|
coupon: true, |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
if (storeInfo == null || |
|
|
|
|
storeInfo.couponVOList == null) |
|
|
|
|
SizedBox( |
|
|
|
|
height: 8, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
///门店对应VIP信息 |
|
|
|
|
Vip(storeInfo, () {}, false), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
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, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
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, |
|
|
|
|
), |
|
|
|
|
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), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
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), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
}, |
|
|
|
|
body: TabBarView( |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
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, |
|
|
|
|
), |
|
|
|
|
///星店活动, |
|
|
|
|
StoreActivity( |
|
|
|
|
widget.arguments, |
|
|
|
|
activitys, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
),/*SmartRefresher( |
|
|
|
|
controller: refreshController = |
|
|
|
|
RefreshController(initialRefresh: false), |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader(), |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
onRefresh: () { |
|
|
|
|
queryStoreInfo(); |
|
|
|
|
}, |
|
|
|
|
child: |
|
|
|
|
),*/ |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 0, |
|
|
|
@ -446,9 +454,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///显示选择人数的弹窗 |
|
|
|
|
showPeopleNum(String tableName) async { |
|
|
|
|
var people = await showDialog( |
|
|
|
|
context: context, |
|
|
|
|
barrierDismissible: false, |
|
|
|
|
builder: (context) { |
|
|
|
|
return PeopleNumView(tableName); |
|
|
|
|
}, |
|
|
|
@ -458,6 +468,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
setState(() { |
|
|
|
|
this.numberOfPeople = people; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|