|
|
@ -8,6 +8,7 @@ import 'package:huixiang/retrofit/data/activity.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/order_info.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/order_info.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/store_info.dart'; |
|
|
|
|
|
|
|
import 'package:huixiang/retrofit/data/user_entity.dart'; |
|
|
|
import 'package:huixiang/retrofit/min_api.dart'; |
|
|
|
import 'package:huixiang/retrofit/min_api.dart'; |
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/store/store_view/store_activity.dart'; |
|
|
|
import 'package:huixiang/store/store_view/store_activity.dart'; |
|
|
@ -47,6 +48,8 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
RefreshController refreshController; |
|
|
|
RefreshController refreshController; |
|
|
|
List<Widget> _widgetOptions; |
|
|
|
List<Widget> _widgetOptions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScrollController controller = ScrollController(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
@ -97,8 +100,6 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ScrollController controller = ScrollController(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Stack( |
|
|
|
return Stack( |
|
|
@ -129,14 +130,6 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
SliverOverlapAbsorber( |
|
|
|
SliverOverlapAbsorber( |
|
|
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), |
|
|
|
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), |
|
|
|
sliver: SliverAppBar( |
|
|
|
sliver: SliverAppBar( |
|
|
|
title: Text( |
|
|
|
|
|
|
|
"", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Colors.black, |
|
|
|
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
expandedHeight: (storeInfo != null && |
|
|
|
expandedHeight: (storeInfo != null && |
|
|
|
storeInfo.couponVOList != null) |
|
|
|
storeInfo.couponVOList != null) |
|
|
|
? 425.h |
|
|
|
? 425.h |
|
|
@ -145,10 +138,6 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
snap: false, |
|
|
|
snap: false, |
|
|
|
pinned: true, |
|
|
|
pinned: true, |
|
|
|
stretch: false, |
|
|
|
stretch: false, |
|
|
|
onStretchTrigger: () { |
|
|
|
|
|
|
|
return Future.sync((){}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
stretchTriggerOffset: 100, |
|
|
|
|
|
|
|
leading: GestureDetector( |
|
|
|
leading: GestureDetector( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
Navigator.of(context).pop(); |
|
|
|
Navigator.of(context).pop(); |
|
|
@ -159,23 +148,16 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
padding: EdgeInsets.all(6), |
|
|
|
padding: EdgeInsets.all(6), |
|
|
|
child: Icon( |
|
|
|
child: Icon( |
|
|
|
Icons.arrow_back_ios, |
|
|
|
Icons.arrow_back_ios, |
|
|
|
color: Colors.white, |
|
|
|
color: Colors.black, |
|
|
|
size: 24, |
|
|
|
size: 24, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
flexibleSpace: FlexibleSpaceBar( |
|
|
|
flexibleSpace: FlexibleSpaceBar( |
|
|
|
// title: Container( |
|
|
|
title: Title( |
|
|
|
// margin: EdgeInsets.only(bottom: 40), |
|
|
|
controller, |
|
|
|
// child: Text( |
|
|
|
storeInfo != null ? storeInfo.storeName : '', |
|
|
|
// 'Expanded Title', |
|
|
|
), |
|
|
|
// style: TextStyle( |
|
|
|
|
|
|
|
// color: Colors.black, |
|
|
|
|
|
|
|
// fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
// fontSize: 18.sp, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
collapseMode: CollapseMode.pin, |
|
|
|
collapseMode: CollapseMode.pin, |
|
|
|
stretchModes: [ |
|
|
|
stretchModes: [ |
|
|
|
StretchMode.zoomBackground, |
|
|
|
StretchMode.zoomBackground, |
|
|
@ -239,13 +221,13 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
backgroundColor: Color(0xFFFAFAFA), |
|
|
|
backgroundColor: Color(0x33FAFAFA), |
|
|
|
centerTitle: false, |
|
|
|
centerTitle: false, |
|
|
|
elevation: 0, |
|
|
|
elevation: 0, |
|
|
|
bottom: PreferredSize( |
|
|
|
bottom: PreferredSize( |
|
|
|
preferredSize: Size( |
|
|
|
preferredSize: Size( |
|
|
|
MediaQuery.of(context).size.width, |
|
|
|
MediaQuery.of(context).size.width, |
|
|
|
38.h, |
|
|
|
38, |
|
|
|
), |
|
|
|
), |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w), |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w), |
|
|
@ -311,7 +293,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
"¥0.00", |
|
|
|
"¥19.00", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 20.sp, |
|
|
|
fontSize: 20.sp, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
@ -480,7 +462,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
"¥0.00", |
|
|
|
"¥19.00", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 20.sp, |
|
|
|
fontSize: 20.sp, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
@ -517,13 +499,6 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
Positioned( |
|
|
|
Positioned( |
|
|
|
right: 15, |
|
|
|
right: 15, |
|
|
|
top: 14, |
|
|
|
top: 14, |
|
|
|
child: GestureDetector( |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
|
|
|
'/router/settlement', |
|
|
|
|
|
|
|
arguments: {}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: RoundButton( |
|
|
|
child: RoundButton( |
|
|
|
width: 17, |
|
|
|
width: 17, |
|
|
|
height: 17, |
|
|
|
height: 17, |
|
|
@ -533,7 +508,10 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
radius: 100, |
|
|
|
radius: 100, |
|
|
|
), |
|
|
|
callback: () { |
|
|
|
|
|
|
|
Navigator.of(context) |
|
|
|
|
|
|
|
.pushNamed('/router/test_page'); |
|
|
|
|
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
@ -548,19 +526,16 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///购物车商品列表 |
|
|
|
Widget shoppGoodsItem(ProductList pro, position) { |
|
|
|
Widget shoppGoodsItem(ProductList productList,position) { |
|
|
|
|
|
|
|
return Container( |
|
|
|
return Container( |
|
|
|
padding: EdgeInsets.only(bottom: 10), |
|
|
|
padding: EdgeInsets.only(bottom: 10), |
|
|
|
child: Row( |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
MImage( |
|
|
|
Image.asset( |
|
|
|
productList != null ? productList.skuImg : "", |
|
|
|
"assets/image/default_1.png", |
|
|
|
width: 60, |
|
|
|
width: 60, |
|
|
|
height: 60, |
|
|
|
height: 60, |
|
|
|
fit: BoxFit.cover, |
|
|
|
fit: BoxFit.cover, |
|
|
|
errorSrc: "assets/image/default_1.png", |
|
|
|
|
|
|
|
fadeSrc: "assets/image/default_1.png", |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 10), |
|
|
|
SizedBox(width: 10), |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
@ -568,7 +543,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
productList.productName, |
|
|
|
"手工啵啵奶茶", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.black, |
|
|
|
color: Colors.black, |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
@ -579,7 +554,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
productList.skuNameStr, |
|
|
|
"无香精", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
fontSize: 11.sp, |
|
|
|
fontSize: 11.sp, |
|
|
@ -587,6 +562,14 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(width: 10), |
|
|
|
SizedBox(width: 10), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"无香精", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF4C4C4C), |
|
|
|
|
|
|
|
fontSize: 11.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 6), |
|
|
|
SizedBox(height: 6), |
|
|
@ -598,7 +581,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
S.of(context).huiyuanjia, |
|
|
|
"会员价", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
fontSize: 13.sp, |
|
|
|
fontSize: 13.sp, |
|
|
@ -606,7 +589,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
productList.sellPrice, |
|
|
|
"¥19.00", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
color: Color(0xFFFF7A1A), |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
@ -629,7 +612,7 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
Padding( |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.only(left: 8, right: 8), |
|
|
|
padding: EdgeInsets.only(left: 8, right: 8), |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
productList.buyNum.toString(), |
|
|
|
"1", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.black, |
|
|
|
color: Colors.black, |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
@ -659,3 +642,58 @@ class _StoreOrderPage extends State<StoreOrderPage> |
|
|
|
// @override |
|
|
|
// @override |
|
|
|
// bool get wantKeepAlive => true; |
|
|
|
// bool get wantKeepAlive => true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Title extends StatefulWidget { |
|
|
|
|
|
|
|
final ScrollController controller; |
|
|
|
|
|
|
|
final String title; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Title(this.controller, this.title); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
|
|
|
|
return _Title(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _Title extends State<Title> { |
|
|
|
|
|
|
|
double alpha = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
void initState() { |
|
|
|
|
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widget.controller.addListener(() { |
|
|
|
|
|
|
|
double maxScrollExtent = widget.controller.position.maxScrollExtent; |
|
|
|
|
|
|
|
double alphaHeight = (kToolbarHeight) / 2; |
|
|
|
|
|
|
|
double alphaProgress = maxScrollExtent - widget.controller.offset; |
|
|
|
|
|
|
|
double alphatemp = 0; |
|
|
|
|
|
|
|
if (alphaProgress <= 1) { |
|
|
|
|
|
|
|
alphatemp = 1; |
|
|
|
|
|
|
|
} else if (alphaProgress <= alphaHeight) { |
|
|
|
|
|
|
|
alphatemp = (((alphaHeight - alphaProgress) / alphaHeight) > 0.5) ? 1 : 0; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
alphatemp = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (alpha != alphatemp && mounted) { |
|
|
|
|
|
|
|
alpha = alphatemp; |
|
|
|
|
|
|
|
print("object: $alpha"); |
|
|
|
|
|
|
|
setState(() {}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
|
|
|
return Container( |
|
|
|
|
|
|
|
margin: EdgeInsets.only(bottom: 38), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
widget.title ?? "", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Colors.black.withOpacity(alpha), |
|
|
|
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
fontSize: 18.sp, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|