|
|
@ -54,9 +54,10 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
int _size = 10;
|
|
|
|
int _size = 10;
|
|
|
|
int _pageCount = 0;
|
|
|
|
int _pageCount = 0;
|
|
|
|
double MessageHeight = 76.w;
|
|
|
|
double MessageHeight = 76.w;
|
|
|
|
double bannerHeight = 354.w;
|
|
|
|
double bannerHeight = 260.w;
|
|
|
|
double buttonsHeight = 334.w;
|
|
|
|
double buttonsHeight = 334.w;
|
|
|
|
double searchHeight = 74.w;
|
|
|
|
double searchHeight = 74.w;
|
|
|
|
|
|
|
|
double hotGoodHeight = 288.w;
|
|
|
|
MarketStatisticsModel? _statistics;
|
|
|
|
MarketStatisticsModel? _statistics;
|
|
|
|
|
|
|
|
|
|
|
|
double tabBarHeight = 40.w;
|
|
|
|
double tabBarHeight = 40.w;
|
|
|
@ -114,8 +115,6 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
_pageCount = baseListModel.total;
|
|
|
|
_pageCount = baseListModel.total;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool _onLoadVisible = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -153,37 +152,47 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
final mediaWidth = MediaQuery.of(context).size.width;
|
|
|
|
final mediaWidth = MediaQuery.of(context).size.width;
|
|
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
body: EasyRefresh.custom(
|
|
|
|
body: Stack(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 530.w,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
|
|
|
|
colors: [
|
|
|
|
|
|
|
|
Color(0xFFFFFFFF),
|
|
|
|
|
|
|
|
Color(0xFFFFF9D1),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
EasyRefresh.custom(
|
|
|
|
firstRefresh: false,
|
|
|
|
firstRefresh: false,
|
|
|
|
enableControlFinishLoad: false,
|
|
|
|
enableControlFinishLoad: false,
|
|
|
|
header: BallPulseHeader(
|
|
|
|
header: MaterialHeader(),
|
|
|
|
backgroundColor: Colors.red.withOpacity(0.8), color: Colors.white),
|
|
|
|
|
|
|
|
footer: MaterialFooter(),
|
|
|
|
footer: MaterialFooter(),
|
|
|
|
topBouncing: false,
|
|
|
|
topBouncing: false,
|
|
|
|
scrollController: _sliverListController,
|
|
|
|
scrollController: _sliverListController,
|
|
|
|
controller: _refreshController,
|
|
|
|
controller: _refreshController,
|
|
|
|
onRefresh: _refresh,
|
|
|
|
onRefresh: _refresh,
|
|
|
|
onLoad: !_onLoadVisible
|
|
|
|
onLoad: () async {
|
|
|
|
? null
|
|
|
|
|
|
|
|
: () async {
|
|
|
|
|
|
|
|
_pageNum++;
|
|
|
|
_pageNum++;
|
|
|
|
await loadMarketInfo();
|
|
|
|
await loadMarketInfo();
|
|
|
|
print(_goodsHomeModelList.length);
|
|
|
|
print(_goodsHomeModelList.length);
|
|
|
|
if (_goodsHomeModelList.length >= _pageCount) {
|
|
|
|
if (_goodsHomeModelList.length >= _pageCount) {
|
|
|
|
_refreshController.finishLoad(noMore: true);
|
|
|
|
_refreshController.finishLoad(noMore: true);
|
|
|
|
_onLoadVisible = false;
|
|
|
|
|
|
|
|
print(_onLoadVisible);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
slivers: _buildBody(context),
|
|
|
|
slivers: _buildBody(context),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future _refresh() async {
|
|
|
|
Future _refresh() async {
|
|
|
|
await updateMarketInfo();
|
|
|
|
await updateMarketInfo();
|
|
|
|
_onLoadVisible = true;
|
|
|
|
|
|
|
|
//_swiperModels = await CommunityFunc.swiper();
|
|
|
|
//_swiperModels = await CommunityFunc.swiper();
|
|
|
|
_marketSwiperModels = await CommunityFunc.marketSwiper();
|
|
|
|
_marketSwiperModels = await CommunityFunc.marketSwiper();
|
|
|
|
_statistics = await CommunityFunc.getMarketStatistics();
|
|
|
|
_statistics = await CommunityFunc.getMarketStatistics();
|
|
|
@ -303,17 +312,16 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
return <Widget>[
|
|
|
|
return <Widget>[
|
|
|
|
HomeSliverAppBar(
|
|
|
|
HomeSliverAppBar(
|
|
|
|
key: _sliverAppBarGlobalKey,
|
|
|
|
key: _sliverAppBarGlobalKey,
|
|
|
|
actions: _actionsWidget(),
|
|
|
|
title: geSearch(),
|
|
|
|
title: _buildTitle(),
|
|
|
|
backgroundColor: Color(0xFFF9F9F9),
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
|
|
|
|
expandedHeight: MessageHeight +
|
|
|
|
expandedHeight: MessageHeight +
|
|
|
|
bannerHeight +
|
|
|
|
bannerHeight +
|
|
|
|
buttonsHeight +
|
|
|
|
buttonsHeight +
|
|
|
|
searchHeight +
|
|
|
|
// searchHeight +
|
|
|
|
tabBarHeight +
|
|
|
|
tabBarHeight +
|
|
|
|
|
|
|
|
hotGoodHeight +
|
|
|
|
ScreenUtil().statusBarHeight +
|
|
|
|
ScreenUtil().statusBarHeight +
|
|
|
|
kToolbarHeight +
|
|
|
|
kToolbarHeight,
|
|
|
|
280.w,
|
|
|
|
|
|
|
|
//积分商城高度
|
|
|
|
//积分商城高度
|
|
|
|
// 172 * 2.w,
|
|
|
|
// 172 * 2.w,
|
|
|
|
flexibleSpace: _flexibleSpaceBar(context),
|
|
|
|
flexibleSpace: _flexibleSpaceBar(context),
|
|
|
@ -361,14 +369,14 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_actionsWidget() {
|
|
|
|
List<Widget> _actionsWidget() {
|
|
|
|
return <Widget>[
|
|
|
|
return <Widget>[
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Get.to(() => ShopCarPage()); // 购物车
|
|
|
|
Get.to(() => ShopCarPage()); // 购物车
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child:
|
|
|
|
child: Image.asset(Assets.newIcon.icGouwuc.path,
|
|
|
|
Image.asset(R.ASSETS_ICONS_SHOP_CAR_PNG, height: 40.w, width: 40.w),
|
|
|
|
height: 48.w, width: 48.w),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: 32.w, right: 32.w),
|
|
|
|
padding: EdgeInsets.only(left: 32.w, right: 32.w),
|
|
|
@ -378,8 +386,8 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
initIndex: 0,
|
|
|
|
initIndex: 0,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Image.asset(R.ASSETS_ICONS_SHOP_ORDER_PNG,
|
|
|
|
child: Image.asset(Assets.newIcon.icDingdan.path,
|
|
|
|
height: 40.w, width: 40.w),
|
|
|
|
height: 48.w, width: 48.w),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
];
|
|
|
|
];
|
|
|
@ -421,15 +429,10 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
//textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
// Expanded(
|
|
|
|
|
|
|
|
// child: ges,
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// child: ges,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
// 20.hb,
|
|
|
|
// 20.hb,
|
|
|
@ -449,20 +452,32 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
// color: Colors.white,
|
|
|
|
// color: Colors.white,
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AnimatedHomeBackground(
|
|
|
|
// AnimatedHomeBackground(
|
|
|
|
key: _animatedBackgroundState,
|
|
|
|
// key: _animatedBackgroundState,
|
|
|
|
height: 530.w,
|
|
|
|
// height: 530.w,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
// backgroundColor: Colors.white,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 265.w,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
|
|
|
|
colors: [
|
|
|
|
|
|
|
|
Color(0xFFFFFFFF),
|
|
|
|
|
|
|
|
Color(0xFFFFF9D1),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().statusBarHeight + kToolbarHeight,
|
|
|
|
height: ScreenUtil().statusBarHeight + kToolbarHeight,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
geSearch(),
|
|
|
|
// geSearch(),
|
|
|
|
20.hb,
|
|
|
|
|
|
|
|
getNum(),
|
|
|
|
|
|
|
|
20.hb,
|
|
|
|
20.hb,
|
|
|
|
|
|
|
|
// getNum(),
|
|
|
|
|
|
|
|
// 20.hb,
|
|
|
|
HomeSwiper(),
|
|
|
|
HomeSwiper(),
|
|
|
|
20.hb,
|
|
|
|
20.hb,
|
|
|
|
_buttonTitle(),
|
|
|
|
_buttonTitle(),
|
|
|
@ -582,30 +597,37 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
geSearch() {
|
|
|
|
geSearch() {
|
|
|
|
return Container(
|
|
|
|
return Row(
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 24.w),
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
child: MaterialButton(
|
|
|
|
children: [
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
Expanded(
|
|
|
|
height: 74.w,
|
|
|
|
child: GestureDetector(
|
|
|
|
shape: StadiumBorder(),
|
|
|
|
onTap: () async {
|
|
|
|
elevation: 0,
|
|
|
|
|
|
|
|
minWidth: double.infinity,
|
|
|
|
|
|
|
|
color: Color(0xFFF3F3F3),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Get.to(() => SearchGoodsPage());
|
|
|
|
Get.to(() => SearchGoodsPage());
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 72.w,
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(left: 32.w),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(36.w),
|
|
|
|
|
|
|
|
color: Colors.white),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Icon(
|
|
|
|
32.wb,
|
|
|
|
Icons.search,
|
|
|
|
Assets.home.icSearch.image(
|
|
|
|
size: 32.w,
|
|
|
|
width: 48.w,
|
|
|
|
color: Color(0xFF666666),
|
|
|
|
height: 48.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
10.wb,
|
|
|
|
10.wb,
|
|
|
|
'请输入关键字'.text.size(28.sp).color(ktextSubColor).make().expand(),
|
|
|
|
'请输入关键字'.text.size(28.sp).color(ktextSubColor).make(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
32.wb,
|
|
|
|
|
|
|
|
..._actionsWidget()
|
|
|
|
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -710,11 +732,11 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
|
|
|
|
|
|
|
|
Widget HomeSwiper() {
|
|
|
|
Widget HomeSwiper() {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 20.w),
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
height: bannerHeight,
|
|
|
|
height: bannerHeight,
|
|
|
|
child: AspectRatio(
|
|
|
|
child: AspectRatio(
|
|
|
|
aspectRatio: 355 / 177,
|
|
|
|
aspectRatio: 343 / 129,
|
|
|
|
child: Swiper(
|
|
|
|
child: Swiper(
|
|
|
|
key: UniqueKey(),
|
|
|
|
key: UniqueKey(),
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
@ -850,7 +872,7 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
R.ASSETS_ICONS_TEST_KINGCION_PNG,
|
|
|
|
Assets.newIcon.allClasses.path,
|
|
|
|
height: 88.w,
|
|
|
|
height: 88.w,
|
|
|
|
width: 88.w,
|
|
|
|
width: 88.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -858,7 +880,7 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'全部分类',
|
|
|
|
'全部分类',
|
|
|
|
style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
|
|
|
|
style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -909,13 +931,21 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
|
|
|
|
|
|
|
|
_recommend() {
|
|
|
|
_recommend() {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: 184.w,
|
|
|
|
height: hotGoodHeight,
|
|
|
|
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
|
|
|
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
|
|
|
padding: EdgeInsets.only(top: 8.w, left: 16.w, right: 16.w),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 32.w,
|
|
|
|
|
|
|
|
left: 32.w,
|
|
|
|
|
|
|
|
right: 32.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius: BorderRadius.circular(12.w),
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
|
|
|
|
colors: [Color(0xFFFFF6F6), Color(0xFFFFFFFF)]),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(16.w),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -926,7 +956,7 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
'爆款推荐',
|
|
|
|
'爆款推荐',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontSize: 32.sp,
|
|
|
|
color: ktextPrimary),
|
|
|
|
color: ktextPrimary),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -935,7 +965,7 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
gridDelegate:
|
|
|
|
gridDelegate:
|
|
|
|
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 6),
|
|
|
|
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
@ -969,7 +999,7 @@ class _MarketPageState extends State<MarketPage>
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemCount: _goodsPopularModelList.length,
|
|
|
|
itemCount: 4,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// Row(
|
|
|
|
// Row(
|
|
|
|