商城分类刷新

pull/1/head
张萌 3 years ago
parent 73f96b379c
commit eaa8eead49

@ -199,10 +199,10 @@ class _MarketPageState extends State<MarketPage>
_categoryModels = await CommunityFunc.getCategory(); _categoryModels = await CommunityFunc.getCategory();
var list = await CommunityFunc.getGoodsClassificationList(0); //0 _goodsClassificationList =
await CommunityFunc.getGoodsClassificationList(0); //0
_goodsClassificationList.replaceRange(0, list.length, list);
print(_goodsClassificationList.length);
_goodsPopularModelList = await CommunityFunc.getGoodsPopularModel(6); _goodsPopularModelList = await CommunityFunc.getGoodsPopularModel(6);
setState(() {}); setState(() {});
@ -815,13 +815,13 @@ class _MarketPageState extends State<MarketPage>
gridDelegate: gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 5), SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 5),
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (index == 9) { if (index == _goodsClassificationList.length) {
return _buildAllTile(); return _buildAllTile();
} else { } else {
return _buildTile(_goodsClassificationList[index], index); return _buildTile(_goodsClassificationList[index], index);
} }
}, },
itemCount: 10, itemCount: _goodsClassificationList.length + 1,
shrinkWrap: true, shrinkWrap: true,
), ),
); );

Loading…
Cancel
Save