|
|
|
@ -22,9 +22,8 @@ import 'package:huixiang/store/store_view/shop_car.dart';
|
|
|
|
|
import 'package:huixiang/store/store_view/store_activity.dart'; |
|
|
|
|
import 'package:huixiang/store/store_view/store_info.dart'; |
|
|
|
|
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'; |
|
|
|
@ -60,6 +59,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
String tenant = ""; |
|
|
|
|
String storeId = ""; |
|
|
|
|
int numberOfPeople = 0; |
|
|
|
|
|
|
|
|
|
///小程序token |
|
|
|
|
String minToken; |
|
|
|
|
String pName; |
|
|
|
@ -138,11 +138,12 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
|
|
|
|
|
///会员信息 |
|
|
|
|
queryMemberInfo() async { |
|
|
|
|
BaseData baseData = await minService.memberInfo() |
|
|
|
|
.catchError((error){debugPrint(error);}); |
|
|
|
|
BaseData baseData = await minService.memberInfo().catchError((error) { |
|
|
|
|
debugPrint(error); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
SharedPreferences.getInstance().then( |
|
|
|
|
(value) => { |
|
|
|
|
(value) => { |
|
|
|
|
value.setString('minMember', jsonEncode(baseData.data)), |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
@ -151,8 +152,10 @@ 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) { |
|
|
|
|
parentId = baseData.data["id"]; |
|
|
|
@ -183,7 +186,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
|
|
|
|
|
/// 查询店铺信息 |
|
|
|
|
queryStoreInfo() async { |
|
|
|
|
BaseData baseData = await apiService.queryStoreInfo(storeId).catchError((error) { |
|
|
|
|
BaseData baseData = |
|
|
|
|
await apiService.queryStoreInfo(storeId).catchError((error) { |
|
|
|
|
debugPrint(error); |
|
|
|
|
}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
@ -203,217 +207,233 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
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) |
|
|
|
|
? 400.h |
|
|
|
|
: 395.h, |
|
|
|
|
floating: false, |
|
|
|
|
snap: false, |
|
|
|
|
pinned: true, |
|
|
|
|
stretch: false, |
|
|
|
|
brightness: Brightness.light, |
|
|
|
|
leading: GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: double.infinity, |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
margin: EdgeInsets.only(left: 10.w), |
|
|
|
|
padding: EdgeInsets.all(10.h), |
|
|
|
|
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: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.circular(8.w), |
|
|
|
|
), |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
Positioned( |
|
|
|
|
child: Column( |
|
|
|
|
return WillPopScope( |
|
|
|
|
onWillPop: () async { |
|
|
|
|
if (dialogShowing) { |
|
|
|
|
debugPrint("ssssasdadsasdadasd"); |
|
|
|
|
SmartDialog.dismiss(); |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
child:Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
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) |
|
|
|
|
? 400.h |
|
|
|
|
: 395.h, |
|
|
|
|
floating: false, |
|
|
|
|
snap: false, |
|
|
|
|
pinned: true, |
|
|
|
|
stretch: false, |
|
|
|
|
brightness: Brightness.light, |
|
|
|
|
leading: GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
height: double.infinity, |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
margin: EdgeInsets.only(left: 10.w), |
|
|
|
|
padding: EdgeInsets.all(10.h), |
|
|
|
|
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: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.circular(8.w), |
|
|
|
|
), |
|
|
|
|
child: Stack( |
|
|
|
|
children: [ |
|
|
|
|
buildSwiper(), |
|
|
|
|
Expanded( |
|
|
|
|
Positioned( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
buildSwiper(), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
child: Container( |
|
|
|
|
color: Colors.transparent, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: |
|
|
|
|
BorderRadius.circular(8.w), |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: |
|
|
|
|
MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: |
|
|
|
|
CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
///门店信息 |
|
|
|
|
StoreInfoView(storeInfo), |
|
|
|
|
// Padding(padding:EdgeInsets.only(left: 14.w), |
|
|
|
|
// child: Text( |
|
|
|
|
// S.of(context).diandan, |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontWeight: MyFontWeight.bold, |
|
|
|
|
// fontSize: 15.sp, |
|
|
|
|
// color: Color(0xFF000000), |
|
|
|
|
// ), |
|
|
|
|
// ),), |
|
|
|
|
// Container( |
|
|
|
|
// width:22.w, |
|
|
|
|
// height: 3.h, |
|
|
|
|
// color: Color(0xFF32A060), |
|
|
|
|
// margin: EdgeInsets.only(top: 5.h,left: 14.w), |
|
|
|
|
// ), |
|
|
|
|
// ///门店对应优惠券 |
|
|
|
|
// if (storeInfo != null && |
|
|
|
|
// storeInfo.couponVOList != null) |
|
|
|
|
// UnionCoupon( |
|
|
|
|
// storeInfo, |
|
|
|
|
// _receiveCoupon, |
|
|
|
|
// coupon: true, |
|
|
|
|
// ), |
|
|
|
|
// |
|
|
|
|
// if (storeInfo == null || |
|
|
|
|
// storeInfo.couponVOList == null) |
|
|
|
|
// SizedBox( |
|
|
|
|
// height: 8, |
|
|
|
|
// ), |
|
|
|
|
// |
|
|
|
|
// ///门店对应VIP信息 |
|
|
|
|
// Vip(storeInfo, () {}, false), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
top: 233.h, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
Positioned( |
|
|
|
|
child: Container( |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Colors.white, |
|
|
|
|
borderRadius: BorderRadius.circular(8.w), |
|
|
|
|
), |
|
|
|
|
backgroundColor: Color(0x33FAFAFA), |
|
|
|
|
centerTitle: false, |
|
|
|
|
elevation: 0, |
|
|
|
|
bottom: PreferredSize( |
|
|
|
|
preferredSize: Size( |
|
|
|
|
MediaQuery.of(context).size.width, |
|
|
|
|
38.h, |
|
|
|
|
), |
|
|
|
|
child: Container( |
|
|
|
|
padding: |
|
|
|
|
EdgeInsets.symmetric(horizontal: 10.w), |
|
|
|
|
width: MediaQuery.of(context).size.width, |
|
|
|
|
child: TabBar( |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
automaticIndicatorColorAdjustment: true, |
|
|
|
|
isScrollable: true, |
|
|
|
|
indicatorWeight: 3, |
|
|
|
|
indicatorColor: Color(0xFF32A060), |
|
|
|
|
labelPadding: EdgeInsets.only( |
|
|
|
|
left: 8.w, |
|
|
|
|
right: 8.w, |
|
|
|
|
), |
|
|
|
|
indicatorSize: TabBarIndicatorSize.label, |
|
|
|
|
unselectedLabelStyle: TextStyle( |
|
|
|
|
fontSize: 15.sp, |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
), |
|
|
|
|
child: Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
///门店信息 |
|
|
|
|
StoreInfoView(storeInfo), |
|
|
|
|
// Padding(padding:EdgeInsets.only(left: 14.w), |
|
|
|
|
// child: Text( |
|
|
|
|
// S.of(context).diandan, |
|
|
|
|
// style: TextStyle( |
|
|
|
|
// fontWeight: MyFontWeight.bold, |
|
|
|
|
// fontSize: 15.sp, |
|
|
|
|
// color: Color(0xFF000000), |
|
|
|
|
// ), |
|
|
|
|
// ),), |
|
|
|
|
// Container( |
|
|
|
|
// width:22.w, |
|
|
|
|
// height: 3.h, |
|
|
|
|
// color: Color(0xFF32A060), |
|
|
|
|
// margin: EdgeInsets.only(top: 5.h,left: 14.w), |
|
|
|
|
// ), |
|
|
|
|
// ///门店对应优惠券 |
|
|
|
|
// if (storeInfo != null && |
|
|
|
|
// storeInfo.couponVOList != null) |
|
|
|
|
// UnionCoupon( |
|
|
|
|
// storeInfo, |
|
|
|
|
// _receiveCoupon, |
|
|
|
|
// coupon: true, |
|
|
|
|
// ), |
|
|
|
|
// |
|
|
|
|
// if (storeInfo == null || |
|
|
|
|
// storeInfo.couponVOList == null) |
|
|
|
|
// SizedBox( |
|
|
|
|
// height: 8, |
|
|
|
|
// ), |
|
|
|
|
// |
|
|
|
|
// ///门店对应VIP信息 |
|
|
|
|
// Vip(storeInfo, () {}, false), |
|
|
|
|
], |
|
|
|
|
labelStyle: TextStyle( |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
), |
|
|
|
|
labelColor: Colors.black, |
|
|
|
|
tabs: [ |
|
|
|
|
MyTab(text: S.of(context).diandan), |
|
|
|
|
// MyTab(text: ""), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
top:233.h, |
|
|
|
|
bottom: 0, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
backgroundColor: Color(0x33FAFAFA), |
|
|
|
|
centerTitle: false, |
|
|
|
|
elevation: 0, |
|
|
|
|
bottom: PreferredSize( |
|
|
|
|
preferredSize: Size( |
|
|
|
|
MediaQuery.of(context).size.width, |
|
|
|
|
38.h, |
|
|
|
|
), |
|
|
|
|
child: Container( |
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w), |
|
|
|
|
width: MediaQuery.of(context).size.width, |
|
|
|
|
child: TabBar( |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
automaticIndicatorColorAdjustment: true, |
|
|
|
|
isScrollable: true, |
|
|
|
|
indicatorWeight: 3, |
|
|
|
|
indicatorColor: Color(0xFF32A060), |
|
|
|
|
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).diandan), |
|
|
|
|
// MyTab(text: ""), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
}, |
|
|
|
|
body: |
|
|
|
|
///点餐 |
|
|
|
|
TabBarView( |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
children: [ |
|
|
|
|
///点餐 |
|
|
|
|
StoreOrderListPage( |
|
|
|
|
widget.arguments, |
|
|
|
|
activitys, |
|
|
|
|
storeInfo, |
|
|
|
|
shopCarGoods, |
|
|
|
|
controller, |
|
|
|
|
minToken, |
|
|
|
|
tenant, |
|
|
|
|
_queryMiNiDetail, |
|
|
|
|
(){ |
|
|
|
|
queryShopCar().then((value) { |
|
|
|
|
this.shopCarGoods = value; |
|
|
|
|
setState(() {}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
}, |
|
|
|
|
body: |
|
|
|
|
///点餐 |
|
|
|
|
TabBarView( |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
children: [ |
|
|
|
|
///点餐 |
|
|
|
|
StoreOrderListPage( |
|
|
|
|
widget.arguments, |
|
|
|
|
activitys, |
|
|
|
|
storeInfo, |
|
|
|
|
shopCarGoods, |
|
|
|
|
controller, |
|
|
|
|
minToken, |
|
|
|
|
tenant, |
|
|
|
|
_queryMiNiDetail, () { |
|
|
|
|
queryShopCar().then((value) { |
|
|
|
|
this.shopCarGoods = value; |
|
|
|
|
setState(() {}); |
|
|
|
|
}); |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
///星店活动, |
|
|
|
|
// StoreActivity( |
|
|
|
|
// widget.arguments, |
|
|
|
|
// activitys, |
|
|
|
|
// ), |
|
|
|
|
], |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
), |
|
|
|
|
), /*SmartRefresher( |
|
|
|
|
///星店活动, |
|
|
|
|
// StoreActivity( |
|
|
|
|
// widget.arguments, |
|
|
|
|
// activitys, |
|
|
|
|
// ), |
|
|
|
|
], |
|
|
|
|
controller: tabcontroller, |
|
|
|
|
), |
|
|
|
|
), /*SmartRefresher( |
|
|
|
|
controller: refreshController = |
|
|
|
|
RefreshController(initialRefresh: false), |
|
|
|
|
enablePullDown: true, |
|
|
|
@ -425,104 +445,106 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
}, |
|
|
|
|
child: |
|
|
|
|
),*/ |
|
|
|
|
), |
|
|
|
|
// if(count() != 0) |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 30, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14), |
|
|
|
|
height: 45.h, |
|
|
|
|
// color: Color(0xFFFAFAFA), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFF383A38), |
|
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
|
), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
), |
|
|
|
|
// if(count() != 0) |
|
|
|
|
Positioned( |
|
|
|
|
bottom: 30, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
child: Stack( |
|
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
|
children: [ |
|
|
|
|
SizedBox(width:45.w,), |
|
|
|
|
Text.rich( |
|
|
|
|
TextSpan(children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: "¥ ", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
fontWeight: MyFontWeight.bold), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: |
|
|
|
|
shopCarGoods != null ? shopCarGoods.cartSum : "0.0", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
fontWeight: MyFontWeight.semi_bold), |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
toDownOrder(); |
|
|
|
|
}, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 103.w, |
|
|
|
|
height: 54.h, |
|
|
|
|
text: S.current.jiesuan, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.bold, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 100, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14), |
|
|
|
|
height: 45.h, |
|
|
|
|
// color: Color(0xFFFAFAFA), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
color: Color(0xFF383A38), |
|
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
|
), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
SizedBox( |
|
|
|
|
width: 45.w, |
|
|
|
|
), |
|
|
|
|
Text.rich( |
|
|
|
|
TextSpan(children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: "¥ ", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
fontWeight: MyFontWeight.bold), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: shopCarGoods != null |
|
|
|
|
? shopCarGoods.cartSum |
|
|
|
|
: "0.0", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
fontWeight: MyFontWeight.semi_bold), |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
), |
|
|
|
|
Spacer(), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
toDownOrder(); |
|
|
|
|
}, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 103.w, |
|
|
|
|
height: 54.h, |
|
|
|
|
text: S.current.jiesuan, |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.bold, |
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
radius: 100, |
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
padding: |
|
|
|
|
EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
if (count() != 0) showShoppingCart(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopping_bag.webp", |
|
|
|
|
width: 66, |
|
|
|
|
height: 66, |
|
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if (count() != 0) |
|
|
|
|
Positioned( |
|
|
|
|
right: 5, |
|
|
|
|
// top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 17.w, |
|
|
|
|
height: 17.h, |
|
|
|
|
text: "${count()}", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFFF65720), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Stack( |
|
|
|
|
children: [ |
|
|
|
|
InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
if(count() != 0) |
|
|
|
|
showShoppingCart(); |
|
|
|
|
}, |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/shopping_bag.webp", |
|
|
|
|
width: 66, |
|
|
|
|
height: 66, |
|
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if(count() != 0) |
|
|
|
|
Positioned( |
|
|
|
|
right: 5, |
|
|
|
|
// top: 14, |
|
|
|
|
child: RoundButton( |
|
|
|
|
width: 17.w, |
|
|
|
|
height: 17.h, |
|
|
|
|
text: "${count()}", |
|
|
|
|
textColor: Colors.white, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
backgroup: Color(0xFFF65720), |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
radius: 100, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///领取优惠券 |
|
|
|
@ -635,7 +657,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
? storeInfo.bannerList[position].imgUrl |
|
|
|
|
: "", |
|
|
|
|
height: 230.h, |
|
|
|
|
width:double.infinity, |
|
|
|
|
width: double.infinity, |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
radius: BorderRadius.zero, |
|
|
|
|
errorSrc: "assets/image/default_2_1.webp", |
|
|
|
@ -687,12 +709,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
///选规格 |
|
|
|
|
_queryMiNiDetail(String id, int count) async { |
|
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai); |
|
|
|
|
if(count < 0){ |
|
|
|
|
if (count < 0) { |
|
|
|
|
shopCarGoods.shoppingCartSkuItemList.forEach((element) { |
|
|
|
|
if(element.productId == id){ |
|
|
|
|
if (element.productId == id) { |
|
|
|
|
shopCartReduce(element); |
|
|
|
|
setState(() { |
|
|
|
|
}); |
|
|
|
|
setState(() {}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
@ -782,8 +803,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
this.shopCarGoods = value; |
|
|
|
|
setState(() {}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(baseDate?.msg, alignment: Alignment.center); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -854,8 +874,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
|
|
|
|
|
if (shopCartKey?.currentState != null) { |
|
|
|
|
shopCartKey.currentState.setState(() {}); |
|
|
|
|
} |
|
|
|
|
setState(() { |
|
|
|
|
}); |
|
|
|
|
setState(() {}); |
|
|
|
|
} |
|
|
|
|
return this.shopCarGoods; |
|
|
|
|
} |
|
|
|
|